Expand my Community achievements bar.

SOLVED

Dynamically creating and binding data

Avatar

Level 1

Hi everyone,

I am creating a form which is available in different languages. Therefore I created a radiobutton per language and on click of one of these buttons, I dynamiccally bind the XML fragment with an existing node (javascript code):

     xfa.data.node.loadXML(xml, true, true)

This works, since I display the XML code in a seperate text field to check.

Afterwards I want to dynamically bind my text elements to the data. Therefore, I already created the bindings to the XML nodes that will be generated later (like xfa.data.node.tag1.tag2).

However, I never see the content of the nodes, not even if I create and bind the XML on the initialise event of the root element (so without choosing a language, but certainly before the bound elements are loaded).

I can see the text when I change the calculate event of a text field as follows.

     xfa.data.node.tag1.tag2.value

I am able to access the XML nodes, but for one reason or the other the binding does not work.

Does anybody know how to fix this? All help would be greatly appreciated!

Kind regards,

Tim

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Unfortunately dyna,ic data binding si not supported in the current release. That is to say that once the form is rendered the binding that is set cannot be changed. You can read the property but you cannot change it.

Paul

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

Unfortunately dyna,ic data binding si not supported in the current release. That is to say that once the form is rendered the binding that is set cannot be changed. You can read the property but you cannot change it.

Paul

Avatar

Level 1

Hi Paul,

thank you for your answer.

Do you have any idea how I could best proceed to meet the requirements I have?

All hints are more than welcome!

Kind regards,

Tim

Avatar

Former Community Member

You woudl have to read teh data from the dom and set the values into the field yourself (with code). You will not be able to rely on the form bindings to do it for you as they are already set to other values.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----