Hi,
I have been trying to create a drop-down to dynamically populate a table based on what drop-down option is chosen. I can get it to work for adding a row at a time, which is fine, but I want to add text related to the chosen option to a field in the newly created row. I can get this to work using Row1.Field.rawValue = "blah blah blah" but when I want to get dynamic and call the row being created by using something like resolveNode I can't get anything to be entered into the field. Can this be done at all?
Here is my script:
==================
topmostSubform.Page1.tabletest.DropDownList2::exit - (JavaScript, client)
if (this.rawValue == 1) {
Table4._Row1.addInstance()
Page1.tabletest.Table4.Row1.Identity.rawValue = "Easement for Transmission Line"
};
if (this.rawValue == 2) {
Table4._Row1.addInstance()
Page1.tabletest.Table4.resolveNode(Row1[Table4.Row1.instanceManager.count-1]).Identity.rawValue = "Easement for electricity and other purposes"
xfa.host.messageBox("Ausgrid");
};
===================
The first part, for this.rawValue == 1 works okay for one instance of adding. The second part, where I have tried to do a resolveNode, adds a row but does not enter any text.
Thanks in advance for your help with, and consideration of, this problem.
Cheers,
Greig
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
the resolveNode method needs somExpressions wrapped in quotes.
In opposite to FormCalc JavaScript doesn't support the numeric values in the accessors [] to resolve an specific instance.
Change your script into;
Page1.tabletest.Table4.resolveNode("Row1[" + Table4.Row1.instanceManager.count-1 + "]").Identity.rawValue = ...
Views
Replies
Total Likes
Hi,
the resolveNode method needs somExpressions wrapped in quotes.
In opposite to FormCalc JavaScript doesn't support the numeric values in the accessors [] to resolve an specific instance.
Change your script into;
Page1.tabletest.Table4.resolveNode("Row1[" + Table4.Row1.instanceManager.count-1 + "]").Identity.rawValue = ...
Views
Replies
Total Likes
Thanks very much for the reply, which is absolutely correct. I did manage to find the answer in the assure Dynamics blog - http://www.assuredynamics.com/index.php/2011/05/som-expressions/, which has a nice dynamic demonstration that was very helpful.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies