Clearing Fields in ProfoundUI

Use this board for starting discussions, asking questions, and giving advice on Web programming for the IBM i platform (and predecessors.)
brianhd71
Profound User
Posts: 36
Joined: Thu Jan 02, 2014 6:20 pm
First Name: Brian
Last Name: Lannoye
Company Name: Dealertrack Technologies
Phone: 801.617.1806
State / Province: Utah
Zip / Postal Code: 84095
Country: United States
Contact:

Clearing Fields in ProfoundUI

Post by brianhd71 »

I'm trying to clear search options in our Bulk Inventory Inquiry. Using changeElementValue() works fine with textboxes, select and combo boxes, checkboxes and dates, but I'm having trouble resetting spinners and radio button groups. Is there a way to reset these widgets to an initial value via javascript?
Attachments
Capture.PNG
Capture.PNG (42.99 KiB) Viewed 4606 times
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: Clearing Fields in ProfoundUI

Post by Scott Klement »

Hmmm... why not do this in the RPG program? To me, anyway, it's not very intuitive for the display to clear it's own fields. Someone unfamiliar with your display might be reading the RPG code trying to figure out how the program works, and assume these fields never get cleared if the clearing is done in the display.

Having said that, doing it in the display should be possible. It only fails with spinners and radio buttons?
brianhd71
Profound User
Posts: 36
Joined: Thu Jan 02, 2014 6:20 pm
First Name: Brian
Last Name: Lannoye
Company Name: Dealertrack Technologies
Phone: 801.617.1806
State / Province: Utah
Zip / Postal Code: 84095
Country: United States
Contact:

Re: Clearing Fields in ProfoundUI

Post by brianhd71 »

As far as I know, only with spinners and radio buttons. I wrote a date function to get a low date so all of our date would pass the filter, and the rest used the changeElementValue function. I suppose I could clear them in the RPG, but why not keep the logic on the client side? When it's an AS400 front end, I do all my clearing and error checking on that front end. And, there must be a way to reset those fields, I just don't know how to yet.
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: Clearing Fields in ProfoundUI

Post by Scott Klement »

My best guess at this point is that nobody has added support for (spinners, radio buttons) to changeElementValue(), because we didn't think of it, and no customer has asked (until now.)

So your options are:
  • Do it in RPG
  • Use JavaScript to set these values directly (via the DOM) rather than our API. If you do this, you also need to set the widgets 'modified' flag for the value to be sent back to the RPG (this is a peculiarity of PUI)
  • Wait for us to fix changeElementValue(). (This is probably your best option.)
I'm working on another customer's project right now, but I could possibly take a look at updating Profound UI to fix this problem sometime next week. Or I could see if another developer has time.
brianhd71
Profound User
Posts: 36
Joined: Thu Jan 02, 2014 6:20 pm
First Name: Brian
Last Name: Lannoye
Company Name: Dealertrack Technologies
Phone: 801.617.1806
State / Province: Utah
Zip / Postal Code: 84095
Country: United States
Contact:

Re: Clearing Fields in ProfoundUI

Post by brianhd71 »

Next week is fine Scott. Thanks!
User avatar
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: Clearing Fields in ProfoundUI

Post by Alex »

We looked into this and it appears that changeElementValue() support is there for Spinners and it worked well in a quick test that I had set up. Are you sure it's not working for you? Can you provide an example? Does the first parameter to changeElementValue() match the id of the element exactly (it's case-sensitive).

Radio buttons are not supported by changeElementValue() and there is a reason for this. The values for radio buttons work in groups, yet the first parameter to changeElementValue() is a reference to a specific radio button with its own value, not the group. What's needed is a way to simply specify whether a specific radio button should be set checked or not. Instead of using changeElementValue(), this can should be accomplished with the following simple statement:

Code: Select all

getObj("myradiobutton").checked = true;
This checks the radio button. To uncheck it, use:

Code: Select all

getObj("myradiobutton").checked = false;
Obviously, you should replace "myradionbutton" with the id of your own radio button.

I hope this helps.
brianhd71
Profound User
Posts: 36
Joined: Thu Jan 02, 2014 6:20 pm
First Name: Brian
Last Name: Lannoye
Company Name: Dealertrack Technologies
Phone: 801.617.1806
State / Province: Utah
Zip / Postal Code: 84095
Country: United States
Contact:

Re: Clearing Fields in ProfoundUI

Post by brianhd71 »

Alex, setting the radio button property worked.
And, I did get the spinner to zero out. I changed the increment value from 10 to 1.
After that, it worked for incremented values of 1, 2, 4 and 10.
Thank you.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests