Re: RefreshingView/DataView with FormComponents and getForm
this is because you are using a refreshing view in combination with form components. in your case view items are removed from the refreshing view before your filter runs, so you have a disconnect between page->form->refresingview- | ->item->formcomponent and so formcomponent.getform() cannot find the form. what you should do is either set an item reuse strategy on the refreshing view to prevent it from removing the view items or use a form-friendly repeater - eg RepeatingView. -igor On Thu, Jan 29, 2009 at 11:50 AM, Ryan wrote: > I hacked together a quickstart and pasted the code here: > http://pastebin.com/m3d0a54 > > I didnt know if there was a policy on pasting code to the list.. > > Thanks, > Ryan > > On Thu, Jan 29, 2009 at 10:47:13AM -0800, Igor Vaynberg exclaimed: > >>show us your code >> >>-igor >> >>On Thu, Jan 29, 2009 at 10:36 AM, Ryan wrote: >>> I have a Panel with a DataView, inside populateItem I add TextFields to >>> the Item (and the dataView is added to the Form). >>> >>> This panel contains a FeedbackPanel that should only show errors >>> generated by fields added in populateItem. Unfortunately the Item object >>> has its parent set to null. So calls to getParent on the TextFields >>> looks like this: >>> >>> textField.getParent() -> item.getParent() -> null. >>> >>> This breaks the ContainerFeedbackMessageFilter and also breaks getForm() >>> on the textfields (which throws a WicketRuntimeException because it >>> cannot find the form). >>> >>> >>> Is this the proper behavior? I was hoping item.getParent() would point >>> to the dataView. >>> >>> Any ideas/pointers? >>> >>> Thanks! >>> Ryan >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >>- >>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>For additional commands, e-mail: users-h...@wicket.apache.org > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RefreshingView/DataView with FormComponents and getForm
I hacked together a quickstart and pasted the code here: http://pastebin.com/m3d0a54 I didnt know if there was a policy on pasting code to the list.. Thanks, Ryan On Thu, Jan 29, 2009 at 10:47:13AM -0800, Igor Vaynberg exclaimed: >show us your code > >-igor > >On Thu, Jan 29, 2009 at 10:36 AM, Ryan wrote: >> I have a Panel with a DataView, inside populateItem I add TextFields to >> the Item (and the dataView is added to the Form). >> >> This panel contains a FeedbackPanel that should only show errors >> generated by fields added in populateItem. Unfortunately the Item object >> has its parent set to null. So calls to getParent on the TextFields >> looks like this: >> >> textField.getParent() -> item.getParent() -> null. >> >> This breaks the ContainerFeedbackMessageFilter and also breaks getForm() >> on the textfields (which throws a WicketRuntimeException because it >> cannot find the form). >> >> >> Is this the proper behavior? I was hoping item.getParent() would point >> to the dataView. >> >> Any ideas/pointers? >> >> Thanks! >> Ryan >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > >- >To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RefreshingView/DataView with FormComponents and getForm
show us your code -igor On Thu, Jan 29, 2009 at 10:36 AM, Ryan wrote: > I have a Panel with a DataView, inside populateItem I add TextFields to > the Item (and the dataView is added to the Form). > > This panel contains a FeedbackPanel that should only show errors > generated by fields added in populateItem. Unfortunately the Item object > has its parent set to null. So calls to getParent on the TextFields > looks like this: > > textField.getParent() -> item.getParent() -> null. > > This breaks the ContainerFeedbackMessageFilter and also breaks getForm() > on the textfields (which throws a WicketRuntimeException because it > cannot find the form). > > > Is this the proper behavior? I was hoping item.getParent() would point > to the dataView. > > Any ideas/pointers? > > Thanks! > Ryan > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RefreshingView/DataView with FormComponents and getForm
I have a Panel with a DataView, inside populateItem I add TextFields to the Item (and the dataView is added to the Form). This panel contains a FeedbackPanel that should only show errors generated by fields added in populateItem. Unfortunately the Item object has its parent set to null. So calls to getParent on the TextFields looks like this: textField.getParent() -> item.getParent() -> null. This breaks the ContainerFeedbackMessageFilter and also breaks getForm() on the textfields (which throws a WicketRuntimeException because it cannot find the form). Is this the proper behavior? I was hoping item.getParent() would point to the dataView. Any ideas/pointers? Thanks! Ryan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org