isTransparentResolver() в калитке 6.x или 7.x

У меня есть код ниже, необходимо изменить его на калитку 6.6, но isTransparentResolver() удален, и я пытаюсь по этой ссылке

  • https://www.mail-archive.com/commits@wicket.apache.org/msg17546.html но бесполезно, у кого-нибудь есть решение для приведенного ниже кода?

    add(new WebMarkupContainer("bodyElement") {
        @Override
        public boolean isTransparentResolver() {
            return true;
        }
    
    
        @Override
        protected void onComponentTag(ComponentTag tag) {
            super.onComponentTag(tag);
            if ((usrLoginHstryList == null || usrLoginHstryList.isEmpty()) &&
                    (usrChangeHstryList == null || usrChangeHstryList.isEmpty())) {
                tag.put("onload", "hideHistoryButtons();");
            } else if (usrLoginHstryList == null || usrLoginHstryList.isEmpty()) {
                tag.put("onload", "hideUserLoginHstryBtn();");
            } else if (usrChangeHstryList == null || usrChangeHstryList.isEmpty()) {
                tag.put("onload", "hideUserChngHstryBtn();");
            }
        }
    });
    

1 ответ

Решение

Наконец я написал это с помощью TransparentWebMarkupContainer

add(new TransparentWebMarkupContainer("bodyElement"){
            @Override
            protected void onComponentTag(ComponentTag tag) {
                super.onComponentTag(tag);
                if((usrLoginHstryList == null || usrLoginHstryList.isEmpty()) && (usrChangeHstryList == null || usrChangeHstryList.isEmpty())){
                    tag.put("onload", "hideHistoryButtons();");
                }else if(usrLoginHstryList == null || usrLoginHstryList.isEmpty()){
                        tag.put("onload", "hideUserLoginHstryBtn();");
                }else if(usrChangeHstryList == null ||usrChangeHstryList.isEmpty()){
                        tag.put("onload", "hideUserChngHstryBtn();");
                }
            }   

        });
Другие вопросы по тегам