Need some help with the ROW property on a subfile field.
From other topics in this forum I can see that there is a ROW property (or variable) giving the actual row for a subfile field.
I am trying to create an onClick script for a subfile field resulting in change of an option field in the same row and then generate an Enter (submit). The Enter works fine, but the reference to the row doesn't work. Sure I am doing something wrong.
The script is the OnClick is:
changeElementValue("S1X.row","2");pui.click("btnSubmit");
This should change the S1X (an option field) on the same row as the clicked field to '2', but it doesn't do it. If I change the row to a fixed number it works.
Ideas about what I am doing wrong ?
Brgds
Helge
onClick / row property on subfile field
-
- Profound User
- Posts: 24
- Joined: Sun Oct 30, 2011 1:04 pm
- First Name: Helge
- Last Name: Bichel
- Company Name: Helge Bichel
- Country: Denmark
- Contact:
- 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: onClick / row property on subfile field
Try:
changeElementValue("S1X." + row,"2");pui.click("btnSubmit");
changeElementValue("S1X." + row,"2");pui.click("btnSubmit");
-
- Profound User
- Posts: 24
- Joined: Sun Oct 30, 2011 1:04 pm
- First Name: Helge
- Last Name: Bichel
- Company Name: Helge Bichel
- Country: Denmark
- Contact:
Re: onClick / row property on subfile field
Doesn't work.
I get
OnClik Error: 'row' not defined.
I get
OnClik Error: 'row' not defined.
- 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: onClick / row property on subfile field
Ok, so you are on the onclick event of an individual field in the grid. Now I understand your dilemma.
Try this:
var id = this.id; row=id.split(".")[1];changeElementValue("S1X." + row,"2");pui.click("btnSubmit");
This should retrieve the current elements id, which will include the row number. The split function will split the id at the period and return the second half ([1]) which is the row number. Then the code I gave you previously should work. I did not get a chance to test this, but it should work.
Try this:
var id = this.id; row=id.split(".")[1];changeElementValue("S1X." + row,"2");pui.click("btnSubmit");
This should retrieve the current elements id, which will include the row number. The split function will split the id at the period and return the second half ([1]) which is the row number. Then the code I gave you previously should work. I did not get a chance to test this, but it should work.
-
- Profound User
- Posts: 24
- Joined: Sun Oct 30, 2011 1:04 pm
- First Name: Helge
- Last Name: Bichel
- Company Name: Helge Bichel
- Country: Denmark
- Contact:
Re: onClick / row property on subfile field
Dear Brian.
That works ! Thank you very much.
Brds
Helge
That works ! Thank you very much.
Brds
Helge
Who is online
Users browsing this forum: Bing [Bot] and 7 guests