Expand my Community achievements bar.

addInstance() delivers som-expression error

Avatar

Level 4

Hi,

I have a form with a table being pre-populated by an XML file.

That works fine.

Now I want to give the user the possibility to add more rows.

For that purpose I added to the right-most field of the table row an exit-event with this JavaScript code:

this.parent.instanceManager.addInstance(true);

The strange thing is: I always get a error which says, that the SOM expression cannot be constructed for the first field of the row.

If I don't have the form pre-populated in the preview it works perfectly and I can add as many rows as I want.

Is there any way to add data to the form's data xml later on?

I have this bad feeling, that the data xml in the form is locked if the form is pre-populated. How can I unlock it?

Uli

2 Replies

Avatar

Level 10

Can you send the form to LiveCycle9@gmail.com so I can have a look at it..

Thanks

Srini

Avatar

Level 4

Hi Srini,

via eMail you let me know:

"

    1) You did not add any data connection. You only added the XML path in the preview. With out the Data binding, form does not know where to populate the XML data. (Check the ScreenShot2 for Data connection.) I created a data connection and bound the fields

to the tags.
    2) Removed the data binding for the Zeile subform. That removed the error.
"

Indeed I do not have a data connection in the form. Yet that works quite well without the data connection. The form get populated with the data from an XML file. As every field has a data binding like
$record.PRINTJOB.PMSDATA.V1.ZEILEN.TABELLE.ZEILE[*].FELDNAME
the form does know where to put the XML data.

On the row (in this case the subform ZEILE) I do not have a data binding.

The point of the problem is:
The form get populated with repeating row data from an XML file. But it appears impossible to add more rows later on via script.

Does anyone have an idea?

Uli