Extended Datatable onrowmouseover does not work properly - jsf

I am trying to highlight the rows of a table when mouse is over. Here is the code:
<div style="position: relative; top: 120px; left: 300px">
<h:panelGrid columns="2">
<h:form>
<rich:extendedDataTable onrowmouseover ="this.style.backgroundColor='yellow'"
onrowmouseout="this.style.backgroundColor='white'" value="#{moneyTransferManager.allAccounts}" var="accounts"
selection="#{extTableSelectionBean.selection}" id="table" frozenColumns="2"
style="height:170px; width:484px;">
<a4j:ajax execute="#form" event="selectionchange" listener="#{extTableSelectionBean.selectionListener}"
render=":res"/>
<f:facet name="header">
<h:outputText value="Hesaplarım"/>
</f:facet>
<rich:column width="120px;">
<f:facet name="header">
<h:outputText value="Hesap Numarası"/>
</f:facet>
<h:outputText value="#{accounts.accountNumber}"/>
</rich:column>
<rich:column width="120px;">
<f:facet name="header">
<h:outputText value="Para Birimi"/>
</f:facet>
<h:outputText value="#{accounts.accountCurrency}"/>
</rich:column>
<rich:column width="120px;">
<f:facet name="header">
<h:outputText value="IBAN"/>
</f:facet>
<h:outputText value="#{accounts.iban}"/>
</rich:column>
<rich:column width="120px;">
<f:facet name="header">
<h:outputText value="Bakiye"/>
</f:facet>
<h:outputText value="#{accounts.balance}"/>
</rich:column>
</rich:extendedDataTable>
</h:form>
<a4j:outputPanel id="res">
<rich:panel header="Seçilen Hesap:" rendered="#{not empty extTableSelectionBean.selectionItems}">
<rich:list type="unordered" value="#{extTableSelectionBean.selectionItems}" var="sel">
<h:outputText value="#{sel.accountCurrency} - #{sel.iban} - #{sel.balance}"/>
</rich:list>
</rich:panel>
</a4j:outputPanel>
<rich:panel styleClass="top">
<div style="position: relative; left: -3px; top: 23px">
<h:outputText style=" font-size: 12px; font-weight: bold; " value="Yapmak istediğiniz işlem .."></h:outputText>
</div>
<h:form>
<div style="position: relative; left: 160px; top: -3px">
<rich:select value="#{transactionManager.selection}" defaultLabel="Bir işlem seçin...">
<f:selectItem itemValue="0" itemLabel="Hesap Hareketlerini Listele" />
</rich:select>
</div>
<div style="position: relative; left: 380px; top: -22px">
<h:commandButton action="#{transactionManager.accountActivity()}" value="Devam" style="color: #000000; font-weight: bold; width: 70px; height: 21px; background-color: grey; -moz-border-radius: 0px; -webkit-border-radius: 15px;"></h:commandButton>
</div>
</h:form>
</rich:panel>
</h:panelGrid>
</div>
The problem is, only columns 1-2 together or 3-4 together are highlighted like this:
Can anyone tell me the problem? Thanks

This is being caused by the frozenColumns attribute. Remove it if you want all the rows to be selected.

Related

How to know if a data table is filtered in Primefaces 5

