This documentation is for an old version of fiftyfive-wicket (2.0.9).


fiftyfive.wicket.feedback
Class FeedbackStyle

java.lang.Object
  extended by org.apache.wicket.behavior.AbstractBehavior
      extended by fiftyfive.wicket.feedback.FeedbackStyle
All Implemented Interfaces:
Serializable, IBehavior, IComponentConfigurationBehavior, IClusterable, IHeaderContributor

public class FeedbackStyle
extends AbstractBehavior

Automatically adds an appropriate CSS feedback class to a component if that component or any of its descendants have feedback messages.

For example, let's say our Java looks like this:

 add(new RequiredTextField("username").add(FeedbackStyle.INSTANCE));

Our HTML is:

 <input type="text" wicket:id="username" />

Now, when our text field has a validation message to report, for example when the user submits the form without filling in the required value, our component will render like this:

 <input type="text" class="feedbackPanelERROR" />

Notice how the <input> gains the appropriate CSS class.

Since:
2.0
See Also:
Serialized Form

Field Summary
static FeedbackStyle INSTANCE
           
 
Constructor Summary
FeedbackStyle()
           
 
Method Summary
protected  String getCssClass(FeedbackMessage msg)
           
protected  FeedbackMessagesModel newFeedbackMessagesModel(Component c)
           
 void onComponentTag(Component c, ComponentTag tag)
           
 
Methods inherited from class org.apache.wicket.behavior.AbstractBehavior
afterRender, beforeRender, bind, cleanup, detach, detachModel, exception, getStatelessHint, isEnabled, isTemporary, onConfigure, onException, onRendered, rendered, renderHead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final FeedbackStyle INSTANCE
Constructor Detail

FeedbackStyle

public FeedbackStyle()
Method Detail

onComponentTag

public void onComponentTag(Component c,
                           ComponentTag tag)
Specified by:
onComponentTag in interface IBehavior
Overrides:
onComponentTag in class AbstractBehavior

newFeedbackMessagesModel

protected FeedbackMessagesModel newFeedbackMessagesModel(Component c)

getCssClass

protected String getCssClass(FeedbackMessage msg)


Copyright © 2011 55 Minutes. All Rights Reserved.