Rectangle 27 30

put your panel with conditional rendering inside another and update it. Like this:

<p:outputPanel id="toUpdate">
  <p:panel id="myPanel" rendered="#{myBean.flag}">
  </p:panel>
<p:outputPanel>

<p:commandButton update="toUpdate"/>

This is a known issue. The element can't be updated if it doesn't exist in DOM.

Why do we have to this ?

it works for me to.. saved lot of time

jsf 2 - JSF 2 / primefaces : p:panel not rendered with ajax? - Stack O...

jsf-2 primefaces
Rectangle 27 9

Attach an ajax listener and let it navigate by NavigationHandler.

<h:form>
    <h:selectOneMenu value="#{navigator.outcome}">
        <f:selectItem itemLabel="Select page..." />
        <f:selectItem itemValue="page1" itemLabel="Page 1" />
        <f:selectItem itemValue="page2" itemLabel="Page 2" />
        <f:selectItem itemValue="page3" itemLabel="Page 3" />
        <f:ajax listener="#{navigator.navigate}" />
    </h:selectOneMenu>
</h:form>
page1.xhtml
page2.xhtml
page3.xhtml
<f:selectItems>

with

private String outcome;

public void navigate() {
    FacesContext context = FacesContext.getCurrentInstance();
    NavigationHandler navigationHandler = context.getApplication().getNavigationHandler();
    navigationHandler.handleNavigation(context, null, outcome + "?faces-redirect=true");
}

The ?faces-redirect=true is not necessary, but it effectively sends a redirect so that the URL in browser address bar will properly change which is better for user experience and bookmarkability of the pages.

Works like a charm. Thanks!

I haven't seen the comment(I don't know why), otherwise I wouldn't have commented...

@spauny: I'm not sure what you mean. Don't you mean to say "answer" instead of "comment"? Well, if you feel that your answer is superfluous, just delete it.

Yes, sorry, I meant answer... My answer it's not totally superfluous; it says also about navigation with redirect instead of navigationHandler :D

jsf 2 - JSF/PrimeFaces selectOneMenu change view-id - Stack Overflow

jsf jsf-2 navigation primefaces selectonemenu
Rectangle 27 42

Exceptions which are thrown during ajax requests have by default totally no feedback in the client side. Only when you run Mojarra with project stage set to Development and use <f:ajax>, then you will get a bare JavaScript alert with the exception type and message. But other than that, and in PrimeFaces, there's by default no feedback at all. You can however see the exception in the server log and in the ajax response (in the webbrowser's developer toolset's "Network" section).

You need to implement a custom ExceptionHandler which does basically the following job when there's a ViewExpiredException in the queue:

String errorPageLocation = "/WEB-INF/errorpages/expired.xhtml";
context.setViewRoot(context.getApplication().getViewHandler().createView(context, errorPageLocation));
context.getPartialViewContext().setRenderAll(true);
context.renderResponse();

Alternatively, you could use the JSF utility library OmniFaces. It has a FullAjaxExceptionHandler for exactly this purpose (source code here, showcase demo here).

Hi BalusC..Thanks always. I browse at the Omnifaces link and I just would like to ask if there will be no conflict if I am using Primefaces already and add Omnifaces into the mix? Also regarding my question, I still will have to read regarding the FullAjaxExceptionHandler..

Absolutely not. Even more, the Showcase application uses PrimeFaces. OmniFaces is merely an utility library whose utilities can only be used by your own command/configuration.

@BalusC I have added omnifaces FullAjaxExceptionHandlerFactory as shown but the page still getting stuck. How can I see if session timeout exception has been thrown?

Press Ask Question button and post an SSCCE.

jsf 2 - Session timeout and ViewExpiredException handling on JSF/Prime...

ajax jsf-2 primefaces session-timeout viewexpiredexception
Rectangle 27 41

Exceptions which are thrown during ajax requests have by default totally no feedback in the client side. Only when you run Mojarra with project stage set to Development and use <f:ajax>, then you will get a bare JavaScript alert with the exception type and message. But other than that, and in PrimeFaces, there's by default no feedback at all. You can however see the exception in the server log and in the ajax response (in the webbrowser's developer toolset's "Network" section).

