• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Edit Grid with Local Data - SetRowValue() Limit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Edit Grid with Local Data - SetRowValue() Limit

    Hello,
    I am having a problem with using the SetRowValue() procedure with an Edit Grid with the local data option checked. From a button click RPG program I have a string column of the edit grid that gets updated using the SetRowValue RPG procedure for each row in the grid. It works if there are few enough rows, but if there are too many rows (332 in my case) and the text I am setting is is more than 33 characters, then it spits out an error log and the user will see an endless spinning circle. If I change the for loop to only iterate through the first 279 rows it works fine (or the last 279 rows). FYI I simplified the RPG down enough that it could still replicate the issue; there is normally more validation logic and things getting set. Some other things that might be relevant are that this edit grid is setup as a popup and also the data of the edit grid gets initially populated by the pretty new Import feature using an Excel spreadsheet.

    Is there some kind of size limitation I should be aware of that would cause this?

    RPG:
    Code:
       Dcl-S RowI like(gSelectionCnt); // row index
       Dcl-S SeedlingChgText Char(50);
    
       SetWidget('importEditGrid');
    
       For RowI = 1 To gSelectionCnt;
          SeedlingChgText = 'Row Ignored. Green Count field was blank.';
          SetRowValue(RowI: 'SDLGCHGTXT': %Trim(SeedlingChgText));
       EndFor;?
    Data Source SQL:
    Code:
    SELECT
      char(' ', 50) AS spilot,
      char(' ', 50) AS greencnt,
      char('', 12) AS millorder,
      char('', 100) AS sdlgchgtxt,
      ibmreqd
    FROM
      sysibm/sysdummy1
    WHERE
      (1 = 0)?
    Thank you, again.

    image.png?image.png?image.png?

  • #2
    I just noticed the log in the browser console now and it looks like some JSON maxes at 65000ish characters, so I guess that is why. Do I need to just be careful to not call SetRowValue too many times per RPG call in order to avoid this?

    Comment


    • #3
      Yes, sounds like it definitely was pushed to the upper limit here. We have the string set to be a 65535 length variable...this was done a very long time ago likely for older OS levels but I think we can safely move this up much higher now.

      You can make this change yourself to get by this for now and we will update this for the next release.

      Go into source member VVNABBTN in QCPYLESRC/YOUR_VALENCE_INSTANCE and change lString from 65535 to let's say 200000. Then you will need to recompile your program. Let us know how this works out for you.

      Code:
      ** --------------------------------------------------------------
      p CleanUp b
      d pi
      d lString   s   65535a varying
      d lWidgets  s   *
      d lIndex    s   like(gWidgetCnt)?
      ?

      Comment


      • #4
        That worked perfectly after increasing that lString variable. Thanks!

        Comment

        Working...
        X