Recently I have moved from JSF 2.0 to JSF 2.2 and Primefaces 3.5 to Primefaces 5
I have got a table which has filter on each column. filtering works well using primefaces 3.5
<p:dataTable id="gwsReportAllPartListDataTable"
value="#{viewAllAnalyticsBean.gwsReportPartTwoList}"
var="report"
paginator="true"
rows="100"
paginatorTemplate="{PageLinks} {CurrentPageReport}"
currentPageReportTemplate="{currentPage} #{dictionary['out_of']} {totalPages}"
emptyMessage="#{dictionary['nothing_is_here']}"
scrollable="true"
scrollWidth="1221"
scrollHeight="500">
<p:ajax event="filter" listener="#{viewAllAnalyticsBean.onFilterDataTable}" oncomplete="updateFilters()"/>
<p:column styleClass="columnCustomClass" style="width: 90px;position:relative; padding-bottom: 30px;">
<f:facet name="header">
<h:outputText value="#{dictionary['reporting_period']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.year}, #{report.gwsReportPartOne.quarter}"/>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 90px;position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.contractNumber}" filterMatchMode="contains" filterStyle="width:80px; position:absolute; bottom:4px;" filterValue="">
<f:facet name="header">
<h:outputText value="#{dictionary['subsoil_user_contract_register_number']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.contractNumber}"/>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 40px;position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.gwsType.code}" filterMatchMode="contains" filterStyle="width:30px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['gws_type']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.gwsType.code}" />
</p:column>
<p:column id="tender_code" width="100" style="position:relative; padding-bottom: 30px;" styleClass="columnCustomClass" filterBy="#{report.skp.code}" filterMatchMode="contains" filterStyle="width:90px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['gws_code_by_skp']}" />
</f:facet>
<h:outputText value="#{report.skp.code}"/>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 150px; position:relative; padding-bottom: 30px;" filterBy="#{report.description}" filterMatchMode="contains" filterStyle="width:140px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['item_name_and_short_description_of_purchased_gws']}" />
</f:facet>
<h:outputText value="#{report.description}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 50px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.tenderType.code}" filterMatchMode="contains" filterStyle="width:40px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['purchase_way']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.tenderType.code}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.agreementNumber}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['agreement_number']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.agreementNumber}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.resultDate}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['tender_result_date']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.resultDate}" >
<f:convertDateTime pattern="dd.MM.yyyy"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.agreementStartDate}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['agreement_conclusion_date']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.agreementStartDate}" >
<f:convertDateTime pattern="dd.MM.yyyy"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.agreementEndDate}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['agreement_deadline_date']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.agreementEndDate}" >
<f:convertDateTime pattern="dd.MM.yyyy"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 50px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.agreementStatus.code}" filterMatchMode="contains" filterStyle="width:40px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['agreement_status']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.agreementStatus.code}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.agreementSum}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['total_sum_of_agreement_without_vat']}, #{viewAllAnalyticsBean.getThTengeOrUsd()}" />
</f:facet>
<h:outputText value="#{viewAllAnalyticsBean.convertValueToCurrentCurrency(report.gwsReportPartOne.agreementSum)}">
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.plannedSum}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['planned_sum_in_gpz_without_vat']}, #{viewAllAnalyticsBean.getThTengeOrUsd()}" />
</f:facet>
<h:outputText value="#{viewAllAnalyticsBean.convertValueToCurrentCurrency(report.gwsReportPartOne.plannedSum)}" >
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.actuallyPaidSum}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['actually_paid_sum_for_report_period_of_agreement_without_vat']}, #{viewAllAnalyticsBean.getThTengeOrUsd()}" />
</f:facet>
<h:outputText value="#{viewAllAnalyticsBean.convertValueToCurrentCurrency(report.gwsReportPartOne.actuallyPaidSum)}" >
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 100px; position:relative; padding-bottom: 30px; background-color: #{two.gwsSumWithoutVatColor}" filterBy="#{report.gwsSumWithoutVat}" filterMatchMode="contains" filterStyle="width:90px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['tender_volume_without_vat_in_price']}, #{viewAllAnalyticsBean.getThTengeOrUsd()}" />
</f:facet>
<h:outputText value="#{viewAllAnalyticsBean.convertValueToCurrentCurrency(report.gwsSumWithoutVat)}">
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.supplierBinOrIin}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['supplier_bin_iin']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.supplierBinOrIin}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 150px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.supplierName}" filterMatchMode="contains" filterStyle="width:140px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['supplier_gws_name']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.supplierName}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 60px; position:relative; padding-bottom: 30px;" filterBy="#{report.gwsReportPartOne.supplierCountry.code}" filterMatchMode="contains" filterStyle="width:50px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['supplier_gws_country']}" />
</f:facet>
<h:outputText value="#{report.gwsReportPartOne.supplierCountry.code}" />
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.kazcontent}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['local_content_piece']}, %" />
</f:facet>
<h:outputText value="#{report.kazcontent}" >
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText>
<ui:remove><h:outputText value="#{report.kazcontentInService}" >
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText></ui:remove>
</p:column>
<p:column styleClass="columnCustomClass" style="width: 80px; position:relative; padding-bottom: 30px;" filterBy="#{report.procurementSumOfLocalContentOfGws}" filterMatchMode="contains" filterStyle="width:70px; position:absolute; bottom:4px;">
<f:facet name="header">
<h:outputText value="#{dictionary['procurement_sum_of_local_content_of_tru']}, #{viewAllAnalyticsBean.getThTengeOrUsd()}" />
</f:facet>
<h:outputText value="#{viewAllAnalyticsBean.convertValueToCurrentCurrency(report.procurementSumOfLocalContentOfGws)}" >
<f:convertNumber pattern="0.00#" locale="ru-RU"/>
</h:outputText>
</p:column>
<p:columnGroup type="footer">
<p:row>
<p:column footerText="#{dictionary['totals']}: " style="text-align:right"/>
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="#{viewAllAnalyticsBean.totalAgreementSum}" />
<p:column footerText="#{viewAllAnalyticsBean.totalPlannedSum}" />
<p:column footerText="#{viewAllAnalyticsBean.totalActualPaid}" />
<p:column footerText="#{viewAllAnalyticsBean.totalGwsSum}" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="" />
<p:column footerText="#{viewAllAnalyticsBean.averageKazContent} %" />
<p:column footerText="#{viewAllAnalyticsBean.totalGwsLocalContent}" />
</p:row>
</p:columnGroup>
</p:dataTable>
I have onFilterDataTable function which fires each time when user start to type to filter fields on each column.
public void onFilterDataTable(AjaxBehaviorEvent event) {
System.out.println("Filter called");
DataTable table = (DataTable) event.getSource();
filteredGwsReportPartTwoList = table.getFilteredValue();
isFiltered = filteredGwsReportPartTwoList.size() != gwsReportPartTwoList.size();
countTotalsAndGenerateGwsReportPartOne(isFiltered);
}
but in Primefaces shows me that getFilteredValue() returns null when Primefaces 3.5 returns ready filtered list.
What is the problem? And how to check if data table shows already filtered data on server side?
me the same thing has happened to move from version 3.5 to 4.0.
I solved the problem using remotecomand to call actionlistener method.
<p:dataTable filterDelay="1000" emptyMessage="No se encontraron elementos" widgetVar="tb1"
id="tablaFact" var="item" selection="#{listadoFacturasMB.selectedFactura}" selectionMode="single" paginator="true"
rows="20" rowKey="#{item.idFactura}" value="#{listadoFacturasMB.facturaUtilList}" filteredValue="#{listadoFacturasMB.filterFacturaUtilList}">
<p:ajax event="filter" oncomplete="handleLoadStart();" update=":frm1:tablaFact :frm1:panelTotal"/>
<p:column style="width:10%" headerText="Importe Total" id="cff3">
<h:outputText value="#{item.importeTotal}"/>
</p:column>
<p:column style="width:10%" headerText="Importe CUC" id="cjj3">
<h:outputText value="#{item.importeCuc}"/>
</p:column>
</p:dataTable>
<p:remoteCommand id="rcom" name="loadRemoteContent" process="#this" update="panelTotal, tablaFact"
actionListener="#{listadoFacturasMB.filterListener2}"/>
Backingbean
public void filterListener2() {
try {
if (filterFacturaUtilList != null) {
//your code
}
}
} catch (Exception e) {
JsfUtil.addErrorMessage(e, "Error: filterListener() " + e.getMessage());
}
}
in PF 5.0 you need to explicit define filteredValue:
<p:dataTable id="gwsReportAllPartListDataTable"
value="#{viewAllAnalyticsBean.gwsReportPartTwoList}"
var="report"
paginator="true"
rows="100"
paginatorTemplate="{PageLinks} {CurrentPageReport}"
currentPageReportTemplate="{currentPage} #{dictionary['out_of']} {totalPages}"
emptyMessage="#{dictionary['nothing_is_here']}"
scrollable="true"
scrollWidth="1221"
scrollHeight="500"
filteredValue="#{someBeanOrScope.someList}">

f:setPropertyActionListener is not working when c:foreach has a variable ID

