Re: components and events

2012-03-17 Thread Muhammad Gelbana
Has anyone tried this with a component in a form fragment ? On Tue, Aug 23, 2011 at 7:43 PM, Josh Canfield wrote: > > I wonder how a component can participate on > > form events (especially onSubmit) which would give me a chance to "set > back" > > the values in my model. > > I would treat your a

Re: components and events + ComponentAction + FormSupport (SOLVED)

2011-08-28 Thread Geoff Callender
Hi Jens, Robert, and others, I've tried to capture the techniques described in this thread in 3 new JumpStart examples. Could you please run your eye over them and let me know if I've missed anything? They're called "Sub-Form Component", "Sub-Form Validation", and "Sub-Form As a Field" in http

Re: components and events + ComponentAction + FormSupport

2011-08-23 Thread Josh Canfield
> That's not fair!! :-) Hehe... true, it's not fair to make a person jump all over the inbox to follow a thread! :-) > I changed the "subject" field as the thread got a new direction (towards one > out of many potential solutions) to clearly seperate it from the initial > question. Changing the s

Re: components and events + ComponentAction + FormSupport

2011-08-23 Thread Jens Breitenstein
He Josh!! Am 23.08.11 19:50, schrieb Josh Canfield: Hmm.. every response from Jens is starting a new thread. Very hard to follow. On Tue, Aug 23, 2011 at 1:43 AM, Robert Zeigler wrote: That's not fair!! :-) I changed the "subject" field as the thread got a new direction (towards one out

Re: components and events + ComponentAction + FormSupport

2011-08-23 Thread Josh Canfield
Hmm.. every response from Jens is starting a new thread. Very hard to follow. On Tue, Aug 23, 2011 at 1:43 AM, Robert Zeigler wrote: > PS. :) > > 1) There's an easier way to do this than what I said in my last e-mail. :) A > ComponentAction is executed in the order in which it is stored.  The pr

Re: components and events

2011-08-23 Thread Josh Canfield
> I wonder how a component can participate on > form events (especially onSubmit) which would give me a chance to "set back" > the values in my model. I would treat your aggregate components the same way the basic textfield classes work. You can either pass the model and have it update the model p

Re: components and events + ComponentAction + FormSupport (SOLVED)

2011-08-23 Thread Jens Breitenstein
ok Robert! you are a genious, that did the trick. for all T5'ers interested in Robert's solution see below both possible versions. BUT: Incidentally, you mentioned validate in your previous e-mail... each form component fires its own validate event, so the validate event you mentioned befor

Re: components and events + ComponentAction + FormSupport

2011-08-23 Thread Robert Zeigler
PS. :) 1) There's an easier way to do this than what I said in my last e-mail. :) A ComponentAction is executed in the order in which it is stored. The problem here is that you're storing it in the SetupRender phase, which is before the form components store their actions for updating the valu

Re: components and events + ComponentAction + FormSupport

2011-08-23 Thread Robert Zeigler
Yeah, after you explained further, I knew that was going to be problematic. :) Try formSupport.defer(Runnable command); The runnable will get executed after all other actions, just before the form's validate event is fired, so the values will be updated at that point. But you'll have to defer t

RE: components and events + ComponentAction + FormSupport

2011-08-23 Thread Jens Breitenstein
Hi Robert (and all others), sorry to bother you, but I implemented a ComponentAction and use FormSupport as you suggested it. And it's near to what I need :-) Unfortunately the "execute" method is called before tapestry updates the property thus I see the orginal value not the new one? Any id

Re: components and events

2011-08-22 Thread Jens Breitenstein
Hi Robert! again, many thanks for you input, I really appreciate this discussion and time you spent If you're using tapestry's form components inside your component, and binding the values, then all of the values should be updated automatically. The main thing is to make sure that the prop

Re: components and events

2011-08-22 Thread Robert Zeigler
If you're using tapestry's form components inside your component, and binding the values, then all of the values should be updated automatically. The main thing is to make sure that the property path to be updated still references a valid object. For instance, if I have a form: With myc

Re: components and events

2011-08-22 Thread Jens Breitenstein
Am 22.08.11 22:36, schrieb Robert Zeigler: I'm not quite sure what you mean by "set back" the values in the model, but it sounds like you're extracting information in setup render that the component needs to determine how to render, and that the same information is necessary for correctly proc

Re: components and events

2011-08-22 Thread Robert Zeigler
I'm not quite sure what you mean by "set back" the values in the model, but it sounds like you're extracting information in setup render that the component needs to determine how to render, and that the same information is necessary for correctly processing the form submission? In any event, th

Re: components and events

2011-08-22 Thread Jens Breitenstein
Hi Robert! I have a hugh and complex form and tried to create components and cut down the page code. Each component gets access to the model by a parameter and in setupRender each component extracts the relevant data and adjusts the visual elements like text / checkbox accordingly to reflect

Re: components and events

2011-08-22 Thread Robert Zeigler
No. Events bubble up, so if you have: The form can "see" the events from somecomponent, and the page will see events from form and somecomponent, but somecomponent won't see the form's event. What are you trying to accomplish? Robert On Aug 22, 2011, at 8/223:04 PM , Jens Breitenstein wr