cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Change the Captioned Text

0 Kudos

Hi Guru,

Original Captioned is "1234"

But Business Requirement is to change them dynamically depend on program passed parameter.

If ($.parent.TESTRUN.isNull) then

    $.parent.TESTRUN.caption = "AAAA"

else

    $.parent.TESTRUN.caption = "BBBB"

endif

Such Logic already applied to

initialize; doReady;ready:Form;ready"layout

But the result is Always "1234".

Any Idea what is missing?

Regards,

Matthew

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Thanks All,

But I had tried as attached


But the Result is Still Like that

Even the No Alert pop up .

Regards,

Matthew

prajeshdesai
Contributor
0 Kudos

As i told you, use javascript not formcalc,see below

and also write my code is on initialize event, not on ready event.

OR

if you want to do it with formcalc, try below


$.fieldname.value.#text = "new caption"

Hope this helps.

0 Kudos

Thanks for your suggestion

Result

0 Kudos

Better resolution

prajeshdesai
Contributor
0 Kudos

use your fieldname,


$.ZTESTRUN.value.#text = "new caption"

0 Kudos

Already tried but

The result are same

prajeshdesai
Contributor
0 Kudos

Why don't you try javascript.

Sorry try below formcalc code on initialize event,


$.caption.value.#text = "New"

Hope this helps

0 Kudos

Thanks,, It work Now

Answers (2)

Answers (2)

Former Member

Hi Matthew,

The recommendation is to provide the caption in the data and not to hard code it in the scripting as part of the form. The caption might change and also might need to be localized.

You can use a feature called Dynamic Properties. It needs to be turned on in the Options dialog (Tools -> Options) on the Data Binding panel.

The Caption in the Field panel of the Object palette then becomes a hyperlink. Clicking on it brings up a data binding dialog and you can select a data binding.

Regardfs,

Juergen

prajeshdesai
Contributor
0 Kudos

Try below javascript on initialize event of field,


xfa.resolveNode("filedname.caption.value.#text").value = "new caption";

Hope this helps.