1 Reply Latest reply on Oct 12, 2009 8:17 PM by sumit kumar

    New Problem during rendering xhtml file

    sumit kumar Newbie
      Hi I am not able to render my contract.xhtml file.
      Reason, its backing bean is using backingbean of adhocinvoice.xhtml. I know the problem is in adhocinvoice.xhtml. But don't know where

      Heres the adhocinvoice.xhtml file

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


      <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:rich="http://richfaces.org/rich"
           xmlns:a4j="http://richfaces.org/a4j">

           
           <script>
           function hideDialog(){
                 var isEdited = document.getElementById("adhocinvoiceform_Id:closeDialogAction_id").value;
                if(isEdited == "true"){
                     alert("Could you please save/cancel the edits before close.");
                } if(isEdited == "false") {               
                          #{rich:component('adhocinvoice')}.hide();return false;               
                }
           }
           
           function validateChangeScope(){
           
            var isEdited1 = document.getElementById("adhocinvoiceform_Id:closeDialogAction_id").value;
            if(isEdited1 == "true") {
                 alert("Could you please save/cancel the edits before change scope.");
                 return false;
                //alert("---"+var1);
                }     
           }
            

      </script>



           <rich:modalPanel id="adhocinvoice" width="508" height="690" left="200"
                top="100" style="background-color: transparent;" rendered="#{not adhocInvoiceBacking.createAccess and adhocInvoiceBacking.renderPermission}">

                <f:facet name="header" style="backgroundImage: none">
                     <h:panelGroup id="Adhoc0">
                          <h:graphicImage value="../../umbrella/img/question-16.png" id="quotion_id"
                               style="border: 0px" />
                          <h:outputText id="Adhoc1" value="Adhoc Invoice"></h:outputText>
                     </h:panelGroup>
                </f:facet>

                <f:facet name="controls">
                     <h:panelGroup id="Adhoc2">
                          <h:graphicImage value="../../umbrella/img/dialog_close.png" id="closeDialog_List"
                               onclick="document.getElementById('adhocinvoiceform_Id:closeLink_Idw').click()" />
                     </h:panelGroup>
                </f:facet>

                <fieldset style="background-color: white;"><a4j:form
                     id="adhocinvoiceform_Id" name="aaa">
                     <a4j:region id="region_id">
                          <div id="Adhocdivid1" style="cursor: move;">

                          <div id="Adhocdivid2" align="right" style="float: up"><a4j:commandLink
                               id="closeLink_Idw">
                               <a4j:support event="onclick" id="close_Id2"
                                    actionListener="#{adhocInvoiceBacking.closeDialogListener}"
                                    oncomplete="hideDialog()" reRender="closeDialogAction_id">
                               </a4j:support>
                          </a4j:commandLink></div>
                          </div>

                          <div align="left"><rich:messages
                               style="color:red;font-weight:bold;" id="messages_id" /></div>



                          <h:inputHidden id="closeDialogAction_id" name="closeName"
                               value="#{adhocInvoiceBacking.closeDialogAction}" />


                          <div align="left" id="Adhocdivid3">
                          <fieldset class="Terms" style="align: left">
                          <h:panelGrid
                               columns="3">
                               <h:outputLabel id="idForcustomer" value="Customer (*):"
                                    styleClass="Label_style" />

                               <rich:comboBox id="customerCombo" immediate="true"
                                    value="#{adhocInvoiceBacking.selectedCustomer}"
                                     enableManualInput="false"
                                     binding="#{adhocInvoiceBacking.clientNamesBinding}" onclick="validateChangeScope();">
                                              <f:selectItems  value="#{adhocInvoiceBacking.clientNames}" /> 
                                    <a4j:support id="comboSupportId" event="onselect"
                                         actionListener="#{adhocInvoiceBacking.customerComboListener}"
                                         reRender="contract_Id,brief_Id,clientList,cancalButton_Id,addButton_Id,saveButton_Id,accoutManager_Id,ExistPOnumber_id,raiseButton_Id,textArea_Id,creditCheckBox_Id,pullthoughCheckBox_id,Po_number">
                                    </a4j:support>
                               </rich:comboBox>

                               <a4j:status id="adhocInoviceStatus_id" for="region_id">
                                    <f:facet name="start">
                                         <h:graphicImage id="Adhoc4" url="../../umbrella/img/aero_busy_20.gif"
                                              style="padding:0px; margin:0px" />
                                    </f:facet>
                               </a4j:status>



                               <h:outputLabel value="Contract :" id="outputIdForContract" />
                               <rich:comboBox  id="contract_Id"
                                    enableManualInput="false"
                                    value="#{adhocInvoiceBacking.selectedContract}"
                                    binding="#{adhocInvoiceBacking.contractNamesBinding}" onclick="validateChangeScope();">
                                    <f:selectItems  value="#{adhocInvoiceBacking.contractNames}" />
                                    <a4j:support id="contractComboSupportId" event="onselect"
                                         actionListener="#{adhocInvoiceBacking.contractComboListener}"
                                         reRender="brief_Id,clientList,cancalButton_Id,addButton_Id,saveButton_Id,accoutManager_Id,ExistPOnumber_id,raiseButton_Id,textArea_Id,creditCheckBox_Id,pullthoughCheckBox_id,Po_number">
                                    </a4j:support>
                               </rich:comboBox>

                               <h:outputLabel value="" styleClass="Label_style" id="outputId2" />

                               <h:outputLabel value="Brief :" id="outputIdForBrief" />
                               <rich:comboBox enableManualInput="false"
                                    value="#{adhocInvoiceBacking.selectedBrief}"
                                     id="brief_Id"
                                    binding="#{adhocInvoiceBacking.briefNamesBinding}" onclick="validateChangeScope();">
                                    <f:selectItems  value="#{adhocInvoiceBacking.briefNames}" />
                                    <a4j:support id="briefComboSupportId" event="onselect"
                                         actionListener="#{adhocInvoiceBacking.briefComboListener}"
                                         reRender="clientList,cancalButton_Id,addButton_Id,saveButton_Id,accoutManager_Id,ExistPOnumber_id,raiseButton_Id,textArea_Id,creditCheckBox_Id,Po_number">
                                    </a4j:support>
                               </rich:comboBox>
                               <h:outputLabel id="Adho7" value="" styleClass="Label_style" />
                          </h:panelGrid></fieldset>
                          </div>

                          <rich:spacer width="1" height="1" id="spacerId1" />
                          <fieldset class="Terms" style="align: right">

                          <div align="left"><h:panelGrid id="Adho8" columns="2">
                          
                               <h:panelGroup id="Adho9">
                                    <h:outputLabel value="Credit invoice(*) :" id="outputLableCredit_Id" />
                                    
                                    <h:selectBooleanCheckbox id="creditCheckBox_Id" immediate="true"
                                         value="#{adhocInvoiceBacking.creditInvoicecheckbox}">
                                    </h:selectBooleanCheckbox>
                                    
                               </h:panelGroup>
                          </h:panelGrid> <h:panelGrid id="Adho10" columns="7" rowClasses="prop"
                                columnClasses="name,value">

                               <h:panelGroup id="Adhoc11">
                                    <h:outputLabel id="adhocInvoicePonumerLabal_Id"
                                         value="PO Number :" styleClass="Label_style" />
                                         &#160;&#160;&#160;&#160;
                               <h:outputText id="ExistPOnumber_id"
                                         value="#{adhocInvoiceBacking.existPONumber}" />
                               &#160;&#160;&#160;&#160;
                          </h:panelGroup>

                               <h:panelGroup id="Adhoc12">
                               
                                    <h:outputLabel value="Pull through :" id="adhocInvoicePonumer_Id" />
                                    
                                    <h:selectBooleanCheckbox  value="#{adhocInvoiceBacking.checkbox}"
                                         id="pullthoughCheckBox_id" immediate="true"
                                         disabled="#{adhocInvoiceBacking.disableCheckbox}">
                                         <a4j:support id="chekboxId" event="onclick"
                                              actionListener="#{adhocInvoiceBacking.getPONumber}"
                                              reRender="Po_number">
                                              </a4j:support>
                                    </h:selectBooleanCheckbox>
                               &#160;&#160;&#160;&#160;
                          </h:panelGroup>
                               <!-- </a4j:form> disabled="#{adhocInvoiceBacking.disableCheckbox}" -->

                               <h:panelGroup id="Adhoc14">
                                    <h:outputLabel value="Number :" id="adhocInvoiceNumer2_Id" />
                                    <h:inputText  value="#{adhocInvoiceBacking.numberValue}"
                                         id="Po_number" disabled="#{adhocInvoiceBacking.numberDisable}" maxlength="30"/>
                               </h:panelGroup>

                          </h:panelGrid> <h:panelGrid id="Adhoc16" columns="3">
                               <h:outputLabel  value="Account manager (*) :"
                                    id="adhocInvoiceAccoutntMangar2_Id" />
                               <div style="width: 12px"></div>

                               <rich:comboBox value="#{adhocInvoiceBacking.accountManagerValue}"
                                    directInputSuggestions="true" width="187px" id="accoutManager_Id"
                                    defaultLabel="#{adhocInvoiceBacking.existAccountMagager}"
                                    binding="#{adhocInvoiceBacking.selctedLable}">
                                    <f:selectItems  value="#{adhocInvoiceBacking.allAccountManagers}" />
                               </rich:comboBox>



                          </h:panelGrid> <h:panelGrid id="Adhoc19" columns="3">
                               <h:outputLabel value="Notes :" id="adhocInveNotes_Id" />
                               <div style="width: 85px"></div>
                               <h:inputTextarea id="textArea_Id"
                                    value="#{adhocInvoiceBacking.notes}" style="width:180" />
                          </h:panelGrid></div>


                          </fieldset>
                          <rich:spacer id="Adhoc20" width="1" height="1" />
                          <fieldset class="Terms">
                          <rich:extendedDataTable
                               value="#{adhocInvoiceBacking.invoiceLineTable}"
                               var="_quotationLists" id="clientList" width="470px" height="140px"
                               selectionMode="null"  >
                               <rich:column id="Adhoc21" label="Description" width="140">
                                    <f:facet name="header">
                                         <h:outputText id="Adhoc22" value="Description" />
                                    </f:facet>
                                    <h:outputText id="Adhoc23" value="#{_quotationLists.service}">
                                    </h:outputText>
                                    <f:facet name="footer" colspan="1">
                                         <h:outputText id="Adhoc24" value="Total" />
                                    </f:facet>
                               </rich:column>

                               <rich:column id="Adhoc25" colspan="1" label="Price" width="120" >
                                    <f:facet name="header">
                                         <h:outputText id="Adhoc26" value="Price" />
                                    </f:facet>
                                    <h:outputText id="Adhoc27" value="#{_quotationLists.cost}">
                                         <f:convertNumber />
                                    </h:outputText>
                               </rich:column>

                               <rich:column id="Adhoc28" label="VAT%" width="40">
                                    <f:facet name="header">
                                         <h:outputText id="Adhoc29" value="VAT%" />
                                    </f:facet>
                                    <h:outputText id="Adhoc30" value="#{_quotationLists.vatRate} &#37;"
                                         styleClass="label">
                                    </h:outputText>
                               </rich:column>

                               <rich:column id="Adhoc31" colspan="1" label="Total" width="120">
                                    <f:facet name="header">
                                         <h:outputText id="Adhoc32" value="Total" />
                                    </f:facet>
                                    <h:outputText id="Adhoc33" value="#{_quotationLists.quantity}"
                                         styleClass="label" />
                                    <f:facet name="footer" colspan="1">
                                         <h:outputText id="Adhoc34" value="#{adhocInvoiceBacking.sumOfTotal}" />
                                    </f:facet>
                               </rich:column>

                               <rich:column id="Adhoc35" width="40" label="Remove" >
                                    <f:facet name="header">
                                         <h:outputText id="Adhoc36" value="Remove" />
                                    </f:facet>
                                    <a4j:commandLink id="clientEdit" reRender="clientList,closeDialogAction_id"
                                         actionListener="#{adhocInvoiceBacking.removeInvoiceLine}">
                                         <h:graphicImage id="Adhoc37" value="../../umbrella/img/gtk-close.png" style="border:0px" />
                                         <f:param id="Adhoc38" name="tempPrimaryKeyName"
                                              value="#{_quotationLists.service}" />
                                    </a4j:commandLink>
                               </rich:column>

                          </rich:extendedDataTable></fieldset>

                          <div align="left"><rich:spacer id="Adhoc39" width="1" height="1" />
                          <fieldset class="Terms"><legend>Add</legend> <h:panelGrid
                               columns="2" rowClasses="prop" columnClasses="name,value">

                               <h:outputLabel id="Adhoc42" value="Description (*) :" styleClass="Label_style" />
                               <h:inputText value="#{adhocInvoiceBacking.desc}"
                                    style="width:150px" id="desc_Id">

                               </h:inputText>
                               <h:outputLabel  value="Price (*) :" styleClass="Label_style"
                                    id="adhocInvoicePriceLebal_Id" />

                               <rich:inputNumberSpinner value="#{adhocInvoiceBacking.price}"
                                    step="1" inputSize="18" maxValue="1000000000" id="price_Id" />
                               <h:outputLabel id="Adhoc41" value="VAT (*) :" styleClass="Label_style" />
                               <rich:inputNumberSpinner value="#{adhocInvoiceBacking.vat}"
                                    maxValue="1000" inputSize="18" id="vat_Id" />
                               

                               <a4j:commandButton action="#{adhocInvoiceBacking.addInvoiceLine}" disabled="#{!adhocInvoiceBacking.accessPermission}"
                                    type="button" value="ADD" reRender="clientList,closeDialogAction_id,desc_Id,price_Id,vat_Id" id="addButton_Id">

                               </a4j:commandButton>
                          </h:panelGrid></fieldset>
                          </div>

                          <div align="right"><h:panelGrid id="Adhoc43" columns="4">
                               <a4j:commandButton type="button" value="Raise" id="raiseButton_Id"
                                    disabled="#{adhocInvoiceBacking.raiseButton or !adhocInvoiceBacking.accessPermission}"
                                    action="#{adhocInvoiceBacking.raiseAdhocInvoice}"
                                    onclick="var isEditedForRaise = document.getElementById('adhocinvoiceform_Id:closeDialogAction_id').value;
                                    if(isEditedForRaise == 'true') { alert('Could you please save/cancel the edits before raise invoice.'); return false;}"
                                    oncomplete="#{rich:component('adhocinvoice')}.hide();return false;">
                               </a4j:commandButton>

                               <a4j:commandButton type="button" value="Save" id="saveButton_Id"
                                    disabled="#{adhocInvoiceBacking.saveButton or !adhocInvoiceBacking.accessPermission}"
                                    action="#{adhocInvoiceBacking.saveAdhocInvoice}"
                                    reRender="creditCheckBox_Id,raiseButton_Id,clientList,closeDialogAction_id,ExistPOnumber_id,accoutManager_Id" />

                               <a4j:commandButton  type="button"
                                    disabled="#{adhocInvoiceBacking.cancalButton}"
                                    action="#{adhocInvoiceBacking.cancalAdhocInvoice}" value="Cancel"
                                    id="cancalButton_Id"
                                    reRender="creditCheckBox_Id,closeDialogAction_id,clientList,accoutManager_Id" />

                          </h:panelGrid></div>
                     </a4j:region>
                     
                </a4j:form></fieldset>
           </rich:modalPanel>


      </ui:composition>

        • 1. Re: New Problem during rendering xhtml file
          sumit kumar Newbie
          And heres the error log.......

          20:26:18,243 ERROR [viewhandler] Error Rendering View[/Contract.xhtml]
          java.lang.IllegalStateException: duplicate Id for a component adhocinvoiceform_Id:j_id480
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:68)
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:92)
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:92)
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:92)
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:92)
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:92)
                  at org.ajax4jsf.application.TreeStructureNode.apply(TreeStructureNode.java:92)
                  at org.ajax4jsf.application.AjaxStateManager.getTreeStructureToSave(AjaxStateManager.java:187)
                  at org.ajax4jsf.application.AjaxStateManager.buildViewState(AjaxStateManager.java:498)
                  at org.ajax4jsf.application.AjaxStateManager$SeamStateManagerWrapper.saveView(AjaxStateManager.java:105)
                  at org.jboss.seam.jsf.SeamStateManager.saveView(SeamStateManager.java:89)
                  at org.ajax4jsf.application.AjaxStateManager.saveSerializedView(AjaxStateManager.java:454)
                  at org.jboss.seam.jsf.SeamStateManager.saveSerializedView(SeamStateManager.java:64)
                  at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:615)
                  at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
                  at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
                  at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                  at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                  at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                  at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
                  at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                  at java.lang.Thread.run(Thread.java:595)
          20:26:18,274 INFO  [AuthorizationBacking] Entering getScreenPermission
          20:26:18,664 INFO  [ADHOCInvoiceBacking] Selected Screen--------------->contract