cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject [Fwd: onChange event handler for the widgets defined inside the union]
Date Sat, 10 Sep 2005 14:56:46 GMT
(This message was sent to my personal address; forwarding to the users 
list.  Discussion should take place there.)

-------- Original Message --------
Subject: 	onChange event handler for the widgets defined inside the union
Date: 	Sat, 10 Sep 2005 16:52:35 +0530
From: 	<vijayaraghavan.subramaniam@wipro.com>
To: 	<users-help@cocoon.apache.org>
CC: 	<cocoon@lojjic.net>



Hi,

Can any one help me out..

How to define onChange event-handler for the widgets defined inside the
union?

What's wrong in the below code?

//flow script code

wid.lookupWidget('description_c').setValue('visible');

wid.lookupWidget('description_u/visible/description').onChange =
function (oldV, newV) {
     print("oldV::" + oldV);
     print("newV::" + newV);
};

//definition file

<fd:union id="description_u" case="description_c">
   <fd:widgets>
     <fd:struct id="visible">
       <fd:widgets>
         <fd:field id="description">
           <fd:datatype base="string" />
           <fd:selection-list>
             <!-- TODO remove the below code   -->
             <fd:item value="1">
               <fd:label><i18n:text>test</i18n:text></fd:label>
             </fd:item>
             <fd:item value="2">
               <fd:label><i18n:text>test2</i18n:text></fd:label>
             </fd:item>
           </fd:selection-list>
         </fd:field>
       </fd:widgets>
     </fd:struct>
     <fd:struct id="disabled">
       <fd:widgets></fd:widgets>
     </fd:struct>
     <fd:struct id="hidden">
       <fd:widgets></fd:widgets>
     </fd:struct>
   </fd:widgets>
</fd:union>


//template file

<ft:union id="description_u">
   <ft:case id="visible">
     <ft:struct id="visible">
       <!-- insert regular header row HTML stuff here -->
       <ft:widget id="description">
         <fi:styling submit-on-change="true" />
       </ft:widget>
     </ft:struct>
   </ft:case>
   <ft:case id="disabled">
     <ft:struct id="disabled">
       <!-- insert regular header row HTML stuff here -->
       <p>Please choose a Phone value first.</p>
     </ft:struct>
   </ft:case>
   <ft:case id="hidden">
      <p>hidden value</p>
   </ft:case>
</ft:union>

Vijay.


Confidentiality Notice

The information contained in this electronic message and any attachments
to this message are intended
for the exclusive use of the addressee(s) and may contain confidential
or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message