Page 1 of 1

row number

Posted: Mon Nov 22, 2021 11:15 am
by ppbedz
Hello,

I coded logic to retrieve the row number of the grid row modified on the onselect, but I keep getting a "row undefined" error. Can someone please assist? Thank you, Patti

This is the code on the OnSelect property (I get the alert so I know I am in the right spot):

alert("code is running");
var rrn = getObj("grid1").grid.getRRN(row);
alert(rrn);
pui.set("T_VendChgRow",rrn);
pui.click()

Re: row number

Posted: Wed Dec 08, 2021 10:11 am
by mwalter
at first look, the default ID for a grid would be Grid1 with a capital "G". Are you sure that your grid is named properly in your code?

Re: row number

Posted: Wed Dec 08, 2021 10:26 am
by ppbedz
Hi Mark,

Yes. I ended up sending my issue to support and they assisted. Part of my problem was I was running an older version of my javascript that had been cached. Thank you for your response.

Re: row number

Posted: Fri May 06, 2022 3:24 pm
by pjshuey
What was the solution to this? I am having the same issue.

Re: row number

Posted: Mon May 09, 2022 8:02 am
by ppbedz
Hello,

It was a combination of things. I needed to clear my cache and close any open threads related to old jobs on our Iseries. The other mistake I was making was executing the pui.click outside of my function. Support provided the code sample below. Hope this helps...

function myFunc(selection,textBox) { //passes the textBox parameter used to reference the textbox widget
var boxID = textBox.id; //get the ID of the textbox widget
var rowNum = boxID.split('.').pop(); //get the portion of the ID that contains the row number
alert(rowNum); //shows a browser alert of the row number for testing
pui.click();
}

myFunc; //calls the function

Re: row number

Posted: Mon May 09, 2022 10:10 am
by pjshuey
Thanks so much! I will give this a shot!