You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Erik Husby <mh...@broad.mit.edu> on 2006/11/15 23:10:44 UTC
Q: Tapestry 4.0.2 - Component containing a form containing a property selection fails on submit
I've created a component that contains a form that contains a
property selection. The property selection item has the submit on
change property. The property selection model and value are on the
component. The form listener is on the component. The page containing
my component does not need to know that there is a form.
When a new value is selected, Tapestry throws a null pointer
exception in PropertySelection.rewindFormComponent trying to access
its model via the abstract getter getModel()
My component does ensure that the property selection model is created
in its prepareForRender method.
Does my page need to know about the form inside my component?
Is there some component property or method that I need to know about?
Is form submission restricted to pages?
---
Erik Husby
Senior Software Engineer
Broad Institute of MIT and Harvard
Rm. 2267, 320 Charles St, Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227
email: mhusby@broad.mit.edu AIM: ErikAtBroad
Re: Q: Tapestry 4.0.2 - Component containing a form containing a property selection fails on submit
Posted by Karthik N <ka...@gmail.com>.
we do a lot of this PropSel refreshes using Tacos and AjaxEventSubmit. HTH.
On 11/16/06, Erik Husby <mh...@broad.mit.edu> wrote:
>
>
> On Nov 15, 2006, at 8:58 PM, Karthik N wrote:
>
> > erik,
> >
> > from what i understand you have
> >
> > Custom Component -> contains Form -> contains PropSel
> >
> >
> Correct
> > - when the PropSel changes, then its enclosing Form causes the submit.
> >
> Correct
> > i have a suspicion this Form might be causing your Custom
> > Component not to
> > rewind and hence probably the
> > Custom Component never sets the model in its prepareForRender
> > during the
> > rewind.
> >
> Correct
> > can you put a system.out.println in the Custom Component's
> > prepareForRender
> > and see if it gets printed on the rewind cycle?
> >
> Verified by setting a breakpoint in the debugger. The Custom
> Component's prepareForRender was called before the page appeared but
> not during the form submit.
>
> > if not, probably you can consider moving the Form outside your
> > Custom Comp.
> >
> Will consider a different way of handling the property selection that
> doesn't involve a form.
> >
> >
> > On 11/16/06, Erik Husby <mh...@broad.mit.edu> wrote:
> >>
> >> I've created a component that contains a form that contains a
> >> property selection. The property selection item has the submit on
> >> change property. The property selection model and value are on the
> >> component. The form listener is on the component. The page containing
> >> my component does not need to know that there is a form.
> >>
> >> When a new value is selected, Tapestry throws a null pointer
> >> exception in PropertySelection.rewindFormComponent trying to access
> >> its model via the abstract getter getModel()
> >>
> >> My component does ensure that the property selection model is created
> >> in its prepareForRender method.
> >>
> >> Does my page need to know about the form inside my component?
> >>
> >> Is there some component property or method that I need to know about?
> >>
> >> Is form submission restricted to pages?
> >>
> >> ---
> >> Erik Husby
> >> Senior Software Engineer
> >> Broad Institute of MIT and Harvard
> >> Rm. 2267, 320 Charles St, Cambridge, MA 02141-2023
> >> mobile: 781.354.6669, office: 617.258.9227
> >> email: mhusby@broad.mit.edu AIM: ErikAtBroad
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Thanks, Karthik
>
> ---
> Erik Husby
> Senior Software Engineer
> Broad Institute of MIT and Harvard
> Rm. 2267, 320 Charles St, Cambridge, MA 02141-2023
> mobile: 781.354.6669, office: 617.258.9227
> email: mhusby@broad.mit.edu AIM: ErikAtBroad
>
>
>
>
--
Thanks, Karthik
Re: Q: Tapestry 4.0.2 - Component containing a form containing a property selection fails on submit
Posted by Erik Husby <mh...@broad.mit.edu>.
On Nov 15, 2006, at 8:58 PM, Karthik N wrote:
> erik,
>
> from what i understand you have
>
> Custom Component -> contains Form -> contains PropSel
>
>
Correct
> - when the PropSel changes, then its enclosing Form causes the submit.
>
Correct
> i have a suspicion this Form might be causing your Custom
> Component not to
> rewind and hence probably the
> Custom Component never sets the model in its prepareForRender
> during the
> rewind.
>
Correct
> can you put a system.out.println in the Custom Component's
> prepareForRender
> and see if it gets printed on the rewind cycle?
>
Verified by setting a breakpoint in the debugger. The Custom
Component's prepareForRender was called before the page appeared but
not during the form submit.
> if not, probably you can consider moving the Form outside your
> Custom Comp.
>
Will consider a different way of handling the property selection that
doesn't involve a form.
>
>
> On 11/16/06, Erik Husby <mh...@broad.mit.edu> wrote:
>>
>> I've created a component that contains a form that contains a
>> property selection. The property selection item has the submit on
>> change property. The property selection model and value are on the
>> component. The form listener is on the component. The page containing
>> my component does not need to know that there is a form.
>>
>> When a new value is selected, Tapestry throws a null pointer
>> exception in PropertySelection.rewindFormComponent trying to access
>> its model via the abstract getter getModel()
>>
>> My component does ensure that the property selection model is created
>> in its prepareForRender method.
>>
>> Does my page need to know about the form inside my component?
>>
>> Is there some component property or method that I need to know about?
>>
>> Is form submission restricted to pages?
>>
>> ---
>> Erik Husby
>> Senior Software Engineer
>> Broad Institute of MIT and Harvard
>> Rm. 2267, 320 Charles St, Cambridge, MA 02141-2023
>> mobile: 781.354.6669, office: 617.258.9227
>> email: mhusby@broad.mit.edu AIM: ErikAtBroad
>>
>>
>>
>>
>
>
> --
> Thanks, Karthik
---
Erik Husby
Senior Software Engineer
Broad Institute of MIT and Harvard
Rm. 2267, 320 Charles St, Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227
email: mhusby@broad.mit.edu AIM: ErikAtBroad
Re: Q: Tapestry 4.0.2 - Component containing a form containing a property selection fails on submit
Posted by Karthik N <ka...@gmail.com>.
erik,
from what i understand you have
Custom Component -> contains Form -> contains PropSel
- when the PropSel changes, then its enclosing Form causes the submit.
i have a suspicion this Form might be causing your Custom Component not to
rewind and hence probably the
Custom Component never sets the model in its prepareForRender during the
rewind.
can you put a system.out.println in the Custom Component's prepareForRender
and see if it gets printed on the rewind cycle?
if not, probably you can consider moving the Form outside your Custom Comp.
On 11/16/06, Erik Husby <mh...@broad.mit.edu> wrote:
>
> I've created a component that contains a form that contains a
> property selection. The property selection item has the submit on
> change property. The property selection model and value are on the
> component. The form listener is on the component. The page containing
> my component does not need to know that there is a form.
>
> When a new value is selected, Tapestry throws a null pointer
> exception in PropertySelection.rewindFormComponent trying to access
> its model via the abstract getter getModel()
>
> My component does ensure that the property selection model is created
> in its prepareForRender method.
>
> Does my page need to know about the form inside my component?
>
> Is there some component property or method that I need to know about?
>
> Is form submission restricted to pages?
>
> ---
> Erik Husby
> Senior Software Engineer
> Broad Institute of MIT and Harvard
> Rm. 2267, 320 Charles St, Cambridge, MA 02141-2023
> mobile: 781.354.6669, office: 617.258.9227
> email: mhusby@broad.mit.edu AIM: ErikAtBroad
>
>
>
>
--
Thanks, Karthik