<JSB> <JSB_DESCRIPTOR name="netscape.peas.BiCalc" displayName="Bidirectional Calculation" shortDescription="Bidirectional Calculation" ENV="client"> <JSB_PROPERTY NAME="prop1" DISPLAYNAME="Property 1" PROPTYPE="JS" TYPE="string" WRITEMETHOD="set1" ISBOUND SHORTDESCRIPTION="This is property 1"> <JSB_PROPERTY NAME="prop2" DISPLAYNAME="Property 2" PROPTYPE="JS" TYPE="string" WRITEMETHOD="set2" ISBOUND SHORTDESCRIPTION="This is property 2"> <JSB_PROPERTY NAME="formula1" DISPLAYNAME="Formula 1" PROPTYPE="JS" TYPE="string" SHORTDESCRIPTION="Formula that calculates property 1 from property 2"> <JSB_PROPERTY NAME="formula2" DISPLAYNAME="Formula 2" PROPTYPE="JS" TYPE="string" SHORTDESCRIPTION="Formula that calculates property 2 from property 1"> <JSB_METHOD NAME="set1" TYPE="void"> <JSB_PARAMETER name="newVal" type="string"> </JSB_METHOD> <JSB_METHOD NAME="set2" TYPE="void"> <JSB_PARAMETER name="newVal" type="string"> </JSB_METHOD> <JSB_EVENT NAME="onChange" LISTENERMETHODS="onChange" LISTENERTYPE="onChangeListener" EVENTMODEL="JS"> <JSB_CONSTRUCTOR> function netscape_peas_BiCalc_set1( s ) { this.prop1 = s this.prop2 = eval( this.formula2 ) this.onChange("prop1", "", this.prop1) this.onChange("prop2", "", this.prop2) } function netscape_peas_BiCalc_set2( s ) { this.prop2 = s this.prop1 = eval( this.formula1 ) this.onChange("prop1", "", this.prop1) this.onChange("prop2", "", this.prop2) } function netscape_peas_BiCalc(params) { this.prop1 = params.prop1 this.formula1 = params.formula1 this.formula2 = params.formula2 this.prop2 = eval( this.formula2 ) this.set1 = netscape_peas_BiCalc_set1; this.set2 = netscape_peas_BiCalc_set2; } </JSB_CONSTRUCTOR> </JSB>