Expand my Community achievements bar.

SOLVED

Rerender form / Dynamic Modify Binding / Multi-Language

Avatar

Level 4

Dear all,

I am try to create a form to support the user to change the language in real time.

So I would like to know if I can:

1) Change the field binding dynamically

So I can prepare a few set of data and bind the one I need, but it seem that I still need to trigger the from to rerender.


2) Refersh the form after the binded data change

I tried something like this:

     xfa.datasets.data.mainData.sfDDLInfo02.loadXML(xfa.datasets.data.mainData.sfDDLInfo01.saveXML(),1,1);

or this:

     xfa.datasets.data.mainData.sfDDLInfo01.Key.value = 'key';
     xfa.datasets.data.mainData.sfDDLInfo01.Value.value = 'value';

And it success to update the dataset, but the dropdown with binded on it do not update....

Regards

Bill

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

If you do an xfa.layout.relayout() command that will cause the form to layout again. If you simply want to merge the data dom again you can do an xfa.form.remerge(). This remerge may also cause a relayout if there is sufficient change to the data.

Paul

View solution in original post

4 Replies

Avatar

Former Community Member

You can view the binding through script but you cannot change it dynamically.

Paul

Avatar

Level 4

Hi Paul,

Thanks for the reply, good to know the answer so I don't need to try anymore on that. =)

Would like to know if I can trigger rerendering of the object or the whole form with script? Because I have a test case like this:

- With dropdown and a table bind to the same data set

- Add and change data with the control in the table

And I find that the dropdown will update after I adding new entry to the table, thus, I think it is somehow possible, anyone can give some light on this?

Regards

Bill

Avatar

Correct answer by
Former Community Member

If you do an xfa.layout.relayout() command that will cause the form to layout again. If you simply want to merge the data dom again you can do an xfa.form.remerge(). This remerge may also cause a relayout if there is sufficient change to the data.

Paul

Avatar

Level 4

Thanks Paul, it work.

Am always wonder where can I find the help/document about the xfa.host/xfa.layout/xfa.form, always seeing these objects but have no idea how can I find out what's available to them.

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] ----