You need to implement a custom ExceptionHandler which does basically the following job when there's a ViewExpiredException in the queue:

String errorPageLocation = "/WEB-INF/errorpages/expired.xhtml";
context.setViewRoot(context.getApplication().getViewHandler().createView(context, errorPageLocation));
context.getPartialViewContext().setRenderAll(true);
context.renderResponse();

Alternatively, you could use the JSF utility library OmniFaces. It has a FullAjaxExceptionHandler for exactly this purpose (source code here, showcase demo here).

Hi BalusC..Thanks always. I browse at the Omnifaces link and I just would like to ask if there will be no conflict if I am using Primefaces already and add Omnifaces into the mix? Also regarding my question, I still will have to read regarding the FullAjaxExceptionHandler..

Absolutely not. Even more, the Showcase application uses PrimeFaces. OmniFaces is merely an utility library whose utilities can only be used by your own command/configuration.

@BalusC I have added omnifaces FullAjaxExceptionHandlerFactory as shown but the page still getting stuck. How can I see if session timeout exception has been thrown?

Press Ask Question button and post an SSCCE.

jsf 2 - Session timeout and ViewExpiredException handling on JSF/Prime...

ajax jsf-2 primefaces session-timeout viewexpiredexception
Rectangle 27 4

Make use of the dialog component's visible attribute. If this is set to true during render, then the page will render with the dialog opened.

<p:dialog ... visible="#{facesContext.postback and facesContext.validationFailed}">

Or if there are more forms in the same page and you'd like to check only if dialog's own form is been submitted:

<p:dialog ... visible="#{dialogForm.submitted and facesContext.validationFailed}">
    <h:form binding="#{dialogForm}">

Note: the #{facesContext.validationFailed} works by default of course only if you make use of JSF builtin validation facilities (required="true", <f:validateXxx>, etc) and/or use fullworthy Validator implementations. It you're for example manually validating in action method and manually adding faces messages, then this will not work, unless you implicitly call FacesContext#validationFailed() yourself.

jsf 2 - primefaces dialog validation without ajax - Stack Overflow

jsf-2 primefaces
Rectangle 27 9

The bean's constructor may be too late for the job if the <p:growl> is rendered before the bean is been constructed for the first time. E.g.

<p:growl />
...
<h:outputText value="#{bean.something}" />

It would only work if the bean is constructed before the <p:growl> is rendered.

<h:outputText value="#{bean.something}" />
...
<p:growl />

In order to solve your concrete problem, you'd need to do the job in a pre render view listener instead.

<f:event type="preRenderView" listener="#{bean.init}" />
public void init() {
    // Add the desired message here.
}

i solved the problem by placing the message/growl at the end of my template code.. is that a good/acceptable practice? or am i going to run into problems with that?

@Jenson: As answered, you need to make sure that the message is added before the target message component is rendered. Which way you choose is up to you.

jsf 2 - display growl when page is loaded primefaces jsf2 - Stack Over...

jsf-2 primefaces load growl
Rectangle 27 15

If it is an AJAX Request, you can add on your trigger component a 'oncomplete' method which has :

<p: ... update='myDatatableId' oncomplete='myDatatableWidget.filter();' />

By this way you will re-triggering current filters on the datatable or you can also clear all filters by using

... oncomplete='myDatatableWidget.clearFilters();' ...

That's a good solution if you are working on the same page. What about navigating to another section and come back later? How can I solve that situation to clear the filters or restore the last filter values?

Using oncomplete instead of update is a good trick to refresh the datatable without losing anything, thanks!

jsf 2 - Primefaces Datatable filter values are lost after the datatabl...

jsf-2 primefaces
Rectangle 27 10

Found where the problem was. The problem wasn't in the graphicimage. It was because the graphicimage tag is being loaded dynamically (similar issue when trying loading from datatable). Dynamic images cannot be rendered directly in datatable or datagrid. (Workaround is to assign a param and bring the images from the id).

However, the solution is here

jsf 2 - graphicimage not rendering streamedcontent in Primefaces - Sta...

jsf-2 primefaces
Rectangle 27 10

