I have a subfile with Hyperlink '+' and '-' (see image1) .
The '+' and '-' have onclick property are added or subtracted amount (see image2) correctly.
Later, when read with RPG program READC the amount field works well if the amount has been changed with keyboard but not hyperlink fields.
Is there any solution ?
Subfile and Hyperlink Event
-
- Profound User
- Posts: 54
- Joined: Fri Dec 19, 2014 12:24 pm
- First Name: Juan
- Last Name: Perez Garcia
- Company Name: NISA
- State / Province: Outside Canada/USA
- Country: Spain
- Contact:
Re: Subfile and Hyperlink Event
Juan,
Could you use a 'spinner' widget instead for the cantSet field? This would eliminate the need for the hyperlinks and allow mouse control to set the value in the field.
You can find the widget in the Input Controls section of the widget toolbar.
Thank you,
Scott
Could you use a 'spinner' widget instead for the cantSet field? This would eliminate the need for the hyperlinks and allow mouse control to set the value in the field.
You can find the widget in the Input Controls section of the widget toolbar.
Thank you,
Scott
- Brian
- Profound Logic Staff Member
- Posts: 286
- Joined: Thu Apr 14, 2011 10:23 am
- First Name: Brian
- Last Name: May
- Company Name: Profound Logic Software
- Contact:
Re: Subfile and Hyperlink Event
Scott is correct that the spinner widget will do what you are trying to accomplish.
If you want to use the hyperlinks instead, can you provide the full javascript you are using in the onclick event?
I believe the issue is that you are manipulating the value of the textbox directly. The Profound UI framework also has a "changed" flag that it uses to detect when screen element values have changed. My guess is that instead of modifying the value directly, you should use the pui.set() API documented here http://www.profoundlogic.com/docs/pages ... d=17137692
Let us know if this helps.
If you want to use the hyperlinks instead, can you provide the full javascript you are using in the onclick event?
I believe the issue is that you are manipulating the value of the textbox directly. The Profound UI framework also has a "changed" flag that it uses to detect when screen element values have changed. My guess is that instead of modifying the value directly, you should use the pui.set() API documented here http://www.profoundlogic.com/docs/pages ... d=17137692
Let us know if this helps.
-
- 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: Subfile and Hyperlink Event
Juan,
You should not use "document.getElementById("cantset." +row).value" to set Profound Logic's widget values. This type of code works fine for plain HTML, but we have a lot of additional code running under the covers, if you set values in the DOM directly you are bypassing our routines. Therefore things like keeping track of which elements have changed will not work since our code never runs to set the "modified" flags at the field and record level.
Instead of using the DOM directly, use the pui.set() API (which is an alias for the changeElementValue API -- they are the same API with two different names.)
Also, please don't use both "response" and "onclick" on the same element. We do not support that. Either use response to trigger your RPG code (and do your calculations on the RPG side) or use "onclick" to do your calculations, and use pui.click() API to submit control back to RPG.
You should not use "document.getElementById("cantset." +row).value" to set Profound Logic's widget values. This type of code works fine for plain HTML, but we have a lot of additional code running under the covers, if you set values in the DOM directly you are bypassing our routines. Therefore things like keeping track of which elements have changed will not work since our code never runs to set the "modified" flags at the field and record level.
Instead of using the DOM directly, use the pui.set() API (which is an alias for the changeElementValue API -- they are the same API with two different names.)
Code: Select all
pui,set("cantset." + row, your-value-here );
-
- Profound User
- Posts: 54
- Joined: Fri Dec 19, 2014 12:24 pm
- First Name: Juan
- Last Name: Perez Garcia
- Company Name: NISA
- State / Province: Outside Canada/USA
- Country: Spain
- Contact:
Re: Subfile and Hyperlink Event
Thank you for your help.
It has been resolved using pui.set () API.
It has been resolved using pui.set () API.
-
- Profound User
- Posts: 54
- Joined: Fri Dec 19, 2014 12:24 pm
- First Name: Juan
- Last Name: Perez Garcia
- Company Name: NISA
- State / Province: Outside Canada/USA
- Country: Spain
- Contact:
Re: Subfile and Hyperlink Event
What other way is there to get the value for: "document.getElementById("cantset." +row).value"??
Tks
Tks
-
- Profound User
- Posts: 54
- Joined: Fri Dec 19, 2014 12:24 pm
- First Name: Juan
- Last Name: Perez Garcia
- Company Name: NISA
- State / Province: Outside Canada/USA
- Country: Spain
- Contact:
Re: Subfile and Hyperlink Event
Thank you for your help.
It has been resolved using pui.set () API.
It has been resolved using pui.set () API.
Who is online
Users browsing this forum: No registered users and 1 guest