richfaces - rich:fileupload in rich:popupPanel fails first time, in a large page -
i have rich:datatable
, bunch of buttons @ bottom of xhtml. use 1 of buttons show rich:popuppanel
upload file. separated rich:popuppanel
rich:fileupload
different forms based on earlier suggestions.
1st form:
<h:form id="form" enctype="multipart/form-data"> <h:panelgrid columns="1" columnclasses="valign"> <rich:messages/> <rich:panel style="width:1100px;"> <f:facet name="header"> <h:outputtext value="mrm segments" /> </f:facet> <rich:datatable value="#{couponcontroller.campaignsegmentdtolist}" var="campaignsegment" id="sas" rowclasses="odd-row, even-row" styleclass="stable" sortmode="single" rowkeyvar="myrow" onrowclick="myfunction()"> <rich:column> <f:facet name="header">no</f:facet> <h:outputtext value="#{myrow + 1}" /> </rich:column> <!-- snipped --> </rich:datatable> <script> //<![cdata[ function updatenumbers() { var = document.getelementbyid('form:sas:tb'); (var i=0; < a.children.length; i++) { a.children[i].children[0].innerhtml = + 1; } } //]]> </script> <a4j:outputpanel ajaxrendered="true"> <rich:popuppanel id="confirmpanestatus" autosized="true" header="confirm"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td colspan="3">are sure want set segments numeric names inactive ?</td></tr> <tr><td colspan="3"><br/></td></tr> <tr><td align="right"> <a4j:commandbutton value="cancel" onclick="#{rich:component('confirmpanestatus')}.hide(); return false;" /> </td><td align="left"> <a4j:commandbutton value="update" onclick="#{rich:component('confirmpanestatus')}.hide(); updatestatus(); return false;" style="margin-left:15px"/> </td></tr> </table> </rich:popuppanel> </a4j:outputpanel> <a4j:outputpanel ajaxrendered="true"> <rich:popuppanel id="errorpane" autosized="true" header="error" > <table border="0" cellspacing="0" cellpadding="0"> <tr><td colspan="3">only .xlsx files accepted</td></tr> <tr><td colspan="3"><br/></td></tr> <tr><td align="right"> <a4j:commandbutton value="close" onclick="#{rich:component('errorpane')}.hide();" /> </td></tr> </table> </rich:popuppanel> </a4j:outputpanel> <a4j:jsfunction name="updatestatus" action="#{couponcontroller.updatecampaignsegmentdtolistwithsegmentstatus()}" render="sas" immediate="true"/> <a4j:jsfunction name="sort" oncomplete="updatenumbers()" /> </rich:panel> </h:panelgrid> <h:panelgrid columns="7"> <a4j:commandbutton value="apply segment type" render="sas" action="#{couponcontroller.updatecampaignsegmentdtolistwithsegmenttype()}" execute="@form" style="width:140px;height:30px;"/> <a4j:commandbutton value="apply segment status" render="sas" execute="@form" style="width:150px;height:30px;"> <rich:componentcontrol target="confirmpanestatus" operation="show"/> </a4j:commandbutton> <a4j:commandbutton value="upload segment names" execute="@none" style="width:160px;height:30px;"> <rich:componentcontrol target="uploadsegmentnames" operation="show" /> </a4j:commandbutton> <a4j:commandbutton value="save" render="sas" action="#{couponcontroller.savecampaignsegmentsreadytopublish()}" execute="@form" style="width:78px;height:30px;"/> <a4j:commandbutton value="publish" render="sas" action="#{couponcontroller.publishcampaignsegmentsreadytopublish()}" execute="@this" style="width:78px;height:30px;"/> <a4j:commandbutton value="re-publish" render="sas" action="#{couponcontroller.republishcampaignsegmentsreadytopublish()}" execute="@this" style="width:78px;height:30px;"/> <h:commandbutton onclick="location.href='campaignsversions.jsf';return false;" value="cancel" style="width:78px;height:30px;"></h:commandbutton> </h:panelgrid> <rich:popuppanel id="statpane" autosized="true"> <h:graphicimage value="/images/please_wait.gif" alt="pw" /> please wait... </rich:popuppanel> <script type="text/javasript"> $(window).load(function() { // animate loader off screen $(".statpane").fadeout("slow");; }); </script> </h:form>
2nd form:
<h:form id="uploadform" enctype="multipart/form-data"> <a4j:outputpanel ajaxrendered="true"> <rich:popuppanel id="uploadsegmentnames" modal="true" autosized="true" header="upload names file" domelementattachment="parent"> <rich:messages/> <rich:panel style="width:400px;height:300px;"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"> <rich:fileupload id="upload" acceptedtypes="xlsx" fileuploadlistener="#{couponcontroller.fileuploadlistener}" immediateupload="true" maxfilesquantity="1" ontyperejected="#{rich:component('errorpane')}.show();" style="width:370px" addlabel="choose file" donelabel="upload complete" execute="@none" servererrorlabel="error, please close upload window , try again"> </rich:fileupload> </td> </tr> <tr><td colspan="3"><br/></td></tr> </table> </rich:panel> <h:panelgrid columns="2" style="width:400px;height:20px;" align="right"> <h:panelgrid columns="1" border="0" style="width:260px;height:20px"/> <h:panelgrid columns="2" border="0"> <a4j:commandbutton value="process" id="process" action="#{couponcontroller.processfile}" render="sas" onclick="#{rich:component('uploadsegmentnames')}.hide();" execute="@form" /> <a4j:commandbutton value="cancel" execute="@none" onclick="#{rich:component('uploadsegmentnames')}.hide();" /> </h:panelgrid> </h:panelgrid> </rich:popuppanel> </a4j:outputpanel> </h:form>
table having 10 row or 350 rows or in between. problem when table big, upload fails first time. if close upload popup , try again. works. happening big table. appreciate help.
i'm using tomcat 7 , richfaces 4.5.1.
solved. bigger table, bigger viewstate calculated. noticed debugging upload xmlhttprequest url , comparing both cases (with small table , large table). increasing maxhttpheadersize 65536 solved issue. state saving method 'client'.
Comments
Post a Comment