2 Replies Latest reply: Apr 12, 2012 6:12 AM by Prasad K T RSS

    Method not supported

    Prasad K T
      Hi !!

      I am using jdeveloper 11.1.1.5

      I had coded one method in my AMImpl
      public String getCurrentYear(String bu, Date id){
              
              CallableStatement cs = null;
              try{
                  
      
              cs=getDBTransaction().createCallableStatement("begin ? := FUNC_FIND_YEAR(?,?); end;",0);
      
              cs.registerOutParameter(1, Types.VARCHAR);
              
              
      
              cs.setDate(3, id);
              cs.setString(2,bu);
                 
                  
              cs.executeUpdate();
               
                  System.out.println ("Current Year :::::"+cs.getString(1));
                  return cs.getString(1);
                  
              }catch(SQLException e){
      
              throw new JboException(e);
      
              }
              finally {
                  if (cs!=null)
                      try{
                      cs.close();
                      }
                      catch (Exception e){System.out.println ("Exception Thrown "+e);}
              }
          }
      I had dragged and dropped this method in my jspx page as parameter form.

      While i am running my jspx page and clicking the button am getting the error as
      Method SupplierAMDataControl.dataProvider.getCurrentYear() not supported
      could any one please help me where i went wrong.
        • 1. Re: Method not supported
          Timo Hahn
          First you should avoid to name parameters 'id' as this is used for other stuff like PKs. next you need to tell us which data type the date is (java.util.date, java.sql.date or oracle.jbo.domain.date).

          How does the page look like?
          Mine works OK
                        <af:panelFormLayout id="pfl1">
                          <af:inputText value="#{bindings.bu1.inputValue}" label="#{bindings.bu1.hints.label}"
                                        required="#{bindings.bu1.hints.mandatory}"
                                        columns="#{bindings.bu1.hints.displayWidth}"
                                        maximumLength="#{bindings.bu1.hints.precision}"
                                        shortDesc="#{bindings.bu1.hints.tooltip}" id="it2">
                            <f:validator binding="#{bindings.bu1.validator}"/>
                          </af:inputText>
                          <af:inputDate value="#{bindings.idate.inputValue}"
                                        label="#{bindings.idate.hints.label}"
                                        required="#{bindings.idate.hints.mandatory}"
                                        shortDesc="#{bindings.idate.hints.tooltip}" id="id2">
                            <f:validator binding="#{bindings.idate.validator}"/>
                            <af:convertDateTime pattern="#{bindings.idate.format}"/>
                          </af:inputDate>
                          <af:commandButton actionListener="#{bindings.getCurrentYear1.execute}"
                                            text="getCurrentYear1"
                                            disabled="#{!bindings.getCurrentYear1.enabled}" id="cb1"/>
                           <af:outputText value="xxxx #{bindings.return.inputValue}" id="ot13"/>
                        </af:panelFormLayout>
          and
              public String getCurrentYear(String bu, oracle.jbo.domain.Date idate)
              {
                  return "hallo " + bu + " --- " + idate;
              }
          Timo
          • 2. Re: Method not supported
            Prasad K T
            Thank you timo!!

            Mine is working good!! What i had done is i just changed my datatype!