0

我有以下代码需要将其更改为 wicket 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();");
            }
        }
    });
    
4

1 回答 1

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();");
                }
            }   

        });
于 2017-06-28T05:08:54.110 回答