cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <baskar.gan...@wipro.com>
Subject Accessing the union type widget value
Date Fri, 09 Sep 2005 13:37:35 GMT

Hi all,



Can anyone tell me how can we access the union widget from the
flowscript?

I have created a definition file as follows:-



<fd:form xmlns="http://apache.org/cocoon/forms/1.0#definition"
      xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
      xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
     
  <fd:widgets>
 
    <!-- case widget, with _c suffix -->
    <fd:field id="student" required="true">
      <fd:datatype base="string" /> 
    </fd:field>
  
    <fd:union id="structStudent" case="student">
      <fd:widgets>
        <fd:struct id="firstname">
          <fd:widgets>
            <fd:field id="name">
              <fd:datatype base="string" /> 
            </fd:field>
          </fd:widgets> 
        </fd:struct>
        <fd:struct id="lastname">
          <fd:widgets>

</fd:widgets>
        </fd:struct>  

   </fd:widgets>
    </fd:union>
 
  </fd:widgets>
</fd:form>



The form is getting rendered correctly by giving the following code



var wid = frmView.getWidget();

wid.lookupWidget(student').setValue('firstname')



It is displaying me a text box but if I want to access the firstname how
will I access?

I tried accessing wid.lookupWidget(student').firstname which it is
telling undefined.

Can any one please  help me out in accessing the widget inside a
structure.



Thanks an Regards,

Baskar.











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.
Mime
View raw message