voyent
inputFile in a popupPanel  XML
Forum Index -> Components
Author Message
Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


Hi,

I just updated to ICEfaces 1.8.0 and use it in my application together with Seam 2.1.1 on a JBoss AS 5.0.1. The app really runs very smooth and I'm very enthusiastic about the increase in performance.

But I have a problem, and I think it's a bug. I include (via Facelets) two popupPanels on a page. One of them contains a inputFile. The other one shows some protocols. The normal use cases are like this: the user clicks on a Protocol button and a popup shows some protocols. Since the popup is modal the only thing the user can do now is to click on the Close button to hdie the popup. The other use case is the same with the other popup. The user clicks on a Up-/Download button and a popup is shown where he can upload a file or download previously uploaded files. This popup is modal, too. So he just can get rid of the popup by closing it.

The problem now is that after uploading a file (recall that only one of those popups can be shown), the protocol popup comes up. Or worse, it shows up, is closed, shows up again and is closed again for several times. All of this happening while the Up-/Download popup still is opened.
Does somebody know what I'm doing wrong or if it's a bug?

Here is the code of the including page:
Code:
<ui:define name="content">
   <s:div styleClass="formBox">
     <ice:form id="editDeveloper">
       <ui:include src="inc/messages.xhtml" />
       
       <s:div styleClass="buttonLine">
         <ice:commandButton image="img/icon_buttonLine_protocol.gif" styleClass="graphical" actionListener="#{protocolProvider.showProtocolDialog}" title="#{YTrack_msgs.tooltip_showProtocol}" immediate="true" />
         <ice:commandButton image="img/icon_buttonLine_attach.gif" styleClass="graphical" actionListener="#{editDeveloper.showUpDownloadDialog}" title="#{YTrack_msgs.tooltip_upDownload}" immediate="true" />
         <h:outputText value="(#{editDeveloper.countOfAttachedFiles})" converter="javax.faces.Long" rendered="#{editDeveloper.countOfAttachedFiles > 0}" styleClass="fileCounter" />
         
         <!-- some other buttons here -->
       </s:div>
       
       <s:div styleClass="clearButtonLineFloat" />
       
       <h:panelGrid cellpadding="0" cellspacing="0" border="0" columns="5" rowClasses="tableRowHeader, tableRowContent" styleClass="testaction">    
         <h:outputText value="#{YTrack_msgs.label_testaction_ID}" />
         <h:outputText value="#{YTrack_msgs.label_testaction_TDate}" />
                 
         <h:outputText value="#{testaction.ID}" />
         <h:outputText value="#{testaction.TDate}">
           <f:convertDateTime type="date" dateStyle="medium"/>
         </h:outputText>
       </h:panelGrid>
             
       <!-- further panelGrids -->
   
       <ui:include src="inc/popup_quickfix.xhtml" />
             
       <ui:include src="inc/popup_protocol.xhtml" />
     
       <ui:include src="inc/popup_upDownload.xhtml">
         <ui:param name="fileProvider" value="#{editDeveloper}" />
       </ui:include>
     </ice:form>
   </s:div>
 </ui:define>

As you probably might have guessed, "editDeveloper" is the backing bean of this page.

Here is the included popup_protocol.xhtml:
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:s="http://jboss.com/products/seam/taglib"
   xmlns:ice="http://www.icesoft.com/icefaces/component">
 
   <ice:panelPopup modal="true"
     rendered="#{protocolProvider.showProtocolDialog}"
     visible="#{protocolProvider.showProtocolDialog}"
     autoCentre="true"
     style="width: 760px; height: 550px;">
     
     <f:facet name="header">
       <ice:panelGroup>
         <ice:outputText value="#{YTrack_msgs.popuptitle_protocol}"
           styleClass="popupTitle" />
         <ice:commandButton image="img/icon_popup_close.gif"
           id="protocolPopupClose"
           actionListener="#{protocolProvider.closeProtocolDialog}"
           styleClass="popupButton"
           style="background: transparent; width: 16px;"
                     immediate="true" />
       </ice:panelGroup>
     </f:facet>
 
     <f:facet name="body">
       <s:div style="width: 100%; height: 550px; overflow: scroll;">
         <ice:panelGrid columns="1" cellpadding="0" cellspacing="0" border="0">
           <ice:outputText value="#{YTrack_msgs.protocol_noProtocols}" rendered="#{empty protocolProvider.protocols}" />
           
           <ice:dataTable value="#{protocolProvider.protocols}"
             var="protocolWrapper" styleClass="testactionList"
             rowClasses="tableRowEven, tableRowOdd"
             rendered="#{not empty protocolProvider.protocols}">
             <!-- all the columns displaying the properties of "protocolWrapper" -->
           </ice:dataTable>
         </ice:panelGrid>
       </s:div>
     </f:facet>
   </ice:panelPopup>
 </ui:composition>

