Expand my Community achievements bar.

SOLVED

change caption numeric field

Avatar

Level 2

I have a form with at least 2 radio buttons named type1 and type2  and on 2 different pages 2 numeric fields NF[0] and NF[1], the binding of NF is global.

if I select the radiobutton type1 then the caption of NF[0] and NF[1] should change into "Type1" and visa versa

I have the following javascript text in the change of the radiobuttonlist:

if (this.rawValue == 1)

{

xfa.form.form1.test.NF.caption.value.text.value = "type1";

}

else if (this.rawValue == 2)

{

xfa.form.form1.test.NF.caption.value.text.value = "type2";

}

this only changes the caption of NF[0], how do I change the caption of NF[1]??

best wishes

Simone

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You can change it with the names that you have but the syntax of the expression is quite confusing:

xfa.resolveNode("xfa.form.form1.test.NF[1]").caption.value.text.value = "type2"

If you rename the field to a unique name then you can set it like the first one:

xfa.form.form1.test.NFnewName.caption.value.text.value = "test2"

Note that you do not need the xfa.form at the beginning of the expression ....so to simplify it woudl be:

form1.test.NFnewName.caption.value.text.value = "test2"

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

You can change it with the names that you have but the syntax of the expression is quite confusing:

xfa.resolveNode("xfa.form.form1.test.NF[1]").caption.value.text.value = "type2"

If you rename the field to a unique name then you can set it like the first one:

xfa.form.form1.test.NFnewName.caption.value.text.value = "test2"

Note that you do not need the xfa.form at the beginning of the expression ....so to simplify it woudl be:

form1.test.NFnewName.caption.value.text.value = "test2"

Paul

Avatar

Level 2

you noted that I didn't need to use xfa.form as prefix but I have had several files that if I didn't use the prefix the form wouldn't work, so the prevent that from happening I use it everywhere

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