I have a table that has one row.
I can add upto five rows by clicking a button that has addInstance()
method.
How can I identify a particular row (for eg 3rd row) and retrieve a
value in that row.
Please help me to get a solution for this problem.
Another Question
How can i get the index of a text in the drop down list box?
For e.g I have three text in the dropdown list namely 1st, 2nd and 3rd
How can I get the index value of the text by scripting?
It depends if you are using JavaScript or FormCalc.
For JavaScript, you use the resolveNode method. For example:
var thirdRow =
yourTableName.resolveNode("yourRowName[3]").yourFieldName.rawValue;
For FormCalc, you can just use the instance index. For example:
yourTableName.yourRowName[3].yourFieldName
If you want to calculate the total of a column in JavaScript:
var rowCount = yourTableName.yourRowName.instanceManager.count;
var yourTotal;
for (var i = 0; i < rowCount; i++) {
var currentRow = yourTableName.resolveNode("yourRowName[" + i +
"]");
yourTotal = yourTotal + currentRow.yourFieldName.rawValue;
}
yourTableName.yourFooterRowName.yourTotalField.rawValue = total;
----------------------------------------------------
As for the index of a text value in a list box, if you want the
current value (in JavaScript):
yourListName.rawValue;
To get the displayed text of the list (in JavaScript):
var numOptions = yourListName.length;
for (var i = 0; i < numOptions; i++) {
app.alert(yourListName.items.nodes.item(i).value);
}
Hope this answers your questions,
John.
What u told works perfectly. Thanks a lot for your answer
Regards,
Mohan
No worries.
Not sure if I'm allowed to post promotions to books here, but I
honestly think that the book "Creating Dynamic Forms with Adobe
LiveCycle Designer" (http://www.peachpit.com/store/product.aspx?
isbn=0321509870) would be an invaluable asset for you. It is great for
beginners and advanced users alike - I got my $40 worth out of it
already and I'm only half way through (and I've been using LiveCycle
products for almost a year now).
John.