Any idea why f:setPropertyActionListener is not working when I'm setting p:dataTable id="inv#{ck001.sequence}", which is a value obtained from the pageBean.
It works ok if I set it to p:dataTable id="inv1", a fixed value
<table class="layout-matrix">
<tr>
<td class="layout-cell" rowspan="3" style="width: 33.33%;">
<p:poll interval="60" listener="#{ck001.refreshData}" update="#form"/>
<div id="availableInventory" style="overflow: scroll; height:1030px" >
<table class="outer-wrap"><tr><td class="outer-cell"><table class="inner-wrap"><tr><td class="inner-cell">
<p:fieldset legend="#{i18n.static.availableInventory}">
<c:forEach var="invBBD" items="#{ck001.distinctBBD}">
<p:panel styleClass="has-footer" >
<p:dataTable id="inv#{ck001.sequence}" var="inv" value="#{ck001.getAvailableInventoryViewModelList(invBBD)}" style="width:300px;">
<f:facet name="header">
<h:outputText value="#{i18n.static.bestBeforeDate}: #{invBBD}" styleClass="strong"/>
</f:facet>
<p:column headerText="#{i18n.static.productDescription}" width="200">
<h:outputText value= "#{inv.productName}" style="display: block; background-color: #{inv.color}"/>
</p:column>
<p:column headerText="#{i18n.static.birdGrade}">
<h:outputText value= "#{inv.birdGrade}" style="display: block; background-color: #{inv.color}"/>
</p:column>
<p:column headerText="#{i18n.static.supplierName}" width="200">
<h:outputText value="#{inv.supplierName}" style="display: block; background-color: #{inv.color}"/>
</p:column>
<p:column headerText="#{i18n.static.quantity}">
<h:outputText value="#{inv.sumOfQuantityOnHand}" style="display: block; background-color: #{inv.color}"/>
</p:column>
<p:column>
<p:commandButton id="chickenReplenishment"
update=":chickenReplenishmentPopupForm:chickenReplenishmentPnl"
process="#this"
oncomplete="chickenReplenishmentPopup.show()"
icon="ui-icon-c34"
title="#{i18n.static.chickenReplenishment}">
<f:setPropertyActionListener value="#{inv}" target="#{ck001.selectedAvailableInventory}" />
<f:setPropertyActionListener value="#{invBBD}" target="#{ck001.selectedBestBeforeDate}" />
<f:setPropertyActionListener value="#{inv.sumOfQuantityOnHand}" target="#{ck001.quantityRequested}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panel>
</c:forEach>
</p:fieldset>
</td></tr></table></td></tr></table>
</div>
</td>
....

PrimeFaces ajax not updating form components

