How do I set the value of a dynamic row text field
i have repeated row form contains button , multiple text fields. there text field (input data field) further information want place in table , multiple buttons want read value of , set table. apologize there multiple questions have , using pseudocode describe it.
top form looks like
inputfield
| buttonx1 | buttony1 | descriptionx1 (read text field)
...
| buttonxn | buttony1 | descriptionxn
outputrow looks like
| buttonoutput | outputfield1 | outputfield2 | outputfield3 |
so do
buttonx1.click
{
outputtable.outputrow.addinstance(true) //this works - else have questions on
outputtable.outputrow.outputfield1.rawvalue = descriptionx1.rawvalue
/*
question 1
how address location in each table set value
question 2
how value of description field in same table , row button
i effect of outputtable.outputrow[??].outputfield1.rawvalue = this.parent.descriptionx
*/
outputtable.outputrow.outputfield2 = inputfield.rawvalue
/*
same question above - how specify dynamic row - proper syntax getting value input field?
*/
outputtable.outputrow.outputfield3 = this.buttonlabel
/*
question 3
how can value of button's label set in field
there should many of these buttons , buttons added - prefer set value based on button's label make value easier - not requiring changing code
*/
question 4 - unrelated above.
is possible build first table
| buttonx | buttony | description |
from xml file. have seen examples of how build if data, can xml pushed form code above actions?
each object in form must have unique name. doing not neccessarily name path or somexpression associated object must unique. in case have table.row.object configuration. row part repeating give each object unique name instance number placed on repeating part. objects in 1st row woudl table.row[0].object...objects in second row woudl table.row[1].object etc .....you can see adding debug instruction on enter event of description field. put code app.alert(this.somexpression) , when enter field see somexpression is. few rows , see pattern (don't forget remove debug code enter event). know have use address fields. if no instance given assumed 0 ..that why 1st row being affected.
so answer questions:
question1: square bracket notation issue javascript (this notation array) have use different means of addressing field include instance number. address description in 3rd row woudl use:
xfa.resolvenode("table.row[2].description").rawvalue = "this new description";
note instance number 2 3rd row because instance numbers 0 based.
question2. resolvenode notation allows pass string can concatinate expressions make string. if writing code on button in same row can instance on using expression this.parent.index. "this" portion refers current object (the button) , parent.index gets th eindex of buttons parent. if button embedded deeper in hierarchy can continue add parent indicators until node want. rewriting expression q1 woudl be:
xfa.resolvenode("table.row[" + this.parent.index + "].description").rawvalue = "this new description";
question3: buttons caption can retrieved using buttonname.caption.value.text.value
question4: when build xml file. expecting come xml file? caption goes on button? typically xml file carries data (not cannot carry other things). need bit of clarification on 1 first.
hope helps
paul
More discussions in LiveCycle Forms
adobe
Comments
Post a Comment