Michael Gerhards created WICKET-6577:
----------------------------------------

             Summary: Introduce class GenericWebMarkupContainer
                 Key: WICKET-6577
                 URL: https://issues.apache.org/jira/browse/WICKET-6577
             Project: Wicket
          Issue Type: New Feature
          Components: wicket
    Affects Versions: 8.0.0
            Reporter: Michael Gerhards


Wicket provides a GenericPanel. Why does it not provide a 
GenericWebMarkupContainer?

The code itself is trivial:

public class GenericWebMarkupContainer<T> extends WebMarkupContainer implements 
IGenericComponent<T, GenericWebMarkupContainer<T>> {

    public GenericWebMarkupContainer(String wicketId) {
        this(wicketId, null);
    }

    public GenericWebMarkupContainer(String wicketId, IModel<T> model) {
        super(wicketId, model);

    }

}

 

My usage scenario is the following:

GenericWebMarkupContainer<String> loggedInUser = new 
GenericWebMarkupContainer<String>("loggedInUser", loggedInUserIDModel) {
    @Override
    protected void onConfigure() {
        super.onConfigure();
        String loggedInUserID = getModelObject(); // IGenericComponent
        setVisibilityAllowed(notNullAndNotEmpty(loggedInUserID));
    }
};

The GenericWebMarkupContainer here is just used as a visibility-container since 
HTML enclosures not always work fine. It references its own ModelObject to 
determine visibility. To be type-save, we need to implement IGenericComponent.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to