1

It's well documented bug in richfaces (see bug RF-11413)

You can try it on Richfaces showcase rich:dataTable -> editing

Only solution I find is : https://community.jboss.org/message/735198 (look for answer from Eldin Okanovic)

But it doesn't work for me, so i came up with similar solution, that works for me.

In xhtml rich:datatable add action on a4j:commandLink action="#{carsBean.popupReset}"

<a4j:commandLink styleClass="no-decor" render="editGrid" execute="@this"
                oncomplete="#{rich:component('editPane')}.show()" action="#{carsBean.popupReset}">
                <h:graphicImage value="/images/icons/edit.gif" alt="edit" />
                <a4j:param value="#{it.index}" assignTo="#{carsBean.currentCarIndex}"/>
                <f:setPropertyActionListener target="#{carsBean.editedCar}" value="{car}" />
</a4j:commandLink>

In CarsBean add method carsBean.popupReset

public void popupReset() {

    FacesContext context = FacesContext.getCurrentInstance();
    UIInput com1 = (UIInput) context.getViewRoot().findComponent("form:price");
    UIInput com2 = (UIInput) context.getViewRoot().findComponent("form:mage");        
    ...        

    com1.resetValue();
    com1.setValue(editedCar.getPrice());
    com2.resetValue();
    com2.setValue(editedCar.getMileage());
    ...

}

It's not pretty solution but so far it works for me.

0 Answers0