0

I have sheet(as datatable) . I am using ajax to update sheet(table) on change . I can update submit button render from backing bean . But i cant update my p:messages rendering like button. At the backing bean i am setting canMessageShow=false to not rendered p:messages but it still shows.

My code :

<form>

<p:commandButton id="submitButton" 
disabled="#{facesContext.validationFailed or !anybean.canSubmit}" 
 actionListener="#{anyBean.dosmethn}"  value="Submit"/>

<p:remoteCommand name="onCellEdit" update="someSheet"/>

<pe:sheet id="someSheet"

<p:messages id="createTrashMessages" rendered="#{anyBean.canMessageShow}" autoUpdate="true"
            showDetail="true" showIcon="false" style="margin-left: 20px; width: 640px;"/>

<p:ajax event="change" global="false"
        update="submitButton someSheet createTrashMessages"
        listener="#{anyBean.editActionListener}" oncomplete="onCellEdit()"/>

<pe:sheetcolumn headerText="Item"
                readOnly="true"
                value="#{entity.item}"/>

<pe:sheet>

</form>

On my ajax update as you can see i am updating sheet and messages it self. Also i tried to remove from FacesContext.getCurrentInstance().getViewRoot().getAttributes() But p:messages still displays. Also i have checked FacesContext.getCurrentInstance().getmessages but it says no elements to display i mean its empty. How can i remove p:messages and not rendering upon ajax update. Because right now ajax updating button also setting canMessageShow to false. But p:messages still displaying.

My java version : 8 jsf 2.2.1 primefaces-extensions 6.2.10 primefaces 6.2

Samet Dağ
  • 93
  • 6

0 Answers0