Af:AutoSuggestBehavior declaring suggestItems method dynamically

Hi,
In our application we generate set of input text fields dynamically. We want to have auto suggest behavior for some of them and want to generate the auto suggest handler dynamically.
For example in the code
<af:iterator id="i3" value="#{pair.attributes}"
var="criterion" varStatus="vs2">
<af:switcher id="criteriaSwitcher2"
facetName="#{criterion.attribute.componentType}"
rendered='#{criterion.additionalInfo.type == "attribute"}'>
<f:facet name="inputText">
<af:group id="g3">
<trh:cellFormat halign="right">
<af:outputLabel value="#{criterion.attribute.label}"
id="textLabe"/>
</trh:cellFormat>
<trh:cellFormat>
<af:selectOneChoice id="textCriterionOperator"
value="#{criterion.operator}" >
<f:selectItems value="#{criterion.operators}"
id="nameCriterionOperators"/>
</af:selectOneChoice>
</trh:cellFormat>
<trh:cellFormat>
<af:inputText id="textInput"
value="#{criterion.values[0]}"
*<af:autoSuggestBehavior*
*suggestItems="#{criterion.suggestMethod}"/>* </af:inputText>
</trh:cellFormat>
</af:group>
</f:facet>
</af:iterator>
The criterion.suggestMethod holds EL expression for the actual suggest implementation method. If I give like above, ADF is thinking that criterion.suggestMethod is the actual suggest handler and complaining that no such method exists. How can I achieve this dynamic behavior?

No. I want this dynamically meaning for Criteria1, the handler is onSuggestCriteria1 and for Criteria 2, the handler is onSuggestCriteria2. I have these defined in the Criertia.suggestMethod variable as an EL expression.
For example, the Criteria object for Criteria1 will have #{SuggestBean.onSuggestCriteria1} and Criteria object for Criteria 2 will have #{SuggestBean.onSuggestCriteria2}.
I would like to get these ELs evaluated and represented as below
For example
<af:inputText id="textInput"
value="#{criterion.values[0]}"
<af:autoSuggestBehavior
suggestItems="#{criterion.suggestMethod}"/> </af:inputText>
Should gete translated to some thing like this for criteria1
<af:inputText id="textInput"
value="#{criterion.values[0]}"
<af:autoSuggestBehavior
suggestItems="#{SuggestBean.onSuggestCriteria1}"/> </af:inputText>
and
some thing like
<af:inputText id="textInput"
value="#{criterion.values[0]}"
<af:autoSuggestBehavior
suggestItems="#{SuggestBean.onSuggestCriteria2}"/> </af:inputText>
for criteria 2.
Hope now it is clear.
Thanks

