You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Watrous <dw...@gmail.com> on 2013/07/17 22:54:08 UTC

FeedbackPanel customization

Hi,

I'm working on a modification of the FeedbackPanel to work better with my
theme. I would like to prevent the class for the actual message from being
appended to. Right now MessageListView is a private final class and
the populateItem adds an AttributeModifier to both the label and the
listItem.

I know I can override getCSSClass, but that still sets it for both the
label and listItem.

I can't extend just MessageListView since it's private and final. Even if I
could subclass that, the FeedbackPanel constructor is called before my
subclass of FeedbackPanel, so that it has already used the original
MessageListView.

Can you think of a clean way to eliminate the AttributeListener on listItem?

Daniel

Re: FeedbackPanel customization

Posted by Daniel Watrous <dw...@gmail.com>.
This is what I ended up doing. Hopefully, as Cedric points out, it will be
more flexible in Wicket 7 and I can come back and clean it up.

Thanks.


On Wed, Jul 17, 2013 at 3:23 PM, Paul Bors <pa...@bors.ws> wrote:

> Of course you can always override them in CSS as well.
>
> /* FEEDBACK MESSAGES */
>
> .feedbackMessages {
>     padding-left: 0;
>     padding-top: 0;
>     text-align: left;
>     margin-left: 0;
>     margin-top: 0;
>     padding-bottom: 1em;
> }
>
> .feedbackMessages div {
>     padding: 0.5em;
>     font-size: xx-small;
>     border: none;
> }
>
> .feedbackMessages div.feedbackPanelERROR {
>     background-color: lightsalmon;
>     border: 1px solid darkred;
> }
>
> .feedbackMessages div.feedbackPanelWARNING {
>     background-color: #FFB90F;
>     border: 1px solid darkgoldenrod;
> }
>
> .feedbackMessages div.feedbackPanelINFO {
>     background-color: lightgreen;
>     border: 1px solid darkgreen;
> }
>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Sebastien [mailto:sebfz1@gmail.com]
> Sent: Wednesday, July 17, 2013 5:21 PM
> To: users@wicket.apache.org
> Subject: Re: FeedbackPanel customization
>
> Hi Daniel,
>
> In such a case, you have to not use getCSSClass, but override
> newMessageDisplayComponent instead.
>
> You have a sample here:
>
> https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/
> main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.java
>
> https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/
> main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.html
>
> Hope this help,
> Sebastien.
>
>
> On Wed, Jul 17, 2013 at 10:54 PM, Daniel Watrous
> <dw...@gmail.com>wrote:
>
> > Hi,
> >
> > I'm working on a modification of the FeedbackPanel to work better with
> > my theme. I would like to prevent the class for the actual message
> > from being appended to. Right now MessageListView is a private final
> > class and the populateItem adds an AttributeModifier to both the label
> > and the listItem.
> >
> > I know I can override getCSSClass, but that still sets it for both the
> > label and listItem.
> >
> > I can't extend just MessageListView since it's private and final. Even
> > if I could subclass that, the FeedbackPanel constructor is called
> > before my subclass of FeedbackPanel, so that it has already used the
> > original MessageListView.
> >
> > Can you think of a clean way to eliminate the AttributeListener on
> > listItem?
> >
> > Daniel
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: FeedbackPanel customization

Posted by Paul Bors <pa...@bors.ws>.
Of course you can always override them in CSS as well.

/* FEEDBACK MESSAGES */

.feedbackMessages {
    padding-left: 0;
    padding-top: 0;
    text-align: left;
    margin-left: 0;
    margin-top: 0;
    padding-bottom: 1em;
}

.feedbackMessages div {
    padding: 0.5em;
    font-size: xx-small;
    border: none;
}

.feedbackMessages div.feedbackPanelERROR {
    background-color: lightsalmon;
    border: 1px solid darkred;
}

.feedbackMessages div.feedbackPanelWARNING {
    background-color: #FFB90F;
    border: 1px solid darkgoldenrod;
}

.feedbackMessages div.feedbackPanelINFO {
    background-color: lightgreen;
    border: 1px solid darkgreen;
}

~ Thank you,
  Paul Bors

-----Original Message-----
From: Sebastien [mailto:sebfz1@gmail.com] 
Sent: Wednesday, July 17, 2013 5:21 PM
To: users@wicket.apache.org
Subject: Re: FeedbackPanel customization

Hi Daniel,

In such a case, you have to not use getCSSClass, but override
newMessageDisplayComponent instead.

You have a sample here:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/
main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.java
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/
main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.html