Found where the problem was. The problem wasn't in the graphicimage. It was because the graphicimage tag is being loaded dynamically (similar issue when trying loading from datatable). Dynamic images cannot be rendered directly in datatable or datagrid. (Workaround is to assign a param and bring the images from the id).

However, the solution is here

jsf 2 - graphicimage not rendering streamedcontent in Primefaces - Sta...

jsf-2 primefaces
Rectangle 27 13

This is, unfortunately, "by design". The evaluation of the #{} expressions is deferred to the exact moment of the access-time. They're unlike "standard" EL ${} in JSP not evaluated at the exact moment they're been parsed by the tag handler and "cached" for future access during the same request/view. At the moment the <p:outputLabel> is rendered, and thus the #{cc.attrs.required} as referenced by UIInput#isRequired() needs to be evaluated, there's no means of any #{cc} in the EL context. So any of its attributes would not evaluate to anything. Only when you're sitting inside the <cc:implementation>, the #{cc} is available in the EL context and all of its attribues would thus successfully evaluate.

Technically, this is an unfortunate corner case oversight in the design of <p:outputLabel>. Standard JSF and EL are namely behaving as specified. Basically, the presentation of the label's asterisk depending on the input's required attribute should be evaluated the other way round: at the moment the <p:inputText> inside the composite is to be rendered or perhaps even already when it's to be built. Thus, the label component should not ask the input component if it's required, but the input component should somehow notify the label component that it's required. This is in turn hard and clumsy (and thus inefficient) to implement.

If moving the label to inside the composite is not an option, then your best bet is to create a tag file instead of a composite component around the input component. It only requires some additional XML boilerplate.

/WEB-INF/tags/input.xhtml
<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:p="http://primefaces.org/ui"
>
    <c:set var="id" value="#{not empty id ? id : 'myInput'}" />
    <c:set var="required" value="#{not empty required and required}" />

    <p:inputText id="#{id}" required="#{required}"/>
</ui:composition>
/WEB-INF/my.taglib.xml
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
    version="2.0"
>
    <namespace>http://example.com/my</namespace>

    <tag>
        <tag-name>input</tag-name>
        <source>tags/input.xhtml</source>
    </tag>
</facelet-taglib>
/WEB-INF/web.xml
<context-param>
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/my.taglib.xml</param-value>
</context-param>
<html ... xmlns:my="http://example.com/my">
...
<p:outputLabel for="myInput" value="#{resources['myLabel']}:" />
<my:input id="myInput" required="#{myBean.required}" />
panelGrid

Then using a tag file instead of a composite component has an extra advantage for you: a tag file is unlike a composite component not interpreted as a single component! You can in fact safely put the label next the input in the tag file and still end up with 2 cells. See also stackoverflow.com/questions/5713718/ This should further reduce the boilerplate.

I've found a way using o:tagAttribute but it's available starting 2.1 while we're using 1.14, do you have plan to create a new release in the future that might include this?

@Rapster Nope, 1.1x is end of life. JSF 2.3 was introduced a few months ago and it has a required CDI dependency. So all focus will be on OmniFaces 2.x and 3.x.

jsf 2 - Primefaces outputLabel for composite component - Stack Overflo...

jsf-2 primefaces composite-component
Rectangle 27 13

This is, unfortunately, "by design". The evaluation of the #{} expressions is deferred to the exact moment of the access-time. They're unlike "standard" EL ${} in JSP not evaluated at the exact moment they're been parsed by the tag handler and "cached" for future access during the same request/view. At the moment the <p:outputLabel> is rendered, and thus the #{cc.attrs.required} as referenced by UIInput#isRequired() needs to be evaluated, there's no means of any #{cc} in the EL context. So any of its attributes would not evaluate to anything. Only when you're sitting inside the <cc:implementation>, the #{cc} is available in the EL context and all of its attribues would thus successfully evaluate.

Technically, this is an unfortunate corner case oversight in the design of <p:outputLabel>. Standard JSF and EL are namely behaving as specified. Basically, the presentation of the label's asterisk depending on the input's required attribute should be evaluated the other way round: at the moment the <p:inputText> inside the composite is to be rendered or perhaps even already when it's to be built. Thus, the label component should not ask the input component if it's required, but the input component should somehow notify the label component that it's required. This is in turn hard and clumsy (and thus inefficient) to implement.

