Re: onBeforeRender vs. prepareForRender
Thank you both guys, all works fine now :) The problem was, that I was using method "prepareForRender()", instead of the "onBeforeRender()". Thanx boys -- View this message in context: http://www.nabble.com/onBeforeRender-vs.-prepareForRender-tp16653398p16657001.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: onBeforeRender vs. prepareForRender
prepareForRender is only called on the Page or Component that is the target itself for rendering (so the begin target) prepareForRender is not meant to be overridden and called from the outside world as far as i can see The hook is onBeforeRender (that is called through a call that originates from a Page.prepareForRender()) johan On Sat, Apr 12, 2008 at 7:29 PM, Stefan Simik <[EMAIL PROTECTED]> wrote: > > One additional question, > > is it valid to change to component hierarchy in these methods ? > > I tried it, but it didnt work: > > > > SHORT EXAMPLE: > - > > AjaxFallbackLink updateLink = new AjaxFallbackLink("updateLink") { > > @Override > public void prepareForRender() { >super.prepareForRender(); > >// if some condition true -> render additional attribute >if (isUpdateProcessRunning()) { >add(new > StyleAttributeAppender("text-decoration: none;")); >} > } > }; > > > and result was, that no STYLE attribute was rendered. > > But when I write: >updateLink.add(new StyleAttributeAppender("text-decoration: none;")); > then, the STYLE attribute is rendered. > > > I cannot find out, what I am doing wrong here.. > > Thanks a lot. > -- > View this message in context: > http://www.nabble.com/onBeforeRender-vs.-prepareForRender-tp16653398p16653658.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: onBeforeRender vs. prepareForRender
Here it is a good reference http://cwiki.apache.org/WICKET/user-code-context.html // Paolo On Sat, Apr 12, 2008 at 7:29 PM, Stefan Simik <[EMAIL PROTECTED]> wrote: > > One additional question, > > is it valid to change to component hierarchy in these methods ? > > I tried it, but it didnt work: > > > > SHORT EXAMPLE: > - > > AjaxFallbackLink updateLink = new AjaxFallbackLink("updateLink") { > > @Override > public void prepareForRender() { >super.prepareForRender(); > >// if some condition true -> render additional attribute >if (isUpdateProcessRunning()) { >add(new > StyleAttributeAppender("text-decoration: none;")); >} > } > }; > > > and result was, that no STYLE attribute was rendered. > > But when I write: >updateLink.add(new StyleAttributeAppender("text-decoration: none;")); > then, the STYLE attribute is rendered. > > > I cannot find out, what I am doing wrong here.. > > Thanks a lot. > -- > View this message in context: > http://www.nabble.com/onBeforeRender-vs.-prepareForRender-tp16653398p16653658.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: onBeforeRender vs. prepareForRender
One additional question, is it valid to change to component hierarchy in these methods ? I tried it, but it didnt work: SHORT EXAMPLE: - AjaxFallbackLink updateLink = new AjaxFallbackLink("updateLink") { @Override public void prepareForRender() { super.prepareForRender(); // if some condition true -> render additional attribute if (isUpdateProcessRunning()) { add(new StyleAttributeAppender("text-decoration: none;")); } } }; and result was, that no STYLE attribute was rendered. But when I write: updateLink.add(new StyleAttributeAppender("text-decoration: none;")); then, the STYLE attribute is rendered. I cannot find out, what I am doing wrong here.. Thanks a lot. -- View this message in context: http://www.nabble.com/onBeforeRender-vs.-prepareForRender-tp16653398p16653658.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
onBeforeRender vs. prepareForRender
Hi guys, I would like to ask, what's the difference between these 2 methods: onBeforeRender vs. prepareForRender and when it is appropriate to use the first or second. Thanks a lot -- View this message in context: http://www.nabble.com/onBeforeRender-vs.-prepareForRender-tp16653398p16653398.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]