julien.thai wrote:
Hi,
Here is the code you gave me last time. I must say that I don(t really understand it. It worked before that I tried to add a page field inside the container:
//Update id value JahiaField theField = container.getField("id"); theField.setValue(new Integer(container.getID()).toString()); FieldsChangeEventListener listener = new FieldsChangeEventListener(); listener.notifyChange(theField.getID()); ServicesRegistry.getInstance().getJahiaContainersService().saveContainer(container, container_list.getID(), jParams);
It seems that I indeed save the whole container but how can I just save the field in both mode (active and staging)?
Try replacing the last line with
ServicesRegistry.getInstance().getJahiaFieldsService.saveField(theField, container.getAclID(), jParams);
Regards, Serge Huber.