I have been trying to update form components by using primefaces ajax . but update property do not update .
Let me elaborate:
I have two selectonemenu in my form and I want to take the selected values from the menus and on submit button click I want the dataTable to be updated and populated with the respective data ..
<p:outputLabel id="state" value="State Name"></p:outputLabel>
<p:selectOneMenu id="statemenu" style="width:300px;"
value="#{MenuBean.state}">
<f:selectItem itemLabel="Select One"></f:selectItem>
<f:selectItems value="#{MenuBean.stateList}"></f:selectItems>
</p:selectOneMenu>
<br></br>
<p:outputLabel value="District"></p:outputLabel>
<p:selectOneMenu id="dist" style="width:300px;"
value="#{MenuBean.district}">
<f:selectItem itemLabel="Select One"></f:selectItem>
<f:selectItems value="#{MenuBean.districtList}"></f:selectItems>
</p:selectOneMenu>
<p:commandButton id="btnSubmit" value="Submit" type="submit"
partialSubmit="true" process="statemenu,dist,#this"
actionListener="#{MenuBean.setVisiblity}"
action="#{MenuBean.getValues}"
title="Submit"
style='font-family: font-family : Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif; font-size: 14px; font-weight: normal'>
</p:commandButton>
Here is the Backing Bean
public void getValues() {
System.out.println("getting the values");
DataTable.getDataTable(state, district);
System.out.println(DataTable.Filter);
System.out.println(DataTable.isLoaded);
System.out.println(state);
System.out.println(district);
}
public void setVisiblity(ActionEvent event) {
DataTable.Filter = false;
DataTable.isLoaded = true;
System.out.println(event.getSource().toString());
System.out.println("Enters the actionListener");
}
Here is the datatable i want to render and filter panel i want to hide on click
<p:dataTable id="disptable" var="table" lazy="true"
rowKey="#{table.sheet_no}" selectionMode="single"
selection="#{DataTable.selectedSheet}" scrollable="true"
scrollHeight="115" rendered="#{DataTable.loaded}"
style="widht:auto ; margin-left:420px;margin-right:30px ;box-shadow: 10px 10px 25px #888888;"
widgetVar="tabl" emptyMessage="No Records to display.">
<p:column headerText="Sheet Number" style="width:25%">
<h:outputLabel value="#{table.sheet_no}"></h:outputLabel>
</p:column>
<p:column headerText="State" style="width:25%">
<h:outputLabel value="#{table.state_cd}"></h:outputLabel>
</p:column>
<p:column headerText="District" style="width:25%">
<h:outputLabel value="#{table.district_cd}"></h:outputLabel>
</p:column>
<f:facet name="footer">
<p:commandButton id="selectButton" title="Show Complete Details"
icon="./images/show.png" update=":form:disp"
oncomplete="PF('Dialog').show()" process="#this,disptable"
style="height:25px;" ajax="true" iconPos="center" />
<p:commandButton style="height:25px;" id="addCart"
title="Add to Cart" icon="./images/cart.png" global="false" />
<p:commandButton style="height:25px;" id="location"
update=":form:tabs:MapDetails" process="#this,disptable"
title="Show Co-ordinates" icon="./images/cart.png" global="false" />
</f:facet>
</p:dataTable>
<h:panelGrid id="filter" columns="1" cellpadding="10" cellspacing="2"
rendered="#{DataTable.filter}"
style="position:absolute;bottom:15px;right:80px;border: 1px solid #1f497d;box-shadow: 10px 10px 25px #888888;
height:auto;width:600px;Text-align:center;">
<p:outputLabel value="Filter your search to get result."></p:outputLabel>
</h:panelGrid>
</h:panelGrid>
Here is the whole page
<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="./css/extra-styles.css" rel="stylesheet" type="text/css" />
<link href="./css/menustyles.css" rel="stylesheet" type="text/css" />
<title>SOI MAP TRANSACTION REGISTRY :: MAP</title>
</h:head>
<body>
<h:form id="form">
<f:event type="preRenderView" listener="#{DataTable.init}" />
<div id="header">
<div style="height: 151px;">
<img id="logo"
style="position: relative; left: 60px; height: 146px; width: 100px"
src="images\img.gif" />
<h:panelGrid id="panel1" columns="1"
style="position: absolute; bottom: auto; left: 175px; right: auto; top: 30px ">
<h:outputText id="output1" value="Survey of India"
style='line-height: normal; font-variant: normal; color: #400040; text-transform: none; font-style: normal; font-size: xx-large; font-family: "Times New Roman", Serif; font-weight: normal'></h:outputText>
<h:outputText styleClass="shadow" value="Map Transaction Registry"
style='font-style: italic; font-size: xx-large; font-family: Georgia, "Times New Roman", Serif; font-weight: normal'
id="shadow"></h:outputText>
</h:panelGrid>
<div id="div1"
style="height: 5px; widht: auto; background-color: #CDCDCD; position: relative; top: 12px; bottom: auto; left: auto; right: auto"></div>
<hr id="hr"
style="height: 5px; widht: auto; position: relative; top: 3px; bottom: auto; left: auto; right: auto" />
</div>
<div id="div2"
style="background: #616063; height: 44px; width: auto; position: relative"></div>
<div id='cssmenu'>
<ul>
<li><a href='index.xhtml'><span>Home</span></a></li>
<li><a href='#'><span>About Us</span></a></li>
<li><a href='#'><span>Our Products</span></a></li>
<li><span>Search Image</span></li>
<li><a href='#'><span>Contact</span></a></li>
<li class='last'><a href='signup.xhtml'><span>New
User</span></a></li>
</ul>
</div>
</div>
<p:fieldset rendered="#{!login_bean.validationComplete}">
<img
style="position: absolute; left: 10px; top: 45px; height: 45px; width: 45x"
src="images\login.gif" />
<p:growl id="growl" showDetail="false" sticky="false" life="3000"
autoUpdate="TURE" />
<h:panelGrid columns="4" class="formTable"
style="position: relative; left: 35px; top: 6px ;">
<p:outputLabel value="Login/Email" style='font-size: 16px;' />
<p:inputText value="#{login_bean.username}" id="username"
required="true" requiredMessage="Please Enter the username"
style="height:15px; width:auto;" />
</h:panelGrid>
<h:panelGrid columns="4" class="formTable"
style="position: relative; left: 35px; top:6px">
<p:outputLabel value="Password" style='font-size: 16px;' />
<br />
<p:password style="height:15px;position: relative; left: 8px"
id="password" value="#{login_bean.password}" required="true"
requiredMessage="Please Enter the Password">
</p:password>
</h:panelGrid>
<h:panelGrid columns="3" class="formTable"
style="position: relative; left: 80px; top: 6px">
<br />
</h:panelGrid>
<h:commandButton id="btnLogin" value="Login"
action="#{login_bean.check}" type="submit" update="true"
style="position: relative; left:245px; top:-20px ; height:25px;widht:38;text-align: center; font-size: 14px;" />
<p:commandLink id="link"
style="position: relative; left:70px; top:-20px ;font-size:13px;"
value="Forgot Password ?"></p:commandLink>
</p:fieldset>
<p:fieldset rendered="#{login_bean.validationComplete}">
<img
style="position: absolute; left: 10px; top: 30px; height: 65px; width: 55px"
src="images\icon.png" />
<h:panelGrid columns="1" class="formTable"
style="position: relative; left: 35px; top: 6px ;">
<p:outputLabel
value="Welcome #{login_bean.username} to Map Tansaction Registry"
style='font-size: 16px; color: red; text-align: center; font-style: bold; font-family: "Times New Roman", Serif; font-weight: bold' />
</h:panelGrid>
<h:panelGrid columns="4" class="formTable"
style="position: relative; left: 55px; top: 6px ;" cellpadding="3"
cellspacing="3">
<h:graphicImage url="images\cart.png"></h:graphicImage>
<h:commandLink value="Cart"
style='font-size: 15px; color:green; text-align: center; font-style: normal; font-family: Georgia, Times, "Times New Roman", serif; font-weight: normal'></h:commandLink>
<h:graphicImage url="images\edit.png"></h:graphicImage>
<h:commandLink value="Edit Details"
style='font-size: 15px; color:green; text-align: center; font-style: normal; font-family: Georgia, Times, "Times New Roman", serif; font-weight: normal'></h:commandLink>
<h:graphicImage url="images\pass.png"></h:graphicImage>
<h:commandLink value="Change Password"
style='font-size: 15px; color:green; text-align: center; font-style: normal; font-family: Georgia, Times, "Times New Roman", serif; font-weight: normal'></h:commandLink>
<h:graphicImage url="images\logout.png"></h:graphicImage>
<h:commandLink value="Logout" action="#{login_bean.logout}"
style='font-size: 15px; color:green; text-align: center; font-style: normal; font-family: Georgia, Times, "Times New Roman", serif; font-weight: normal'></h:commandLink>
</h:panelGrid>
</p:fieldset>
<!-- Search Tab View -->
<p:tabView activeIndex="2">
<p:tab title="Map Sheet">
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Map Sheet No :" />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:inputText style="height:20px;width:300px;"></p:inputText>
</h:panelGrid>
<br />
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Scale/GSD " />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:selectOneMenu tabindex="1" style="height:25px;widht:auto;">
<f:selectItem itemLabel="-- ALL --" itemValue="all"></f:selectItem>
<f:selectItem itemLabel="5000" itemValue="5000"></f:selectItem>
<f:selectItem itemLabel="6000" itemValue="6000"></f:selectItem>
<f:selectItem itemLabel="8000" itemValue="8000"></f:selectItem>
<f:selectItem itemLabel="10000" itemValue="10000"></f:selectItem>
<f:selectItem itemLabel="12500" itemValue="12500"></f:selectItem>
<f:selectItem itemLabel="15000" itemValue="15000"></f:selectItem>
<f:selectItem itemLabel="25000" itemValue="25000"></f:selectItem>
<f:selectItem itemLabel="30000" itemValue="30000"></f:selectItem>
<f:selectItem itemLabel="40000" itemValue="40000"></f:selectItem>
<f:selectItem itemLabel="50000" itemValue="50000"></f:selectItem>
</p:selectOneMenu>
</h:panelGrid>
<br />
<br />
<h:panelGrid style="position:relative; left:165px" columns="2"
cellpadding="2" cellspacing="2">
<p:commandButton value="Reset"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 13px; font-weight: normal'></p:commandButton>
<p:commandButton id="submit" value="Submit"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 13px; font-weight: normal'></p:commandButton>
</h:panelGrid>
<!-- <h:panelGrid>
<p:graphicImage url="images/tips.png"></p:graphicImage>
<p:outputLabel value="Tips :"></p:outputLabel>
</h:panelGrid> -->
</p:tab>
<p:tab title="Lat/Long">
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Lat BL : " />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:inputText style="height:20px;width:300px;"></p:inputText>
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Lng BL : " />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:inputText style="height:20px;width:300px;"></p:inputText>
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Lat TR : " />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:inputText style="height:20px;width:300px;"></p:inputText>
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Lng TR : " />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:inputText style="height:20px;width:300px;"></p:inputText>
</h:panelGrid>
<br />
<p:commandLink value="Grab bounding from the Map"></p:commandLink>
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Scale/GSD"></p:outputLabel>
<p:selectOneMenu tabindex="1">
<f:selectItem itemLabel="-- ALL --" itemValue="all"></f:selectItem>
<f:selectItem itemLabel="5000" itemValue="5000"></f:selectItem>
<f:selectItem itemLabel="6000" itemValue="6000"></f:selectItem>
<f:selectItem itemLabel="8000" itemValue="8000"></f:selectItem>
<f:selectItem itemLabel="10000" itemValue="10000"></f:selectItem>
<f:selectItem itemLabel="12500" itemValue="12500"></f:selectItem>
<f:selectItem itemLabel="15000" itemValue="15000"></f:selectItem>
<f:selectItem itemLabel="25000" itemValue="25000"></f:selectItem>
<f:selectItem itemLabel="30000" itemValue="30000"></f:selectItem>
<f:selectItem itemLabel="40000" itemValue="40000"></f:selectItem>
<f:selectItem itemLabel="50000" itemValue="50000"></f:selectItem>
</p:selectOneMenu>
</h:panelGrid>
<br />
<h:panelGrid style="position:relative; left:165px" columns="2"
cellpadding="2" cellspacing="2">
<p:commandButton value="Reset"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 13px; font-weight: normal'></p:commandButton>
<p:commandButton value="Submit"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 13px; font-weight: normal'></p:commandButton>
</h:panelGrid>
</p:tab>
<p:tab title="Name">
<h:panelGrid columns="1">
<p:outputLabel id="state" value="State Name"></p:outputLabel>
<p:selectOneMenu id="statemenu" style="width:300px;"
value="#{DropDown.selectedState}">
<f:selectItem itemLabel="Select One"></f:selectItem>
<f:selectItems value="#{DropDown.stateList}"></f:selectItems>
</p:selectOneMenu>
<br></br>
<p:outputLabel value="District"></p:outputLabel>
<p:selectOneMenu id="dist" style="width:300px;"
value="#{DropDown.selectedDistrict}">
<f:selectItem itemLabel="Select One"></f:selectItem>
<f:selectItems value="#{DropDown.districtList}"></f:selectItems>
</p:selectOneMenu>
</h:panelGrid>
<br />
<h:panelGrid columns="2">
<p:outputLabel value="Scale/GSD"></p:outputLabel>
<p:selectOneMenu tabindex="1">
<f:selectItem itemLabel=" --ALL-- " itemValue="all"></f:selectItem>
<f:selectItem itemLabel="5000" itemValue="5000"></f:selectItem>
<f:selectItem itemLabel="6000" itemValue="6000"></f:selectItem>
<f:selectItem itemLabel="8000" itemValue="8000"></f:selectItem>
<f:selectItem itemLabel="10000" itemValue="10000"></f:selectItem>
<f:selectItem itemLabel="12500" itemValue="12500"></f:selectItem>
<f:selectItem itemLabel="15000" itemValue="15000"></f:selectItem>
<f:selectItem itemLabel="25000" itemValue="25000"></f:selectItem>
<f:selectItem itemLabel="30000" itemValue="30000"></f:selectItem>
<f:selectItem itemLabel="40000" itemValue="40000"></f:selectItem>
<f:selectItem itemLabel="50000" itemValue="50000"></f:selectItem>
</p:selectOneMenu>
</h:panelGrid>
<br />
<h:panelGrid style="position:relative; left:165px" columns="2"
cellpadding="2" cellspacing="2">
<p:commandButton value="Reset"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 14px; font-weight: normal'></p:commandButton>
<p:commandButton id="btnSubmit" value="Submit" type="submit"
partialSubmit="true" process="statemenu,dist,#this"
actionListener="#{DropDown.setVisiblity}"
action="#{DropDown.getValues}" title="Submit"
update="#all"
ajax="true"
style='font-family: font-family : Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif; font-size: 14px; font-weight: normal'>
</p:commandButton>
</h:panelGrid>
</p:tab>
<p:tab title="Spec">
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Specification Number :" />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:inputText style="height:20px;width:300px;"></p:inputText>
</h:panelGrid>
<br />
<h:panelGrid columns="2" cellpadding="2" cellspacing="2">
<p:outputLabel value="Scale/GSD " />
<p:outputLabel value="*" style='color:red;' />
</h:panelGrid>
<h:panelGrid>
<p:selectOneMenu tabindex="1" style="height:25px;widht:auto;">
<f:selectItem itemLabel="-- ALL --" itemValue="all"></f:selectItem>
<f:selectItem itemLabel="5000" itemValue="5000"></f:selectItem>
<f:selectItem itemLabel="6000" itemValue="6000"></f:selectItem>
<f:selectItem itemLabel="8000" itemValue="8000"></f:selectItem>
<f:selectItem itemLabel="10000" itemValue="10000"></f:selectItem>
<f:selectItem itemLabel="12500" itemValue="12500"></f:selectItem>
<f:selectItem itemLabel="15000" itemValue="15000"></f:selectItem>
<f:selectItem itemLabel="25000" itemValue="25000"></f:selectItem>
<f:selectItem itemLabel="30000" itemValue="30000"></f:selectItem>
<f:selectItem itemLabel="40000" itemValue="40000"></f:selectItem>
<f:selectItem itemLabel="50000" itemValue="50000"></f:selectItem>
</p:selectOneMenu>
</h:panelGrid>
<br />
<br />
<h:panelGrid style="position:relative; left:165px" columns="2"
cellpadding="2" cellspacing="2">
<p:commandButton value="Reset"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 13px; font-weight: normal'></p:commandButton>
<p:commandButton value="Submit"
style='font-family: font-family : Baskerville, "Baskerville Old Face",
"Hoefler Text", Garamond, "Times New Roman", serif;;
font-size: 13px; font-weight: normal'></p:commandButton>
</h:panelGrid>
</p:tab>
</p:tabView>
<!--The tab to Display the Complete Meta data of the sheet selected -->
<p:tabView id="tabs" scrollable="true" orientation="top"
styleClass="tabs" style="position:absolute; top:240px;">
<p:tab title="Meta Data">
<h:panelGrid id="MapDetails">
<h:panelGrid columns="2" cellpadding="2" cellspacing="5"
style="position:relative;left:5px;top:50px">
<p:outputLabel value="Sheet No : " style="font:serif"></p:outputLabel>
<p:outputLabel value="#{DataTable.selectedSheet.sheet_no}"></p:outputLabel>
<p:outputLabel value="Surveyed year : "></p:outputLabel>
<p:outputLabel value="--"></p:outputLabel>
<p:outputLabel value="Publication Year : "></p:outputLabel>
<p:outputLabel value="--"></p:outputLabel>
<p:outputLabel value="Map Projection: "></p:outputLabel>
<p:outputLabel value="--"></p:outputLabel>
<p:outputLabel value="Map Datum : "></p:outputLabel>
<p:outputLabel value="--"></p:outputLabel>
<p:outputLabel value="Place : "></p:outputLabel>
<p:outputLabel value="--"></p:outputLabel>
</h:panelGrid>
<h:panelGrid>
<h:panelGrid style="position:relative;left:-110px;top:-170px">
<div
style="position: absolute; top: 95px; left: 20px; border-bottom-style: solid; border-bottom-width: thin; border-top-style: solid; border-top-color: #000000; height: 104px; width: 202px; bottom: auto; left: 414px; right: auto; border-bottom-color: #000000; border-top-width: thin"></div>
<div
style="border-left-color: #000000; border-right-color: #000000; border-left-style: dashed; border-right-width: medium; border-right-style: dashed; border-left-width: medium; height: 180px; width: 134px; position: absolute; bottom: auto; left: 450px; right: auto; top: 65px"></div>
</h:panelGrid>
<p:outputLabel title="North East Corner Longitude"
value="#{DataTable.selectedSheet.NE_Corner_Long}"
style="position: absolute; bottom: auto; right: 135px; top:75px"></p:outputLabel>
<p:outputLabel title="North West Corner Longitude"
value="#{DataTable.selectedSheet.NW_Corner_Long}"
style="position: absolute; bottom: auto; right: 275px; top: 75px"></p:outputLabel>
<p:outputLabel title="North East Corner Latitude"
value="#{DataTable.selectedSheet.NE_Corner_Lat}"
style="position: absolute; bottom: auto; right: 82px; top: 123px"></p:outputLabel>
<p:outputLabel title="South East Corner Latitude"
value="#{DataTable.selectedSheet.SE_Corner_Lat}"
style="position: absolute; bottom: auto; right: 82px; top: 228px"></p:outputLabel>
<p:outputLabel title="North West Corner Latitude"
value="#{DataTable.selectedSheet.NW_Corner_Lat}"
style="position: absolute; bottom: auto; right: 330px; top: 123px"></p:outputLabel>
<p:outputLabel title="South West Corner Latitude"
value="#{DataTable.selectedSheet.SW_Corner_Lat}"
style="position: absolute; bottom: auto; right: 330px; top: 228px"></p:outputLabel>
<p:outputLabel title="South East Corner Longitude"
value="#{DataTable.selectedSheet.SE_Corner_Long}"
style="position: absolute; bottom: auto; right: 135px; top: 290px"></p:outputLabel>
<p:outputLabel title="Sorth West Corner Longitude"
value="#{DataTable.selectedSheet.SW_Corner_Long}"
style="position: absolute; bottom: auto; right: 275px; top: 290px"></p:outputLabel>
<h:panelGrid columns="2" cellpadding="3" cellspacing="5"
style="postion:absolute;margin-left:300px;margin-top:85px">
<p:outputLabel value="State : "></p:outputLabel>
<p:outputLabel value="#{DataTable.selectedSheet.state_cd}"></p:outputLabel>
<p:outputLabel value="District : "></p:outputLabel>
<p:outputLabel value="#{DataTable.selectedSheet.district_cd}"></p:outputLabel>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
</p:tab>
</p:tabView>
<h:panelGrid id="render" style="margin-top:200px;">
<!-- The Datatable -->
<p:dataTable id="disptable" value="#{DataTable.dataTable}"
var="table" lazy="true" rowKey="#{table.sheet_no}"
selectionMode="single" selection="#{DataTable.selectedSheet}"
scrollable="true" scrollHeight="115" rendered="#{DataTable.loaded}"
style="widht:auto ; margin-left:420px;margin-right:30px ;box-shadow: 10px 10px 25px #888888;"
widgetVar="tabl" emptyMessage="No Records to display.">
<p:column headerText="Sheet Number" style="width:25%">
<h:outputLabel value="#{table.sheet_no}"></h:outputLabel>
</p:column>
<p:column headerText="State" style="width:25%">
<h:outputLabel value="#{table.state_cd}"></h:outputLabel>
</p:column>
<p:column headerText="District" style="width:25%">
<h:outputLabel value="#{table.district_cd}"></h:outputLabel>
</p:column>
<f:facet name="footer">
<p:commandButton id="selectButton" title="Show Complete Details"
icon="./images/show.png" update=":form:disp"
oncomplete="PF('Dialog').show()" process="#this,disptable"
style="height:25px;" ajax="true" iconPos="center" />
<p:commandButton style="height:25px;" id="addCart"
title="Add to Cart" icon="./images/cart.png" global="false" />
<p:commandButton style="height:25px;" id="location"
update=":form:tabs:MapDetails" process="#this,disptable"
title="Show Co-ordinates" icon="./images/cart.png" global="false" />
</f:facet>
</p:dataTable>
<!--The Dialog to display the selected sheet detials -->
<p:dialog header="Detail" widgetVar="Dialog" resizable="false"
id="carDlg" modal="true">
<h:panelGrid id="disp" columns="2" cellpadding="4" cellspacing="4"
style="margin:0 auto;">
<f:facet name="header">
</f:facet>
<h:outputText id="sheet" value="Sheet No:" />
<h:outputText value="#{DataTable.selectedSheet.sheet_no}"
style="font-weight:bold" />
<h:outputText id="state" value="State:" />
<h:outputText value="#{DataTable.selectedSheet.state_cd}"
style="font-weight:bold" />
<h:outputText id="district" value="District:" />
<h:outputText value="#{DataTable.selectedSheet.district_cd}"
style="font-weight:bold" />
</h:panelGrid>
</p:dialog>
<!-- Panel Grid which display the Filter text -->
<h:panelGrid id="filter" columns="1" cellpadding="10" cellspacing="2"
rendered="#{DataTable.filter}"
style="position:absolute;bottom:15px;right:80px;border: 1px solid #1f497d;box-shadow: 10px 10px 25px #888888;
height:auto;width:600px;Text-align:center;">
<p:outputLabel value="Filter your search to get result."></p:outputLabel>
</h:panelGrid>
</h:panelGrid>
<!-- Ajax Status for ajax request -->
<p:ajaxStatus onstart="PF('statusDialog').show();"
onsuccess="PF('statusDialog').hide();" />
<!-- Dialog for ajax Status -->
<p:dialog modal="true" widgetVar="statusDialog" draggable="false"
closable="false" maximizable="false" resizable="false"
header="Searching">
<p:graphicImage value="/images/loading.gif" />
</p:dialog>
</h:form>
</body>
</html>
you are missing update="distTable" in commandButton
<p:commandButton id="btnSubmit" value="Submit"
partialSubmit="true" process="statemenu,dist,#this"
actionListener="#{MenuBean.setVisiblity}"
action="#{MenuBean.getValues}"
title="Submit"
style='font-family: font-family : Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif; font-size: 14px; font-weight: normal'
update="distTable">
</p:commandButton>
that page is a terrible mess. even eclipse refuse to format its content...
multiple suggestions:
put your css, js, images inside /resources/js, /resources/css folders
use <h:outputStylesheet name="css/menustyles.css" /> instead of <link href="./css/menustyles.css" rel="stylesheet" type="text/css" />
use <h:body> instead of <body>
do not use <f:event type="preRenderView" listener="#{DataTable.init}" /> if DataTable is a #ManagedBean, use #PostConstruct instead
prefer conventional names: #{dataTableBean.init} is better than #{DataTable.init}
use <h:graphicImage name="images/img.gif" /> instead of <img src="images\img.gif" />
use / instead of \ in paths
put <p:growl> as direct child of <h:body> or <h:form>
USE CSS CLASSES!!
it's nearly impossible to debug a page coded that way.
i'm sorry, but i give up.

