2017-06-27 4 views
0

Ich habe unten Code müssen es ändern 6,6 bis Wicket, aber isTransparentResolver() entfernt wird, und ich versuche, nach diesem LinkisTransparentResolver() in Wicket 6.x oder 7.x

  • https://www.mail-archive.com/[email protected]/msg17546.html aber keine Verwendung, hat jemand Lösung für den unteren Code?

    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

Haben Sie versucht, mit 'TransparentWebMarkupContainer'? – soorapadman

+0

Ich habe versucht, aber bin mir nicht sicher, wie diese Komponente in Bezug auf den obigen Code zu verwenden, Unter Code habe ich geschrieben, aber bin mir nicht sicher, ob es korrekt ist oder nicht. add (neue TransparentWebMarkupContainer ("bodyElement") { \t \t \t \t \t \t @Override \t \t \t protected void onComponentTag (ComponentTag tag) { \t \t \t \t super.onComponentTag (tag); \t \t \t \t tag.put ("onload", "initDisplay();"); \t \t \t } \t \t} \t \t \t \t \t); –

+0

Ja, es scheint mir richtig zu sein. Kein Problem – soorapadman

Antwort

1

Schließlich habe ich diese mit TransparentWebMarkupContainer geschrieben

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

     });