Re: Fwd: Get label input submit
Hey guys, after all this discussion, someone have idea of how I can get the label of the submit button? 2012/10/17 William Lopes williamlopes@gmail.com Man, I tested this today and not works in the practice. 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 22:25:48 -0300, William Lopes williamlopes@gmail.com wrote: So, we go to say that I have 3 atributes in my form: title(stringGeneric), author(modeloDadosGeneric), year(numericGeneric). Case I try to click in submit of the author, the context received will be year, if I add another field, like description(**stringLargeGeneric), the return to click in submit button will be description. This happens because the context is loaded just after click in the submit. Nope, this isn't correct. The context for a Submit component is defined (loaded) while it's rendered, not when the submit button/link is clicked. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
Use the event onSelectedFromX() where X is the t:id of the t:submit. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Get-label-input-submit-tp5716924p5716927.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
But is this way that I use. How my form is dynamic, everything is dynamic, until the id. Because of this I would enjoy to know how get the label of the clicked submit. 2012/10/16 Lance Java lance.j...@googlemail.com Use the event onSelectedFromX() where X is the t:id of the t:submit. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Get-label-input-submit-tp5716924p5716927.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
my form is dynamic So use the t:context attribute. I could to use the t:context, but my form is dynamic and the context would change for the last input I'm not sure what you mean here, perhaps a code sample would help. Surely you can calculate a suitable context value based on the current submit you are rendering? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Get-label-input-submit-tp5716924p5716929.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
I only had a quick look at your code but it seems that your loop variable currentAtributoGeneric is the underlying source of your data. You could use this entire object as your context (assuming that it has an encoder) or a primary key. You could even use selected fields from this object to construct a context array. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Get-label-input-submit-tp5716924p5716958.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
Yes, but my currentAtributoGeneric is just one variable and your value is changed the each iteration. I have that to find another way, something that make reference too. If I use the currentAtributoGeneric like you said, I'll to catch just the last currentAtributoGeneric, independently of which I choose. How the value of the label isn't changed (is persisted), I'm wanting use it. 2012/10/16 Lance Java lance.j...@googlemail.com I only had a quick look at your code but it seems that your loop variable currentAtributoGeneric is the underlying source of your data. You could use this entire object as your context (assuming that it has an encoder) or a primary key. You could even use selected fields from this object to construct a context array. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Get-label-input-submit-tp5716924p5716958.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
On Tue, 16 Oct 2012 15:13:09 -0300, William Lopes williamlopes@gmail.com wrote: Yes, but my currentAtributoGeneric is just one variable and your value is changed the each iteration. I have that to find another way, something that make reference too. If I use the currentAtributoGeneric like you said, I'll to catch just the last currentAtributoGeneric, independently of which I choose. This isn't correct. The context passed to your event handler method will contain exactly the context you passed to it. As every iteration of your loop has a different currentAtributoGeneric, each Submit content context will have a different value. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
That's what I think too, but in the practice this not works. 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 15:13:09 -0300, William Lopes williamlopes@gmail.com wrote: Yes, but my currentAtributoGeneric is just one variable and your value is changed the each iteration. I have that to find another way, something that make reference too. If I use the currentAtributoGeneric like you said, I'll to catch just the last currentAtributoGeneric, independently of which I choose. This isn't correct. The context passed to your event handler method will contain exactly the context you passed to it. As every iteration of your loop has a different currentAtributoGeneric, each Submit content context will have a different value. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
On Tue, 16 Oct 2012 15:49:12 -0300, William Lopes williamlopes@gmail.com wrote: That's what I think too, but in the practice this not works. Code please. ;) -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
http://pastebin.com/PPuJjkSm 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 15:49:12 -0300, William Lopes williamlopes@gmail.com wrote: That's what I think too, but in the practice this not works. Code please. ;) -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
On Tue, 16 Oct 2012 17:06:57 -0300, William Lopes williamlopes@gmail.com wrote: http://pastebin.com/PPuJjkSm Template please too. And please describe why you say it doesn't work. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
.java http://pastebin.com/PPuJjkSm .tml http://pastebin.com/Fz4yWzNX Like I said in previous mails, the context of the submit button is changed for the currentAtributoGeneric of last input field of the form. 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 17:06:57 -0300, William Lopes williamlopes@gmail.com wrote: http://pastebin.com/PPuJjkSm Template please too. And please describe why you say it doesn't work. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
Yes, but my currentAtributoGeneric is just one variable and your value is changed the each iteration Correct, but before it is changed, you are rendering a HTML submit button to the MarkupWriter. End result being multiple submit elements, each with it's own unique context value. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Get-label-input-submit-tp5716924p5716972.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
input t:label=currentAtributoGeneric.name t:type=Submit t:id=selecionar t:context=id value= class=imageSubmit/ public Object onSelectedFromSelecionar(String atributoNome) { } It seems to me you're passing one context in the template (an id) and expecting something else in the event handler method (an attribute name). I have no idea what this id you're passing as a context. Anyway, it should be currentAtributoGeneric itself (if it's an entity class) or some property of it that you can use to retrieve the original object in the event handler method. On Tue, 16 Oct 2012 17:30:45 -0300, William Lopes williamlopes@gmail.com wrote: .java http://pastebin.com/PPuJjkSm .tml http://pastebin.com/Fz4yWzNX Like I said in previous mails, the context of the submit button is changed for the currentAtributoGeneric of last input field of the form. I'm not following you here. Are you talking about the value received as a parameter in your event handler method? 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 17:06:57 -0300, William Lopes williamlopes@gmail.com wrote: http://pastebin.com/PPuJjkSm Template please too. And please describe why you say it doesn't work. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Get label input submit
input t:label=currentAtributoGeneric.name t:type=Submit t:id=selecionar t:context=id value= class=imageSubmit/ public Object onSelectedFromSelecionar(String atributoNome) { } Sorry, I put the code that I was testing. The right context is: t:context=currentAtributoGeneric.name 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com input t:label=**currentAtributoGeneric.name t:type=Submit t:id=selecionar t:context=id value= class=imageSubmit/ public Object onSelectedFromSelecionar(**String atributoNome) { } It seems to me you're passing one context in the template (an id) and expecting something else in the event handler method (an attribute name). I have no idea what this id you're passing as a context. Anyway, it should be currentAtributoGeneric itself (if it's an entity class) or some property of it that you can use to retrieve the original object in the event handler method. On Tue, 16 Oct 2012 17:30:45 -0300, William Lopes williamlopes@gmail.com wrote: .java http://pastebin.com/PPuJjkSm .tml http://pastebin.com/Fz4yWzNX Like I said in previous mails, the context of the submit button is changed for the currentAtributoGeneric of last input field of the form. I'm not following you here. Are you talking about the value received as a parameter in your event handler method? 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 17:06:57 -0300, William Lopes williamlopes@gmail.com wrote: http://pastebin.com/PPuJjkSm Template please too. And please describe why you say it doesn't work. -- Thiago H. de Paula Figueiredo --** --**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.orghttp://apache.org users-unsubscribe@**tapestry.apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo
Fwd: Get label input submit
Unfortunately, in practice this doesn't works. 2012/10/16 Lance Java lance.j...@googlemail.com Yes, but my currentAtributoGeneric is just one variable and your value is changed the each iteration Correct, but before it is changed, you are rendering a HTML submit button to the MarkupWriter. End result being multiple submit elements, each with it's own unique context value. So, we go to say that I have 3 atributes in my form: title(stringGeneric), author(modeloDadosGeneric), year(numericGeneric). Case I try to click in submit of the author, the context received will be year, if I add another field, like description(stringLargeGeneric), the return to click in submit button will be description. This happens because the context is loaded just after click in the submit. 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com ** On Tue, 16 Oct 2012 21:33:31 -0300, William Lopes williamlopes@gmail.com wrote: input t:label=currentAtributoGeneric.name t:type=Submit t:id=selecionar t:context=id value= class=imageSubmit/ public Object onSelectedFromSelecionar(String atributoNome) { } Sorry, I put the code that I was testing. The right context is: t:context=currentAtributoGeneric.name What's the value received by the event handler method? 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com input t:label=currentAtributoGeneric.name t:type=Submit t:id=selecionar t:context=id value= class=imageSubmit/ public Object onSelectedFromSelecionar(String atributoNome) { } It seems to me you're passing one context in the template (an id) and expecting something else in the event handler method (an attribute name). I have no idea what this id you're passing as a context. Anyway, it should be currentAtributoGeneric itself (if it's an entity class) or some property of it that you can use to retrieve the original object in the event handler method. On Tue, 16 Oct 2012 17:30:45 -0300, William Lopes williamlopes@gmail.com wrote: .java http://pastebin.com/PPuJjkSm .tml http://pastebin.com/Fz4yWzNX Like I said in previous mails, the context of the submit button is changed for the currentAtributoGeneric of last input field of the form. I'm not following you here. Are you talking about the value received as a parameter in your event handler method? 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 17:06:57 -0300, William Lopes williamlopes@gmail.com wrote: http://pastebin.com/PPuJjkSm Template please too. And please describe why you say it doesn't work. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo -- Thiago H. de Paula Figueiredo
Re: Fwd: Get label input submit
On Tue, 16 Oct 2012 22:25:48 -0300, William Lopes williamlopes@gmail.com wrote: So, we go to say that I have 3 atributes in my form: title(stringGeneric), author(modeloDadosGeneric), year(numericGeneric). Case I try to click in submit of the author, the context received will be year, if I add another field, like description(stringLargeGeneric), the return to click in submit button will be description. This happens because the context is loaded just after click in the submit. Nope, this isn't correct. The context for a Submit component is defined (loaded) while it's rendered, not when the submit button/link is clicked. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Fwd: Get label input submit
Man, I tested this today and not works in the practice. 2012/10/16 Thiago H de Paula Figueiredo thiag...@gmail.com On Tue, 16 Oct 2012 22:25:48 -0300, William Lopes williamlopes@gmail.com wrote: So, we go to say that I have 3 atributes in my form: title(stringGeneric), author(modeloDadosGeneric), year(numericGeneric). Case I try to click in submit of the author, the context received will be year, if I add another field, like description(**stringLargeGeneric), the return to click in submit button will be description. This happens because the context is loaded just after click in the submit. Nope, this isn't correct. The context for a Submit component is defined (loaded) while it's rendered, not when the submit button/link is clicked. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org