command button doesn't work in dialog

I have a map layout with markers in my jsf page. When I click on a marker I can retrieve all info about that point through my database. As I click on a marker a dialog is shown up. Here is my layout unit:
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<p:growl id="growl" showDetail="true"/>
<p:gmap center="41.067445,29.047749" zoom="11" type="HYBRID" model="#{mapTrial.simpleModel}" style="width:100%;height:100%" streetView="true">
<p:ajax event="overlaySelect" listener="#{mapTrial.onMarkerSelect}" update="growl" partialSubmit="true" immediate="true"/>
<p:gmapInfoWindow rendered="true">
<h:form id="form">
<p:tabView id="tabView" dynamic="false" cache="true" orientation="top" effect="blind" style="font-size: 10px;font-weight: bold;">
<p:tab id="tab1" title="Proje Bilgileri">
<h:panelGrid columns="2" cellpadding="3">
<h:outputText value="Proje Adı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.projectName}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Proje Detayı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.projectExp}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Proje Koordinatları: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.projectCoordLat}, #{mapTrial.projectCoordLong}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İlçe: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.district}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Sektör: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.sector}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İş Durumu: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.workStatus}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Sorumlu Müd. Yard.: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.assistant}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İhale Adı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.bidName}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Firma: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.company}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İhale Bedeli: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.bidCost}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Ödenen Hak Ediş Tutarı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.costPaid}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="SÜRE BİLGİSİ" style="font-weight: bold; font-size: 13px; float: right; font-style: italic"/><p:separator />
<h:outputText value="Başlangıç Tarihi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.startDate}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İşin Süresi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.processTime}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Bitiş Tarihi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.endDate}" style="font-weight: bold; font-size: 13px;"/>
</h:panelGrid>
</p:tab>
<p:tab id="tab2" title="Teknik Bilgiler">
<h:panelGrid columns="2" cellpadding="3">
<h:outputText value="Ada/Parsel: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.parcel}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Plan Durumu: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.planStatus}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Yolun Genişliği: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.roadWidth}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Yolun Uzunluğu: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.roadLength}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Toplam Alan: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.totalArea}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İlave Bilgi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.extraInfo}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Teklif Birim Fiyat: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.unitOffer}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Yapım Yaklaşık Maliyeti: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.approxCost}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Proje Maliyeti: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.projectCost}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Dosya Kodu: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.fileNu}" style="font-weight: bold; font-size: 13px;"/>
</h:panelGrid>
</p:tab>
<p:tab id="tab3" title="Proje Teşkilatı">
<h:panelGrid columns="2" cellpadding="3">
<h:outputText value="Şef: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.chef}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Mimar: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.arch}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İnşaat Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.strEng}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Peyzaj Mimarı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.landArch}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Elektrik Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.elecEng}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Jeoloji Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.geoEng}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Makine Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.machEng}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Harita Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.mapEng}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Şehir Plancısı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.planEng}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İHALE ÖNCESİ TAKİP" style="font-weight: bold; font-size: 13px; float: right; font-style: italic"/><p:separator />
<h:outputText value="Sorumlu Müd. Yard.: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.assistantBefore}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Sorumlu Müh./Mimar: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.engArch}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="UYGULAMACI KONTROL TEŞKİLATI" style="font-weight: bold; font-size: 13px; float: right; font-style: italic"/><p:separator />
<h:outputText value="Müdür Yard.: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.mudYard}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Mimar: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.mim}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="İnşaat Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.ins}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Peyzaj Mimarı: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.peyz}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Elektrik Mühendisi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.elek}" style="font-weight: bold; font-size: 13px;"/>
</h:panelGrid>
</p:tab>
<p:tab id="tab4" title="Firma Bilgisi">
<h:panelGrid columns="2" cellpadding="3">
<h:outputText value="Yetkili Kişi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.compResp}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Görevi: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.compResJob}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Telefon: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.compTel}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="Adres: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.compAddress}" style="font-weight: bold; font-size: 13px;"/>
<h:outputText value="E-Posta: " style="font-size: 13px;"/>
<h:outputText value="#{mapTrial.compMail}" style="font-weight: bold; font-size: 13px;"/>
</h:panelGrid>
</p:tab>
<p:tab title="Yorumlar">
<p:commandButton value="Yorum Ekle" id="addCom" onclick="comDialog.show();" style="font-size: 11px;font-weight: bold;">
<p:dialog header="Yorum Ekle" widgetVar="comDialog" resizable="true" showEffect="explode" hideEffect="explode" appendToBody="true" modal="true" closable="true">
<p:inputTextarea rows="6" cols="33" />
<br />
<p:commandButton value="Ekle" action="#{mapTrial.saveComm}" immediate="true" style="font-size: 12px;font-weight: bold;"/>
<p:commandButton value="Vazgeç" async="true" onclick="comDialog.hide();" style="font-size: 12px;font-weight: bold;"/>
</p:dialog>
</p:commandButton>
</p:tab>
<p:tab title="Dosyalar">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/images/pdf.png" />
<h:outputText value=""/>
</h:panelGrid>
</p:tab>
<p:tab title="Resimler">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/images/pdf.png" />
<h:outputText value=""/>
</h:panelGrid>
</p:tab>
</p:tabView>
<br />
<center>
<h:outputText value="Toplam Proje Sayısı: #{mapTrial.total}" style="font-size: 13px; color: red"/>
</center>
</h:form>
</p:gmapInfoWindow>
</p:gmap>
</p:layoutUnit>
My problem here is with that part:
<p:tab title="Yorumlar">
<p:commandButton value="Add Comment" id="addCom" onclick="comDialog.show();" style="font-size: 11px;font-weight: bold;">
<p:dialog header="Add Comment" widgetVar="comDialog" resizable="true" showEffect="explode" hideEffect="explode" appendToBody="true" modal="true" closable="true">
<p:inputTextarea rows="6" cols="33" />
<br />
<p:commandButton value="Add" action="#{mapTrial.saveComm}" immediate="true" style="font-size: 12px;font-weight: bold;"/>
<p:commandButton value="Cancel" async="true" onclick="comDialog.hide();" style="font-size: 12px;font-weight: bold;"/>
</p:dialog>
</p:commandButton>
</p:tab>
When I open the tab and click on the button it shows the add comment dialog. But as dialog is shown and the add button is clicked, simply nothing happens. I tried it with removing appendToBody and model attributes but that time it doesn't show comment dialog even.
How can I achieve this?
Move the <p:dialog> outside the <h:form> and add a <h:form> inside it.
<h:form>
<!-- JSF code... -->
<p:tab>
<!-- more JSF code... -->
<!-- the button that gives you problems -->
<!-- the p:dialog doesn't go inside the button =\ -->
<p:commandButton value="Add Comment" id="addCom" onclick="comDialog.show();"
style="font-size: 11px;font-weight: bold;">
</p:commandButton>
</p:tab>
<!-- more and more JSF code... -->
<h:form>
<!-- the dialog goes here -->
<p:dialog header="Add Comment" widgetVar="comDialog" resizable="true"
showEffect="explode" hideEffect="explode" appendToBody="true" modal="true"
closable="true">
<!--the p:dialog must have its own h:form -->
<h:form>
<p:inputTextarea rows="6" cols="33" />
<br />
<p:commandButton value="Add" action="#{mapTrial.saveComm}" immediate="true"
style="font-size: 12px;font-weight: bold;"/>
<p:commandButton value="Cancel" async="true" onclick="comDialog.hide();"
style="font-size: 12px;font-weight: bold;"/>
</h:form>
</p:dialog>
Next time, please don't post a code wall, instead provide a SSCCE in order to analyze your problem. We don't need to read all the code in order to find the problem.

validating dynamic textbox2 based on entered value in textbox1 in rich table

I am creating components dynamically using rich:dataTable and the components in each row are checkbox, text1, text2. I am able to create/delete rows. I added validators for text1 and text2.
I need to validate text2 based on chars enetered in text1. Suppose in text1 component if 3 is entered then in text2 component I need to allow max 3 chars. And this need to be done for all the dynamically generated rows for the entire table.
<rich:dataTable id ="outtable" value="#{bean.Items}" var="row">
<rich:column>
<f:facet name="header">
<h:outputText id="selectrow" value="select" style="font-weight: bold; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;" />
</f:facet>
<h:selectBooleanCheckbox value="#{row.selected}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText size="15" value="Bean Value"
style="font-weight: bold; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;"/>
</f:facet>
<s:decorate id="valueDecoration" template="layout/edit.xhtml">
<h:inputText size="8" maxlength="4" value="#{row.beanValue}" required="true" >
<f:validator validatorId="beanValueValidator"/>
<s:validate/>
<a:support event="onblur" reRender="valueDecoration" bypassUpdates="false" ajaxSingle="true"/>
</h:inputText>
</s:decorate>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Bean Data"
style="font-weight: bold; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;"/>
</f:facet>
<s:decorate id="dataDecoration" template="layout/edit.xhtml">
<h:inputText size="30" maxlength="40" value="#{row.beanData}" required="true">
<f:validator validatorId="beanDataValidator"/>
<s:validate/>
<a:support event="onblur" reRender="dataDecoration" bypassUpdates="false" ajaxSingle="true" />
</h:inputText>
</s:decorate>
</rich:column>
<f:facet name="footer">
<h:panelGroup>
<h:commandButton value="Add Row" action="#{bean.add}" />
<h:commandButton value="Delete Selected" action="#{bean.remove}" />
</h:panelGroup>
</f:facet>
</rich:dataTable>
How can I achieve this?
Give richfaces 3.3 Graph Validator (4.x) a try.

Resources