Short version:
I have a subfile with several fields. Using javascript I can changed the contents of a field by changing the "innerHTML" property of a subfile field. However the updated field is not returned to the program. The original text is returned. Is there a way to change the text of an output subfile field and have it returned to the program?
Long version:
I have a two tabbed display. On one of the tabs I have an iFrame which contains a map. On the other tab is a subfile listing of addresses and their associated Lat/Long coordinates. A marker is placed on the map for every subfile record. When I drag one of the markers on the map I update the Lat/Long coordinates for the associated record in the subfile field. The user then selects that marker by either clicking on the marker in the map or clicking on a subfile record. At this point I would like the updated lat/long coordinates returned to the program. what I am getting is the original coordinates.
Thanks for the help,
Alan
Changing subfile field content
-
- New User
- Posts: 4
- Joined: Tue Mar 11, 2014 12:01 pm
- First Name: Alan
- Last Name: Baldwin
- Company Name: TMW Systems
- Contact:
-
- 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: Changing subfile field content
Sorry, you can't return the contents of an output field to the RPG program. The PUI framework considers output fields to be "output-only", so it never attempts to send the contents of the field back to the server.
You can, however, do this using an input field (text box). If you decide to do that, you can use CSS classes to make the input field look the same as an output field, and you can use JavaScript code to prevent the user from being able to change the field directly. The changeElementValue() API can be used to change the contents of the field (or the equivalent pui.set API).
You can, however, do this using an input field (text box). If you decide to do that, you can use CSS classes to make the input field look the same as an output field, and you can use JavaScript code to prevent the user from being able to change the field directly. The changeElementValue() API can be used to change the contents of the field (or the equivalent pui.set API).
- Alex
- Profound Logic Staff Member
- Posts: 233
- Joined: Fri Jan 04, 2008 12:10 pm
- First Name: Alex
- Last Name: Roytman
- Company Name: Profound Logic Software
- Contact:
Re: Changing subfile field content
FYI, Profound UI already ships with a class named "PR". When you assign "PR" to the "css class" property of a textbox, it will look protected (or just like an output field). I believe "PR" is case-sensitive.
Also, while you can use JavaScript to prevent the user from changing the contents of the field directly, you should also be able to just set the "read only" property of the textbox to "true" and that should accomplish the same thing. It will be "read only" only for the user -- you should still be able to change the contents of the field programmatically.
Also, while you can use JavaScript to prevent the user from changing the contents of the field directly, you should also be able to just set the "read only" property of the textbox to "true" and that should accomplish the same thing. It will be "read only" only for the user -- you should still be able to change the contents of the field programmatically.
-
- New User
- Posts: 4
- Joined: Tue Mar 11, 2014 12:01 pm
- First Name: Alan
- Last Name: Baldwin
- Company Name: TMW Systems
- Contact:
Re: Changing subfile field content
Thanks very much for the information. I will give this a try and let you know how it goes.
Alan
Alan
-
- New User
- Posts: 4
- Joined: Tue Mar 11, 2014 12:01 pm
- First Name: Alan
- Last Name: Baldwin
- Company Name: TMW Systems
- Contact:
Re: Changing subfile field content
This worked great:
Changed the output field to a textbox.
Added the CSS class "PR" so it looks like an output field.
Because the map is in an IFrame, I used "parent.changeElementValue(latname, latdeg);" to change the latitude in the subfile.
Now a user can drag a marker on the map and the corresponding lat/long for the subfile is updated and returned to the program.
Thanks!
Alan
Changed the output field to a textbox.
Added the CSS class "PR" so it looks like an output field.
Because the map is in an IFrame, I used "parent.changeElementValue(latname, latdeg);" to change the latitude in the subfile.
Now a user can drag a marker on the map and the corresponding lat/long for the subfile is updated and returned to the program.
Thanks!
Alan
Who is online
Users browsing this forum: No registered users and 3 guests