Alpha Video Training
Results 1 to 25 of 25

Thread: Repeating Section Row Number Issue

  1. #1
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Repeating Section Row Number Issue

    I have a weird issue that has just recently started. By the way, I'm using Alpha Anywhere version 4.3. I have a UX with a repeating section. The first field within the repeating section is a text field with the lookup option enabled with the edit-combo list selected as the type. When I change the value of this field (called Sales Code), I want it to set the value of a field on the current row of the repeating section to 1 if the value is currently not 1. It is not working so I am testing to make sure that it is getting the current row number and returning an alert to me on the screen to show me that row number. It always returns 1 as the row number even if I am not on row 1. Here is the JavaScript that is running when I change the value of this field:

    Code:
    var RowNum = {dialog.Object}.getRepeatingSectionActiveRow('REPEATINGSECTION_7');
    alert('Row # = '+RowNum;
    Also, I tried using this same code on another field in the repeating section that does not have any type of smart control enabled such as the lookup option and it works perfectly on that field.

    Another issue that is not a huge deal right now, but is strange, is that ever since upgrading to version 4.3, any fields that have smart controls in them such as lookups or calendar/time controls are not displaying with the style set for the field. For example, in the repeating section above, the Sales Code field that has the lookup option enabled has a style set to Arial 12 pt font and color of navy blue. However the text is not displaying in that font size or that color. Unsure if the font name is displaying correct or not (probably is correct but maybe that is by default).

    Any help that anyone can provide would be great! Thank you in advance.

  2. #2
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON, Canada
    Posts
    1,665

    Default Re: Repeating Section Row Number Issue

    It works for me, you are missing the closing parentheses in your javascript (unless that was a typo).
    Code:
    var RowNum = {dialog.Object}.getRepeatingSectionActiveRow('REPEATINGSECTION_7');
    alert('Row # = '+RowNum);
    Alpha Anywhere v12.4.6.1.3 Build 6232-5386 IIS v10.0 on Windows Server 2019 Std in Hyper-V

  3. #3
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    In my code, I actually had the missing parentheses, it was just a typo when I put it in this forum. It still is not working correctly for me. It works fine on a standard text field but if I choose to enable the lookup option on the field, no matter what row I'm actually on, it returns 1. Thanks for catching my typo though.

  4. #4
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON, Canada
    Posts
    1,665

    Default Re: Repeating Section Row Number Issue

    David, it works for me. Try this component and see if it works, I think this is what you are trying to do.

    Stephen
    Attached Files Attached Files
    Alpha Anywhere v12.4.6.1.3 Build 6232-5386 IIS v10.0 on Windows Server 2019 Std in Hyper-V

  5. #5
    Member
    Real Name
    Michael Cornford
    Join Date
    Oct 2011
    Location
    East Sussex, UK
    Posts
    884

    Default Re: Repeating Section Row Number Issue

    Repeating sections are funny row number will return correctly but make sure you understand logical and physical. It is explained in the documentation.

  6. #6
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON, Canada
    Posts
    1,665

    Default Re: Repeating Section Row Number Issue

    Here is an example with code to set the value to '1' if it is not already '1'
    Attached Files Attached Files
    Alpha Anywhere v12.4.6.1.3 Build 6232-5386 IIS v10.0 on Windows Server 2019 Std in Hyper-V

  7. #7
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    Stephen,

    Your UX works fine. Mine is not working but I have the same JavaScript you have. I have a meeting to go to right now but when I get back, I'll post my UX and see if it does the same thing on your end as it is doing to me.

    Thanks!

  8. #8
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    Stephen,

    I thought maybe I had something wrong in my code somewhere, so to be safe, I started to re-create my UX. I have attached the one I just created here. It is very raw and doesn't have much styling to it, but for me it does not return the correct row number unless I first click on just the row itself. So, in order to reproduce the error, simply click the drop down on the Sales Code field on the 2nd or 3rd row in the repeating section and choose a value for that field. The Javascript that runs after you change the field is set to return the row # of the current row but it returns row 1 instead of the correct row. If I click on the row somewhere first and then change the value of the Sales Code field on that row, it works. I can also click on any other field in the repeating section that is not a drop down first and then change the value of the Sales Code field and it works. It is as if the row is not getting focus when you just jump straight to changing the value of the Sale Code field first (which is what the user would normally do). Thank you for taking the time to look into this for me. I've spent a lot of time looking at it myself and just can't figure out why this is happening. As I said, it was working fine about a week ago or so and the only thing I can think of that has changed is upgrading to version 4.3 of Alpha. Not saying that is what caused it and it probably didn't cause it.

    UX.zip

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

    Default Re: Repeating Section Row Number Issue

    David, you mention you're using Alpha Version 4.3... but that covers a lot of builds. Which build are you using?

    I opened your UX in Build 3962 (latest official release) and in the latest pre-release. I tried to add a simple debugger statement to the RS dropdown Sales_Code. When I saved I got this error...

    RS_Error.png

    Which means there's something funky going on with your data bindings... which are not set... but something must have been messed up at some point.
    I removed all Data Binding Settings... even though there's nothing there... and then I could save.

    I get the proper row returned.

    So... go through the process of Removing all Data Binding settings... and see if that helps.

  10. #10
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    David,
    I am also using build 3962. I'll try removing the data bindings and then set them back up and see what happens. Thanks!

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

    Default Re: Repeating Section Row Number Issue

    In the sample you posted... there were no Data Bindings... is that right?

  12. #12
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    That is correct. I have a similar UX that does have bindings and that is where I discovered this issue. After reading some of the replies, I thought I would try to create a new UX and just see if there was an issue that I had not discovered with the original UX. I didn't put in any code except the On Change event for the Sales Code field in the repeating section which simply should return the current row that I'm on. If I change the Sales Code in the 2nd row, it returns that it is on Row 1 which it is obviously not.

    I know that normally you would not start on the 2nd row, but in the original UX what I'm seeing is that if you navigate to an existing record and then go the next available line item in the repeating section to add more data, it is set to change some data based on the option selected in the sales code field and then jump to the next field on that row. What is happening is that the data on the 1st row is changing and jumping back to the next field in the first row. So that is why I started putting in code to just tell me what row I was on when I changed this field and that is when I hit this wall where it is returning the wrong row #. I tried your suggestion to remove the data bindings from the UX that I posted here and now that one is working OK. I have not tried it yet on the original UX. I'll keep you posted if that works or not. Thank you!

  13. #13
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    OK, I just tried to remove all data bindings from the original UX and re-map everything. I still get the same issue with it telling me I'm on the wrong row. Since removing it from the UX that I posted here did work, I'm going to try to re-create the entire UX and see what happens. It may be tomorrow before I get a chance to do that, but I'll post my results here when I've completed that.

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

    Default Re: Repeating Section Row Number Issue

    Just to confirm... you took your sample UX... the UX you posted here... removed all Data Binding... and now your sample UX is working for you?

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

    Default Re: Repeating Section Row Number Issue

    What data back end are you using? You could try posting your original UX here, along with SQL (if sql) dumps containing sample (or empty) data of the 2 tables.

  16. #16
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    Yes, the sample UX is working now that I cleared the data binding even though there was no binding to begin with. When I cleared the original UX and then re-mapped, it did not work.

  17. #17
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    I spoke too soon. I went back to the sample UX again and now it is giving me the wrong row number again. I tried removing the data bindings again and that had no effect.

  18. #18
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON, Canada
    Posts
    1,665

    Default Re: Repeating Section Row Number Issue

    David, I am seeing the problem in your component.
    Try setting the focus first on the control by changing your javascript to the following:

    Code:
    {dialog.Object}.setFocus('SALES_CODE');
    var RowNum = {dialog.Object}.getRepeatingSectionActiveRow('INVDETAILS');
    alert('Row # = '+RowNum);
    Alpha Anywhere v12.4.6.1.3 Build 6232-5386 IIS v10.0 on Windows Server 2019 Std in Hyper-V

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

    Default Re: Repeating Section Row Number Issue

    What data back end are you using?

    What changes were made to the sample UX between it working and not working?

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

    Default Re: Repeating Section Row Number Issue

    Can't see a need to use setFocus... it seems something else is going on. Focus is already set to the Textbox Lookup.

    RS_Row.PNG

  21. #21
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    Stephen,

    I put the set focus code in and still get the same thing. Thanks for trying though, I had not thought about setting the focus first.

    David,
    I am using MySQL as a backend. The only change I made was to remove the data binding even though there was none and then went to working preview. It worked fine. Then after a while I went back into the same component and just tried it again and it didn't work that time. I removed the data binding again and it still didn't work.

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

    Default Re: Repeating Section Row Number Issue

    Not that the back end matters... since your sample isn't data bound... just curious.

    It would be interesting if you posted your non-working UX again. I'd like to see if it carries the same error as the first time you posted.

  23. #23
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    This morning I opened the sample UX that I had submitted and it worked. So I went to the original UX and it did not work, but I have now discovered that if you type the value you want in the Sales Code field rather than actually clicking on it within the drop down list or you click the drop down arrow on the field first and then type the value you want (causing the list to filter as you type) and then either hit the tab button or enter button on the keyboard or just simply click into another field on the same row then it will work properly. Only if you click within the Sales Code field and then just type the value you want and then cause the Sales Code field to lose focus will it return Row 1 every time. Not sure what this means but I found it to be an interesting new wrinkle. Thanks again for taking a look into this.

  24. #24
    Member
    Real Name
    David Stroud
    Join Date
    May 2007
    Posts
    66

    Default Re: Repeating Section Row Number Issue

    I have found a fix (sort of). I don't think this should be necessary but at least it works. I put in code on the On Mouse Over event on the repeating section itself to set the focus to the sales code field on the first row.

    Code:
    {dialog.Object}.setFocus('SALES_CODE',1);
    Then when I go to a different row and click in the sales code field and type the value that I want and hit the tab button to move to the next field, I now get the correct row # returned to me every time. There may be a better way to accomplish this so if anyone has any suggestions on that, please let me know. Again thank you to everyone who looked into this issue. I'm going to publish this UX with this mouse over code for now.

  25. #25
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON, Canada
    Posts
    1,665

    Default Re: Repeating Section Row Number Issue

    I'm not really sure what's happening with your UX component that this is necessary. I managed to make it work by adding the setFocus on the onChange event yet it didn't work for you.
    David K says this shouldn't be necessary and his knowledge of coding is much better than mine, so I suspect he is correct. Still, it is very odd that you have to do this at all.
    Glad you at least figured out some sort of a solution.
    Alpha Anywhere v12.4.6.1.3 Build 6232-5386 IIS v10.0 on Windows Server 2019 Std in Hyper-V

Similar Threads

  1. Repeating Section Validation Issue
    By jennygong in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 06-23-2014, 05:04 PM
  2. Max rows number on repeating section
    By Catalin in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 03-03-2014, 03: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, 10:35 PM
  4. How do I get the repeating section row number in dialog2 component?
    By LukeS in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 05-26-2012, 03:19 AM
  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-12-2012, 12:55 AM

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
  •