Hi to all...
I tried to looking for some answers, but without success, and I decided to aks here:
is it possibile to change the Javascript in onkeyup/onchange/onclick events of a textbox with a Javascript or PUI. command?
I've the commands I need in Javascript, to put in these events, in some variables on the screen (labels).
Thanks
Onkeyup Javascript from RPG
-
- New User
- Posts: 6
- Joined: Fri Feb 02, 2018 10:13 am
- First Name: Livio
- Last Name: Daneluzzi
- Company Name: Daneluzzi IT
- State / Province: Outside Canada/USA
- Country: Italy
- 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: Onkeyup Javascript from RPG
Sorry, I don't understand the question. Can you give me an example?
-
- New User
- Posts: 6
- Joined: Fri Feb 02, 2018 10:13 am
- First Name: Livio
- Last Name: Daneluzzi
- Company Name: Daneluzzi IT
- State / Province: Outside Canada/USA
- Country: Italy
- Contact:
Re: Onkeyup Javascript from RPG
Sorry Scott, I hope this will explain better: ;-)
I need to change the ONKEYUP, or ONCLICK, or ONCHANGE event attribute, of a TEXTBOX, with a Javascript command.
I saw there's way to change the attributes of a TEXTBOX in a display file, for example with the command:
setDOMAttribute("TEXTBOX1", "value", "abcdefgh");
and if I use "value" it works perfect, but I need to change, for example, "onclick" attribute, and I thought to modify the command like this one:
setDOMAttribute("TextBox1", "onclick", "some Javascript code");
but it doesn't work. It doesn't change the "onclick" attribute.
Is there a way to do it? Am I using the right command, or is there another one for to do this thing?
Thanks a lot
I need to change the ONKEYUP, or ONCLICK, or ONCHANGE event attribute, of a TEXTBOX, with a Javascript command.
I saw there's way to change the attributes of a TEXTBOX in a display file, for example with the command:
setDOMAttribute("TEXTBOX1", "value", "abcdefgh");
and if I use "value" it works perfect, but I need to change, for example, "onclick" attribute, and I thought to modify the command like this one:
setDOMAttribute("TextBox1", "onclick", "some Javascript code");
but it doesn't work. It doesn't change the "onclick" attribute.
Is there a way to do it? Am I using the right command, or is there another one for to do this thing?
Thanks a lot
-
- 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: Onkeyup Javascript from RPG
I'd never heard of setDOMAttribute() before your message. I looked, and it appears to be part of our software, but I've never heard of it before and never saw anyone use it.
If you want to add your own event handler to Profound UI at runtime, you would use the addEvent() API documented here:
http://www.profoundlogic.com/docs/pages ... Id=3276841
To remove that event handler (prior to adding a different one) you would use the removeEvent() API:
http://www.profoundlogic.com/docs/pages ... Id=3276843
Please note that if you're adding/removing events like this you are working at the DOM level, so you must only use this with browser events, not anything that's specific to Profound UI. In other words, you are working directly at the HTML level, NOT at the Profound widget level.
It is very unusual for a customer to do this, and I find it extremely strange that you would do that. I strongly suspect that you are asking the wrong question! Rather than changing the actual code while the display is running, it'd make much more sense to use stuff like if statements, etc, so that you run different code under different circumstances.
If you want to add your own event handler to Profound UI at runtime, you would use the addEvent() API documented here:
http://www.profoundlogic.com/docs/pages ... Id=3276841
To remove that event handler (prior to adding a different one) you would use the removeEvent() API:
http://www.profoundlogic.com/docs/pages ... Id=3276843
Please note that if you're adding/removing events like this you are working at the DOM level, so you must only use this with browser events, not anything that's specific to Profound UI. In other words, you are working directly at the HTML level, NOT at the Profound widget level.
It is very unusual for a customer to do this, and I find it extremely strange that you would do that. I strongly suspect that you are asking the wrong question! Rather than changing the actual code while the display is running, it'd make much more sense to use stuff like if statements, etc, so that you run different code under different circumstances.
-
- New User
- Posts: 6
- Joined: Fri Feb 02, 2018 10:13 am
- First Name: Livio
- Last Name: Daneluzzi
- Company Name: Daneluzzi IT
- State / Province: Outside Canada/USA
- Country: Italy
- Contact:
Re: Onkeyup Javascript from RPG
Thanks a lot Scott, for the answer.
I think that to change dinamically the Javascript while display running extends the possibility of manage it without limits.
It's only an idea and I think to try it... if all will works like I think, surely I can share the idea here in the forum. I don't know if, in the future, it will have an application somewhere.
I think that to change dinamically the Javascript while display running extends the possibility of manage it without limits.
It's only an idea and I think to try it... if all will works like I think, surely I can share the idea here in the forum. I don't know if, in the future, it will have an application somewhere.
Who is online
Users browsing this forum: No registered users and 13 guests