If moving the label to inside the composite is not an option, then your best bet is to create a tag file instead of a composite component around the input component. It only requires some additional XML boilerplate.

/WEB-INF/tags/input.xhtml
<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:p="http://primefaces.org/ui"
>
    <c:set var="id" value="#{not empty id ? id : 'myInput'}" />
    <c:set var="required" value="#{not empty required and required}" />

    <p:inputText id="#{id}" required="#{required}"/>
</ui:composition>
/WEB-INF/my.taglib.xml
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
    version="2.0"
>
    <namespace>http://example.com/my</namespace>

    <tag>
        <tag-name>input</tag-name>
        <source>tags/input.xhtml</source>
    </tag>
</facelet-taglib>
/WEB-INF/web.xml
<context-param>
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/my.taglib.xml</param-value>
</context-param>
<html ... xmlns:my="http://example.com/my">
...
<p:outputLabel for="myInput" value="#{resources['myLabel']}:" />
<my:input id="myInput" required="#{myBean.required}" />
panelGrid

Then using a tag file instead of a composite component has an extra advantage for you: a tag file is unlike a composite component not interpreted as a single component! You can in fact safely put the label next the input in the tag file and still end up with 2 cells. See also stackoverflow.com/questions/5713718/ This should further reduce the boilerplate.

I've found a way using o:tagAttribute but it's available starting 2.1 while we're using 1.14, do you have plan to create a new release in the future that might include this?

@Rapster Nope, 1.1x is end of life. JSF 2.3 was introduced a few months ago and it has a required CDI dependency. So all focus will be on OmniFaces 2.x and 3.x.

jsf 2 - Primefaces outputLabel for composite component - Stack Overflo...

jsf-2 primefaces composite-component
Rectangle 27 2

You have to make the rendered component a rendered free because it must be exist when you submit the ajax request to server add another container to branchrender and move the rendered id to it

<h:panelGroup  id="branchrender">
     <h:panelGroup   rendered="#{daily.showBranchDimension}">
                                        <h:outputText value="Branch" />
                                        <p:selectOneMenu value="#{accounts.branchs}" id="branch"  style="width: 250px;"> 
                                            <f:selectItem itemLabel="ALL" itemValue="ALL" />
                                            <f:selectItems value="#{dimensions.branchCode()}"/>                    
                                        </p:selectOneMenu>
      </h:panelGroup> 
</h:panelGroup>

@YouYou: Many of these basic issues have duplicates in StackOverflow. Please search for them and mark them as such. It keeps SO clean.

jsf 2 - Show/Hide components in primefaces 5/JSF 2.2 - Stack Overflow

jsf-2 primefaces
Rectangle 27 5

Your concrete problem is caused because you've turned off ajax by ajax="false". This will create a synchronous form submit which makes it impossible to fire an ajax request along. If you remove ajax="false", then it will likely work, but you've still a race condition if the one method depends on the result of the other. It's not defined which one would be executed first.

Better just use a single command component. You can use action and actionListener together. The action is intented for business actions. The actionListener is intented for preparing of business actions. If you need more action listeners, just nest a <f:actionListener> or perhaps a <f:setPropertyActionListener>.

<p:commandButton value="Submit"
    actionListener="#{userBean.correlation}"
    action="#{userBean.execute}"
    update="correlationDialog" />

Thanks Balus..I have tried by removing off ajax but it did not worked.

I also tried with single command component that you have suggested,but in this approach it is executing correlation method first followed by execute method..But I want to execute both methods at the same time not one by one...So is there any other way to execute both methods at the same time?

Why exactly would you want to do that? Do you realize that you need 2 threads for that? The above answer just executes the both methods in 1 enduser interaction.

Yes exactly..I need to threads that will run in parallel..But before implementing threading I am looking for some other option..How to run two bean methods simultaneously in JSF without implementing Threading.

Actually the problem is If I marge these two methods and create a single bean method that executes after click on submit button..it takes too much time to execute and load the xhtml page.To minimize this loading and execution time I converted this single method in two different methods.

