0 Replies Latest reply on Dec 3, 2019 7:26 AM by Sohail Anwar

    Disable cancel image in Bank Transfer Search form

    Sohail Anwar

      I want to disable cancel image on the basis of some conditions. This is bank transfer search page and I am extending SearchTransfersCO controller class. Problem is image is not being hide or disabled. Below is my code:

       

                String trxnRefNumber = paramOAPageContext.getParameter("trxnReferenceNumber");

                int vResponsibilityId = paramOAPageContext.getResponsibilityId();

                OADBTransaction trans = oAApplicationModule.getOADBTransaction();

                CallableStatement cs = trans.createCallableStatement("BEGIN :1 := XCOMPANY_BANK_TRANFER_BD_CHECK_F(:2,:3); END;",0);

                try

                {

                  cs.registerOutParameter(1,Types.VARCHAR);

                  cs.setString(2,trxnRefNumber);

                  cs.setInt(3,vResponsibilityId);

                  cs.execute();

                  String vResult = cs.getString(1);

                  if("0".equals(vResult))

                  {

                   //OASwitcherBean sb = (OASwitcherBean)paramOAWebBean.findChildRecursive("CancelSwitcher");

                   OAImageBean imgbean = (OAImageBean)paramOAWebBean.findChildRecursive("CancelEnabled");

                   imgbean.setRendered(false);

                  }

                  /*else

                  {

                    OASwitcherBean sb = (OASwitcherBean)paramOAWebBean.findChildRecursive("CancelSwitcher");

                    sb.setRendered(true);

                  }*/

                 }

                              catch(SQLException e)

                              {

                                throw new OAException("Unexpected error bank transfer extension "+e.getMessage(),OAException.ERROR);

                              }

       

      Previously I did using switcher bean but it disabled cancel option for all responsibilities. I want to disable for specific responsibilities which will be determined by function XCOMPANY_BANK_TRANFER_BD_CHECK_F

       

      Please suggest how to achieve this.