I have a datatable with rowedit. One column of my table is a list box, list items are displayed dynamically (depending on the value in another box) I use rowEditInit to set the selectedrow element. And I want to update the list to get the correct values. This does not work. When i do
<p:ajax event="rowEditInit" listener="#{workOrderDetail.onEdit}" update="orderitemstable" />
Then, when I click on the pencil icon, I see a line switcher in edit mode and extracting list items. But he immediately went into non-editing mode.
But when I do
<p:ajax event="rowEditInit" listener="#{workOrderDetail.onEdit}" update="rmactionenumid" />
Then clicking on the pencil icon places the line in edit mode, but the call is not made to retrieve the list items. I believe that this does not cause an update on rmactionenumid.
Any ideas?
Roel
Here is my jsf code
<p:ajax event="rowEditInit" listener="#{workOrderDetail.onEdit}" update="rmactionenumid" /> <p:column > <p:cellEditor> <f:facet name="output"> <h:outputText id="rmactionenumidlabel" value="#{orderItem.rmActionRepr}" > </h:outputText> </f:facet> <f:facet name="input"> <h:selectOneListbox id="rmactionenumid" value="#{orderItem.rmActionEnumId}" size="1" valueChangeListener="#{workOrderDetail.setActionRepr}"> <f:selectItems value="#{workOrderDetail.actionItems}"/> <p:ajax event="change" update="partdiscount,labourdiscount,totalprice,:detail:wodetail:totals" execute="@this" /> </h:selectOneListbox> </f:facet> </p:cellEditor> </p:column> <p:column > <p:rowEditor id="edit" /> </p:commandLink> </p:column> </p:dataTable>
and here is my java bean code
public List<SelectItem> getActionItems() throws MWSException { ArrayList<SelectItem> actions = new ArrayList<SelectItem>(); if (getSelectedOrderItem() != null) { ListManager lm = new ListManager(getWA().getMwsProxy()); MWSGenericMapList items = lm.nativeSearch(getWS().getUser(), HdfWebConstants.NS_VEHICLEPARTACTIONS, 0, 0, 200, false, getSelectedOrderItem().getVehiclePartCode()); for (int i = 0; i < items.size(); i++) { actions.add(new SelectItem(items.get(i).get("rmaction_enumid").toString(), items.get(i).get("rmaction") .toString())); } } return actions; } public void setSelectedOrderItem(IMWSOrderItem newSelectedOrderItem) throws MWSException { this.selectedOrderItem = newSelectedOrderItem; } public void onEdit(RowEditEvent event) throws MWSException { setSelectedOrderItem((IMWSOrderItem) event.getObject()); }
I am using PF3.5
jsf datatable primefaces listbox
roel
source share