jsf 2 - Call multiple bean method in primefaces simultaneously - Stack...

jsf-2 primefaces
Rectangle 27 12

This is a problem with the default way that Spring Security sends redirects back to the client. The default method of sending a redirect to the client is the HTML approach of sending a 302 Temporarily Moved response, however this does not work for AJAX clients. The AJAX client will interpret this as a redirect to a new location to post/get its data and not as a page redirect. The correct way to get the AJAX client to redirect the browser to a new page in the same way as a normal HTML request is:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<partial-response>
  <redirect url="http://your.url.here/"></redirect>
</partial-response>

To override the default invalid session strategy used by Spring Security, you need to create a SessionManagementFilter bean in your Spring config, and pass it a class that implements InvalidSessionStrategy and sends the correct redirect response when a request is received either via HTML or AJAX:

<bean id="sessionManagementFilter" class="org.springframework.security.web.session.SessionManagementFilter">
  <constructor-arg name="securityContextRepository" ref="httpSessionSecurityContextRepository" />
  <property name="invalidSessionStrategy">
    <bean class="yourpackage.JsfRedirectStrategy">
       <constructor-arg name="invalidSessionUrl" value="/your_session_expired_page.xhtml" />
    </bean>
  </property>
</bean>
<bean id="httpSessionSecurityContextRepository" class="org.springframework.security.web.context.HttpSessionSecurityContextRepository"/>
<security:http use-expressions="true">
    <security:custom-filter ref="sessionManagementFilter" before="SESSION_MANAGEMENT_FILTER" />
    ...
</security:http>

The custom session management filter will now be created when your application starts, and the invalid session strategy class provided will execute whenever an expired session is found.

A good example of how to implement the invalid session strategy can be found here: https://gist.github.com/banterCZ/5160269

One note from my (successful) implementation of your answer here: Don't clear your cookies then trigger the ajax request as a way of testing this method! The new, session-less request isn't considered "invalid" the same way an expired session is!

jsf 2 - Redirect handling PrimeFaces Ajax requests on session timeout ...

ajax jsf-2 primefaces spring-security session-timeout
Rectangle 27 12

This is a problem with the default way that Spring Security sends redirects back to the client. The default method of sending a redirect to the client is the HTML approach of sending a 302 Temporarily Moved response, however this does not work for AJAX clients. The AJAX client will interpret this as a redirect to a new location to post/get its data and not as a page redirect. The correct way to get the AJAX client to redirect the browser to a new page in the same way as a normal HTML request is:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<partial-response>
  <redirect url="http://your.url.here/"></redirect>
</partial-response>

To override the default invalid session strategy used by Spring Security, you need to create a SessionManagementFilter bean in your Spring config, and pass it a class that implements InvalidSessionStrategy and sends the correct redirect response when a request is received either via HTML or AJAX:

<bean id="sessionManagementFilter" class="org.springframework.security.web.session.SessionManagementFilter">
  <constructor-arg name="securityContextRepository" ref="httpSessionSecurityContextRepository" />
  <property name="invalidSessionStrategy">
    <bean class="yourpackage.JsfRedirectStrategy">
       <constructor-arg name="invalidSessionUrl" value="/your_session_expired_page.xhtml" />
    </bean>
  </property>
</bean>
<bean id="httpSessionSecurityContextRepository" class="org.springframework.security.web.context.HttpSessionSecurityContextRepository"/>
<security:http use-expressions="true">
    <security:custom-filter ref="sessionManagementFilter" before="SESSION_MANAGEMENT_FILTER" />
    ...
</security:http>

The custom session management filter will now be created when your application starts, and the invalid session strategy class provided will execute whenever an expired session is found.

A good example of how to implement the invalid session strategy can be found here: https://gist.github.com/banterCZ/5160269

One note from my (successful) implementation of your answer here: Don't clear your cookies then trigger the ajax request as a way of testing this method! The new, session-less request isn't considered "invalid" the same way an expired session is!

jsf 2 - Redirect handling PrimeFaces Ajax requests on session timeout ...

ajax jsf-2 primefaces spring-security session-timeout
Rectangle 27 4

Dialog Framework opens the dialog in an iframe. To update values in the parent view add this ajax event to the commandButton or commonadLink that opens the dialog:

