2017-06-27 70 views
0

我有下面的代码需要改变它检票口6.6,但isTransparentResolver()被删除,我想根据这个链接isTransparentResolver()在检票口6.x或7.x的

  • https://www.mail-archive.com/[email protected]/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'? – soorapadman

+0

我试过了,但我不确定如何使用该组件与上面的代码有关,下面的代码是我写的,但我不确定它是否正确。 附加(新TransparentWebMarkupContainer( “bodyElement”){ \t \t \t \t \t \t @覆盖 \t \t \t保护无效onComponentTag(ComponentTag标签){ \t \t \t \t super.onComponentTag(标签); \t \t \t \t tag.put(“onload”,“initDisplay();”); \t \t \t} \t \t} \t \t \t \t \t ); –

+0

对我来说似乎是对的。没有问题 – soorapadman

回答

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

     });