How to append records into repeating table during form load

V

Victor

Hi,

I have a scenario like this. I would like to append certain info into the
repeating table's rows when the form is loaded.

For example, i have fields Issue Date, Item, Item Category and Returned
Date in the repeating table. When i check that form is new i would like to
append the Item rows with "TMIS PASS", "SITE PASS","SAFETY PASSPORT", "PETTY
CASH FLOAT", "OUTSTANDING LOAN" and leave the Issue date as today's date and
the rest of the fields blank.

I have created an array like this

var theItems=new Array("TMIS PASS", "SITE PASS","SAFETY PASSPORT",
"PETTY CASH FLOAT", "OUTSTANDING LOAN" ).

I would like to use a for loop to loop the length of the array and append
the description into the Item field rows in the repeating table.

I have tried using
XDocument.View.ExecuteAction("xCollection::insert","Item_12") but it failed
saying XDocument.View is null or not an object.

Can anyone please help me by teaching me how to use AppendChild to do this?
Provide me the AppendChild codes, thanks.

Regards,
Victor
 
V

Victor

Hi Zhang,

Thank you for replying. Yoiu are right that we can use
XDocument.View.ExecuteAction in OnLoad event. Can you show me how to append
records by add elements in DOM directly? Give me some codes example.

Thanks a lot.

Regards,
Victor
 
V

Victor

Hi Zhang,

I have managed to append the records by using appendChild() method.
Thanks.

Regards,
Victor

Victor said:
Hi Zhang,

Thank you for replying. Yoiu are right that we can use
XDocument.View.ExecuteAction in OnLoad event. Can you show me how to append
records by add elements in DOM directly? Give me some codes example.

Thanks a lot.

Regards,
Victor



Zhang Haiguang said:
You cannot call XDocument.View.ExecuteAction in OnLoad event.
Maybe you could append the records by add elements in DOM directly.

InfoJet Service
InfoPath Web Form
[http://www.infojetsoft.com]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top