Re: Dynamically change feedback panel border color?
For FeedbackPanel, I am not sure how to do this. I tried onComponentTag(), etc. and it seems there is always compile error. Looks like FeedbackPanel is a special beast. --- On Thu, 3/4/10, Riyad Kalla wrote: > From: Riyad Kalla > Subject: Re: Dynamically change feedback panel border color? > To: users@wicket.apache.org > Date: Thursday, March 4, 2010, 10:28 PM > I *think* you want to handle that > inside of onRender: > http://wicket.apache.org/docs/1.4/org/apache/wicket/Component.html#onRender(org.apache.wicket.markup.MarkupStream) > > On Thu, Mar 4, 2010 at 7:58 PM, David Chang > wrote: > > > > > I am using a div with border color to enclose feedback > messages. I can > > control whether to generate the feedback div based on > whether there is any > > message to render. Now I hope to change its border > color depending on the > > severity of the message. But (1) always causes error: > > > > Cannot modify component hierarchy after render phase > has started (page > > version cant change then anymore). > > > > How can I change the border color when there is > message to render? What is > > the best way? > > > > Thanks! > > > > > > - > > > > HTML: > > > > > > > > Java code: > > > > add(new FeedbackPanel("feedbackHolder") { > > @Override > > public boolean isVisible() { > > (1) if (anyErrorMessage()) > > add(new > SimpleAttributeModifier("class", "redBox")); > > return anyMessage(); > > } > > }); > > > > > > > > > > > > > - > > 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: Dynamically change feedback panel border color?
I *think* you want to handle that inside of onRender: http://wicket.apache.org/docs/1.4/org/apache/wicket/Component.html#onRender(org.apache.wicket.markup.MarkupStream) On Thu, Mar 4, 2010 at 7:58 PM, David Chang wrote: > > I am using a div with border color to enclose feedback messages. I can > control whether to generate the feedback div based on whether there is any > message to render. Now I hope to change its border color depending on the > severity of the message. But (1) always causes error: > > Cannot modify component hierarchy after render phase has started (page > version cant change then anymore). > > How can I change the border color when there is message to render? What is > the best way? > > Thanks! > > > - > > HTML: > > > > Java code: > > add(new FeedbackPanel("feedbackHolder") { > @Override > public boolean isVisible() { > (1) if (anyErrorMessage()) > add(new SimpleAttributeModifier("class", "redBox")); > return anyMessage(); > } > }); > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Dynamically change feedback panel border color?
I am using a div with border color to enclose feedback messages. I can control whether to generate the feedback div based on whether there is any message to render. Now I hope to change its border color depending on the severity of the message. But (1) always causes error: Cannot modify component hierarchy after render phase has started (page version cant change then anymore). How can I change the border color when there is message to render? What is the best way? Thanks! - HTML: Java code: add(new FeedbackPanel("feedbackHolder") { @Override public boolean isVisible() { (1) if (anyErrorMessage()) add(new SimpleAttributeModifier("class", "redBox")); return anyMessage(); } }); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org