8 Replies Latest reply: Jan 18, 2013 7:21 AM by MahdiCharara RSS

    how to set Save and Apply button to disabled

    MahdiCharara
      Hi all

      i need to disable the save and apply buttons according to some action the user is doing, when the user changes some LOV value the save button should be disabled

      the following code i am using is not working to disable the button,

      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) {

      String val = "";
      String message = "";
      int statusVal = 0;
      try {
      super.processFormRequest(pageContext, webBean);
      if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) {

      OAMessageChoiceBean rGBean1 = (OAMessageChoiceBean)webBean.findIndexedChildRecursive("Status");
      if (rGBean1 != null) {
      val = (String)rGBean1.getValue(pageContext);
      statusVal = Integer.parseInt(val);
      if (statusVal == 1) {
      OAApplicationModule am = pageContext.getApplicationModule(webBean);
      OAViewObject vo1 = (OAViewObject)am.findViewObject("WOCreateUpdateVO");
      vo1.reset();
      if (vo1 != null) {
      vo1.next();
      OARow row = (OARow)vo1.getCurrentRow();
      String ReasonCode = (String)row.getAttribute("Attribute1");
      //message = message + ReasonCode;
      if (ReasonCode == null) {

      OASubmitButtonBean savebBean = ((OASubmitButtonBean)webBean.findChildRecursive("Save"));

      if (savebBean != null){
      savebBean.setDisabled(true);
      }
      OASubmitButtonBean applybBean = ((OASubmitButtonBean)webBean.findChildRecursive("Apply"));

      if (savebBean != null){
      applybBean.setDisabled(true);
      }

      }
      }

      }
      }
      }

      }
      catch(Exception exception){
      throw new OAException("Error in Staffing Query: "+exception, OAException.ERROR);
      }

      please any one had this issue.

      any help??

      Regards,