package ch.openech.client.org.event.correct;

import java.util.Collections;
import java.util.List;

import ch.openech.client.org.event.OrganisationEventEditor;
import ch.openech.dm.organisation.Organisation;
import ch.openech.mj.edit.form.Form;
import ch.openech.xml.write.EchNamespaceContext;
import ch.openech.xml.write.WriterEch0148;

public class CorrectUidBrancheEvent extends OrganisationEventEditor<Organisation> {
	
	public CorrectUidBrancheEvent(EchNamespaceContext namespaceContext) {
		super(namespaceContext);
	}

	@Override
	protected void fillForm(Form<Organisation> formPanel) {
		formPanel.area(Organisation.ORGANISATION.uidBrancheText);
		formPanel.area(Organisation.ORGANISATION.nogaCode);
	}

	@Override
	public Organisation load() {
		return getOrganisation();
	}

	@Override
	protected List<String> getXml(Organisation organisation, Organisation changedOrganisation, WriterEch0148 writerEch0148) throws Exception {
		return Collections.singletonList(writerEch0148.correctUidBranche(changedOrganisation));
	}
}
@@ -610,36 +610,161 @@
  %7B%0D%0A%09%09formPanel.
-area
+line(Organisation.ORGANISATION.uidBrancheText);%0D%0A%09%09formPanel.line(Organisation.ORGANISATION.nogaCode);%0D%0A%0D%0A%09%09formPanel.setRequired
 (Organisation.OR
@@ -808,12 +808,19 @@
 nel.
-area
+setRequired
 (Org

Add required