• 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.

Sending User Multi Select Values to RPG program

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

  • Sending User Multi Select Values to RPG program

    Hello,
    I have a field within a Form widget that has been transformed to a multi-select dropdown. Is there a method that will allow me to receive all the options selected in my backend RPG program? I am thinking something similar to GetFormChar. Thanks!

  • #2
    You would still use GetFormChar. However, the returned value will be an array: ["Value1","Value2","Value3"].

    We can then use the vvJson procedures to extract each element.

    Code:
    d lChar           s           5000a
    d lValue          s            128a
    d lArrayPtr       s               *
    d lCount          s              3 0
    d lIndex          s                  like(lCount)          
     /free
      lChar     = GetFormChar('MY_FIELD');
      lArrayPtr = vvJson_parse(%addr(lChar)); // parse string into object
      lCount    = vvJsona_size(lArrayPtr);   // determine # elements
      for lIndex = 1 to lCount;              // loop through each element
        lValue = %str(vvJsona_getString(lArrayPtr
                                       :lIndex-1));
      endfor;
     /end-free


    Comment


    • #3
      This is pretty neat! Thanks for the swift response!

      Comment

      Working...
      X