Re: [T5] missing some listener to bind component/page events ?
#Cyrille37# wrote: In another way to explain, I would like to make by hand the same work than a t:actionLink in a t:loop the code : t:loop source=1..10 value=guess t:actionlink t:id=guess context=guess${guess}/t:actionlink /t:loop create several links like : /do.guess/4 /do.guess/6 /do.guess/7 So, howto do the same by hand (without a loop) ??? You can use list in context. For example, if you have a ListstringgetGuessContexte() { ListString list = new ArrayListString(); list.add(plop); list.add(new Integer(guess).toString()); return list; } In your : t:actionlink t:id=guess context=guesscontext${guess}/t:actionlink You will have link : .../do./guess/plop/0, .../do.guess/plop/1 etc. See http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#org.apache.tapestry.corelib.components.actionlink Well, if anybody as an idea about how to do this kind of think with submit button, I'm interested :) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] missing some listener to bind component/page events ?
Francois Armand a écrit : #Cyrille37# wrote: In another way to explain, I would like to make by hand the same work than a t:actionLink in a t:loop the code : t:loop source=1..10 value=guess t:actionlink t:id=guess context=guess${guess}/t:actionlink /t:loop create several links like : /do.guess/4 /do.guess/6 /do.guess/7 So, howto do the same by hand (without a loop) ??? You can use list in context. For example, if you have a ListstringgetGuessContexte() { ListString list = new ArrayListString(); list.add(plop); list.add(new Integer(guess).toString()); return list; } In your : t:actionlink t:id=guess context=guesscontext${guess}/t:actionlink You will have link : .../do./guess/plop/0, .../do.guess/plop/1 etc. See http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#org.apache.tapestry.corelib.components.actionlink Thank you François, The problem is not on the component context, but on the component id. I think a listener concept is missing ! Another example : (This code is invalid because of the duplicate component id) html t:actionlink t:id=want2beRich context=trueYES/t:actionlink t:actionlink t:id=want2beRich context=falseYES/t:actionlink /html java Object onActionFromWant2beRich( boolean yes ) { ... } /java Perhaps I've missed some essential concept ?? cheers cyrille. Well, if anybody as an idea about how to do this kind of think with submit button, I'm interested :) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] missing some listener to bind component/page events ?
#Cyrille37# wrote: Thank you François, The problem is not on the component context, but on the component id. Oups ^^ I think a listener concept is missing ! Another example : (This code is invalid because of the duplicate component id) html t:actionlink t:id=want2beRich context=trueYES/t:actionlink t:actionlink t:id=want2beRich context=falseYES/t:actionlink /html java Object onActionFromWant2beRich( boolean yes ) { ... } /java Ok, now I better understand your concern. You would have a kind of group notion for action event ? Somethink like that : 8-- t:actionlink t:gid=want2beRich t:id=foo context=trueYES/t:actionlink t:actionlink t:gid=want2beRich t:id=bar context=falseYES/t:actionlink 8-- And the event handler onActionFromFoo match first link, onActionFromBar match second link, and onActionFromWant2beRich match both. I don't think this kink of feature exists for now, but you can take advantage of event bubbling to achieve your need : just create a trivial component Want2beRich : 8-- java: public class Want2beRich {} html: div xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; t:actionlink context=trueYES/t:actionlink t:actionlink context=falseNO/t:actionlink /div 8-- and use it on your parent component/page : t:want2berich/, with the corresponding event handler onActionFromWant2berich. Well, it seems that the risk is to have a batch of component with this solution... Nonetheless, I hope it will help you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] missing some listener to bind component/page events ?
Hi (again and again ;-) Is it possible to create event for a component ?? After read guide Component Events and done some tests I could not figure howto manage differents events for a component. For exemple I would like to bind 2 links to the onActionA() method and 2 other link to the onActionB() method. How it is possible ? This following code does not work, but it is to explain me need : lia href=# t:type=actionLink t:id=A bind A()/a/li lia href=# t:type=actionLink t:id=A bind A()/a/li lia href=# t:type=actionLink t:id=B bind B()/a/li lia href=# t:type=actionLink t:id=B bind B()/a/li I've understand that : A link : a href=# t:type=actionLink t:id=doBallot1 Ballot 01/a The t:type is a component, so I must use 'actionLink' to send a event. The t:id is the unique id of the component. It miss something like a listener as with Tapestry4, isn't it ? cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] missing some listener to bind component/page events ?
In another way to explain, I would like to make by hand the same work than a t:actionLink in a t:loop the code : t:loop source=1..10 value=guess t:actionlink t:id=guess context=guess${guess}/t:actionlink /t:loop create several links like : /do.guess/4 /do.guess/6 /do.guess/7 So, howto do the same by hand (without a loop) ??? cyrille #Cyrille37# a écrit : Hi (again and again ;-) Is it possible to create event for a component ?? After read guide Component Events and done some tests I could not figure howto manage differents events for a component. For exemple I would like to bind 2 links to the onActionA() method and 2 other link to the onActionB() method. How it is possible ? This following code does not work, but it is to explain me need : lia href=# t:type=actionLink t:id=A bind A()/a/li lia href=# t:type=actionLink t:id=A bind A()/a/li lia href=# t:type=actionLink t:id=B bind B()/a/li lia href=# t:type=actionLink t:id=B bind B()/a/li I've understand that : A link : a href=# t:type=actionLink t:id=doBallot1 Ballot 01/a The t:type is a component, so I must use 'actionLink' to send a event. The t:id is the unique id of the component. It miss something like a listener as with Tapestry4, isn't it ? cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]