Highlighted

how to change the caption of a regular button ?

Avatar

Guest

07-08-2008

Hi there,



I am using LifeCycle Designer 8.0 and during the past days I have been reading dozens of forum entries, giving tips a try to populate the caption of a regular button with the value of a drop down list. Among many other combinations of various properties I have tried the following scripts in the exit event of the drop down list but none of them works :



a) Button1.caption.value = DropDown1.rawValue

b) Button1.caption.value.text = DropDown1.rawValue

c) Button1.caption.value.#text = DropDown1.rawValue

d) Button1.caption.value.text.value = DropDown1.rawValue



Anyone willing to share the secrecy behind changing the caption of a regular button ?



Many thanks,

Joel

Replies

Highlighted

SriRamuSr

07-08-2008

You can use this following command to change the caption of the button



xfa.resolveNode("Button.caption.value.#text").value = "New Caption";
Highlighted

Avatar

Guest

07-08-2008

Hi Sri,

thanks for your suggestion; I've just tried it but unfortunately it does not work, neither the button's caption nor anything else is changing. Any further ideas ?

Regards, Joel
Highlighted

SriRamuSr

07-08-2008

Use it with Full Name....



For Eg.,



form1.Page1.Table1.Row7.button1.caption.value



like that...



If this also doesnt work, please provide me the scenario in which You are performing this or that sample code?



So that I can check it in my System....
Highlighted

Avatar

Guest

07-08-2008

Hello again,

still no luck with your second suggestion. To keep things simple and avoid any interferences with other objects I created a new file with one only form. On that form I added one drop down list and populated it with three values (1, 2, 3). Then I added one button and copied your code in the exit event of the drop down list. Subsequently, selecting one of the values from the drop down list is unfortunately not updating the caption of the button.

Regards, Joel
Highlighted

SriRamuSr

07-08-2008

Joel,



I tried your scenario in my Computer.

1) Created a Plain Design layout with Master page and default Page in that PDF Layout Form.

2) Renamed the Default Page as "SamplePage"

3) Created a DropDown List with 3 Items in it

4) Also created a Normal Button

5) put the following statement in the Button Click Event



form1.SamplePage.DropDownList1::exit - (JavaScript, client)

xfa.resolveNode("form1.SamplePage.Button1.caption.value.#text").value = form1.SamplePage.DropDownList1.rawValue ;



6) Checked in my Preview Window (Pressing F5)

7) Scenario Works fine.



Tips:

1) Check whether the event is getting trigerred properly

2) Assign the caption with Simple Text

3) If this also doesnt work, you can debug this having Message Box before that assignment.

For Eg.,

xfa.host.messageBox(<<Object's Property whose Value need to check>>);



Even this Doesnt Work, Please get back to me in email. My Email ID is SriRamu.SR@cognizant.com



Sri
Highlighted

Avatar

Guest

08-08-2008

Hi Sri,

thanks a lot for your additional off-line information. Everything is working fine now. For all others out there facing similar problems, make sure that you save your form as an "Adobe Dynamic XML Form" AND NOT as an "Adobe Static PDF Form": you can set the respective option when saving your file via 'Save as'. Furthermore, make sure that your form is marked as an 'Interactive Form' in the 'preview type' field which you can access via the 'Form Properties' screen.

Joel