Alpha Video Training
Results 1 to 7 of 7

Thread: Repeating row number

  1. #1
    Member
    Real Name
    John Mucci
    Join Date
    Nov 2010
    Location
    New York
    Posts
    311

    Default Repeating row number

    Hello All,

    I'm looking to populate a field with the active row number within a repeating Section of a UX.

    I'm using the below code once a field has been clicked. via an inline Java.

    However nothing is populating in the field do I need to add further code? I also tried with Js and using the "e" without any luck.

    Code:
    //{dialog.Object}.getInstanceNumber('CONTAINER_1');
    {dialog.Object}.getRepeatingSectionActiveRow('CONTAINER_1');

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,562

    Default Re: Repeating row number

    Both the methods you list will give you the value you want. But you must then assign that value to the field.

    If you are clicking into a RS field... and want that field value to be the RS Active Row Number... then you can do this...

    Code:
    var rsAR = {dialog.Object}.getRepeatingSectionActiveRow('REPEATINGSECTION_1');
    {dialog.object}.setValue('INVOICEAMT:'+rsAR,rsAR);
    This will set the field "INVOICEAMT" inside RS "REPEATINGSECTION_1" with the value of the Active Row you just clicked on within that RS.

    I'm not sure why you're using 'CONTAINER_1'... unless you're naming you're Repeating Sections as 'CONTAINER...' which I wouldn't do. A "Container" is a specific control in Alpha... with specific types. A Repeating Section is a type of container... but you must reference the "Repeating Section" Container ID... not the container it sits in.

    I'm not sure what you mean by "via an inline Java". By inline do you mean you're using the click or onClick event of the field? And just to confirm, it's Javascript. Java is something completely different.

  3. #3
    Member
    Real Name
    John Mucci
    Join Date
    Nov 2010
    Location
    New York
    Posts
    311

    Default Re: Repeating row number

    Quote Originally Posted by Davidk View Post
    Both the methods you list will give you the value you want. But you must then assign that value to the field.

    If you are clicking into a RS field... and want that field value to be the RS Active Row Number... then you can do this...

    Code:
    var rsAR = {dialog.Object}.getRepeatingSectionActiveRow('REPEATINGSECTION_1');
    {dialog.object}.setValue('INVOICEAMT:'+rsAR,rsAR);
    This will set the field "INVOICEAMT" inside RS "REPEATINGSECTION_1" with the value of the Active Row you just clicked on within that RS.

    I'm not sure why you're using 'CONTAINER_1'... unless you're naming you're Repeating Sections as 'CONTAINER...' which I wouldn't do. A "Container" is a specific control in Alpha... with specific types. A Repeating Section is a type of container... but you must reference the "Repeating Section" Container ID... not the container it sits in.

    I'm not sure what you mean by "via an inline Java". By inline do you mean you're using the click or onClick event of the field? And just to confirm, it's Javascript. Java is something completely different.
    Thanks David I will give this a try. You asked why the name 'Container, this was the default name for the RS Container ID name and yes it is the onclick events. Sorry should have spelled out JavaScript :)

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,562

    Default Re: Repeating row number

    The default name for a Repeating Section is always "REPEATINGSECTION_n" where n represents the next RS container number. The default name for a Container with Type of 'None' is "CONTAINER_n".

  5. #5
    Member
    Real Name
    John Mucci
    Join Date
    Nov 2010
    Location
    New York
    Posts
    311

    Default Re: Repeating row number

    Quote Originally Posted by Davidk View Post
    The default name for a Repeating Section is always "REPEATINGSECTION_n" where n represents the next RS container number. The default name for a Container with Type of 'None' is "CONTAINER_n".
    David this is why I used the Container, just want to make sure I'm reading it correctly.
    RS.JPG

  6. #6
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,562

    Default Re: Repeating row number

    Maybe it's the build of Alpha you're using... it must be older. Maybe everything was "CONTAINER_" at some point... it isn't currently.
    I would change that Id, but you are using the name properly. Regardless, I always change the default names for stuff like this... to something meaningful about what's being contained. If the container is just used as a wrapper I don't bother changing the name.

  7. #7
    Member
    Real Name
    John Mucci
    Join Date
    Nov 2010
    Location
    New York
    Posts
    311

    Default Re: Repeating row number

    Quote Originally Posted by Davidk View Post
    Maybe it's the build of Alpha you're using... it must be older. Maybe everything was "CONTAINER_" at some point... it isn't currently.
    I would change that Id, but you are using the name properly. Regardless, I always change the default names for stuff like this... to something meaningful about what's being contained. If the container is just used as a wrapper I don't bother changing the name.
    Noted thanks

Similar Threads

  1. Repeating Section Row Number Issue
    By dstroud13 in forum Mobile & Browser Applications
    Replies: 24
    Last Post: 12-01-2016, 11:25 AM
  2. Max rows number on repeating section
    By Catalin in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 03-03-2014, 02:26 AM
  3. Getting total number of rows in Repeating Section
    By tcbarker4 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 01-11-2014, 09:35 PM
  4. Repeating Section Row Count And Access To The Number
    By Al Buck in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 04-26-2013, 01:11 PM
  5. Dialog - relative row number in repeating section
    By Jay Talbott in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 04-11-2012, 11:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •