i m trying to update a panelgrid form selectOneRadio within a dialog.
Every time i chose on of the two options the whole panelGrid collapse and a NPE is thorw without any details.
My Sourcecode:
<h:form id="form_tmpVst">
<p:dialog id="dialog_tmpVst" header="Temporäre Verkaufsstelle" widgetVar="dialog_tmpVst" modal="true" resizable="false" showEffect="clip">
<p:selectOneRadio id="radio_placeOnMap" value="#{mapBean.placedByAddress}" layout="custom">
<f:selectItem itemLabel="Karte" itemValue="#{false}" />
<f:selectItem itemLabel="Adresse" itemValue="#{true}" />
<p:ajax update="panel_tmpVst" />
<!-- <p:ajax #process="#this" update="#this panelTempVst" /> -->
</p:selectOneRadio>
<p:panelGrid id="panel_tmpVst">
<p:row>
<p:column colspan="2">
<p:outputLabel value="Platzierung: " />
</p:column>
</p:row>
<p:row>
<p:column>
<p:radioButton id="radio_tmpVstPlaceByAddress" for="radio_placeOnMap" itemIndex="0" />
<p:outputLabel value="Karte" for="radio_tmpVstPlaceByAddress" />
</p:column>
</p:row>
<p:row>
<p:column>
<p:radioButton id="radio_tmpVstPlaceByMap" for="radio_placeOnMap" itemIndex="1" />
<p:outputLabel value="Adresse" for="radio_tmpVstPlaceByMap" />
</p:column>
<p:column>
<p:inputTextarea id="txtarea_address" rows="5" cols="30" counter="txtarea_counter" maxlength="200" counterTemplate="{0} Zeichen übrig."
autoResize="false" value="test data __öäüöäöüöäö" required="#{mapBean.placedByAddress}" disabled=" #{!mapBean.placedByAddress}"
style="resize: none;" />
<br />
<h:outputText id="txtarea_counter" style="font-size: .5em;" />
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel value="Name:" for="txt_tmpname" />
</p:column>
<p:column>
<p:inputText id="txt_tmpname" value="#{mapBean.tmpVstName}" required="true" />
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel value="BST:" for="txt_bsttmp" />
</p:column>
<p:column>
<p:inputText id="txt_bsttmp" value="#{mapBean.tmpDistrict}" required="true" />
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel value="VST:" for="txt_vsttmp" />
</p:column>
<p:column>
<p:inputText id="txt_vsttmp" value="#{mapBean.tmpVstNumber}" required="true" />
</p:column>
</p:row>
</p:panelGrid>
<br />
<p:commandButton value="Hinzufügen" id="btn_addTmpVst" action="#{mapBean.addTempVst()}" type="submit" ajax="true"
update=":dataTableForm:markerListDataTable, :mapForm:map, :growl" oncomplete="PF('dialog_tmpVst').hide();" />
</p:dialog>
</h:form>
Before:
After radio-button klick:
Many Thanks in advence
This is normal, basiclly you're updating the h:panelGrid which contains the p:radioButtons without a notice to the owner (p:selectOneRadio).
To solve this update the p:selectOneRadio alongside the h:panelGrid, that way the rendering would work as expected:
<p:ajax update="panel_tmpVst radio_placeOnMap" />
Related
is it possible to keep the behaviour more stable?
what I have:
an Tree table with 3 columns, first has collapsed stuff in it
if I open one and close it, then click on sort
it is open after that
what I would like to have:
keep it closed if it was closed before sort
<h:form id="form">
<p:treeTable value="#{ttBasicView.root}" var="document">
<f:facet name="header">
FritzBox Smart Home Daten
</f:facet>
<p:column headerText="Name" >
<h:outputText value="#{document.name}" />
</p:column>
<p:column headerText="Gesamtverbrauch (in kWh)" sortBy="#{document.gesamtverbrauch}" actionListener="#{BasicView.expandAll}">
<h:outputText value="#{document.gesamtverbrauch}" />
</p:column>
<p:column headerText="aktuelle Temperatur" sortBy="#{document.akttemperatur}">
<h:outputText value="#{document.akttemperatur}" />
</p:column>
<p:column style="width:24px">
<p:commandLink update=":form:documentPanel" oncomplete="PF('documentDialog').show()" title="View Detail" styleClass="ui-icon ui-icon-search">
<f:setPropertyActionListener value="#{document}" target="#{ttBasicView.selectedDocument}" />
</p:commandLink>
</p:column>
</p:treeTable>
<p:dialog id="dialog" header="Document Detail" showEffect="fade" widgetVar="documentDialog" modal="true" resizable="false">
<p:outputPanel id="documentPanel">
<p:panelGrid columns="2" columnClasses="label,value" rendered="#{not empty ttBasicView.selectedDocument}">
<h:outputLabel for="name" value="Name: " />
<h:outputText id="name" value="#{ttBasicView.selectedDocument.name}" style="font-weight:bold" />
<h:outputLabel for="gesamtverbrauch" value="Gesamtverbrauch: " />
<h:outputText id="gesamtverbrauch" value="#{ttBasicView.selectedDocument.gesamtverbrauch}" style="font-weight:bold" />
<h:outputLabel for="akttemperatur" value="aktuelle Temperatur: " />
<h:outputText id="akttemperatur" value="#{ttBasicView.selectedDocument.akttemperatur}" style="font-weight:bold" />
</p:panelGrid>
</p:outputPanel>
</p:dialog>
</h:form>
That was my problem too.
Try it in your treeTable :
<p:ajax event="collapse"
onstart="handleLoadingStarted()"
oncomplete="handleLoadingStopped()" />
I'm have a submit form and would like to display a row where they enter a birthdate if the relationship selected is a son or daughter.
I finally got things to work but it feels clunky and verbose with the use <p:row> Plus I couldn't get the update to work unless I used #form which then required the extra <p:ajax> on first/last name textinputs since their values would disappear if entered before a selection in the drop down was made.
This works but seems verbose
<h:form id="form2">
<p:panel header="Add a Non-Member">
<p:panelGrid>
<p:row>
<p:column>
<h:outputLabel for="fname" value="First Name: " />
</p:column>
<p:column>
<p:inputText id="fname" required="true"
value="#{memberManager.newNonMember.first_name}" >
<p:ajax update="#form" />
</p:inputText>
</p:column>
<p:column>
<p:message for="fname"></p:message>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel for="lname" value="Last Name: " />
</p:column>
<p:column>
<p:inputText id="lname" required="true"
value="#{memberManager.newNonMember.last_name}" >
<p:ajax update="#form" />
</p:inputText>
</p:column>
<p:column>
<p:message for="lname"></p:message>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputText value="Relationship: " />
</p:column>
<p:column>
<p:selectOneMenu id="relationship" value="#{memberManager.newNonMember.type}" required="True"
requiredMessage="Relationship is required for non-member">
<f:selectItem itemLabel="Select One" itemValue="#{null}" noSelectionOption="true" />
<f:selectItems value="#{memberManager.relationTypes}" var="type" itemValue="#{type}" itemLabel="#{type.label}" />
<p:ajax update="#form" />
</p:selectOneMenu>
</p:column>
<p:column>
<p:message for="relationship" />
</p:column>
</p:row>
<p:row id="birthrow">
<p:column>
<h:outputLabel for="nm_birth_date" value="#{memberManager.newNonMember.type.label}'s Birthdate: "
rendered="#{memberManager.newNonMember.type.label == 'Son'|| memberManager.newNonMember.type.label == 'Daughter'}" />
</p:column>
<p:column>
<p:calendar id="nm_birth_date" showOn="button" navigator="true" value="#{memberManager.newNonMember.birth_date}"
rendered="#{memberManager.newNonMember.type.label == 'Son'|| memberManager.newNonMember.type.label == 'Daughter'}"
required="#{memberManager.newNonMember.type.label == 'Son'|| memberManager.newNonMember.type.label == 'Daughter'}"
pattern="MM/dd/yyyy" mask="true"
requiredMessage="Your #{memberManager.newNonMember.type.label}'s Birthdate is required" />
</p:column>
<p:column>
<p:message for="nm_birth_date"></p:message>
</p:column>
</p:row>
</p:panelGrid>
<br />
<p:commandButton value="Add" action="#{memberManager.addAction}" ajax="false" />
</p:panel>
</h:form>
When I kept the panelGrid but used update="birthrow" on just the selectOneMenu ajax and removed the inputText ajax the birthdate row didn't update as expected, including after form was submitted with errors (ie last name required, then the ajax update stopped working)
Originally I wasn't using p:row or p:column but instead the columns attribute on the panel grid. But based on this How to rendered <p:selectOneMenu> by BalusC I knew I needed a wrapper component which is why I went the p:row route.
But is there a cleaner way to not use all the p:rows and extra ajax on the text inputs?
You could just have wrapped individual cells in a <h:panelGroup> without the need for all that <p:row><p:column> verbosity.
<h:panelGroup id="birthdateLabel">
<h:outputLabel ... />
</h:panelGroup>
<h:panelGroup id="birthdateInput">
<p:calendar ... />
</h:panelGroup>
<p:message ... />
To update them, just use update="birthdateLabel birthdateInput".
I have a form with two p: commandbutton to user request system, both buttons perform the same action, because it has a p: accordeonpanel both buttons the user requested to post the information from the beginning or end of the page . The first button is properly validating the two components I am indicating, but the second button at the bottom of the page to do so is what makes me clean fields and p: selectOneMenu, as if making a "reset". Any idea of the problem? Here is the code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template=" ./../../../WEB-INF/templates/main_template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<ui:define name="left">
<ui:include src="#{bundle.LeftMenuSite}">
</ui:include>
</ui:define>
<ui:define name="content_altern">
<h3>#{bundle.SitSrtInfoTitle}</h3>
<h:form id="gralForm" prependId="false">
<p:commandButton ajax="true" style="float:right;" id="insertDataSRT0" process="#this,accPanel:mainInfoRF,accPanel:panelGridMap" update="accPanel:mainInfoRF accPanel:panelGridMap" action="#{sitSrtInfoController.create}" value="#{bundle.SendData}" icon="ui-icon ui-icon-disk"/>
<br/><br/>
<p:accordionPanel activeIndex="1" multiple="true" id="accPanel">
<p:tab title="#{bundle.AccTabSrtList}" id="tabSRTList">
<ui:include src="/admin/sites/sitSrtInfo/List.xhtml"/>
</p:tab>
<p:tab title="#{bundle.AccTabSrtInfo}" id="tabInfo">
<p:messages globalOnly="true" ></p:messages>
<p:panelGrid id="panelGridMap" columns="4">
<h:outputLabel value="#{bundle.SitSrtInfoLabel_siteId}" />
<p:inputText id="siteId" value="#{sRTGMapController.srtgMap.srtCode}" required="true" />
<h:outputLabel value="#{bundle.SitSrtInfoLabel_latitude}" style="text-align: right" />
<p:inputText id="latitude" value="#{sRTGMapController.srtgMap.latitude}" required="true" style="width:100px" />
<h:outputLabel value="#{bundle.SitSrtInfoLabel_longitude}" style="width:50px" />
<p:inputText id="longitude" value="#{sRTGMapController.srtgMap.longitude}" required="true" style="width:100px" />
<h:outputLabel value="#{bundle.SitSrtInfoLabel_srRadius}" />
<p:inputText id="srRadius" value="#{sRTGMapController.srtgMap.radius}" required="true" />
<h:outputLabel value=" " style="width:50px" />
<h:outputLabel value=" " style="width:50px" />
<p:commandButton process="panelGridMap" value="#{bundle.ViewPosition}" oncomplete="if (!args.validationFailed) dlg.show()" action="#{sRTGMapController.createModel}" update="dlg panelGridMap" icon="ui-icon-pin-s" />
</p:panelGrid>
<p:dialog id="dlg" widgetVar="dlg" modal="false" styleClass="div-left" >
<p:gmap id="myMap" center="#{sRTGMapController.center}" fitBounds="false" zoom="18" type="HYBRID"
styleClass="viewGMap" model="#{sRTGMapController.circleModel}" />
</p:dialog>
<p:panelGrid id="mainInfoRF">
<p:row>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_dateReq}" /></p:column>
<p:column>
<p:calendar id="dateReq" value="#{sitSrtInfoController.selected.dateReq}" navigator="true" required="true" readonlyInput="true" >
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:calendar>
</p:column>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_priority}" />
</p:column>
<p:column>
<p:selectOneMenu id="priority" value="#{sitSrtInfoController.selected.priority}" required="true" >
<f:selectItems value="#{staticCatsController.priority.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}"/>
</p:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_typeSite}" />
</p:column>
<p:column>
<p:selectOneMenu id="typeSite" value="#{sitSrtInfoController.selected.typeSite}" required="true" >
<f:selectItems value="#{staticCatsController.typeSite.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}"/>
</p:selectOneMenu>
</p:column>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_region}" />
</p:column>
<p:column>
<p:selectOneMenu id="region" value="#{sitSrtInfoController.selected.region}" required="true" >
<f:selectItems value="#{staticCatsController.region.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}"/>
</p:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_cluster}" />
</p:column>
<p:column>
<p:inputText id="cluster" value="#{sitSrtInfoController.selected.cluster}" required="true" />
</p:column>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_year}"/>
</p:column>
<p:column>
<p:inputText id="year" value="#{sitSrtInfoController.selected.year}" required="true" />
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="#{bundle.SitSrtInfoLabel_srVersion}" /></p:column>
<p:column> <p:inputText id="srVersion" value="#{sitSrtInfoController.selected.srVersion}" required="true" /></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_datum}" /></p:column>
<p:column> <p:selectOneMenu id="datum" value="#{sitSrtInfoController.selected.datum}" required="true" >
<f:selectItems value="#{staticCatsController.datum.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}"/>
</p:selectOneMenu></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_morphology}"/> </p:column>
<p:column><p:selectOneMenu id="morphology" value="#{sitSrtInfoController.selected.morphology}" required="true" >
<f:selectItems value="#{staticCatsController.morphology.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}"/>
</p:selectOneMenu></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_colDesign}" /></p:column>
<p:column> <p:selectBooleanCheckbox id="colDesign" value="#{sitSrtInfoController.selected.colDesign}" required="true" /></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_ownerId}" /></p:column>
<p:column> <p:selectOneMenu id="ownerId" value="#{sitSrtInfoController.selected.ownerId}" required="true" >
<f:selectItems value="#{staticCatsController.owner.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}"/>
</p:selectOneMenu></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_oveDesign}" /></p:column>
<p:column> <p:selectBooleanCheckbox id="oveDesign" value="#{sitSrtInfoController.selected.oveDesign}" required="true" /></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_existSiteIdCms}" /></p:column>
<p:column> <p:selectBooleanCheckbox id="existSiteIdCms" value="#{sitSrtInfoController.selected.existSiteIdCms}" required="true" /></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_existSiteName}" /></p:column>
<p:column> <p:inputText id="existSiteName" value="#{sitSrtInfoController.selected.existSiteName}" required="true" /></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_hubSite}" /></p:column>
<p:column> <p:selectBooleanCheckbox id="hubSite" value="#{sitSrtInfoController.selected.hubSite}" required="true" /></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_fiberMw}" /></p:column>
<p:column> <p:selectOneMenu id="fiberMw" value="#{sitSrtInfoController.selected.fiberMw}" required="true" >
<f:selectItems value="#{staticCatsController.fiberMW.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}" />
</p:selectOneMenu></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_mwRepeater}" /></p:column>
<p:column> <p:selectBooleanCheckbox id="mwRepeater" value="#{sitSrtInfoController.selected.mwRepeater}" required="true" /></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_generatedBy}" /></p:column>
<p:column> <p:inputText id="generatedBy" value="#{sitSrtInfoController.selected.generatedBy}" required="true" /></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_receivedBy}" /></p:column>
<p:column> <p:inputText id="receivedBy" value="#{sitSrtInfoController.selected.receivedBy}" required="true" /></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_statusReg}" /></p:column>
<p:column> <p:selectBooleanCheckbox id="statusReg" value="#{secCompaniesController.selected.statusReg}" required="true" /></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_country}" /></p:column>
<p:column> <p:selectOneMenu id="countryId" value="#{geoCitiesController.countrySelected}" required="true" >
<f:selectItems value="#{geoCountriesController.itemsAvailableSelectOne}"/>
<p:ajax listener="#{geoCitiesController.statesByCountryId}" update="stateId" />
</p:selectOneMenu></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_state}" /></p:column>
<p:column> <p:selectOneMenu id="stateId" value="#{geoCitiesController.stateSelected}" required="true" >
<f:selectItem itemLabel="#{bundle.SelectState}" itemValue=""/>
<f:selectItems value="#{geoCitiesController.statesAvailable}"/>
<p:ajax listener="#{geoCitiesController.citiesByStateId()}" update="cityId" />
</p:selectOneMenu></p:column>
</p:row>
<p:row>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_city}" /></p:column>
<p:column> <p:selectOneMenu id="cityId" value="#{sitSrtInfoController.selected.city}" required="true" >
<f:selectItem itemLabel="#{bundle.SelectCity}" itemValue=""/>
<f:selectItems value="#{geoCitiesController.citiesAvailable}"/>
</p:selectOneMenu></p:column>
<p:column> <h:outputLabel value="#{bundle.SitSrtInfoLabel_market}"/></p:column>
<p:column> <p:selectOneMenu id="market" value="#{sitSrtInfoController.selected.market}" required="true" >
<f:selectItems value="#{geoMarketsController.itemsAvailableSelectOne}"/>
</p:selectOneMenu></p:column>
</p:row>
<p:row>
<p:column colspan="1">
<h:outputLabel value="#{bundle.SitSrtInfoLabel_comments}" />
</p:column>
<p:column colspan="3">
<p:inputTextarea value="#{sitSrtInfoController.selected.comments}" id="comments" rows="6" cols="45" maxlength="400" autoResize="false" required="true"/>
</p:column>
</p:row>
</p:panelGrid>
<br/>
</p:tab>
<p:tab title="#{bundle.AccTabSrtRF}" id="tabRFSRT">
<ui:include src="/admin/sites/sitSrtRf/Create.xhtml"/>
</p:tab>
<p:tab title="#{bundle.AccTabSrtTrans}" id="tabTransSRT">
<ui:include src="/admin/sites/sitSrtTrans/Create.xhtml"/>
</p:tab>
</p:accordionPanel>
<br/><br/>
<p:commandButton ajax="true" style="float:right;" id="insertDataSRT1" process="#this,accPanel:mainInfoRF,accPanel:panelGridMap" update="accPanel:panelGridMap accPanel:mainInfoRF" action="#{sitSrtInfoController.create}" value="#{bundle.SendData}" icon="ui-icon ui-icon-disk"/>
</h:form>
</ui:define>
<ui:define name="content_middle">
</ui:define>
If I understand correctly, you want the reset button, reset does everything.
So if I understand well enough that you do the reset button that calls a bean where it reset all the pulsed variable after this does the update of the #form
Hi i have a command link so when click it i action="#{projectAdminisrationMB.showGroups(userObj)}" a fieldset will be rendred <p:fieldset legend="Manage User Groups" id="manageUserGroupsFS" rendered="#{projectAdminisrationMB.manageUserGroupsFSFlag}">
when the fieldset was in the same <ui:define name="body"> everything works but when i put it in a separated ui:define it will not be rendered.
Here's the code :
<ui:define name="body">
<h:form id="manageProjeUFform">
<div class="right">
<p:growl id="growl" showDetail="true" sticky="true" />
<br/><br/><br/><br/>
<h:panelGrid columns="2" cellpadding="10">
<p:column>
<p:fieldset legend=" Users ">
<h:panelGrid columns="2" cellpadding="10">
<p:dataTable border="1" value="#{projectAdminisrationMB.projectUsersList}"
id="projectUserDt"
var="userObj"
rowKey="#{userObj.name}"
selection="#{projectAdminisrationMB.selectedExistingProjectUser}"
selectionMode="single"
rowIndexVar="rowIndex"
binding="#{table1}">
<p:column id="column1">
<f:facet name="header">
<h:outputText value="Login"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.name}"/>
</p:column>
<p:column id="column2">
<f:facet name="header">
<h:outputText value="Entire Name"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.lastName}"></h:outputText>
<h:outputText value="#{userObj.firstName}"></h:outputText>
</p:column>
<p:column id="column5">
<f:facet name="header">
<h:outputText value="Groups"></h:outputText>
</f:facet>
<p:commandLink id="manageUG" title="Manage User Groups" style="margin-right:5px" update=":rightContentform:manageUserGroupsFS" action="#{projectAdminisrationMB.showGroups(userObj)}" ajax="true">
<h:graphicImage value="../images/cssImg/manage-groups-icon.png" />
<f:setPropertyActionListener target="#{projectAdminisrationMB.selectedUserRow}" value="#{userObj}" />
<f:setPropertyActionListener target="#{projectAdminisrationMB.selectedUserRow.dbRowIndex}" value="#{table.rowIndex}" />
</p:commandLink>
</p:column>
<f:facet name="footer">
<p:commandButton id="addProjectUserdlg" value=" Add " onclick="dlg1.show()" />
<p:commandButton id="deleteProjectUserdlg" value=" Delete " onclick="confirmation.show()"/>
</f:facet>
</p:dataTable>
</h:panelGrid>
</p:fieldset>
</div>
</h:form>
</ui:define>
<h:panelGrid columns="3">
<h:panelGrid id="display" header="User Detail" columns="2" cellpadding="4">
<f:facet name="header">
<p:graphicImage value="/images/users/user.png"/>
</f:facet>
<h:outputText value="Login:" />
<h:outputText value="#{projectAdminisrationMB.selectedUserRow.lastName}" />
<h:outputText value="Name:" />
<h:outputText value="#{projectAdminisrationMB.selectedUserRow.lastName}" />
<h:outputText value="First Name:" />
<h:outputText value="#{projectAdminisrationMB.selectedUserRow.firstName}" />
<h:outputText value="Email:" />
<h:outputText value="#{projectAdminisrationMB.selectedUserRow.email}" />
<h:outputText value="Phone:" />
<h:outputText value="#{projectAdminisrationMB.selectedUserRow.phoneNumber}" />
</h:panelGrid>
<p:pickList id="pickList" value="#{projectAdminisrationMB.selectedUserGroups}" var="group"
itemLabel="#{group}" itemValue="#{group}" converter="groupConverter" >
<f:facet name="sourceCaption">Belong To</f:facet>
<f:facet name="targetCaption">Exclude From</f:facet>
<p:column style="width:25%">
<p:graphicImage value="/images/group/#{group.name}.gif" />
</p:column>
<p:column style="width:75%;">
#{group.name}
</p:column>
<p:ajax event="transfer" listener="#{projectAdminisrationMB.onTransferGroup}" update=":manageProjeUFform:growl" />
</p:pickList>
<p:commandButton id="saveGroupsBtn" value="Save" update=":manageProjeUFform:growl" actionListener="#{projectAdminisrationMB.saveUserGroupsModif}"/>
</h:panelGrid>
</p:fieldset>
</h:form>
</ui:define>
Any help will be appreciated .
here's the solution enjoy it :)
<p:commandLink id="manageUG" title="Manage User Groups" style="margin-right:5px"
update="#all" action="#{projectAdminisrationMB.showGroups(userObj)}" ajax="true">
<h:graphicImage value="../images/cssImg/manage-groups-icon.png" />
<f:setPropertyActionListener target="#{projectAdminisrationMB.selectedUserRow}" value="#{userObj}" />
<f:setPropertyActionListener target="#{projectAdminisrationMB.selectedUserRow.dbRowIndex}" value="#{table.rowIndex}" />
</p:commandLink>
i used #all to update the ui define section that's it
i have checkbox column in datatable, i want to have some ajax code which when i click on the checbox button on the header should check all the checkbox in the rendered data rows of the datatable. I am using primefaces, they have something out of box for this but we don't want to implement it. Please let me know if there is a easy solution using ajax.
As of now we have coded as below but we can go something better than that.
<p:dataTable id="userListTable" value="#{Bean.List}"
var="user" rowClasses="odd even"
<p:column style="width:18px">
<f:facet name="header">
<p:selectBooleanCheckbox
valueChangeListener="#{Controller.toggleCheckBox}"
partialSubmit="true" immediate="true" />
</f:facet>
<p:selectBooleanCheckbox value="#{user.disable}"
disabled="#{user.disable}"
valueChangeListener="#{circleController.enableDisableOkbutton}"
partialSubmit="true" immediate="true" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{labels['circle.userList.name']}" />
</f:facet>
<p:panelGrid styleClass="noBorders">
<p:row>
<p:column rowspan="3" style="width:60px;">
<p:graphicImage
value="#{name}.jpg"
style="width:50px;height:50px" />
</p:column>
<p:column>
<h:outputText value=" " />
<h:outputText value="#{user.firstName}" />
<h:outputText value=" " />
<h:outputText value="#{user.lastName}" />
</p:column>
</p:row>
<p:row>
<h:outputText value="#{user.country}" />
</p:row>
</p:panelGrid>
</p:column>
</p:dataTable>