Accessing form data via Javascript. | Community
Skip to main content
Jul 16, 2007 5:59 PM UTC

Accessing form data via Javascript.

Hi,



I'm completely stuck. I have a form with a table with a row containing a textfields. I'm able to add rows to that table via JavaScript. No problem here. Now I want to populate a dropdown with the data entered into the textfield(s). And Here I'm completely stuck. I don't manage to find the instantiated rows with their Textfields.



The hierchy view shows form1>purchaseOrder>Table1>Row



I tried stuff like this:

'xfa.resolveNodes("xfa.form.form1.purchaseOrder.Table1.Row[0].TextField1").rawValue'

or

'xfa.form.form1.purchaseOrder.Table1.Row[0].TextField1'

to access the node or the field without succces.



Nor do I find the way to get a count of the instantiated rows, so I could loop through them.



Thanks in advance

(a desperate)

Steven
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

16 replies

Sep 20, 2008 3:13 AM UTC
hi paul i got the rows inserting even upto 50 rows after changing the Max=7 to Max=50 in the XML source. You can use Find option and find for Max and change the correct value..
Translate
Sep 12, 2008 1:22 PM UTC
In the binding tab do you have a max value set for your repeating subform?



Also is it trying to go across a page ...you would have to allow page breaks in th eparent subform before it woudl be allowed to break across pages.
Translate
Sep 12, 2008 11:18 AM UTC
hi i have problem in adding rows to a table in adobe livecycle. I'm able to insert just 7 rows after that it doesn't do anything. I want to add around 20 rows to a table. How can i do that.



Thanks in advance
Translate
May 6, 2008 1:39 PM UTC
b Setting Initial View Properties to override Workspace defaults



We are new to LiveCycle 8 (less than 3months experience) even though we have used or been using its predecessors for year.



We would like to limit the confusion of our end users by restricting what non-form specific data and operations they see and can perform when opening a form in LiveCycle ES Workspace. I.e., no Edit, File, Find, Measuring, and the likes. Some forms would be more restrictive than others. So what we are really looking for is some method by which we can, on a form by form basis, turn off certain of the menu items that appear or can be turned on when a form is opened.



Setting the Initial View properties on the form would be the ideal way. But even setting the properties programmatically would be helpful.



Any assistance is greatly appreciated.
Translate
Apr 11, 2008 7:45 AM UTC
Can somebody help me to fill in a table in Javascript.

I tried this:

xfa.resolveNodes("data.TableView.BodyTable["+i+"].NAME").rawValue = "100";



It doesn't work.
Translate
Level 10
Jul 19, 2007 11:51 AM UTC
PS Like Jasmin says, you're probably better off posting this on the LiveCycle Designer Forum.
Translate
Jul 19, 2007 11:51 AM UTC
DJEEZ!!!

It actualy works like this.



So my code worked all the time, but it's the messageBox that has a ...euh "feature" :-)



thanks
Translate
Level 10
Jul 19, 2007 11:32 AM UTC
Hi Steven

Welcome to the wonderful world of Javascript.



Try this:

xfa.host.messageBox("Index:" + this.parent.index);



Not 100% sure why this works better, but it's something to do with Javascript's loose typing, and forcing index to be displayed as a string by concatenating.



Howard

http://www.avoka.com
Translate
Jul 19, 2007 11:19 AM UTC
Hi,



I stumbled on a new problem.



This is what I want to do.

1.I have a table:tableEntry, I have a textField=txtDescription in a row=rowEntry and a button=btnRemoveRow for removing the row.

2. I have a tableTarget with rowTarget and within the row a dropdownlist=ddlTarget.

3. Now each time a add a row in the tableEntry and enter data txtDescription I populate the ddlTarget for each row in the tableTarget. That's why I needed the previous code. This works.

4. The user can now select a value from the ddlTarget.



5. A user now edits the data in txtDescription

6. The ddlTarget is updated with the edited value



Now my problem. When I look at the code on the click event on the btnRemoveRow for removing a row in the tableEntry I see this:

_rowEntry.removeInstance(this.parent.index);

so I presume that "this.parent.index" holds the reference for the row I'm working in. Thus when I add an "exit" event on my txtDescription field, I (should) know what row I'm working in via "this.parent.index". So I can loop through the rows in tableTarget and update the appropriate dropdown item.



But this doesn't seem to work. I really don't get how the DOM works in lifecycle designer.



this is the code I used to test:

form1.Page1.tableEntry.rowEntry.txtDescription::exit - (JavaScript, client)

xfa.host.messageBox(this.parent.index);



Steven
Translate
Level 10
Jul 18, 2007 9:10 PM UTC
Hi

Just one other thing...

Don't declare a variable of "nodes" instead of "mynodes". "nodes" appears to be an implicitly defined variable, and if you try to use it, all sorts of weird stuff happens.

Took me 3 hours to find that one :-S

Howard
Translate