"protocolProvider" is a bean which gives access to the protocols of the current entity.

And this is the included popup_upDownload.xhtml:
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:s="http://jboss.com/products/seam/taglib"
   xmlns:ice="http://www.icesoft.com/icefaces/component">
 
   <ice:panelPopup modal="true"
     rendered="#{fileProvider.showUpDownloadDialog}"
     visible="#{fileProvider.showUpDownloadDialog}"
     style="width: 700px;"
     autoCentre="true">
     <f:facet name="header">
       <ice:panelGroup>
         <ice:outputText value="#{YTrack_msgs.popuptitle_upDownload}"
           styleClass="popupTitle" />
         <ice:commandButton image="img/icon_popup_close.gif"
           id="upDownloadPopupClose"
           actionListener="#{fileProvider.closeUpDownloadDialog}"
           partialSubmit="true"
                     styleClass="popupButton"
           style="background: transparent; width: 16px;"
                     immediate="true" />
       </ice:panelGroup>
     </f:facet>
 
     <f:facet name="body">
       <ice:panelGrid columns="1" cellpadding="0" cellspacing="0" border="0">
         <h:dataTable value="#{fileProvider.attachedFiles}"
           var="attachedFile"
           rendered="#{!empty fileProvider.attachedFiles}"
           styleClass="testactionList" rowClasses="tableRowEven, tableRowOdd"
           style="text-align: center;">
           
           <h:column>
             <f:facet name="header">
               <h:outputText value="#{YTrack_msgs.label_upDownload_filename}" />
             </f:facet>
             <h:outputText value="#{attachedFile.name}" />
           </h:column>
           
           <h:column>
             <f:facet name="header">
               <h:outputText value="#{YTrack_msgs.label_upDownload_view}" />
             </f:facet>
             <ice:commandButton image="img/icon_upDownload_view.gif"
               styleClass="graphical" partialSubmit="true"
               action="#{fileProvider.viewFile(attachedFile)}"
               style="width: 16px;" />
           </h:column>
           
           <h:column>
             <f:facet name="header">
               <h:outputText value="#{YTrack_msgs.label_upDownload_download}" />
             </f:facet>
             <ice:commandButton image="img/icon_upDownload_download.gif"
               styleClass="graphical"
               action="#{fileProvider.downloadFile(attachedFile)}"
               style="width: 16px;" />
           </h:column>
           
           <h:column rendered="#{preventChanges ? false : true}">
             <f:facet name="header">
               <h:outputText value="#{YTrack_msgs.label_upDownload_remove}" />
             </f:facet>
             <ice:commandButton image="img/icon_upDownload_remove.gif"
               styleClass="graphical" partialSubmit="true"
               action="#{fileProvider.removeFile(attachedFile)}"
               style="width: 16px;" />
           </h:column>
         </h:dataTable>
         
         <ice:inputFile id="upload"
           actionListener="#{fileProvider.upload}"
           submitOnUpload="postUpload"
           label="#{YTrack_msgs.label_upDownload_upload}"
           style="margin-top: 30px;"
           rendered="#{preventChanges ? false : true}" />
         </ice:panelGrid>
     </f:facet>
   </ice:panelPopup>
 </ui:composition>

Note that "fileProvider" is not the name of a backing bean, it's a parameter which is set to the backing bean "editDeveloper" in the including page.

Thanks for your help
Newlukai
nabatzis

Joined: 18/Feb/2009 00:00:00
Messages: 10
Offline


Newlukai,

Do you have a progress bar and listener? It sounds like during the upload while the progress is being updated the other popup is shown and because it should not be then it gets closed.

Can you try with disabling progress upload related updates?

Try progressRender="false" and see what happens.

Do not forget per the javadoc the life cycle in 1.8.0 has changed, "... As of ICEfaces 1.8 DR#2, the RenderManager method is completely outdated, since now the inputFile requires a full JSF lifecycle for each progress event, meaning that now it automatically renders itself. "
Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


I don't use a progress bar, so I don't know if I could "disable progress upload related updates".

But I tried "progressRender=false" and it doesn't work.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team