Hope this help,
Sebastien.


On Wed, Jul 17, 2013 at 10:54 PM, Daniel Watrous
<dw...@gmail.com>wrote:

> Hi,
>
> I'm working on a modification of the FeedbackPanel to work better with 
> my theme. I would like to prevent the class for the actual message 
> from being appended to. Right now MessageListView is a private final 
> class and the populateItem adds an AttributeModifier to both the label 
> and the listItem.
>
> I know I can override getCSSClass, but that still sets it for both the 
> label and listItem.
>
> I can't extend just MessageListView since it's private and final. Even 
> if I could subclass that, the FeedbackPanel constructor is called 
> before my subclass of FeedbackPanel, so that it has already used the 
> original MessageListView.
>
> Can you think of a clean way to eliminate the AttributeListener on 
> listItem?
>
> Daniel
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel customization

Posted by Daniel Watrous <dw...@gmail.com>.
Hi Sebastian,

I looked at your example, but it's not quite what I need. I want the style
applied to 'messages' but not to 'message'. Your example seems to allow for
a style to be applied to 'message' and not to 'messages'

I've tried implementing it, but that's where I'm stuck. Am I missing
something?

Daniel


On Wed, Jul 17, 2013 at 3:20 PM, Sebastien <se...@gmail.com> wrote:

> Hi Daniel,
>
> In such a case, you have to not use getCSSClass, but override
> newMessageDisplayComponent instead.
>
> You have a sample here:
>
> https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.java
>
> https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.html
>
> Hope this help,
> Sebastien.
>
>
> On Wed, Jul 17, 2013 at 10:54 PM, Daniel Watrous <dwmaillist@gmail.com
> >wrote:
>
> > Hi,
> >
> > I'm working on a modification of the FeedbackPanel to work better with my
> > theme. I would like to prevent the class for the actual message from
> being
> > appended to. Right now MessageListView is a private final class and
> > the populateItem adds an AttributeModifier to both the label and the
> > listItem.
> >
> > I know I can override getCSSClass, but that still sets it for both the
> > label and listItem.
> >
> > I can't extend just MessageListView since it's private and final. Even
> if I
> > could subclass that, the FeedbackPanel constructor is called before my
> > subclass of FeedbackPanel, so that it has already used the original
> > MessageListView.
> >
> > Can you think of a clean way to eliminate the AttributeListener on
> > listItem?
> >
> > Daniel
> >
>

Re: FeedbackPanel customization

Posted by Sebastien <se...@gmail.com>.
Hi Daniel,

In such a case, you have to not use getCSSClass, but override
newMessageDisplayComponent instead.

You have a sample here:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.java
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/panel/JQueryFeedbackPanel.html

Hope this help,
Sebastien.


On Wed, Jul 17, 2013 at 10:54 PM, Daniel Watrous <dw...@gmail.com>wrote:

> Hi,
>
> I'm working on a modification of the FeedbackPanel to work better with my
> theme. I would like to prevent the class for the actual message from being
> appended to. Right now MessageListView is a private final class and
> the populateItem adds an AttributeModifier to both the label and the
> listItem.
>
> I know I can override getCSSClass, but that still sets it for both the
> label and listItem.
>
> I can't extend just MessageListView since it's private and final. Even if I
> could subclass that, the FeedbackPanel constructor is called before my
> subclass of FeedbackPanel, so that it has already used the original
> MessageListView.
>
> Can you think of a clean way to eliminate the AttributeListener on
> listItem?
>
> Daniel
>

Re: FeedbackPanel customization

Posted by Cedric Gatay <ga...@gmail.com>.
Hi,
the fix for the issue you face with Css classes has been integrated into Wicket 7.0 (https://issues.apache.org/jira/browse/WICKET-4852).

Regards,

On 17 juillet 2013 at 22:54:37, Daniel Watrous (dwmaillist@gmail.com) wrote:

Hi,  

I'm working on a modification of the FeedbackPanel to work better with my  
theme. I would like to prevent the class for the actual message from being  
appended to. Right now MessageListView is a private final class and  
the populateItem adds an AttributeModifier to both the label and the  
listItem.  

I know I can override getCSSClass, but that still sets it for both the  
label and listItem.  

I can't extend just MessageListView since it's private and final. Even if I  
could subclass that, the FeedbackPanel constructor is called before my  
subclass of FeedbackPanel, so that it has already used the original  
MessageListView.  

Can you think of a clean way to eliminate the AttributeListener on listItem?  

Daniel  
__
Cedric Gatay (@Cedric_Gatay)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr