You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Michael Gerhards (JIRA)" <ji...@apache.org> on 2018/08/06 09:22:00 UTC

[jira] [Updated] (WICKET-6577) Introduce class GenericWebMarkupContainer

     [ https://issues.apache.org/jira/browse/WICKET-6577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Gerhards updated WICKET-6577:
-------------------------------------
    Remaining Estimate: 1h
     Original Estimate: 1h

> 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
>            Priority: Minor
>   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)