You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Manjith Kumar Adapa <ma...@aztec.soft.net> on 2005/09/29 11:36:34 UTC

How to iterate thru the controls in Tapestry???

Hi,

Well I have a page where I have 10 Text fields,
10 DropDowns, 10 Files to be uploaded.
Well when I do the server-side validation I need to write the same code for
all the each component individually.
This makes my code redundant
Well, is there any mechanism in Tapestry through which I can iterate thru
the same type of components and do the server-side validation and implement
functionality.

Please somebody suggest me a good mechanism to iterate thru the same
components in Tapestry instead of saying 
getName1(), getName2(), ....ten times for each and every server-side
validation that I have to do...

Thanks in Advance.

Thanks
Manjith

-----Original Message-----
From: Joe Trewin [mailto:joe@canfactory.com] 
Sent: Thursday, September 29, 2005 2:05 PM
To: Tapestry users; Renat Zubairov
Subject: RE: Listeners question

You could leave the form listener blank and move it to a listener
attached to the submit button.

I've also found that if you throw a RenderRewoundException then that
will prevent the form listener from being thrown, although you may want
to make sure that the listener is deferred to ensure that everything
rewinds correctly first.

(This is undocumented - that I can see - but looking at the Form source
code seems to be the way to handle events and then prevent them from
being passed along to the form listener.)

-----Original Message-----
From: Renat Zubairov [mailto:renat.zubairov@gmail.com] 
Sent: 29 September 2005 09:30
To: Tapestry users
Subject: Listeners question

Hello Tapestry gurus,

I have a page with "Ok" and "Cancel" buttons. like following:

    <component id="ok" type="Submit">
		<binding name="value" value="message:ok"/>
    </component>
    <component id="cancel" type="Submit">
		<binding name="listener" value="listener:doCancel"/>
        <binding name="value" value="message:cancel"/>
        <binding name="defer" value="false"/>
    </component>

Those components inside a form for a edit/create business entity.
Cancel listener implementation looks like following:

	public IPage doCancel() {
		return getUserListPage();
	}

Where user list page is injected. The problem is when I click on the
cancel button, cancel button listener is called, but after it also "Ok"
button listener (form submit) is called also. What should I do in order
to not to call "Ok" button listener.
Thank you.

--
Best regards,
Renat Zubairov

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to iterate thru the controls in Tapestry???

Posted by Ron Piterman <rp...@gmx.net>.
<span jwcid="@For" source="ognl:listOfObjects"
   value="ognl:currentObject">

   <span jwcid="@TextField" value="ognl:currentObject.name"/>
   <span jwcid="@Checkbox" value="ognl:currentObject.kiss"/>

</span>

����� Manjith Kumar Adapa:
> Hi,
> 
> Well I have a page where I have 10 Text fields,
> 10 DropDowns, 10 Files to be uploaded.
> Well when I do the server-side validation I need to write the same code for
> all the each component individually.
> This makes my code redundant
> Well, is there any mechanism in Tapestry through which I can iterate thru
> the same type of components and do the server-side validation and implement
> functionality.
> 
> Please somebody suggest me a good mechanism to iterate thru the same
> components in Tapestry instead of saying 
> getName1(), getName2(), ....ten times for each and every server-side
> validation that I have to do...
> 
> Thanks in Advance.
> 
> Thanks
> Manjith
> 
> -----Original Message-----
> From: Joe Trewin [mailto:joe@canfactory.com] 
> Sent: Thursday, September 29, 2005 2:05 PM
> To: Tapestry users; Renat Zubairov
> Subject: RE: Listeners question
> 
> You could leave the form listener blank and move it to a listener
> attached to the submit button.
> 
> I've also found that if you throw a RenderRewoundException then that
> will prevent the form listener from being thrown, although you may want
> to make sure that the listener is deferred to ensure that everything
> rewinds correctly first.
> 
> (This is undocumented - that I can see - but looking at the Form source
> code seems to be the way to handle events and then prevent them from
> being passed along to the form listener.)
> 
> -----Original Message-----
> From: Renat Zubairov [mailto:renat.zubairov@gmail.com] 
> Sent: 29 September 2005 09:30
> To: Tapestry users
> Subject: Listeners question
> 
> Hello Tapestry gurus,
> 
> I have a page with "Ok" and "Cancel" buttons. like following:
> 
>     <component id="ok" type="Submit">
> 		<binding name="value" value="message:ok"/>
>     </component>
>     <component id="cancel" type="Submit">
> 		<binding name="listener" value="listener:doCancel"/>
>         <binding name="value" value="message:cancel"/>
>         <binding name="defer" value="false"/>
>     </component>
> 
> Those components inside a form for a edit/create business entity.
> Cancel listener implementation looks like following:
> 
> 	public IPage doCancel() {
> 		return getUserListPage();
> 	}
> 
> Where user list page is injected. The problem is when I click on the
> cancel button, cancel button listener is called, but after it also "Ok"
> button listener (form submit) is called also. What should I do in order
> to not to call "Ok" button listener.
> Thank you.
> 
> --
> Best regards,
> Renat Zubairov
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org