<p:commandButton value="Open Dialog" actionListener"...">
   <p:ajax event="dialogReturn" update="idFormStore"/>
</p:commandButton>

jsf 2 - PrimeFaces RequestContext.getCurrentInstance().update() not wo...

jsf-2 primefaces
Rectangle 27 3

Yes, you are right! I think the clicks are too fast, and the button back on first page and next on last page didn't dissapear when test clicked on it. So is there any thing I can do with this or only speed down the tests ?

Well, I must admit that I'm not very familiar with Webdriver, but definitely test should wait to page to be completely load before go on. I don't know is that possible and easy, but that is more reliable test.

jsf 2 - Primefaces wizard encodeStep NPE exception thrown - Stack Over...

jsf-2 primefaces
Rectangle 27 1

JS/Ajax will only update elements which are already present in the HTML DOM tree. JS basically does first a document.getElementById(clientId) to obtain the to-be-updated element and then replaces the whole node with the new node retrieved from ajax response. JS/Ajax can't magically show/update elements which are never been rendered to the HTML output. You basically need to update a parent component which is always rendered and thus guaranteed to be present in the HTML DOM tree.

Assuming that the parent component is a <p:dataTable>,

<p:dataTable id="tableId" ...>
update
<p:ajax update="tableId" />

I used a panelGrid, just updating that element solve the problem, thanks man :)

jsf 2 - Render a p:column with ajax primefaces - Stack Overflow

jsf-2 primefaces
Rectangle 27 2

You can find out the index of the selected column with jQuery and send it to server as an ajax event

first add an inputText above the table (make it hidden)

<h:inputText id="mySelectedColumnId" value="#{myBean.mySelectedColumnField}" style="display:none">
    <f:ajax listener="#{myBean.myListener}"></f:ajax>
</h:inputText>

and the following js code to bind clicking on the table and triggering click on the h:inputText which will trigger listened on the server

jQuery(document).delegate("#yourTableID td", "click", function (event) {//bind every click on any td in the table
    var columnNumber = jQuery(this).index();//get index of clicked row
    jQuery("#mySelectedColumnId").val(columnNumber); //set value in the inputtext
    jQuery("#mySelectedColumnId").change(); //this will trigger the ajax listener
});

What I actually meant was the following structure:

<h:outputScript name="js/newjavascriptfile.js" target="head" />

.
.
.
.

<h:form prependId="false">
     <h:inputText id="mySelectedColumnId" value="#{myBean.mySelectedColumnField}" style="display:none">
         <f:ajax listener="#{myBean.myListener}"></f:ajax>
     </h:inputText>
     <p:dataTable id="DataTable"....
.
.
.
.

and inside the js (place it inside js folder inside resources folder in the root of your web app folder Resources (Library) In JSF 2.0) file place

jQuery(window).load(function () {
     jQuery(document).delegate("#yourTableID td", "click", function (event) {//bind every click on any td in the table
        var columnNumber = jQuery(this).index();//get index of clicked row
        jQuery("#mySelectedColumnId").val(columnNumber); //set value in the inputtext
        jQuery("#mySelectedColumnId").change(); //this will trigger the ajax listener
    });
});

Thanks for the reply but in primeface datatable there is no onClick event, in this case how do i get the js code activate (i am in the process of learning js).

Ok, i did it by putting a inputText inside the p:column and using its onClick event, Thanks for the solution.

jsf 2 - Primefaces Datatable column selection - Stack Overflow

jsf-2 primefaces
Rectangle 27 4

When using Primefaces selector jQuery is used to select components on client side, and discover their client ids. When AJAX is sent one of parameters that is sent is javax.faces.partial.render whose value are client ids of components which should be updated. If component doesn't have client id it can't be updated directly, you can update parent component for example. Provide id attribute for panelGroup and try to update it with Primefaces selector.

Thanks! I added id attribute for panelGroup and it was working. But I think I would probably just stay with p:outputPanel, it saves me the headache to come up with meaningful names for the ids.. Again, thanks for the explanation!

jsf 2 - Primefaces selectors not updating a panelGroup - Stack Overflo...

jsf-2 primefaces selector