I have a use case, to select a row in a datatable and populate a quick entry toolbar so the information can be edited and then submitted back to the datatable. My problem is that the h:inputText doesn't update while other components do. My datatable looks like this
Code: Select all
<p:dataTable id="quickEntryTable" styleClass="dataTable" rows="10" paginatorPosition="bottom" paginatorTemplate="<div class="paginateButtons" >{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}</div>"
value="#{inventoryMovementBean.inventoryMovementInstanceList}" var="inventoryMovementInstance" paginator="true" dynamic="false"
selection="#{inventoryMovementBean.selectedInventoryMovementInstance}" selectionMode="single" update="pageTabs"
onselectComplete="PrimeFaces.ajax.AjaxRequest('/#{grailsApplication.metadata['app.name']}/inventoryMovement/index.xhtml',{formId:'inforForm',global:true},{'buttonEditInventoryMovementSelect_submit':'buttonEditInventoryMovementSelect_submit','primefacesPartialUpdate':'pageTabs'});
return false;"> .....</p:dataTable>
Code: Select all
<p:commandButton id="buttonEditInventoryMovementSelect" actionListener="#{inventoryMovementBean.doEdit}" update="pageTabs" immediate="true" style="display:none" />
Code: Select all
void doEdit(ActionEvent ae){
editMode = true
customerItemWarehouseSelected = true
}
Code: Select all
<h:inputText id="test4" value="#{inventoryMovementBean.inventoryMovementInstance.quantity}" >
I've also tried adding an immediate="true" once which did update the value when I clicked a row, but if I clicked another row right after, it kept the old value in the h:inputText and didn't change it. The readonly and disabled worked fine when clicking multiple rows one after another.
If I use a commandLink click when a row is selected and remove the PrimeFaces.ajax.AjaxRequest everything updates fine but I'd like to be able to click just a row without needing to push another button.
My quick entry and datatable are both in a tab. I update the tab when I do any update.
Thanks