Add controls based upon the data

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Diane
New User
Posts: 2
Joined: Fri Mar 03, 2017 1:25 pm
First Name: Diane
Last Name: Brown
Company Name: TMW Systems
Contact:

Add controls based upon the data

Post by Diane »

I need to be able to create a screen that is formated depending upon data in a file. It would consist of output text, an input box, then possibly more text and more input boxes. An example would be "Your manifest is approved, but you need to wait " + #### + " hours until you can do whatever". The user sending the message would enter a value where I show the "####". Right now, I'm loading a text area. The text area allows anything to be entered though and would be difficult to validate. The messages could need several fields updated; there really isn't a limit. A message could be "Enter the value for blah" + #### + ", then tell me blah " + ######## + "and also how many blah blah blah? " + ##

Thanks in advance!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Add controls based upon the data

Post by Scott Klement »

This can be done very easily with HTML, like

Code: Select all

Your manifest is approved, but you need to wait <input type="text" id="field1" name="field1"></input> hours until you can do whatever
You could put that into an HTML container (aka "Wrapping Text") widget, for example. You can insert HTML tags whenever you want it to ask for input...

But the tricky part is what to do with the data that was entered. The RPG program will need to know all of the fields in the record format at compile-time since these need to be in the external definition of the display file. Since the field is added dynamically, it won't be there.

I suppose the solution would be to have a bunch of hidden fields that the user doesn't see but are part of the record format, and use JavaScript to copy the values of the dynamic fields to the hidden fields before submitting the result back to the RPG program. Maybe not as simple as you would like... but it'd work.
Diane
New User
Posts: 2
Joined: Fri Mar 03, 2017 1:25 pm
First Name: Diane
Last Name: Brown
Company Name: TMW Systems
Contact:

Re: Add controls based upon the data

Post by Diane »

Scott,

I had thought about using <input> fields, but haven't been using Profound long enough to know how the <form> logic works. Your idea of hidden fields though could work.

Thanks for your help!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests