/* * Recherche.java * * Created on 29 mars 2007, 13:16 * Copyright Adm */ package spagololf; import com.sun.data.provider.impl.CachedRowSetDataProvider; import com.sun.rave.web.ui.appbase.AbstractPageBean; import com.sun.webui.jsf.component.Body; import com.sun.webui.jsf.component.Button; import com.sun.webui.jsf.component.Checkbox; import com.sun.webui.jsf.component.DropDown; import com.sun.webui.jsf.component.Form; import com.sun.webui.jsf.component.Head; import com.sun.webui.jsf.component.HiddenField; import com.sun.webui.jsf.component.Html; import com.sun.webui.jsf.component.Hyperlink; import com.sun.webui.jsf.component.Link; import com.sun.webui.jsf.component.MessageGroup; import com.sun.webui.jsf.component.Page; import com.sun.webui.jsf.component.StaticText; import com.sun.webui.jsf.component.Table; import com.sun.webui.jsf.component.TableColumn; import com.sun.webui.jsf.component.TableRowGroup; import com.sun.webui.jsf.model.DefaultTableDataProvider; import com.sun.webui.jsf.model.SingleSelectOptionsList; import javax.faces.FacesException; import javax.faces.convert.IntegerConverter; import javax.faces.convert.LongConverter; import javax.faces.event.ValueChangeEvent; /** *

Page bean that corresponds to a similarly named JSP page. This * class contains component definitions (and initialization code) for * all components that you have defined on this page, as well as * lifecycle methods and event handlers where you may add behavior * to respond to incoming events.

*/ public class Recherche extends AbstractPageBean { // private int __placeholder; /** *

Automatically managed component initialization. WARNING: * This method is automatically generated, so any user-specified code inserted * here is subject to being replaced.

*/ private void _init() throws Exception { missionDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.missionRowSet}")); programmeDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.programmeRowSet}")); actionDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.actionRowSet}")); sous_actionDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.sous_actionRowSet}")); objectifDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.objectifRowSet}")); indicateurDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{SessionBean1.indicateurRowSet}")); } private Page page1 = new Page(); public Page getPage1() { return page1; } public void setPage1(Page p) { this.page1 = p; } private Html html1 = new Html(); public Html getHtml1() { return html1; } public void setHtml1(Html h) { this.html1 = h; } private Head head1 = new Head(); public Head getHead1() { return head1; } public void setHead1(Head h) { this.head1 = h; } private Link link1 = new Link(); public Link getLink1() { return link1; } public void setLink1(Link l) { this.link1 = l; } private Body body1 = new Body(); public Body getBody1() { return body1; } public void setBody1(Body b) { this.body1 = b; } private Form form1 = new Form(); public Form getForm1() { return form1; } public void setForm1(Form f) { this.form1 = f; } private DropDown mission = new DropDown(); public DropDown getMission() { return mission; } public void setMission(DropDown dd) { this.mission = dd; } private StaticText idmission = new StaticText(); public StaticText getIdmission() { return idmission; } public void setIdmission(StaticText st) { this.idmission = st; } private DropDown programme = new DropDown(); public DropDown getProgramme() { return programme; } public void setProgramme(DropDown dd) { this.programme = dd; } private StaticText idprogramme = new StaticText(); public StaticText getIdprogramme() { return idprogramme; } public void setIdprogramme(StaticText st) { this.idprogramme = st; } private MessageGroup messageGroup1 = new MessageGroup(); public MessageGroup getMessageGroup1() { return messageGroup1; } public void setMessageGroup1(MessageGroup mg) { this.messageGroup1 = mg; } private CachedRowSetDataProvider missionDataProvider = new CachedRowSetDataProvider(); public CachedRowSetDataProvider getMissionDataProvider() { return missionDataProvider; } public void setMissionDataProvider(CachedRowSetDataProvider crsdp) { this.missionDataProvider = crsdp; } private CachedRowSetDataProvider programmeDataProvider = new CachedRowSetDataProvider(); public CachedRowSetDataProvider getProgrammeDataProvider() { return programmeDataProvider; } public void setProgrammeDataProvider(CachedRowSetDataProvider crsdp) { this.programmeDataProvider = crsdp; } private LongConverter missionConverter = new LongConverter(); public LongConverter getMissionConverter() { return missionConverter; } public void setMissionConverter(LongConverter lc) { this.missionConverter = lc; } private LongConverter programmeConverter = new LongConverter(); public LongConverter getProgrammeConverter() { return programmeConverter; } public void setProgrammeConverter(LongConverter lc) { this.programmeConverter = lc; } private DropDown action = new DropDown(); public DropDown getAction() { return action; } public void setAction(DropDown dd) { this.action = dd; } private CachedRowSetDataProvider actionDataProvider = new CachedRowSetDataProvider(); public CachedRowSetDataProvider getActionDataProvider() { return actionDataProvider; } public void setActionDataProvider(CachedRowSetDataProvider crsdp) { this.actionDataProvider = crsdp; } private LongConverter actionConverter = new LongConverter(); public LongConverter getActionConverter() { return actionConverter; } public void setActionConverter(LongConverter lc) { this.actionConverter = lc; } private StaticText idaction = new StaticText(); public StaticText getIdaction() { return idaction; } public void setIdaction(StaticText st) { this.idaction = st; } private DropDown sousaction = new DropDown(); public DropDown getSousaction() { return sousaction; } public void setSousaction(DropDown dd) { this.sousaction = dd; } private StaticText idssaction = new StaticText(); public StaticText getIdssaction() { return idssaction; } public void setIdssaction(StaticText st) { this.idssaction = st; } private CachedRowSetDataProvider sous_actionDataProvider = new CachedRowSetDataProvider(); public CachedRowSetDataProvider getSous_actionDataProvider() { return sous_actionDataProvider; } public void setSous_actionDataProvider(CachedRowSetDataProvider crsdp) { this.sous_actionDataProvider = crsdp; } private LongConverter sousactionConverter = new LongConverter(); public LongConverter getSousactionConverter() { return sousactionConverter; } public void setSousactionConverter(LongConverter lc) { this.sousactionConverter = lc; } private DropDown objectif = new DropDown(); public DropDown getObjectif() { return objectif; } public void setObjectif(DropDown dd) { this.objectif = dd; } private StaticText idobjectif = new StaticText(); public StaticText getIdobjectif() { return idobjectif; } public void setIdobjectif(StaticText st) { this.idobjectif = st; } private CachedRowSetDataProvider objectifDataProvider = new CachedRowSetDataProvider(); public CachedRowSetDataProvider getObjectifDataProvider() { return objectifDataProvider; } public void setObjectifDataProvider(CachedRowSetDataProvider crsdp) { this.objectifDataProvider = crsdp; } private LongConverter objectifConverter = new LongConverter(); public LongConverter getObjectifConverter() { return objectifConverter; } public void setObjectifConverter(LongConverter lc) { this.objectifConverter = lc; } private Table indicateur = new Table(); public Table getIndicateur() { return indicateur; } public void setIndicateur(Table t) { this.indicateur = t; } private TableRowGroup tableRowGroup1 = new TableRowGroup(); public TableRowGroup getTableRowGroup1() { return tableRowGroup1; } public void setTableRowGroup1(TableRowGroup trg) { this.tableRowGroup1 = trg; } private CachedRowSetDataProvider indicateurDataProvider = new CachedRowSetDataProvider(); public CachedRowSetDataProvider getIndicateurDataProvider() { return indicateurDataProvider; } public void setIndicateurDataProvider(CachedRowSetDataProvider crsdp) { this.indicateurDataProvider = crsdp; } private TableColumn tableColumn2 = new TableColumn(); public TableColumn getTableColumn2() { return tableColumn2; } public void setTableColumn2(TableColumn tc) { this.tableColumn2 = tc; } private Hyperlink detail = new Hyperlink(); public Hyperlink getDetail() { return detail; } public void setDetail(Hyperlink h) { this.detail = h; } private TableColumn tableColumn4 = new TableColumn(); public TableColumn getTableColumn4() { return tableColumn4; } public void setTableColumn4(TableColumn tc) { this.tableColumn4 = tc; } private Button supprimer = new Button(); public Button getSupprimer() { return supprimer; } public void setSupprimer(Button b) { this.supprimer = b; } private TableColumn tableColumn3 = new TableColumn(); public TableColumn getTableColumn3() { return tableColumn3; } public void setTableColumn3(TableColumn tc) { this.tableColumn3 = tc; } private StaticText staticText2 = new StaticText(); public StaticText getStaticText2() { return staticText2; } public void setStaticText2(StaticText st) { this.staticText2 = st; } private TableColumn tableColumn6 = new TableColumn(); public TableColumn getTableColumn6() { return tableColumn6; } public void setTableColumn6(TableColumn tc) { this.tableColumn6 = tc; } private StaticText staticText3 = new StaticText(); public StaticText getStaticText3() { return staticText3; } public void setStaticText3(StaticText st) { this.staticText3 = st; } private StaticText err = new StaticText(); public StaticText getErr() { return err; } public void setErr(StaticText st) { this.err = st; } private Checkbox action0 = new Checkbox(); public Checkbox getAction0() { return action0; } public void setAction0(Checkbox c) { this.action0 = c; } private Checkbox ssaction0 = new Checkbox(); public Checkbox getSsaction0() { return ssaction0; } public void setSsaction0(Checkbox c) { this.ssaction0 = c; } /******************************/ //Flag de premiere page /******************************/ private HiddenField flag = new HiddenField(); public HiddenField getFlag() { return flag; } public void setFlag(HiddenField hf) { this.flag = hf; } /**************************/ //Flag de maj liste mission /**************************/ private HiddenField flagMission = new HiddenField(); public HiddenField getFlagMission() { return flagMission; } public void setFlagMission(HiddenField hf) { this.flagMission = hf; } /*****************************/ //Flag de maj liste programme /*****************************/ private HiddenField flagProg = new HiddenField(); public HiddenField getFlagProg() { return flagProg; } public void setFlagProg(HiddenField hf) { this.flagProg = hf; } /**************************/ //Flag de maj liste action /**************************/ private HiddenField flagAction = new HiddenField(); public HiddenField getFlagAction() { return flagAction; } public void setFlagAction(HiddenField hf) { this.flagAction = hf; } /******************************/ //Flag de maj liste sous-action /******************************/ private HiddenField flagSsaction = new HiddenField(); public HiddenField getFlagSsaction() { return flagSsaction; } public void setFlagSsaction(HiddenField hf) { this.flagSsaction = hf; } /***************************/ //Flag de maj liste Objectifs /***************************/ private HiddenField flagObj = new HiddenField(); public HiddenField getFlagObj() { return flagObj; } public void setFlagObj(HiddenField hf) { this.flagObj = hf; } /*****************************/ //Flag de maj liste Indicateurs /******************************/ private HiddenField flagIndic = new HiddenField(); public HiddenField getFlagIndic() { return flagIndic; } public void setFlagIndic(HiddenField hf) { this.flagIndic = hf; } private StaticText deb = new StaticText(); public StaticText getDeb() { return deb; } public void setDeb(StaticText st) { this.deb = st; } //
/** *

Construct a new Page bean instance.

*/ public Recherche() { } /** *

Callback method that is called whenever a page is navigated to, * either directly via a URL, or indirectly via page navigation. * Customize this method to acquire resources that will be needed * for event handlers and lifecycle methods, whether or not this * page is performing post back processing.

* *

Note that, if the current request is a postback, the property * values of the components do not represent any * values submitted with this request. Instead, they represent the * property values that were saved for this view when it was rendered.

*/ public void init() { // Perform initializations inherited from our superclass super.init(); // Perform application initialization that must complete // *before* managed components are initialized // TODO - add your own initialiation code here // // Initialize automatically managed components // *Note* - this logic should NOT be modified try { _init(); } catch (Exception e) { log("Recherche Initialization Failure", e); throw e instanceof FacesException ? (FacesException) e: new FacesException(e); } // // Perform application initialization that must complete // *after* managed components are initialized // TODO - add your own initialization code here } /** *

Callback method that is called after the component tree has been * restored, but before any event processing takes place. This method * will only be called on a postback request that * is processing a form submit. Customize this method to allocate * resources that will be required in your event handlers.

*/ public void preprocess() {} /** *

Callback method that is called just before rendering takes place. * This method will only be called for the page that * will actually be rendered (and not, for example, on a page that * handled a postback and then navigated to a different page). Customize * this method to allocate resources that will be required for rendering * this page.

*/ public void prerender() { /****************************************************************/ //si la page se charge pour la premiere fois on fait les requetes //avec chaque premiers éléments de liste trouvés /***************************************************************/ if (flag.isDisabled() == false){ try{ getSessionBean1().getProgrammeRowSet().setInt(1,0); getSessionBean1().getActionRowSet().setInt(1,0); getSessionBean1().getSous_actionRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(2,0); getSessionBean1().getIndicateurRowSet().setInt(1,0); } catch (Exception e) { error("erreur d'initialisation"); log("erreur d'initialisation",e); } }else{ if (mission.getSelected() != null){ try { // Synchronize data provider with current selection missionDataProvider.setCursorRow(missionDataProvider.findFirst("id_mission", mission.getSelected())); } catch (Exception e) { error("Cannot switch to mission " + mission.getSelected()); log("Cannot switch to mission " + mission.getSelected(), e); } } if (programme.getSelected() != null){ try { // Synchronize data provider with current selection programmeDataProvider.setCursorRow(programmeDataProvider.findFirst("id_programme", programme.getSelected())); } catch (Exception e) { error("Cannot switch to programme " + programme.getSelected()); log("Cannot switch to programme " + programme.getSelected(), e); } } if (action.getSelected() != null){ try { //Synchronize data provider with current selection actionDataProvider.setCursorRow(actionDataProvider.findFirst("id_action", action.getSelected())); } catch (Exception e) { error("Cannot switch to action " + action.getSelected()); log("Cannot switch to action " + action.getSelected(), e); } } if (sousaction.getSelected() != null){ try { // Synchronize data provider with current selection sous_actionDataProvider.setCursorRow(sous_actionDataProvider.findFirst("id_sous_action", sousaction.getSelected())); } catch (Exception e) { error("Cannot switch to ssaction " + sousaction.getSelected()); log("Cannot switch to ssaction " + sousaction.getSelected(), e); } } if (objectif.getSelected() != null){ try { // Synchronize data provider with current selection objectifDataProvider.setCursorRow(objectifDataProvider.findFirst("id_objectif", objectif.getSelected())); } catch (Exception e) { error("Cannot switch to objectif " + objectif.getSelected()); log("Cannot switch to objectif " + objectif.getSelected(), e); } } /*******************************************************************************************/ //si la requête programme donne un résultat vide, on initialise toutes les listes du dessous /*******************************************************************************************/ if (programmeDataProvider.getRowCount() == 0 || flagProg.isDisabled() == true) { err.setText("résultat nul pour la missionn: " + missionDataProvider.getValue("nom_mission")); flagProg.setDisabled(false); flagAction.setDisabled(false); flagSsaction.setDisabled(false); flagObj.setDisabled(false); flagIndic.setDisabled(false); try{ getSessionBean1().getProgrammeRowSet().setInt(1,0); getSessionBean1().getActionRowSet().setInt(1,0); getSessionBean1().getSous_actionRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(2,0); getSessionBean1().getIndicateurRowSet().setInt(1,0); } catch (Exception e){ error("Erreur d'initialisation a partir de programme"); log("Erreur d'initialisation a partir de programme" ,e); } }else{ /***********************************************************************************************/ //sinon, si la requête action donne un résultat vide, on initialise toutes les listes du dessous /***********************************************************************************************/ if (action0.isChecked() == false && flagAction.isDisabled() == true || actionDataProvider.getRowCount() == 0){ err.setText("résultat nul pour le programmee: " + programmeDataProvider.getValue("nom_programme")); flagAction.setDisabled(false); flagSsaction.setDisabled(false); flagObj.setDisabled(false); flagIndic.setDisabled(false); try{ getSessionBean1().getActionRowSet().setInt(1,0); getSessionBean1().getSous_actionRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(2,0); getSessionBean1().getIndicateurRowSet().setInt(1,0); } catch (Exception e){ error("Erreur d'initialisation a partir d'action"); log("Erreur d'initialisation a partir d'action" ,e); } }else{ /*****************************************************************************************/ //sinon, si la requête sous action donne un résultat vide et que la check box est décochée, //on initialise toutes les listes du dessous /*****************************************************************************************/ if (ssaction0.isChecked() == false && flagSsaction.isDisabled() == true || sous_actionDataProvider.getRowCount() == 0){ err.setText("résultat nul pour l'actionn: " + actionDataProvider.getValue("nom_action")); flagSsaction.setDisabled(false); flagObj.setDisabled(false); flagIndic.setDisabled(false); try{ getSessionBean1().getSous_actionRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(2,0); getSessionBean1().getIndicateurRowSet().setInt(1,0); } catch (Exception e){ error("Erreur d'initialisation a partir de sous action"); log("Erreur d'initialisation a partir de sous action" ,e); } }else{ /*************************************************************************************************/ //sinon, si la requête objectif donne un résultat vide, on initialise toutes les listes du dessous /*************************************************************************************************/ if (objectifDataProvider.getRowCount() == 0 || flagObj.isDisabled() == true){ err.setText("résultat nul pour la sous_actionn: " + sous_actionDataProvider.getValue("nom_sous_action")); flagObj.setDisabled(false); flagIndic.setDisabled(false); try{ getSessionBean1().getObjectifRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setInt(2,0); getSessionBean1().getIndicateurRowSet().setInt(1,0); } catch (Exception e){ error("Erreur d'initialisation a partir d'objectif"); log("Erreur d'initialisation a partir d'objectif" ,e); } }else{ /**********************************************************************************/ //sinon, si la requête indicateur donne un résultat vide, on initialise le tableau /**********************************************************************************/ if (indicateurDataProvider.getRowCount() == 0 || flagIndic.isDisabled() == true){ err.setText("résultat nul pour l'objectif: " + objectifDataProvider.getValue("nom_objectif")); flagIndic.setDisabled(false); try{ getSessionBean1().getIndicateurRowSet().setInt(1,0); } catch (Exception e){ error("Erreur d'initialisation a partir d'indicateur"); log("Erreur d'initialisation a partir d'indicateur" ,e); } } } } } } } } /** *

Callback method that is called after rendering is completed for * this request, if init() was called (regardless of whether * or not this was the page that was actually rendered). Customize this * method to release resources acquired in the init(), * preprocess(), or prerender() methods (or * acquired during execution of an event handler).

*/ public void destroy() { missionDataProvider.close(); programmeDataProvider.close(); actionDataProvider.close(); sous_actionDataProvider.close(); objectifDataProvider.close(); indicateurDataProvider.close(); } /** *

Return a reference to the scoped data bean.

*/ protected SessionBean1 getSessionBean1() { return (SessionBean1)getBean("SessionBean1"); } /** *

Return a reference to the scoped data bean.

*/ protected ApplicationBean1 getApplicationBean1() { return (ApplicationBean1)getBean("ApplicationBean1"); } /** *

Return a reference to the scoped data bean.

*/ protected RequestBean1 getRequestBean1() { return (RequestBean1)getBean("RequestBean1"); } public void mission_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); /*********************************/ //Réinitialise le texte informatif /*********************************/ err.setText(""); /*********************************************************/ //on réactive d'abord les listes si elles sont désactivées /*********************************************************/ action.setRendered(true); action0.resetValue(); sousaction.setRendered(true); ssaction0.resetValue(); flagProg.setDisabled(false); flagAction.setDisabled(true); flagSsaction.setDisabled(true); flagObj.setDisabled(true); flagIndic.setDisabled(true); /*********************************/ //Si la sélection est non nulle... /*********************************/ if (mission.getSelected() != null){ /*************************************************/ //Met a jour la liste programmes avec la sélection /*************************************************/ try{ getSessionBean1().getProgrammeRowSet().setObject(1,mission.getSelected()); programme.resetValue(); programmeDataProvider.refresh(); } catch (Exception e) { error("Erreur mise a jour liste programme avec la sélection: " + missionDataProvider.getValue("id_mission")); log("Erreur mise a jour liste programme avec la sélection: " + missionDataProvider.getValue("id_mission"),e); } } } public void programme_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); /*********************************/ //Réinitialise le texte informatif /*********************************/ err.setText(""); /*********************************************************/ //on réactive d'abord les listes si elles sont désactivées /*********************************************************/ action.setRendered(true); action0.resetValue(); sousaction.setRendered(true); ssaction0.resetValue(); flagAction.setDisabled(false); flagSsaction.setDisabled(true); flagObj.setDisabled(true); flagIndic.setDisabled(true); /*********************************/ //Si la sélection est non nulle... /*********************************/ if (programme.getSelected() != null){ /***********************************************/ //Met a jour la liste actions avec la sélection /***********************************************/ try{ getSessionBean1().getActionRowSet().setObject(1,programme.getSelected()); actionDataProvider.refresh(); getSessionBean1().getSous_actionRowSet().setObject(1,action.getValue()); } catch (Exception e) { error("Erreur mise a jour liste action avec la sélection: " + programmeDataProvider.getValue("id_programme")); log("Erreur mise a jour liste action avec la sélection: " + programmeDataProvider.getValue("id_programme"),e); } } } public void action_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); /*********************************/ //Réinitialise le texte informatif /*********************************/ err.setText(""); /******************************************************************/ //Si la sélection est non nulle et que la case ssaction0 est cochée /******************************************************************/ if (action.isRendered() == true){ if (ssaction0.isChecked() == true) { flagSsaction.setDisabled(true); flagObj.setDisabled(false); flagIndic.setDisabled(true); /*************************************************/ //Met a jour la liste objectifs avec la sélection /*************************************************/ try{ getSessionBean1().getObjectifRowSet().setObject(1,action.getSelected()); getSessionBean1().getObjectifRowSet().setInt(2,0); if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); }catch (Exception e){ error("Impossible de basculer vers l'objectiff"); log("Impossible de basculer vers l'objectiff"); } /****************************************************************************************/ //Met a jour la liste sous action avec la sélection si la case ssaction0 n'est pas cochée /****************************************************************************************/ }else { flagSsaction.setDisabled(false); flagObj.setDisabled(true); flagIndic.setDisabled(true); try{ getSessionBean1().getSous_actionRowSet().setObject(1,action.getSelected()); sous_actionDataProvider.refresh(); }catch (Exception e){ error("Impossible de basculer vers la sous-action"); log("Impossible de basculer vers la sous-action",e); } } } } public void sousaction_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); /*********************************/ //Réinitialise le texte informatif /*********************************/ err.setText(""); flagObj.setDisabled(false); flagIndic.setDisabled(true); /*****************************************************************/ //Si la sélection est non nulle et que la case action0 est cochée /*****************************************************************/ if (sousaction.isRendered() == true){ if (action0.isChecked() == true) { /**************************************************************/ //Met a jour la liste objectifs avec le parametre id_action à 0 /**************************************************************/ try{ getSessionBean1().getObjectifRowSet().setInt(1,0); getSessionBean1().getObjectifRowSet().setObject(2,sousaction.getSelected()); objectifDataProvider.refresh(); }catch (Exception e){ error("Impossible de basculer vers l'objectif1"); log("Impossible de basculer vers l'objectif1",e); } } else { /*************************************************************************************/ //Sinon, si aucune case n'est cochée, met a jour la liste objectifs en fct des 2 choix /*************************************************************************************/ try{ getSessionBean1().getObjectifRowSet().setObject(1,action.getValue()); getSessionBean1().getObjectifRowSet().setObject(2,sousaction.getSelected()); objectifDataProvider.refresh(); }catch (Exception e){ error("Impossible de basculer vers l'objectif2"); log("Impossible de basculer vers l'objectif2",e); } } } } public void objectif_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); flagIndic.setDisabled(false); /*********************************/ //Réinitialise le texte informatif /*********************************/ err.setText(""); /*********************************/ //Si la sélection est non nulle... /*********************************/ if (objectif.getSelected() != null){ try{ /****************************************************/ //Met a jour le tableau indicateurs avec la sélection /****************************************************/ getSessionBean1().getIndicateurRowSet().setObject(1,objectif.getSelected()); indicateurDataProvider.refresh(); }catch (Exception e){ error("Impossible de basculer vers l'indicateur"); log("Impossible de basculer vers l'indicateur",e); } } } public void action0_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); err.setText(""); /**************************************************************/ //vérifie que l'autre case n'est pas cochée, si oui, la décoche /**************************************************************/ if (ssaction0.isChecked() == true && action0.isChecked() == true){ ssaction0.resetValue(); action.setRendered(false); sousaction.setRendered(true); action.setForgetValue(true); flagSsaction.setDisabled(false); flagObj.setDisabled(true); try{ getSessionBean1().getObjectifRowSet().setObject(1,0); getSessionBean1().getObjectifRowSet().setObject(2,sousaction.getValue()); if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); } catch (Exception e){ error("Erreur de cochage ss"); log("Erreur de cochage ss",e); } }else { /*********************************/ //Si la check box est cochée faire /*********************************/ if (action0.isChecked()==true) { action.setRendered(false); action.setForgetValue(true); try{ /**************************/ //désactive la liste action /**************************/ getSessionBean1().getObjectifRowSet().setObject(1,0); getSessionBean1().getObjectifRowSet().setObject(2,sousaction.getValue()); if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); } catch (Exception e){ error("Erreur de cochage 1"); log("Erreur de cochage 1",e); } } else { action.setForgetValue(false); action.setRendered(true); flagAction.setDisabled(false); /**************************************************************************/ //Si la case n'est pas cochée, activer la liste action puis la réinitialise /**************************************************************************/ try{ getSessionBean1().getObjectifRowSet().setObject(1,action.getValue()); getSessionBean1().getSous_actionRowSet().refreshRow(); getSessionBean1().getObjectifRowSet().setObject(2,sousaction.getValue()); if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); } catch (Exception e){ error("Erreur de cochage 2"); log("Erreur de cochage 2",e); } } } } public void ssaction0_processValueChange(ValueChangeEvent event) { flag.setDisabled(true); err.setText(""); /**************************************************************/ //vérifie que l'autre case n'est pas cochée, si oui, la décoche /**************************************************************/ if (action0.isChecked()==true && ssaction0.isChecked() == true){ action0.resetValue(); sousaction.setRendered(false); flagSsaction.setDisabled(true); action.setForgetValue(false); action.setRendered(true); flagAction.setDisabled(false); try{ getSessionBean1().getObjectifRowSet().setObject(1,action.getValue()); getSessionBean1().getObjectifRowSet().setObject(2,0); //if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); } catch (Exception e){ error("Erreur de cochage 3"); log("Erreur de cochage 3",e); } } /*********************************/ //Si la check box est cochée faire /*********************************/ else { if (ssaction0.isChecked()==true) { flagSsaction.setDisabled(true); sousaction.setRendered(false); try{ /*************************************************************/ //désactive la liste sous action et initialise son curseur à 0 /*************************************************************/ getSessionBean1().getObjectifRowSet().setObject(1,action.getValue()); getSessionBean1().getObjectifRowSet().setObject(2,0); if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); } catch (Exception e){ error("Erreur de cochage 4"); log("Erreur de cochage 4",e); } } else { sousaction.setRendered(true); flagSsaction.setDisabled(false); flagObj.setDisabled(true); /********************************************************************************/ //Si la case n'est pas cochée, activer la liste sous-action puis la réinitialise /*******************************************************************************/ try{ getSessionBean1().getObjectifRowSet().setObject(1,action.getValue()); getSessionBean1().getSous_actionRowSet().refreshRow(); getSessionBean1().getObjectifRowSet().setObject(2,sousaction.getValue()); if (objectif.getRows()>0) objectif.resetValue(); objectifDataProvider.refresh(); } catch (Exception e){ error("Erreur de cochage ss"); log("Erreur de cochage ss",e); } } } } }