Page 1 of 1

Correct method to use pui.set

Posted: Fri Oct 23, 2020 8:46 am
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);

Re: Correct method to use pui.set

Posted: Fri Oct 23, 2020 9:27 am
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.

Re: Correct method to use pui.set

Posted: Sat Oct 24, 2020 10:38 am
by Theju112
Hi Scott,

Thanks for the helpful response, as usual.