myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helmut Swaczinna" <swaczi...@wlp-systems.de>
Subject [Tobago] Popup rendered twice
Date Wed, 20 Feb 2008 16:27:42 GMT
Hi,

I discovered a strange behavior: The same popup is rendered twice in the 
HTML code. With the same id and the same
content ids. This is an extract from the generated HTML:

...<div id="usersPage:insertPasswordPopup" class="tobago-popup-default" 
onclick="Tobago.popupBlink('usersPage:insertPasswordPopup')" 
style="background: none; filter: 
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/worklist/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/image/popupBg.png',

sizingMethod='scale');"
></div><iframe id="usersPage:insertPasswordPopup::iframe" 
>class="tobago-popup-iframe tobago-popup-none" style="width: 1012; height: 
>640; " src="javascript:false;" frameborder="0"
></iframe><div id="usersPage:insertPasswordPopup::content" 
>class="tobago-popup-content tobago-popup-none" style="width: 300; height: 
>150; "
><div class="tobago-box-default" 
>id="usersPage:insertPasswordPopup:_idJsp405" style="width:300px; 
>height:149px; "
>...
<!--
Tobago.setupPopup('usersPage:insertPasswordPopup', 'null', 'null', true);
// -->
</script></div><div id="usersPage:insertPasswordPopup" 
class="tobago-popup-default" 
onclick="Tobago.popupBlink('usersPage:insertPasswordPopup')" 
style="background: none; filter: 
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/worklist/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/image/popupBg.png',

sizingMethod='scale');"
></div><iframe id="usersPage:insertPasswordPopup::iframe" 
>class="tobago-popup-iframe tobago-popup-none" style="width: 1012; height: 
>640; " src="javascript:false;" frameborder="0"
></iframe><div id="usersPage:insertPasswordPopup::content" 
>class="tobago-popup-content tobago-popup-none" style="width: 300; height: 
>150; "
><div class="tobago-box-default" 
>id="usersPage:insertPasswordPopup:_idJsp405" style="width:300px; 
>height:149px; "
>...
<!--
Tobago.setupPopup('usersPage:insertPasswordPopup', 'null', 'null', true);
// -->
</script>...


I can't reproduce this in a simple example but the structure of the page 
looks like this:

JSP:

<f:view>
  <tc:page id="inputPage" width="300px" height="200px">
  <tc:panel>
    <tc:button label="Popup1"
      action="#{controller.buttonAction}">
      <f:facet name="popup">
        <tc:popup id="popup1" width="100" height="100"
          rendered="#{controller.popup1}">
          <tc:box label="Popup1">
            <f:facet name="layout">
              <tc:gridLayout rows="*" columns="*"/>
            </f:facet>
            <tc:out value="Popup1"/>
            <tc:button label="close"
              action="#{controller.popup1Action}">
              <tc:attribute name="popupClose" value="afterSubmit"/>
            </tc:button>
          </tc:box>
        </tc:popup>
      </f:facet>
    </tc:button>
    <tc:popup id="popup2" width="100" height="100"
      rendered="#{controller.popup2}">
      <tc:box label="Popup2">
        <f:facet name="layout">
          <tc:gridLayout rows="*" columns="*"/>
        </f:facet>
        <tc:out value="Popup2"/>
        <tc:button label="close"
          action="#{controller.popup2Action}">
          <tc:attribute name="popupClose" value="afterSubmit"/>
        </tc:button>
      </tc:box>
    </tc:popup>
  </tc:panel>
  </tc:page>
</f:view>

Java:

private boolean showPopup1;
private boolean showPopup2;

public void buttonAction() {
  showPopup1 = true;
  showPopup2 = false;
}

public void popup1Action() {
  showPopup1 = false;
  showPopup2 = true;
}

public void popup2Action() {
  showPopup1 = false;
  showPopup2 = false;
}

public boolean isPopup1() {
  return showPopup1;
}

public boolean isPopup2() {
  return showPopup2;
}

There is one popup associated with a button and a second popup not 
accociated with a button. The second
popup is opened when the first popup is closed. The popups are handled in 
the old fashion way with the
rendered attribute. The second popup is rendered twice (but displayed only 
once).

I use the current snapshot but the problem exists with older version too.

Regards
Helmut 


Mime
View raw message