Cool Mr Ice wrote:If you agree that there is still a bug specifically in the updating of the header facet of the dataTable, do you think I should create another issue for this?
To answer your question above, please see/read the following:
Cagatay/Optimus-Prime's response (please note the part about buying support)
viewtopic.php?f=3&t=16865&start=10#p51598
Issue created as per the above forum conversation (before Cagatay's response)
http://code.google.com/p/primefaces/iss ... il?id=3064
Okay, back to hacking a solution.
First of all, i like your responses, very detailed and responsive.
Per your last post and test case/results, I think it's time to use JavaScript to resolve this issue. I've had to do the same even just yesterday (last night or earlier this morning, forgot exactly the time I had to code that...smile). Please read the following blog, and do something similar; i did the other-way-around (client-to-server maybe 1 or 2 days/nights ago), which is also documented in this blog.
BalusC's blog: Pass variables from server side to client side
I really don't like the behavior I've been experiencing recently in p:dataTable f:facet name="header" (header of the dataTable). I tried to add the following in dataTable header or a p:column f:facet name="header" (datatable column header), and it did not render well at all.
Code: Select all
<h:panelGrid columns="2" cellspacing="2" cellpadding="2">
<h:selectOneRadio value="#{pf_orderCustomerPointOfContactController.listToBrowse}"
onclick="document.getElementById('orderEditForm:dt_selectOrderCustomerPointOfContact:btn_filter').click()">
<f:selectItem itemLabel="Ordered By" itemValue="orderCustomerPointOfContact" />
<f:selectItem itemLabel="Customer" itemValue="customer" />
<f:selectItem itemLabel="All" itemValue="all" />
</h:selectOneRadio>
<h:outputText value="Point Of Contacts (select one)" />
</h:panelGrid>
So i did the following (please stay with me on this, i'm providing this example to show that JavaScript should be able to solve your issue):
1. moved the code above outside of the p:dataTable, just above the p:dataTable
2. I researched/googled and researched/googled on how to make the selectOneRadio make an AJAX call to the bean onclick or onchange via f:ajax, valueChangeListener attribute of p:selectOneRadio (which is new component added to PrimeFaces 3.0, as you will see added to PrimeFaces Labs Showcase).
3. The above research ended up in no working solution for me.
4. So, I was reminded that I used Javascript (client-to-server example or use-case) on a different xhtml page (
Payroll Browse/Report) and different requirement/use-case/hack, so I decided to include JavaScript in my solution for the selectOneRadio.
5. First, I had to use h:selectOneRadio instead of p:selectOneRadio, because p:selectOneRadio didn't have a documented onclick="..." (client callback)
6. Second, I decided to click an existing
Filter p:commandButton, that already existed on the page, via onclick="..." of h:selectOneRadio, but it did NOT work, immediately/initially.
7. I had to look at the generated HTML source via Google Chrome's "inspect element" context/popup menu option, and I recognized that the Filter p:commandbutton had id =
orderEditForm:dt_selectOrderCustomerPointOfContact:btn_filter. So, I had to make a code change as follows:
BEFORE
Code: Select all
onclick="document.getElementById('orderEditForm:btn_filter').click()"
AFTER replacing
orderEditForm:btn_filter with
orderEditForm:dt_selectOrderCustomerPointOfContact:btn_filter
Code: Select all
onclick="document.getElementById('orderEditForm:dt_selectOrderCustomerPointOfContact:btn_filter').click()"
8. Problem solved, and finally, I had a working solution: AJAX call to re-filter the data in p:dataTable after enduser clicks one of the radio button options.
Keep reading after code below, please.
pf_SelectOrderCustomerPointOfContact.xhtml (just sharing the entire xhtml source, if you're interested)
Code: Select all
<?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">
<html 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:p="http://primefaces.org/ui">
<ui:composition>
<p:panel header="Select Point Of Contact">
<h:panelGrid columns="2" cellspacing="2" cellpadding="2">
<h:selectOneRadio value="#{pf_orderCustomerPointOfContactController.listToBrowse}"
onclick="document.getElementById('orderEditForm:dt_selectOrderCustomerPointOfContact:btn_filter').click()">
<f:selectItem itemLabel="Ordered By" itemValue="orderCustomerPointOfContact" />
<f:selectItem itemLabel="Customer" itemValue="customer" />
<f:selectItem itemLabel="All" itemValue="all" />
</h:selectOneRadio>
<h:outputText value="Point Of Contacts (select one)" />
</h:panelGrid>
<p:dataTable id="dt_selectOrderCustomerPointOfContact" var="selectOrderCustomerPOC" value="#{pf_orderCustomerPointOfContactController.lazyModel}"
paginator="true" paginatorAlwaysVisible="false" rows="10" rowsPerPageTemplate="10,25,50,100,500,1000"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
selection="#{pf_orderCustomerPointOfContactController.selectedRow}">
<p:ajax event="page" update=":@this :@form:_ajax_status"/>
<f:facet name="header">
<h:panelGrid columns="1" cellpadding="1" cellspacing="1" width="100%">
<h:panelGroup>
<p:commandButton value="Cancel" icon="ui-icon ui-icon-arrowthick-1-w"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu"
actionListener="#{pf_orderCustomerPointOfContactController.cancelSelectPointOfContactForOrder()}"/>
<p:commandButton value="Select" icon="ui-icon-check"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu"
actionListener="#{pf_orderCustomerPointOfContactController.selectPointOfContact()}"/>
<p:commandButton id="btn_filter" value="Filter" icon="ui-icon-search"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact"
actionListener="#{pf_orderCustomerPointOfContactController.prepareSelectPointOfContactForOrder}"/>
<p:commandButton value="Clear Filter"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact"
actionListener="#{pf_orderCustomerPointOfContactController.clearFilter}"/>
</h:panelGroup>
<h:panelGroup>
<p:commandButton value="A" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('A')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="B" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('B')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="C" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('C')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="D" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('D')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="E" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('E')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="F" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('F')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="G" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('G')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="H" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('H')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="I" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('I')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="J" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('J')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="K" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('K')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="L" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('L')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="M" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('M')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="N" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('N')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="O" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('O')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="P" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('P')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="Q" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('Q')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="R" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('R')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="S" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('S')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="T" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('T')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="U" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('U')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="V" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('V')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="W" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('W')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="X" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('X')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="Y" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('Y')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="Z" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('Z')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
</h:panelGroup>
</h:panelGrid>
</f:facet>
<p:column selectionMode="single" />
<p:column>
<f:facet name="header">
<h:panelGrid columns="1">
<h:outputText value="Point Of Contact" />
<p:autoComplete id="autoComplete_ocPocId" value="#{pf_orderCustomerPointOfContactController.selectedPointOfContact}"
completeMethod="#{pf_orderCustomerPointOfContactController.complete}"
var="p" itemLabel="#{p.pointOfContactName}" itemValue="#{p}"
queryDelay="3000" size="50"
onblur="close()">
<p:ajax event="itemSelect" update=":orderEditForm:_ajax_status :orderEditForm:formMessages dt_selectOrderCustomerPointOfContact"/>
</p:autoComplete>
</h:panelGrid>
</f:facet>
<h:outputText escape="false" value="#{pf_ordersController.getPointOfContactSuggestionDisplay(selectOrderCustomerPOC)}"/>
</p:column>
<f:facet name="footer">
<h:panelGrid columns="1" cellpadding="1" cellspacing="1" width="100%">
<h:panelGroup>
<p:commandButton value="A" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('A')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="B" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('B')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="C" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('C')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="D" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('D')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="E" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('E')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="F" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('F')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="G" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('G')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="H" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('H')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="I" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('I')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="J" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('J')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="K" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('K')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="L" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('L')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="M" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('M')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="N" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('N')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="O" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('O')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="P" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('P')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="Q" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('Q')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="R" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('R')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="S" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('S')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="T" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('T')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="U" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('U')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="V" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('V')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="W" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('W')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="X" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('X')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="Y" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('Y')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
<p:commandButton value="Z" actionListener="#{pf_orderCustomerPointOfContactController.setFilterNameBeginWith('Z')}" update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact autoComplete_ocPocId"/>
</h:panelGroup>
<h:panelGroup>
<p:commandButton value="Cancel" icon="ui-icon ui-icon-arrowthick-1-w"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu"
actionListener="#{pf_orderCustomerPointOfContactController.cancelSelectPointOfContactForOrder()}"/>
<p:commandButton value="Select" icon="ui-icon-check"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu"
actionListener="#{pf_orderCustomerPointOfContactController.selectPointOfContact()}"/>
<p:commandButton value="Filter" icon="ui-icon-search"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact"
actionListener="#{pf_orderCustomerPointOfContactController.prepareSelectPointOfContactForOrder}"/>
<p:commandButton value="Clear Filter"
update=":orderEditForm:_ajax_status :orderEditForm:formMessages :orderEditForm:panelBelowEditMenu dt_selectOrderCustomerPointOfContact"
actionListener="#{pf_orderCustomerPointOfContactController.clearFilter}"/>
</h:panelGroup>
</h:panelGrid>
</f:facet>
</p:dataTable>
</p:panel>
</ui:composition>
</html>
Please take note to the Javascript solution that I shared above and the following p:commandButton ID, which was in the p:dataTable f:facet name="header" (p:dataTable header). It belongs to the dataTable header, so when referencing it via JavaScript or a simple p:ajax update="...", you may need to reference it as part of the p:dataTable or via @this.
orderEditForm:dt_selectOrderCustomerPointOfContact:btn_filter
If the solution is not via update="...", then please try BalusC's Javascript (server-to-client) or one of my JavaScript solutions above to see if you can set the menuitem txt via JavaScript. Since test1 and test2 worked fine (outside of p:dataTable), then I would recommend that you do the following:
1. h:inputHidden id="
test1" value="{bean.
menuItemValue}" (which will ALWAYS have the menuItem text value AFTER onPage, if you like)
2. JavaScript onload = function that will use get
Code: Select all
document.getElementById('mainForm:serviceTypes:test4:menuItem_ID').value = document.getElementById('mainForm:test1').value
3. Confirm the above DOM element references in your generated HTML page source
4. You can even add some condition in onload JavaScript function, if {bean.onPageExecuted}, then execute code in # 2 above, if necessary; may not be necessary though.
Looking forward to your response.