onselect
-
- Profound User
- Posts: 37
- Joined: Tue Aug 27, 2013 7:34 am
- First Name: Seynabou
- Last Name: Gueye
- Company Name: Oo2
- Country: Senegal
- Contact:
onselect
I have a list box and a text box. I would like for each value selected in the list box, load it into the text box the number corresponding to that value.
I think that I must do this using Javascript with the property onselect of the list box but I have problem with Javascript. I would like a little help please.
I think that I must do this using Javascript with the property onselect of the list box but I have problem with Javascript. I would like a little help please.
-
- 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: onselect
I don't think there is an onselect property for a list box, is there?
Can you clarify?
Can you clarify?
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: onselect
There is no onselect property for a listbox, but you could use its onclick property.
Put this in the onclick of your list box:
"TextBox1" is the ID of your text box. So you are setting the value of "TextBox1" to the value gotten from your list box when an item is clicked/selected, "pui.get(this)".
I think the "pui.set()" and "pui.get()" functions are available from version 4.6.5
Put this in the onclick of your list box:
Code: Select all
pui.set("TextBox1", pui.get(this))
I think the "pui.set()" and "pui.get()" functions are available from version 4.6.5
Last edited by Paul_Ramcharitar on Mon Oct 21, 2013 11:17 am, edited 1 time in total.
-
- Profound User
- Posts: 37
- Joined: Tue Aug 27, 2013 7:34 am
- First Name: Seynabou
- Last Name: Gueye
- Company Name: Oo2
- Country: Senegal
- Contact:
Re: onselect
Scott
I do a mistake, It is a dropdown box, not a list box.
I read this part of the documentation:
"onselect event (Combo Box)
The onselect event for combo boxes activates when a selection is made from the combo choices. The event should be specified as a JavaScript expression."
I do a mistake, It is a dropdown box, not a list box.
I read this part of the documentation:
"onselect event (Combo Box)
The onselect event for combo boxes activates when a selection is made from the combo choices. The event should be specified as a JavaScript expression."
-
- 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: onselect
Actually, a "list box" and a "drop down box" are the same thing, except that the list box shows more than one row at a time on the screen. They are the same widget, under the covers.
However, a combo box is different. A combo box allows the user to type their selection as well as selecting it from the choices. When they do select one, the 'onselect' event will fire. Is that what you are using, a Combo box?
Can you also explain more about what is meant by "I would like for each value selected in the list box, load it into the text box the number corresponding to that value."
However, a combo box is different. A combo box allows the user to type their selection as well as selecting it from the choices. When they do select one, the 'onselect' event will fire. Is that what you are using, a Combo box?
Can you also explain more about what is meant by "I would like for each value selected in the list box, load it into the text box the number corresponding to that value."
-
- Profound User
- Posts: 37
- Joined: Tue Aug 27, 2013 7:34 am
- First Name: Seynabou
- Last Name: Gueye
- Company Name: Oo2
- Country: Senegal
- Contact:
Re: onselect
I thaught that Dropdown box and Combo box are the same.
I have a list of differents pieces (CNI, PA, PC) and for each piece I have a number.
For example for my CNI the number is xxxxxxxxxxxxxxxxxx and for my Passport the number is xxxxxxxxxxxxxxxxxx.
I want that when I choose one of the piece, to load the number matching with that type of piece in the text box.
The datas are in a table of a database.
I have a list of differents pieces (CNI, PA, PC) and for each piece I have a number.
For example for my CNI the number is xxxxxxxxxxxxxxxxxx and for my Passport the number is xxxxxxxxxxxxxxxxxx.
I want that when I choose one of the piece, to load the number matching with that type of piece in the text box.
The datas are in a table of a database.
Last edited by oumouna on Mon Oct 21, 2013 11:53 am, edited 1 time in total.
-
- Profound User
- Posts: 37
- Joined: Tue Aug 27, 2013 7:34 am
- First Name: Seynabou
- Last Name: Gueye
- Company Name: Oo2
- Country: Senegal
- Contact:
Re: onselect
I am using Combo Box
-
- 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: onselect
I would set the "onchange" value of the combo box to pui.click(). When the user makes a change, this will cause control to be returned to the RPG program. The RPG program can then set all of the fields on the screen to the corresponding values.
If you'd like an indicator to be set (to notify the RPG program that the onchange fired) you can put a hidden button on the screen, and do pui.click("id of hidden button"). The response of the button can be bound to an indicator that the RPG program can check for.
If you'd like an indicator to be set (to notify the RPG program that the onchange fired) you can put a hidden button on the screen, and do pui.click("id of hidden button"). The response of the button can be bound to an indicator that the RPG program can check for.
-
- Profound User
- Posts: 37
- Joined: Tue Aug 27, 2013 7:34 am
- First Name: Seynabou
- Last Name: Gueye
- Company Name: Oo2
- Country: Senegal
- Contact:
Re: onselect
When I do [onchange] pui.click("ID of hidden Button"), when a value is select in the combo box, does this put the button on??
-
- 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: onselect
It clicks the button (just as it would if someone clicked it with the mouse.) This way, the button can turn an indicator on and return control to your RPG program, and the RPG program can check for the button being clicked.
IF you make it a hidden button, then the button can only be clicked via pui.click().
IF you make it a hidden button, then the button can only be clicked via pui.click().
Who is online
Users browsing this forum: No registered users and 5 guests