This content has been marked as final.
Show 4 replies
-
1. Re: Frustrating problem with ids (I think)
kragoth Jul 21, 2009 9:03 PM (in response to cmathrusse)Can you please post your actual xhtml code. The html is basically useless.
Just copy and paste it into your post and surround it with [ code ] tags (without the spaces obviously) -
2. Re: Frustrating problem with ids (I think)
ilya_shaikovsky Jul 22, 2009 4:06 AM (in response to cmathrusse)the problem could be in session scoped bindings usage.
-
3. Re: Frustrating problem with ids (I think)
cmathrusse Jul 22, 2009 1:03 PM (in response to cmathrusse)Here is the addresses.xhtml
<!DOCTYPE html 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:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="../layout/layout.xhtml"> <ui:param name="pageTitle" value="#{msgs.rtpAddressSearchTitle}" /> <ui:param name="printPage" value="/address/addressesPrintable.jsf" /> <ui:param name="printDisabled" value="#{empty address.records}" /> <ui:define name="main-frame"> <h:form> <h:panelGrid id="addressesPanel1" width="125%"> <h:panelGrid columns="16"> <label for="addressesExternalId">#{msgs.rptHdrExtId}:</label> <h:inputText id="addressesExternalId" size="12" value="#{address.searchAddress.externalId}" /> <rich:spacer width="10%" height="10" /> <label for="addressesAddressName">#{msgs.rptHdrName}:</label> <h:inputText id="addressesAddressName" size="12" value="#{address.searchAddress.name}" /> <rich:spacer width="10%" height="10" /> <h:outputLabel for="addressesOrganizationList" value="#{msgs.orgsTitle}:" /> <h:selectOneMenu id="addressesOrganizationList" value="#{address.searchAddress.organization}" converter="organizationConverter"> <f:selectItems value="#{address.allOrganizations}"/> </h:selectOneMenu> <rich:spacer width="10%" height="10" /> <h:outputLabel for="addressesCountryList" value="#{msgs.countriesTitle}:" /> <h:selectOneMenu id="addressesCountryList" value="#{address.searchAddress.country}" converter="countryConverter"> <f:selectItems value="#{address.allCountries}"/> </h:selectOneMenu> <rich:spacer width="10%" height="10" /> <h:outputLabel for="addressesAddressStateList" value="#{msgs.rptState}:" /> <h:selectOneMenu id="addressesAddressStateList" value="#{address.searchAddress.addressState}" converter="addressStateConverter"> <f:selectItems value="#{address.allAddressStates}"/> </h:selectOneMenu> <rich:spacer width="10%" height="10" /> <rich:spacer width="20%" height="10" /> <a4j:commandButton id="addressesButtonSearch" type="button" value="#{msgs.buttonSearch}" action="#{address.searchAction}"/> </h:panelGrid> <rich:spacer height="10" /> <rich:dataTable value="#{address.records}" var="rptAddress" id="addressesReportDataTable" onRowMouseOver="this.style.backgroundColor='#F1F1F1';this.style.cursor='pointer'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="0" cellspacing="0" border="0" rows="#{layout.user.rowsPerPage}" reRender="addressesReportDataTableDs" rendered="#{not empty address.records}" style="width: 100%; table-layout: fixed;" binding="#{addressDetail.table}"> <a4j:support id="addressesRowClickAction" event="onRowClick" action="#{addressDetail.selectAction}"> <a4j:actionparam name="addressDetailReturnPage" value="address" assignTo="#{addressDetail.returnPage}"/> </a4j:support> <f:facet name="header"> <rich:columnGroup> <rich:column colspan="8"> <h:outputText value="#{msgs.rptDailyTitle}" /> </rich:column> </rich:columnGroup> </f:facet> <rich:column style="text-align: center" filterBy="#{rptAddress.externalId}" filterEvent="onkeyup" sortBy="#{rptAddress.externalId}"> <f:facet name="header"> <h:outputText value="#{msgs.rptHdrExtId}"/> </f:facet> <h:outputText value="#{rptAddress.externalId}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.name}" filterEvent="onkeyup" sortBy="#{rptAddress.name}"> <f:facet name="header"> <h:outputText value="#{msgs.rptHdrName}"/> </f:facet> <h:outputText value="#{rptAddress.name}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.address1}" filterEvent="onkeyup" sortBy="#{rptAddress.address1}"> <f:facet name="header"> <h:outputText value="#{msgs.address1}"/> </f:facet> <h:outputText value="#{rptAddress.address1}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.city}" filterEvent="onkeyup" sortBy="#{rptAddress.city}"> <f:facet name="header"> <h:outputText value="#{msgs.addressCity}"/> </f:facet> <h:outputText value="#{rptAddress.city}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.regionCode}" filterEvent="onkeyup" sortBy="#{rptAddress.regionCode}"> <f:facet name="header"> <h:outputText value="#{msgs.addressRegion}"/> </f:facet> <h:outputText value="#{rptAddress.regionCode}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.country}" filterEvent="onkeyup" sortBy="#{rptAddress.country}"> <f:facet name="header"> <h:outputText value="#{msgs.addressCountry}"/> </f:facet> <h:outputText value="#{rptAddress.country}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.organization.id}" filterEvent="onkeyup" sortBy="#{rptAddress.organization.id}"> <f:facet name="header"> <h:outputText value="#{msgs.rptHdrOrg}"/> </f:facet> <h:outputText value="#{rptAddress.organization.id}" /> </rich:column> <rich:column style="text-align: center" filterBy="#{rptAddress.addressState.id}" filterEvent="onkeyup" sortBy="#{rptAddress.addressState.id}"> <f:facet name="header"> <h:outputText value="#{msgs.processState}"/> </f:facet> <h:outputText value="#{rptAddress.addressState.id}" /> </rich:column> <f:facet name="footer"> <rich:datascroller id="addressesReportDataTableDs" for="addressesReportDataTable" maxPages="20" renderIfSinglePage="false"/> </f:facet> </rich:dataTable> </h:panelGrid> </h:form> </ui:define> </ui:composition>
And here is the order report:<!DOCTYPE html 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:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="../layout/layout.xhtml"> <ui:param name="pageTitle" value="#{msgs.rptOrderTransactionTitle}" /> <ui:param name="printPage" value="/reports/totAddrSentPrintable.jsf" /> <ui:param name="printDisabled" value="#{empty totalAddrReport.records}" /> <ui:define name="main-frame"> <h:form> <h:panelGrid> <h:panelGrid columns="13"> <label for="calStartDate">#{msgs.rptStartDate}:</label> <rich:calendar name="Calendar" id="calStartDate" value="#{totalAddrReport.startDate}" timeZone="#{totalAddrReport.dateTimeZone}" datePattern="#{totalAddrReport.datePattern}"> </rich:calendar> <rich:spacer width="10%" height="10" /> <label for="calEndDate">#{msgs.rptEndDate}:</label> <rich:calendar name="Calendar" id="calEndDate" value="#{totalAddrReport.endDate}" timeZone="#{totalAddrReport.dateTimeZone}" datePattern="#{totalAddrReport.datePattern}"> </rich:calendar> <rich:spacer width="10%" height="10" /> <label for="orderTxOrderNo">#{msgs.rptOrderNo}:</label> <h:inputText id="orderTxOrderNo" value="#{totalAddrReport.orderNo}"> </h:inputText> <rich:spacer width="10%" height="10" /> <label for="orderTxOrganizationList">#{msgs.rptOrganization}:</label> <h:selectOneMenu id="orderTxOrganizationList" value="#{totalAddrReport.selectedOrgType}"> <f:selectItems value="#{totalAddrReport.organizations}" /> </h:selectOneMenu> <rich:spacer width="10%" height="10" /> <a4j:commandButton id="orderTxButtonSearch" type="button" value="#{msgs.buttonSearch}" action="#{totalAddrReport.searchAction}"/> </h:panelGrid> <rich:spacer height="10" /> <rich:dataTable value="#{totalAddrReport.records}" var="order" id="orderTxReportTable" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="0" cellspacing="0" border="0" style="width: 100%;" rows="2" reRender="orderTxReportTableDs" rendered="#{not empty totalAddrReport.records}"> <f:facet name="header"> <h:outputText value="#{msgs.rptOrderTransactionTitle}" /> </f:facet> <rich:column style="font-weight: bold; text-align: center; border-right: none; background-color: #D8D8D8;" sortBy="#{order.orderNo}"> <f:facet name="header"> <h:outputText value="#{msgs.rptOrderNo}" /> </f:facet> <h:outputText value="#{order.orderNo}" /> </rich:column> <rich:column style="font-weight: bold; text-align: center; border-right: none; background-color: #D8D8D8;" sortBy="#{order.orderCode}" > <f:facet name="header"> <h:outputText value="#{msgs.rptHdrOrderCode}" /> </f:facet> <h:outputText value="#{order.orderCode}" /> </rich:column> <rich:column style="font-weight: bold; text-align: center; border-right: none; background-color: #D8D8D8;" sortBy="#{order.releaseStatus}"> <f:facet name="header"> <h:outputText value="#{msgs.rptReleaseStatus}" /> </f:facet> <h:outputText value="#{msgs.rptStatusReleased}" rendered="#{order.releaseStatus==true}"></h:outputText> <h:outputText value="#{msgs.rptStatusNotReleased}" rendered="#{order.releaseStatus==false}"></h:outputText> </rich:column> <rich:column style="font-weight: bold; text-align: center; border-right: none; background-color: #D8D8D8;" > <f:facet name="header"> <h:outputText value="#{msgs.addressOrg}" /> </f:facet> <h:outputText value="#{order.organization}" /> </rich:column> <rich:column style="background-color: #D8D8D8;" > <f:facet name="header"> <h:outputText value="#{msgs.rptHdrExtId}" /> </f:facet> </rich:column> <rich:column style="background-color: #D8D8D8;" > <f:facet name="header"> <h:outputText value="#{msgs.rptType}" /> </f:facet> </rich:column> <rich:column style="background-color: #D8D8D8;" > <f:facet name="header"> <h:outputText value="#{msgs.rptHdrName}" /> </f:facet> </rich:column> <rich:column style="background-color: #D8D8D8;" > <f:facet name="header"> <h:outputText value="#{msgs.rptAddress}" /> </f:facet> </rich:column> <rich:column style="font-weight: bold; text-align: center; border-right: none; background-color: #D8D8D8;" > <f:facet name="header"> <h:outputText value="#{msgs.rptStatus}" /> </f:facet> <h:outputText value="#{order.state}" /> </rich:column> <rich:column style="font-weight: bold; text-align: center; border-right: none; background-color: #D8D8D8;"> <f:facet name="header"> <h:outputText value="#{msgs.rptDateProcessed}" /> </f:facet> <h:outputText value="#{order.createDate}" /> </rich:column> <rich:subTable id="orderTxReportTableSubTable1" onRowMouseOver="this.style.backgroundColor='#F1F1F1';this.style.cursor='pointer'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" var="orderAddressRecord" value="#{order.addresses}" rendered="#{not empty order.addresses}" binding="#{addressDetail.table}"> <a4j:support id="orderTxReportTableRowClickAction" event="onRowClick" action="#{addressDetail.selectAction}"> <a4j:actionparam name="addressDetailReturnPage" value="orderAddresses" assignTo="#{addressDetail.returnPage}"/> </a4j:support> <rich:column colspan="3" style="border-right: none;"> <rich:spacer /> </rich:column> <rich:column style="text-align: center;" > <h:outputText value="#{orderAddressRecord.organization.id}" /> </rich:column> <rich:column> <h:outputText value="#{orderAddressRecord.externalId}"></h:outputText> </rich:column> <rich:column> <h:outputText value="#{msgs.rptAddress}" rendered="#{orderAddressRecord.nameType=='ADDRESS_NAME'}"></h:outputText> <h:outputText value="#{msgs.rptContact}" rendered="#{orderAddressRecord.nameType=='CONTACT_NAME'}"></h:outputText> </rich:column> <rich:column> <h:outputText value="#{orderAddressRecord.name}"></h:outputText> </rich:column> <rich:column> <h:outputText value="#{orderAddressRecord.address1}, "/> <h:outputText rendered="#{not empty orderAddressRecord.address2}" value="#{orderAddressRecord.address2}, " /> <h:outputText rendered="#{not empty orderAddressRecord.address3}" value="#{orderAddressRecord.address3}, " /><br/> <h:outputText rendered="#{orderAddressRecord.city != '-'}" value="#{orderAddressRecord.city}, "/> <h:outputText rendered="#{orderAddressRecord.regionCode != '-'}" value="#{orderAddressRecord.regionCode} "/> <h:outputText rendered="#{orderAddressRecord.postalCode != '-'}" value="#{orderAddressRecord.postalCode}, "/> <h:outputText value="#{orderAddressRecord.country}"/> </rich:column> <rich:column> <h:outputText value="#{orderAddressRecord.addressState.id}" /> </rich:column> <rich:column> <h:outputText value="#{orderAddressRecord.createDate.time}" converter="dateTimeConverter"/> </rich:column> </rich:subTable> <f:facet name="footer"> <rich:columnGroup> <rich:column>#{msgs.rptTotals}</rich:column> <rich:column colspan="5" > <h:outputText value="#{msgs.rptOrders}: "></h:outputText> <h:outputText value="#{totalAddrReport.totalOrders}"></h:outputText> </rich:column> <rich:column colspan="5" > <h:outputText value="#{msgs.rptAddresses}: "></h:outputText> <h:outputText value="#{totalAddrReport.totalAddresses}"></h:outputText> </rich:column> </rich:columnGroup> </f:facet> </rich:dataTable> <rich:datascroller id="orderTxReportTableDs" for="orderTxReportTable" maxPages="20" renderIfSinglePage="false"/> </h:panelGrid> </h:form> </ui:define> </ui:composition>
Thanks for the help... -
4. Re: Frustrating problem with ids (I think)
ilya_shaikovsky Jul 22, 2009 1:06 PM (in response to cmathrusse)So as I told later.. You have binding to the same object and its scope longer than request. So behavior is expected.