setOutputMarkupPlaceholderTag(true) Martijn On Dec 16, 2007 10:30 PM, Mika Salminen <[EMAIL PROTECTED]> wrote:
> Hello, > > I encountered a problem with hiding/showing components with ajax. If a > component is initially not visible according to the isVisible() method, it > is not rendered on the page. But if it becomes visible as an effect of > ajax request and I try to update it on the client by adding the component > to AjaxRequesTarget it will still not be shown. > > I think that the problem is caused by the fact that if component is not > initially visible nothing, even a placeholder for the component is not > rendered to the client. So when ajax response that tries to replace the > component in DOM tree is executed on the client, it can not find any > component with the markup id and therefore can not replace some node that > does not exist. > > There are multiple quite easy workarounds for this hiding problem. For > example using CSS visibility attribute (quite ugly), or placing the > component you are willing to hide and show in a markup container that is > always rendered and sending back update of this markup container in ajax > request instead of the contained component. > > But I somehow think that it is quite peculiar that one needs to find > workarounds for this kind of trivial-looking task. I did not create bug > (or improvement request) yet because I want to know what others think > about this and I'm quite new to the framework so I might be doing > something wrong. > > If it is necessary to make improvements to framework to fix this, how > about adding placeholders in HTML for non-rendered components. Instead of > not rendering anything at all, empty div or span with necessary markup id > could be rendered. > > Thanks, > > -Mika > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-rc1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
