Hello All,

I have a page with 2 forms on it.  The first form only has a select in it and 
the contents of the second form depend on the selection of select in the first 
form.  No I tried to put an @EventListener to listen when the select changed 
its contents.  When I did this the index that was returned was not the value 
that was selected.  The only way that I could get this to be the correct value 
was to put in a submitForm attribute in the @EventListener and put a listener 
on that form.  I have included code snippets below and I'm using Tapestry 
4.1.5.  What I would like to know is this the correct way to do this?  Have I 
stumbled across a bug?

Craig

Page.java
*************************************************************
@EventListener(events="onchange",elements="cameraList", 
submitForm="personListForm")
public void loadPerson(IRequestCycle cycle)
{
}

public void personformSubmit(IRequestCycle cycle)
{
        int idx = getPersonSelectedIndex();
        //do stuff to fill in form 2
}
*************************************************************
Page.html
*************************************************************
<form jwcid="[EMAIL PROTECTED]" style="display: inline;" listener="listener: 
personformSubmit">
          <select jwcid="[EMAIL PROTECTED]" style="width:250px;">
            <span jwcid="@For" source="ognl: personList" 
value="ognl:currentPerson" index="ognl:currentPersonIndex">
              <option jwcid="@Option" selected="ognl: 
personSelection[currentPersonIndex]" 
label="ognl:currentPerson.shortDescription"/>
            </span>
          </select>
        </form>
*****************************************************************

If you are not an authorised recipient of this e-mail, please contact me at 
Redflex immediately by return phone call or by email. In this case, you should 
not read, print, retransmit, store or act in reliance on this e-mail or any 
attachments, and should destroy all copies of them. This e-mail and any 
attachments are confidential and may contain privileged information and/or 
copyright material of Redflex or third parties. You should only retransmit, 
distribute or commercialise the material if you are authorised to do so. This 
notice should not be removed.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to