[ https://issues.apache.org/jira/browse/WICKET-6577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sven Meier resolved WICKET-6577. -------------------------------- Resolution: Fixed Assignee: Sven Meier Fix Version/s: 9.0.0 8.1.0 Added GenericWebMarkupContainer as requested. > 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 > Assignee: Sven Meier > Priority: Minor > Fix For: 8.1.0, 9.0.0 > > Original Estimate: 1h > Remaining Estimate: 1h > > 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)