on 06-03-2010 3:42 PM
Hello Experts,
I want to access the Table rows which are getting populated by WDA context, in form JavaScript when the table is populated.
on the basis of few cell values i want to disable and enable particular cells in table rows when the table is rendered to the user.
Please provide your inputs and suggestion on how to write a java script for it and in which event i should write the script.
i searched SDN and found couple of blogs and threads and tried using them but not working.
Thanks,
Siddharth
1) you need to see the data coming from the backend to your form
2) you must write your script and user proper addressing, example:
you place the script on the row subform level, you write like
var help_var = this.yourfieldname.rawValue;
this.field2.rawValue = help_var;
this means the subform, where the script is placed (or field if you would place it on the field level)
you can use parent pointer to access the node one level up from your position in the form hierarchy
something like this.parent (where this means row, then this.parent means the subform for table).
Examples available here (last chapter):
Regards Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello All,
thanks for your suggestions.
after some research and trial and error i found the solution:here is the sample code for those who might face this issue.
SUPERNODE(Root Node)
--SUBFM(SUBFORM)
-
MYNODE( Table)
-
DATA(Table ROW)
-
ADD (Table COLUMNS)
-
DELETE (Table COLUMNS)
var data1;
var norows = xfa.resolveNodes("SUPERNODE.SUBFM.MYNODE.DATA[*]").length;
for ( var i =0; i < norows; i++)
{
if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").rawValue == "")
{
xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].DELETE").access = "readOnly";
}
if( xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").rawValue != "")
{
xfa.resolveNode("SUPERNODE.SUBFM.MYNODE.DATA["i"].ADD").access = "readOnly";
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
To access the rows of your table in the context, try to use the below syntax :
var fields = xfa.form.subform.table.row.all;
for (var i=0; i<=fields.length; i++ )
{
do your code here
}
NB: It is always better to do all manipulations to your table in the back end.
Regards,
Deepa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Experts,
Any suggestions inputs are most welcome.
Thanks,
Siddharths
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.