Correct method to use pui.set

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Theju112
Profound User
Posts: 48
Joined: Fri Jul 10, 2020 8:35 am
First Name: Thej
Last Name: Pav
Company Name: Confidential
Phone: 00918310800134
Address 1: Chennai
Address 2: India
City: Chennai
State / Province: Outside Canada/USA
Zip / Postal Code: 673592
Country: India
Contact:

Correct method to use pui.set

Post by Theju112 »

Dear Scott and Team,

I am trying to understand the correct way to use the pui.set() API to set the value of an element.

So I am trying to set the value of an element whose id is S1DECLAT. So tried pui.set("S1DECLAT", "800" ); but it doesnt work.

However, the id I see when I inspect the element in chrome is S1DECLAT.1, Using this successfully sets the value.

The below code sets the value of S1DECLAT element to 700 (The value assigned through the id from chrome inspector) and not 800. But I believe I must be missing something here as I am expecting to be able to use the id set in the profound designer? Please guide.

Code: Select all

alert(getElementValue("S1DECLAT.1"))
pui.set("S1DECLAT.1", "700" );
pui.set("S1DECLAT", "800" );
pui.click(btnSubmit);
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: Correct method to use pui.set

Post by Scott Klement »

The ID of an element must be unique; its not possible to have two elements with the same id on the screen at the same time.

For that reason, when an element is repeated for each row in the grid, we automatically add the row number to the id. So if you set the id to S1DECLAT and it is in a grid row, we will change the id to S1DECLAT.1 for the first row of the grid, S1DECLAT.2 for the second row of the grid, and so forth.
Theju112
Profound User
Posts: 48
Joined: Fri Jul 10, 2020 8:35 am
First Name: Thej
Last Name: Pav
Company Name: Confidential
Phone: 00918310800134
Address 1: Chennai
Address 2: India
City: Chennai
State / Province: Outside Canada/USA
Zip / Postal Code: 673592
Country: India
Contact:

Re: Correct method to use pui.set

Post by Theju112 »

Hi Scott,

Thanks for the helpful response, as usual.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest