Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Which form event to use on form-open to change text object caption?

$
0
0

Hello, I have a checkbox that when selected will change the caption of a text object and two text fields, and when deselected will revert back to their default caption. When the form is reopened, I want the text object's caption as well as the two text fields' caption to be set according to the checkbox being selected or not.

 

I can do it for the two text fields using their 'form:ready' event. But the text object has no scripting events to use. So I'm assuming the text object's caption needs to be changed using an event at the form level. I believe it is the form's 'docReady' event but I can't make it work. I've tried other form events and no one works. So I don't know if it is that I'm not using the correct form event or the correct scripting, or a combination of the two.

 

Here's the scripting the checkbox uses to change the captions when selected/deselected (this works fine): form1.Page1.DGSiteInfo.Row2.Table1.Row1.blnAdditionNMSystem::change - (JavaScript, client)

 

if (this.rawValue == 1) //the box is checked

     {

          form1.Page1.Specs.Row3.Table1.Row2.lblInstalledKW.rawValue = "Added generator capacity (kW)"; //change text object caption           form1.Page1.Specs.Row7.Table1.Row1.numInverterQty.caption.value.resolveNode("#text").valu e = "Number of added inverters:"; //change text field caption           form1.Page1.Specs.Row7.Table1.Row1.numTotalInverterKW.caption.value.resolveNode("#text"). value = "Total added inverter capacity:" //change text field caption

     }

else

     {

          form1.Page1.Specs.Row3.Table1.Row2.lblInstalledKW.rawValue = "Installed generator capacity (kW)"; //change text object caption           form1.Page1.Specs.Row7.Table1.Row1.numInverterQty.caption.value.resolveNode("#text").valu e = "Number of inverters:"; //change text field caption           form1.Page1.Specs.Row7.Table1.Row1.numTotalInverterKW.caption.value.resolveNode("#text"). value = "Total inverter capacity:"; //change text field caption

     }

 

 

Here's the scripting one of the text fields uses when the form opens, the other text field follows the same scripting (this also works fine): form1.Page1.Specs.Row7.Table1.Row1.numInverterQty::ready:form - (JavaScript, client)

 

//will ensure the label is properly set based on the controlling field when the form is opened

if (DGSiteInfo.Row2.Table1.Row1.blnAdditionNMSystem.rawValue == 1) //if controlling field value is checked     

     {

          form1.Page1.Specs.Row7.Table1.Row1.numInverterQty.caption.value.resolveNode("#text").valu e = "Number of added inverters:"; //change field caption

     }

//else, the field automatically uses its default caption

 

Here's the scripting I've tried to use in the forms 'docReady' event (and other form events) to change the text object's caption when the form opens (this doesn't work):

form1::docReady - (JavaScript, client)

 

//will ensure the label is properly set based on the controlling field when the form is opened

if (DGSiteInfo.Row2.Table1.Row1.blnAdditionNMSystem.rawValue == 1) //if controlling field value is checked     

     {

          form1.Page1.Specs.Row3.Table1.Row2.lblInstalledKW.rawValue = "Added generator capacity (kW)"; //change text object caption

     }

//else, the field automatically uses its default caption


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>