[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
t:htpane does not call getPane() after reloading the page  XML
Forum Index -> Development
Author Message
kretzler

Power User

Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline

Hello,

in our application we can change the language any time. If I change the language the page is reloaded.

After reloading the page our 'prepare' method from the page is called and all messages on the page are changed. Without the content of a pane.

The pane is the only component on the page which uses componentbinding. After reloading it seems that the get or setPane() Method isnt called. I thought when I load the same page the second time then it is the same if I call the page the first time.

Any ideas?

public HTPANEComponent getPane() {
return m_pane;
}
public void setPane(final HTPANEComponent pane) {
if (m_pane == pane) {
return;
}
m_pane = pane;
initPane();
}


Thanks,
Ralph
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi,

the get-ter of the componentbinding-property is never called. The set-ter with every request that is processed on server side, not only "one time".
Only time, when it is not called: when the rendered of the component is set to false...

Code:
     public void encodeBegin(FacesContext context) throws IOException 
     {
         if (isRendered() == false)
             return;
         ResponseWriter writer = context.getResponseWriter();
         XMLWriter.writer_writeFormattedText(writer,null,"\n\n<!-- HTPANE begin -->\n");
         String clientId = getClientId(context);
         
         String width = writeTdAroundControl(writer,null,true);
         String height = getAttributeValueAsString("height");
         if (height != null && height.endsWith("%"))
             height = "100%";
         
         XMLWriter.writer_startElement(writer,null,"table");
         XMLWriter.writer_writeAttribute(writer,null,"cellspacing","0");
         XMLWriter.writer_writeAttribute(writer,null,"cellpadding","0");
         StringBuffer style = new StringBuffer();
         if (width != null)
             style.append(";width:"+width);
         if (height != null)
             style.append(";height:"+height);
         if (style.length() > 0)
             XMLWriter.writer_writeAttribute(writer,null,"style",style.toString());
         String styleClass = getCurrentStyleClass("classpane");
         XMLWriter.writer_writeAttribute(writer,null,"class",styleClass);
         XMLWriter.writer_closeStartElement(writer,null);
         // --------------------------------------------------------------------
         updateComponentBinding();        
     }
 


In short: the set-ter is called... - that's what the code and our testing tells ;-)

Björn

Björn Müller, CaptainCasa GmbH
kretzler

Power User

Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline

ups ... you are right. The setter and not the getter is called. My breakpoint was only on the getter method.

Sorry for wasting your time.
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team