Using TableRow Index to set ReadOnly

Avatar

Avatar
Validate 1
Level 4
Ryan_Lunka
Level 4

Likes

11 likes

Total Posts

143 posts

Correct reply

11 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
Ryan_Lunka
Level 4

Likes

11 likes

Total Posts

143 posts

Correct reply

11 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Ryan_Lunka
Level 4

31-07-2008

I have a dynamic table that adds a new row whenever the button beside it is clicked. Pretty simple. When a new row is added there are two cells (text fields) that the user is supposed to enter. One of the cells contains an OK button. When the user clicks the OK button, I would like the entire corresponding row to be set to readOnly, so the values can no longer be edited.



I figure there is some way of accessing a single instance in a table using an index, but I cannot figure out the syntax. Everything I try always changes the first row in the table. Does anyone have any suggestions or help?



Thank you so much!

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

31-07-2008

To get the index you would use this.parent.index. This will tell you which instance you are working with. Now that you know the instance you can address each of the objects by using the appropriate SOM Expression. To get the som expression I put an app.alert(this.somExpression); This will show you the structure you need to follow. The container for your object will have the instance number on it (i.e. form1[0].Page1[0].subform[*].fieldname[0] ...where * is the instance number.



Now when you go to set a value you cannot use [ ] in javascript so to create the expression you need this syntax:



xfa.resoleNode("form1.Page1.subform[" + this.parent.index + "]").fieldname.rawValue



Make sense?

Avatar

Avatar
Validate 1
Level 4
Ryan_Lunka
Level 4

Likes

11 likes

Total Posts

143 posts

Correct reply

11 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
Ryan_Lunka
Level 4

Likes

11 likes

Total Posts

143 posts

Correct reply

11 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Ryan_Lunka
Level 4

31-07-2008

That worked. Thank you very much!