But sometimes that form doesn't have to do anything because there is no Object in the model
So i call
form.setVisible(false)
but still i get this:
java.lang.NullPointerException: Model and model object must not be null
at com.voicetribe.wicket.PropertyModel.getObject(PropertyModel.java:190)
at com.voicetribe.wicket.Component.getModelObjectAsString(Component.java:317)
at com.voicetribe.wicket.markup.html.form.TextField.handleComponentTag(TextField.java:131)
even setting all the child components to non visible doesn't have a desired effect.
Do we need to go through the render fase even when it is not visible?
i think so because we do this:
handleRender(visible ? cycle : cycle.nullResponse());
in the Component.render()
so what options do we have to support an null object in such an example?
If we have to go through the render fase with a null response then i see 2 options:
1> PropertyModel shouldn't throw a null pointer.
2> Component.getModelObject and Component.getModelObjectAsString() should be able to handle this gracefully.
(If it sees that the object of its model == null and it is not visible then there is no error)
I think i prefer option 2 but there is one problem with it. Normally i just would call setVisible(false) on the parent (the form object)
not all its child components. So how does a child component know that he is also not visible. I think setVisible of component should
be overriden by Container and that one should call setVisible on all its components.
other idea's?
johan
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Wicket-develop mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
