Topic
8 replies Latest Post - ‏2013-08-14T06:53:05Z by aquDan
aquDan
aquDan
48 Posts
ACCEPTED ANSWER

Pinned topic Loopvar not getting created

‏2013-06-13T07:49:48Z |

Hi.  I have created an XML variable and mapped that variable to the DataPage builder and created DataColumnModifier too.  But when i try to access the loopvar, i am not able to see the loopvar.  Could anyone please help ?

 

 

  • mburati
    mburati
    2466 Posts
    ACCEPTED ANSWER

    Re: Loopvar not getting created

    ‏2013-06-13T21:12:40Z  in response to aquDan

    Could you describe when/how you're trying to access the loopvar and what you're trying to do with it?

    As described in a number of threads in the forum (and hopefully the wiki) the loop variable is only useful during the rendering of the loop within the JSP being rendered.   In other words, it's like a local variable within a for or while loop that stores the value of the current row "while" that loop is iterating over the rows, which it only does when it's rendering the JSP.    Outside of that loop it is not set to anything useful because you're not in the loop so there's no "current row" for it to be set to.

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • Dennis_te_Lintelo
    Dennis_te_Lintelo
    27 Posts
    ACCEPTED ANSWER

    Re: Loopvar not getting created

    ‏2013-06-21T08:14:21Z  in response to aquDan

    Your XML variable needs to be based on a schema.

    To solve your problem:

    - use a simple schema generator builder and use your XML variable as sample data.

    - base the type of your variable on the schema generated by the simple schema generator builder

    - regenerate your model and the LoopVar variable will be avaiable.

    Have fun!

    • aquDan
      aquDan
      48 Posts
      ACCEPTED ANSWER

      Re: Loopvar not getting created

      ‏2013-07-25T13:25:18Z  in response to Dennis_te_Lintelo

      Hi Dennis,

      Thanks for your reply.  But still i didn't get the loop variable.  Please find the attached model.  I have used a xml variable, Simple Schema Generator and then Data Page and Data Column Modifier.  Please let me know where am i missing ?

       

       

      Attachments

      • DunnoJack
        DunnoJack
        32 Posts
        ACCEPTED ANSWER

        Re: Loopvar not getting created

        ‏2013-07-25T15:55:39Z  in response to aquDan

        Looking at your model, the data page builder wants to display a "detail" type page instead of a table that is listing locations. That makes me think that your variable containing the xml is only for a single item, and not setup as a list. If there isn't anything to loop through, then the loopvar won't be created. 

        • aquDan
          aquDan
          48 Posts
          ACCEPTED ANSWER

          Re: Loopvar not getting created

          ‏2013-07-26T13:21:36Z  in response to DunnoJack

          Thanks Jack.  But even though changing my variable to a list, it is not showing me the loop var.  Can you please refer the attached model and help how to get the loopvar ?  I am using Websphere Experience Factory 7.0.1 with the fixpack 3.

          Attachments

          • mburati
            mburati
            2466 Posts
            ACCEPTED ANSWER

            Re: Loopvar not getting created

            ‏2013-07-26T13:58:14Z  in response to aquDan

            Looking at your model (with 8.0.0.2+)  I see a loop variable in the Application Tree view.

             - I do not see a simple schema generator builder as Dennis had suggested above.

             - I do not understand where you are looking for the loop variable, when you say that you do not see it.  Can you be more explicit about where you are looking for the loop variable when you are not seeing it, and where you're trying to use it?

            I hope that info helps,
            ..Mike Burati 
            The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
          • DunnoJack
            DunnoJack
            32 Posts
            ACCEPTED ANSWER

            Re: Loopvar not getting created

            ‏2013-07-26T15:24:09Z  in response to aquDan

            You were really close. All you needed was the schema for the variable, like Mike and Dennis mentioned. See the attached model. 

            I created a really quick schema for the variable, and then added a column in the Data Column Modifier builder. I use a text builder to display some text (your record's id) using the loop variable.

            Attachments

            • aquDan
              aquDan
              48 Posts
              ACCEPTED ANSWER

              Re: Loopvar not getting created

              ‏2013-08-14T06:53:05Z  in response to DunnoJack

              Thanks Jack.  It worked.