Similar Messages

  • Purpose of declaring the method or class or static and as instance

    what is the purpose of declaring a method in a class or the class itself as static.
    Does it mean we cannot create a copy of that class or method if we declare it as static.
    if so then why do they dont want that class to be created as a copy ?
    Why do they want to declare a class as static
    please provide some conceptual undersatnding regarding the static and instance class with one example

    Static methods are often used for the implementation of utility methods. Please have a look at the class CL_ABAP_CHAR_UTILITIES for example.
    You use the methods of this class in the same way as you would use a function in ABAP (like
    LINES( itab )
    ). You use it in a static way because the functionality is always the same no matter in what context you are calling the function.
    The purpose of instance methods is that their logic is in some way related to an attribute of the object instance that you use to call it.
    For example, you create an instance of object PO (a purchase order) called MY_PO. Then the method
    MY_PO->ADD_POSITION
    would add a position to a concrete PO that has a unique number etc. But if the object has a static method DELETE_POSITION then it just deletes the current position of a PO, regardless on which concrete PO you are acting at the moment.
    I hope this clarifies it for you.
    Regards,
    Mark

  • Invoke a method dynamically

    Hi,
    I want to invoke a method dynamically. I have the class name and method name in a variable and the list of import and export parameter for this method in an internal table. Now I need to invoke this method dynamically i.e. without having it to call in code like this classname->methodname(.....). I want something like reflection in java, where we can call the method using invoke method of method class ex:
    try {
    Method method = cls.getMethod( "setColor",
    new Class[] {Color.class} );
    method.invoke( obj, new Object[] );
    It would be helpful if you can provide a simple example on how it can be implemented in ABAP.
    Thanks,
    Raghavendra

    Hi,
         You can perform calls in that way as follows.
    You need to pass the parameters usingthe following table of type ABAP_PARAMBIND_TAB.
    DATA: ptab type ABAP_PARAMBIND_TAB,
               ptab_line like line of ptab.
    DATA: clas_name type stirng VALUE 'CLASS_NAME',
               method_name type string VALUE 'METHOD_NAME'.
    DATA: obj  type ref to OBJECT.
    create object obj type class_name.
    ptab_line-name = 'PARAM_NAME'.
    ptab_line-kind = CL_ABAP_OBJECTDESCR=>EXPORTING.
    Then you can use
    CALL METHOD  obj->(method_name) PARAMETER-TABLE ptab.
    Regards,
    Sesh

  • Why interfaces can not declare static methods?

    Why interfaces can not declare static methods?

    Why are you shouting?
    Is your internet broken?
    [http://www.google.co.uk/search?q=interface+static+methods+java] 2,440,000 hits.

  • Declaring static methods.

    I have some questions about declaring a method as static. If I first write a paragraph about my understanding so far, followed by a code snippet hopefully somebody can help me out.
    It is my understanding (limited) that only one class is loaded by the classloader. When creating an object, all its parameters are stored, but each object does not have its own copy of the methods its class defines, each method. If a method is declared as static then you do not have to create an instance of this class to call this method.
    Code
    /** Get table of codes.
          * @return <code>Hashtable</code> populated with clinical code values.
        public Hashtable getCodeHashtable(HttpServletRequest request) {
            Hashtable htResults = new Hashtable();
            try {
                SpParameter[] spOut = {
                    new SpParameter(OracleTypes.CURSOR, 0)//po_cur_data
                 HOUtils utils = new HOUtils();
                UtilDBquery db = utils.getUtilDBquery(request);
                htResults = db.runGeneralStoredProcedureThrowsExceptions(null, spOut, SP_CodeList, null, true, true);
            } catch (Exception e){
                 e.printStackTrace();
            return htResults;
    Questions
    1) If each object does not carry around its own copy of the methods associated with its class, how does the jvm know which object is calling a method?
    2) In the above code snippet, if I were to make the method static would this have implications if 2 people were to browse to the same page on the app server and run this method at the same time?
    Thanks for any replies.

    1) If each object does not carry around its own copy of the methods
    associated with its class, how does the jvm know which object is
    calling a method?Each object stores one single pointer to its class description. The class
    description contains all the methods (also the static ones). This is a bit
    of a simplification but basically that's all there is to it. When you call
    a method, the address of the method is looked up in that class description
    and it's invoked. For non static methods there's a hidden parameter,
    called 'this' so the method always 'knows' which object it (the method)
    is invoked on. For static methods that hidden parameter simply isn't
    present.
    2) In the above code snippet, if I were to make the method static
    would this have implications if 2 people were to browse to the same
    page on the app server and run this method at the same time?Who knows? This all depends whether or not the method (static or not)
    is reentrant, i.e. does the method have side effects? Does the method
    needs to be synchronized?
    kind regards,
    Jos

  • Declaring a method

    why do we need to make a method private as well as final in
    private static final methods

    if we declare a method as private then that method can't access in other classes even in subclasses also.
    if the method declare as final then that method can't overridden in sub classes
    if the method declare as static the only one instance is enough for as
    ex: we can call that method in sub classes without creating the object of the super class.
    class a
    static void method1()
    System.out.println("in super class");
    class b extends class a
    Public static void main(String a[]);
    method1();
    it will print in super class as out put.

  • Strange about invoking web service method declared “string  method(void)”;

    Dear forum readers
    I’m experimenting with OpenESB and web services. I’ve create a simple web service using NetBeans 6.1. The method consists of a single method, getTime, that is declared:
    String getTime()
    My current experiment is to invoke this method from a BPEL-process using the “Invoke” process object. The strange thing is that it seems like I have to provide a “dummy” inbound variable from the BPEL-designer even though the method doesn’t take any parameters. I include a snippet from the BPEL process below which includes the section where I set the dummy GetTimeIn-variable and then invokes the WS method getTime().
    <assign name="Assign2">
    <copy>
    <from>'DummyValue'</from>
    <to variable="GetTimeIn" part="parameters"/>
    </copy>
    </assign>
    <invoke name="Invoke1" partnerLink="PartnerLink1" operation="getTime" xmlns:tns="http://ws/" portType="tns:MyWebService" outputVariable="GetTimeOut" inputVariable="GetTimeIn"/>
    If I don’t initiate the dummy variable or remove it altogether, I can’t successfully call the method. If I include the dummy in-parameter the call works just fine and I get back the current time as a string.
    I must admit that I’m still a rookie to web services, especially when calling them from a BPEL-process, so it may be a very trivial reason for this behaviour. Anyway, any help on this matter would be greatly appreciated.
    Regards, Ola

    Thank you both for the response. Regarding Rennay’s posting I have an additional question. When I create a new web service I don't have the "Document Literal" option nor a "Concrete Configuration" tab. I've created the web service using the "Web Application" project type and then adding a web service using the "Web Service..." wizard. This wizard doesn't have the configuration properties you mention, but if I add a WSDL-file to a BPEL-project the wizard has the properties you mention.
    Is it possible to create a web service, programmed as an ordinary Java-class, from an existing WSDL-file? In that case it may solve the problem with the “Document Literal” property. Currently I don’t know any other way to create such a web-service other than the through the web service wizard in a web application project. Of course, it’s possible to craft it from scratch but that’s to much work to be practical.
    Regards, Ola

  • How to declare abstract method

    given - work worked at first .
    fact - then i went to add new entity object names ScottOafE0 . went through all the next sand finished. a package and entity obj already exist. i also tried to put a new package and ScottOafAM in a seperate place. still a no go
    when i went to run the form it errors out w/ below msg.
    Error(14,8): class xxxoaf.oracle.apps.xxuab.hr.newforms.server.ScottOafEOImpl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) in class oracle.apps.fnd.framework.server.OAEntityImpl
    Guess - i tired to put import oracle.apps.fnd.framework.server.OAEntityImpl in the controller file . didnt work
    any idea how to define abstract method ?
    thanks
    scott

    You dont need to define your class as abstract, that would not resolve your issue, what is happening is
    oracle.apps.fnd.framework.server.OAEntityImpl is a abstract class, and has a method declared as setLastUpdateLogin(oracle.jbo.domain.Number) in class
    Now, any class (xxxoaf.oracle.apps.xxuab.hr.newforms.server.ScottOafEOImpl ) extending from this class must either provide a definition to this method (provide the implementation logic), or must itself be declared abstract.
    We had a discussion on this issue in the forum , look for the thread.
    Thanks
    Tapash

  • Error with declaring a method with array variable

    Hi,
    I had implemented this:
    import java.awt.*;
    import javax.swing.*;
    public class Oefening1
         public static void main(String args[])
              int array[]= new int[10];
              int getal;
              JTextArea outputArea = new JTextArea();
              Container container = getContentPane();
              container.add(outputArea);
              public void invoerRij(int array[10])
                   output +=" ";
                   for(int counter = 0; counter <10;counter++){
                        output +="Geef een getal in"+"\n"+array[counter]+"\n";
                        outputArea.setText(output);
    I had comilated this code while the compiler gave errors like these:
    A:\Oefening1.java:15: illegal start of expression
              public void invoerRij(int array[10])
    ^
    A:\Oefening1.java:24: ';' expected
    ^
    A:\Oefening1.java:12: cannot resolve symbol
    symbol : method getContentPane ()
    location: class Oefening1
              Container container = getContentPane();
    ^
    3 errors
    Tool completed with exit code 1
    Now i have read my book and finded out that the declaration of a method always starts with public.
    Can anyone halp me solving these probs? Thanks
    Crazydj1

    The problem is that you didn't close the previous method definition.
    Compiler error messages (in any language) often mistakenly report false errors on perfectly valid code immediately following the actual error.
    When you post code on these forums, please wrap in in &#91;code]&#91;/code] tags.

  • Declaring constructor method public or private.  What's the point?

    My book declares the constructor method public. I tried declaring it private, and without any modifier out of curiousity. It runs exactly the same. What's the point of doing so?
    public class test
         public static void main( String[] args )
              test fun = new test();
              test fun2 = new test(2);     
              System.out.println( fun );
    //          System.out.println( test.toString() );
         public String toString()
              return "This is the toString";
         test()
              System.out.println( "This is the constructor method" );
         test( int x )
              System.out.println( "This is the constructor method: " +x );
    }

    yougene wrote:
    I'm new to OOP so maybe I'm not completely grasping the terminology. But this program works just fine with my class.
    public class test2
         public static void main( String[] args )
              test foo = new test();
    }It gives me the following output
    ----jGRASP exec: java test2
    This is the constructor method
    ----jGRASP: operation complete.The constructor method is executing from an outside class. I tried this with and without the private modifier on the constructor. Same result.Try compiling this.
    public class C1 {
      private C1() {
        System.out.println("C1 c'tor");
    public class C2 {
      public void foo() {
        C1 c1 = new C1();
    }

  • How declara a method in my jsp code?

    I have the following method.
    Somebody knows as there is to declare it in my jsp code?
    Thanks.
    public String reemplaza(String i,String ci,cf)
    String o=i;
    while(o.indexOf(ci)!=-1)
    { o=o.substring(0,indexOf(ci))+cf+o.substring(indexOf(ci)+ci.length(),o.length()); }
    return o;
    }

    Compare the codes and you see the errors.
    //Before(with errors)
    public String reemplaza(String i,String ci,cf)
    String o=i;
    while(o.indexOf(ci)!=-1)
    { o=o.substring(0,indexOf(ci))+cf+o.substring(indexOf(ci)+ci.length(),o.length()); }
    return o;
    //After(with no errors):
    public String reemplaza(String i,String ci,String cf)
    String o=i;
    while(o.indexOf(ci)!=-1)
    { o=o.substring(0,o.indexOf(ci))+cf+o.substring(o.indexOf(ci)+ci.length(),o.length()); }
    return o;

  • How to invoke method dynamically?

    hai forum,
    Plz let me know how do we invoke a dynamically choosen method method[ i ] of a class file by passing parameter array, para[ ].The structure of my code is shown below.. How will i write a code to invoke the selected method method?Plz help.
    public void init()
    public void SelectClass_actionPerformed(ActionEvent e)
    //SELECT A METHOD method[ i ] DYNAMICALLY HERE
    private void executeButton1_mouseClicked(MouseEvent e) {
    //GET PARAMETERS para[ ] HERE.
    //METHOD SHOULD BE INVOKED HERE
    }//end of main class

    Often,a nicer way would be to create an interface like "Callable" with one single "doMagic()" method, and different classes implementing this interface, instead of one class with different methods. Then simply load the class by name, call newInstance(), cast to Callable and invoke doMagic(). Keeps you away from most of the reflection stuff.

  • Declaring field from the internally declared table into dynamic table

    Hi Gurus,
    I need your help on one of my requirements.
    Due to dynamic nature of ALV report, I have used a dynamic internal table to pass it to function module.
    In dynamic tables, I am trying to have one column form the internal table which is being calculated by substracting 2 fields( i,e. diff = wa_stk-labst - wa_stk-omeng). Is it possible to include that field (diff) which is coming from the internally declared table(i_out) into the dynamic table decleration. Please assist.
    Thanks in Advance

    Hi,
    Suppose your dynamic table is of type table.
    When you pass the data from internal table I_OUT to your dynamic table it will get the same structure as of your internally declared table IT_OUT which is calculated by subtracting 2 fields.
    What you can do is create one more field in I_OUT which holds the value of the subtracted amount then pass the table IT_OUT to your dynamic table.
    Thanks
    Bhanu

  • Exception declaration for methods in a Controller

    Hi all enthusiasts of WD,
    me again :-). I just noticed that one cannot declare exceptions thrown by a public method in a controller. Is it on purpose to shut down exception handling?
    Maybe it makes sense to forbid this for the component interface controller, since the interface controller is accessible outside the component, it's not a good idea to ask other components to handle the exceptions specific to one component (after all, a component should be a self-contained unit); but for other controllers like component controller, it's convenient and safe to allow exception declaration --- it can only be accessed inside the component anyway.
    Will this be supported in the future? Thanks.
    Best regards,
    Ge

    Ge,
    You misinterpreted my answer a bit.
    1. Create own subclass of RuntimeException so you may distinguish your exceptions and standard ones like NullPointerException, ArrayIndexOutOfBoundsException:
    public class GeRuntimeException extends RuntimeException {
      public GeRuntimeException(final String message) { super(message); }
      public GeRuntimeException(final Throwable cause) { super(cause); }
      public GeRuntimeException(final String message, final Throwable cause) { super(message, cause); }
    2. Next create concrete sublcasses of your superclass:
    public class GeSecurityException extends GeRuntimeException {
    public class GeDatabaseException extends GeRuntimeException {
      public GeDatabaseException(final java.sql.Exception cause) { super(cause); }
    3. Typical code pattern that throws your exception:
    final PreparedStatement pstmt = ...;
    try {
      pstmt.setInt(1, 0);
      pstmt.setString(2, "String param");
      pstmt.executeUpdate();
    } catch (final SQLException ex) {
      throw new GeDatabaseException(ex);
    4. Typical code pattern that handle exception:
    try {
      wdThis.wdGetOtherController().makeDatabaseCall();
    } catch (final GeDatabaseException ex) {
      wdComponentAPI.getMessageManager().reportException(
        new WDNonFatalException( ex.getCause() ), false
      return;
    } catch (final GeRuntimeException ex) {
      wdComponentAPI.getMessageManager().reportError("Unexpected failure");
      return;
    /* Some other code if no exception */
    Notice that code above does not catch generic RuntimeException, only your sublcasses.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Reg: declaring classes, methods, objects

    Hi,
    Can anyone help me on how do i declare classes and methods in webdynpro. My requirement is to do some functionality in a method of a class and reuse the code wherever i require.
    Can anyone help me on this?
    Thanks
    Regards
    Naveen

    Hi Naveen George ,
                           You can create methods in both component controller and on each view also.
    methods dexlaring in comp controller will be common among all view
    you can call comp controller method like comp_controller->method name in other view
    and own methods can be called like wd_this-> method name.
    you can also use wizard to call methods
    for calling own methods you have to select current controller radio button and for comp_controller you hacve to use used controller.
    you can create method by going to method tab both in view and component controller
    Regards
    Sarath

Maybe you are looking for

  • How to format boothcamp partition

    I have iMac (Snow leopard OS) and a friend set up a partition and installed Windows but after years I realized I don't need it. Is there anyway to format this partition so I can use it as another drive and can be browse from Mac OS? This is my first

  • CS2 doesn't recognize DNG 5.4 converted files.

    Ran the new DNG converter files on Panasonic LX2 RW2 files.  The conversion went well. When I tried to open up the files in either Bridge or CS2 I get: Could Not Complete Your Request Because Photoshop Does Not Recognize This Type of File. The older

  • Browser is freezing every few minutes with facebook and not on other browsers, please help! i love mozilla, can't switch :)

    hey guys, im a devoted user of mozilla but lately whenever i open my facebook (or other sites with lots of adds) it freezes for like a minute, every few minutes. I didn't have this problem when I used explorer nor when doing it on other computers. so

  • Custom table Transport Request

    Hi, I have created a ztable and assigned a package and tranport request, then I have created table maintennance generator for the same table but saved the table maintenance generator under $TMP.  As the table maitenance generator is not allowing to c

  • Ultra Cs3 with Premiere Pro CS4

    I want to make sure I understand the situation with Ultra CS3. I did not upgrade to CS4, I have a standalone Production Premium CS4. I uninstalled PP CS3.  I installed PP CS4.  It took two full days to do. Now I want to use Ultra. From all I can find