Method binding

hi,
i was trying to dynamically build a number of link buttons and associate them all using method binding to an action and this action is supposed to take as argument an ActionEvent object to detect what component triggered the action but when i run the code i always get an illegal agument exception,<br>
<b>here is my code and the error ,wish any one could help<b>
--------Code in backingBean--------------------
Class[] signatures = {ActionEvent.class };
MethodBinding mb1 = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{page2 .processAction}", signatures);
mylink.setActionListener(mb1);
public void processAction(ActionEvent ae) { .... }
---------------------End code-----------------
The exception i get :
Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
Exception Details: java.lang.IllegalArgumentException argument type mismatch
Possible Source of Error:
Class Name: sun.reflect.NativeMethodAccessorImpl
File Name: NativeMethodAccessorImpl.java
Method Name: invoke0
Line Number: -2
Thanks in advance,
sssnbj

Can you try renaming your method to something else instead of processAction(). The default ActionListener also had processAction and so do other actionListeners. I am not sure if that would help but its worth trying. I don't see anything wrong with your code.
Regards
-Jayashri

Similar Messages

  • Method Binding/ method call

    Hi
    I'm new to JSF and I have a problem understanding the Method Binding. I have a backing bean method which i want to be excecuted. I created a method binding like
    <t:tree dataSource="'#{Tree.configure}"/>
    My component extends UICommand and the action property is set correctly.
    But the Method configure() in class "Tree" is not excecuted. Maybe I understand something completely wrong with the method binding. Can anybody help me?
    Thanks in advance

    It is in fact a custom component
    My Tag-class
    public class JSFTreeTag extends UIComponentTag{
        public static final String RENDER_TYPE ="UITreeRenderer";
        public static final String COMPONENT_TYPE = "UITree";
        private String dataSource = "";
        private String immediate = "";
        /** Creates a new instance of JSFTreeTag */
        public JSFTreeTag() {
        public void setDataSource(String dataSource){
            this.dataSource = dataSource;
        public String getDataSource(){
            return this.dataSource;
        public void setImmediate(String immediate){
            this.immediate = immediate;
        protected void setProperties(UIComponent component){
            super.setProperties(component);
            UITree tree = null;
            try{
                tree = (UITree) component;
            }catch(ClassCastException cce){
                System.err.print("Component "+component.toString()+" is not of the expected type!");
            if (dataSource != null){
                if(isValueReference(dataSource)){
                   MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(dataSource, null);
                   tree.setAction(mb);
                }else{
                    tree.getAttributes().put("dataSource", dataSource);
            if (immediate != null) {
                if (isValueReference(immediate)) {
                    ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding(immediate);
                    tree.setValueBinding("immediate", vb);
                }else{
                     boolean _immediate = new Boolean(immediate).booleanValue();
                     tree.setImmediate(_immediate);
        public void release(){
            super.release();
            this.dataSource = null;
       public String getComponentType() {
            return COMPONENT_TYPE;
        public String getRendererType() {
            return RENDER_TYPE;
    }Component class
    public class UITree extends UICommand{
        public static final String FAMILY = "UITreeFamily";
        /** Creates a new instance of UITree */
        public UITree() {
        public Object saveState(FacesContext context){
            Object[] save = new Object[1];
            save [0] = super.saveState(context);
            return save;
        public void restoreState(FacesContext context, Object state){
            Object[] restore = (Object[]) state;
            super.restoreState(context, restore[0]);
        public String getFamily(){
            return FAMILY;
    }The component is not finished but debugger says that the action and iimmediate is set.
    tld
    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
      version="2.0">
       <tlib-version>0.01</tlib-version>
      <tag>
           <name>jsftree</name>
                <tag-class>com.bla.bli.blubb.JSFTreeTag</tag-class>
           <attribute>
                <name>dataSource</name>
                <required>false</required>
                <rtexprvalue>false</rtexprvalue>
                <type>java.lang.String</type>
           </attribute>
            <attribute>
                <name>immediate</name>
                <required>false</required>
                <rtexprvalue>false</rtexprvalue>
                <type>java.lang.String</type>
            </attribute>
      </tag>
    </taglib>The renderer is not ready yet (just a code skeleton.
    I developed a custom component before so i have some (not much) experience but i have problems with the method binding

  • Web service method binding (flash builder issue)

    I have a new Flash Builder (Flex) project, basically it has 2 combo boxes in it. I have added a web service, the service is called uws_lookups and has 2 methods, lookupLanguage and lookupCountry.
    If I bind a combobox to the result from either of these services everything works as expected, here is the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:uws_lookups="services.uws_lookups.*"
          minWidth="955" minHeight="600">
    <fx:Script>
      <![CDATA[
       import com.adobe.serializers.utility.TypeUtility;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       protected function comboBox_creationCompleteHandler(event:FlexEvent):void
        lookupCountryResult.token = uws_lookups.lookupCountry();
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:CallResponder id="lookupCountryResult"/>
      <uws_lookups:Uws_lookups id="uws_lookups"
             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
             showBusyCursor="true"/>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:ComboBox id="comboBox" creationComplete="comboBox_creationCompleteHandler(event)" labelField="countryName">
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupCountryResult.lastResult.Tables.Country.Rows)}"/>
    </s:ComboBox>
    <s:ComboBox/>
    </s:Application>
    As you can see the combobox gets bound, the results are returned and displayed, however when I bind the second box to the other method Flash Builder does the most stupid thing ever:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:uws_lookups="services.uws_lookups.*"
          minWidth="955" minHeight="600">
    <fx:Script>
      <![CDATA[
       import com.adobe.serializers.utility.TypeUtility;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       protected function comboBox_creationCompleteHandler(event:FlexEvent):void
        lookupCountryResult.token = uws_lookups.lookupCountry();
       protected function comboBox2_creationCompleteHandler(event:FlexEvent):void
        lookupLanguageResult.token = uws_lookups.lookupLanguage();
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:CallResponder id="lookupCountryResult"/>
      <s:CallResponder id="lookupLanguageResult"/>
      <uws_lookups:Uws_lookups id="uws_lookups" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:ComboBox id="comboBox" creationComplete="comboBox_creationCompleteHandler(event)" labelField="countryName">
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupCountryResult.lastResult.Tables.Country.Rows)}"/>
    </s:ComboBox>
    <s:ComboBox id="comboBox2" creationComplete="comboBox2_creationCompleteHandler(event)" labelField="LanguageName">
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupLanguageResult.lastResult.Tables.Country.Rows)}"/>
    </s:ComboBox>
    </s:Application>
    Now I'm pretty sure that isnt what I asked it to do, so I manually change the code line to read correctly
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupLanguageResult.lastResult.Tables.Language.Ro ws)}"/>
    Which enables to second combobox to work, but the original one (countries) now displays [Object: Language_type]
    I have debugged the application and both methods do actually return the correct data, FB is just choosing to do something stupid when I add the second call.
    I have done the basics, deleted the project and started again, tried a different web service, tried different methods, but it looks like when I use more than one method it fails, so please tell me, what am I doing wrong because I know Flash Builder cannot be doing this by design.
    I will post the service response in another post.
    Thanks for any help you have!
    Shaine

    Ok, lets prove I'm not going mad. New Project, add webservice, which has 2 methods as before. Drag datagrid to stage and bind to data for lookup countries, the code generated is:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:uws_lookups="services.uws_lookups.*"
          minWidth="955" minHeight="600">
    <fx:Script>
      <![CDATA[
       import com.adobe.serializers.utility.TypeUtility;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
        lookupCountryResult.token = uws_lookups.lookupCountry();
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:CallResponder id="lookupCountryResult"/>
      <uws_lookups:Uws_lookups id="uws_lookups"
             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
             showBusyCursor="true"/>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:DataGrid id="dataGrid" x="10" y="10" width="400" height="580"
        creationComplete="dataGrid_creationCompleteHandler(event)" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="ID" headerText="ID"></s:GridColumn>
        <s:GridColumn dataField="countryName" headerText="countryName"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object countryName="countryName1" ID="ID1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupCountryResult.lastResult.Tables.Country.Rows)}"/>
    </s:DataGrid>
    </s:Application>
    So. now te good bit, drag another datagrid to the stage and bind to the second method (languages), and guess what? it all goes horribly wrong, here is the complete code for that too:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:uws_lookups="services.uws_lookups.*"
          minWidth="955" minHeight="600">
    <fx:Script>
      <![CDATA[
       import com.adobe.serializers.utility.TypeUtility;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
        lookupCountryResult.token = uws_lookups.lookupCountry();
       protected function dataGrid2_creationCompleteHandler(event:FlexEvent):void
        lookupLanguageResult.token = uws_lookups.lookupLanguage();
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:CallResponder id="lookupCountryResult"/>
      <uws_lookups:Uws_lookups id="uws_lookups"
             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
             showBusyCursor="true"/>
      <s:CallResponder id="lookupLanguageResult"/>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:DataGrid id="dataGrid" x="10" y="10" width="400" height="580"
        creationComplete="dataGrid_creationCompleteHandler(event)" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="ID" headerText="ID"></s:GridColumn>
        <s:GridColumn dataField="countryName" headerText="countryName"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object countryName="countryName1" ID="ID1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupCountryResult.lastResult.Tables.Country.Rows)}"/>
    </s:DataGrid>
    <s:DataGrid id="dataGrid2" x="418" y="10" width="400" height="590"
        creationComplete="dataGrid2_creationCompleteHandler(event)" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="ID" headerText="ID"></s:GridColumn>
        <s:GridColumn dataField="LanguageName" headerText="LanguageName"></s:GridColumn>
        <s:GridColumn dataField="LanguageCode" headerText="LanguageCode"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object ID="ID1" LanguageCode="LanguageCode1" LanguageName="LanguageName1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupLanguageResult.lastResult.Tables.Country.Rows)}"/>
    </s:DataGrid>
    </s:Application>
    Now this is without ANY modification from me whatsoever, and all I get is the CountryID field displayed, so I modify the code manually to read:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:uws_lookups="services.uws_lookups.*"
          minWidth="955" minHeight="600">
    <fx:Script>
      <![CDATA[
       import com.adobe.serializers.utility.TypeUtility;
       import mx.controls.Alert;
       import mx.events.FlexEvent;
       protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
        lookupCountryResult.token = uws_lookups.lookupCountry();
       protected function dataGrid2_creationCompleteHandler(event:FlexEvent):void
        lookupLanguageResult.token = uws_lookups.lookupLanguage();
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:CallResponder id="lookupCountryResult"/>
      <uws_lookups:Uws_lookups id="uws_lookups"
             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
             showBusyCursor="true"/>
      <s:CallResponder id="lookupLanguageResult"/>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:DataGrid id="dataGrid" x="10" y="10" width="400" height="580"
        creationComplete="dataGrid_creationCompleteHandler(event)" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="ID" headerText="ID"></s:GridColumn>
        <s:GridColumn dataField="countryName" headerText="countryName"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object countryName="countryName1" ID="ID1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupCountryResult.lastResult.Tables.Country.Rows)}"/>
    </s:DataGrid>
    <s:DataGrid id="dataGrid2" x="418" y="10" width="400" height="590"
        creationComplete="dataGrid2_creationCompleteHandler(event)" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="ID" headerText="ID"></s:GridColumn>
        <s:GridColumn dataField="LanguageName" headerText="LanguageName"></s:GridColumn>
        <s:GridColumn dataField="LanguageCode" headerText="LanguageCode"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
      <s:typicalItem>
       <fx:Object ID="ID1" LanguageCode="LanguageCode1" LanguageName="LanguageName1"></fx:Object>
      </s:typicalItem>
      <s:AsyncListView list="{TypeUtility.convertToCollection(lookupLanguageResult.lastResult.Tables.Language.Rows)}"/>
    </s:DataGrid>
    </s:Application>
    And now I can see the CountryID, LanguageID, LanguageName and LanguageCode, but still no Country Name, so where do I look now, and more to the point why is this happening?
    Please please please please help, this is just slightly more than business critical, I have to justify the cost of this project, and so far, not having  lot of fun with it.
    Thanks
    Shaine

  • Multiple Iterator for single Method Binding

    Hi,
    I have a POJO data control, which is exposing a method that is calling web service and fetching the data. The method has been added on the page as method action and created corresponding methodIterator. Now i want to create multiple tables based on the data set returned by the method but with different filter criteria. I tried using custom filterModel for this, it was working as well but data control method was getting called for each row populated in the table. This was causing Web Service call for each row.
    To avoid this, i created methods that are returning row sets to be populated in each tables in managed bean. Now i am trying to create MethodIterator based on these methods that will be referred by the table binding but its not working. How can i add these methods in managed bean as methodAction in my page definition file.
    Please let me know if there is any other way to achieve this. To summarize, i need to create multiple table with different filter criteria using one method that is returning complete data set using minimum service calls.
    JDev : 11.1.1.6.
    Thanks

    You don't understand. My JPanel implements the MouseListener interface and its mousePressed(MouseEvent ) method gets called THREE TIMES on a single mouse click. Normally it should only be called ONCE.
    It seems that the app that is using the JPanel extension has somehow registered it as interested in mouse events MULTIPLE TIMES.
    I've never seen this before in Swing and was wondering if anyone else has.
    Thanks,
    Ted

  • Method Binding to JSF 1.0 validate-Method error

    Hi there,
    Iam impressed, changing from Beta to 1.0 wasn't that much work at all, I just got one problem left:
    <h:inputText value="#{methodsBean.orderNumber}" validator="#{methodsBean.checkOrderNumber}"/>
    This is my method:
         public void checkOrderNumber(FacesContext context, UIInput input, Object value) throws ValidatorException
              String orderNumber = (String)input.getValue();
              if (orderNumber.startsWith("100-") && orderNumber.length() == 8)
                   //ok
                   input.setValid(true);
              else
                   FacesMessage message =
                        new FacesMessage(
                             resources.getString("order_number_wrong"),
                             resources.getString("order_number_wrong_detail"));
                   throw new ValidatorException(message);               
    It does not work, but what's wrong? I
    any ideas?!
    Thanx!

    hi,
    perhaps you must use UIComponent instead of UIInput
    the signature of Validator.validate() changed.
    Object was added (you have it)
    and UIComponent instead of UIInput.
    here a method of me:
    public static void validateEmail(
              FacesContext context,
              UIComponent component,
              Object value)
              throws ValidatorException {
              if ((context == null) || (component == null)) {
                   throw new NullPointerException();
              if (!(component instanceof UIOutput)) {
                   return;
              String inhalt = value.toString();
                     //GenericValidator aus Commons-Validator-Projekt
              if (!GenericValidator.isEmail(inhalt)) {
                   FacesMessage fehler =
                        MessageFactory.getMessage(
                             context,
                             "EMAIL_UNGUELTIG",
                             new Object[] { "[email protected]" });
                   throw new ValidatorException(fehler);
         }cheers,

  • JSF Method Binding

    Hi everyone, I'm totally new to JSF and have been working on the examples by the James Holmes book, JSF Complete Ref:
    http://www.jsfcompref.com/code_download.html
    I have a question on MethodBinding managed beans.
    In my faces-config.xml file I can specify a value for my currentYear.
      <managed-bean>
        <managed-bean-name>UserBean</managed-bean-name>
        <managed-bean-class>com.jsfcompref.register.UserBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
              <property-name>currentYear</property-name>
              <value>2007</value>
         </managed-property>
      </managed-bean>And I can retreive that as follows:
    <h:inputText value="#{UserBean.currentYear}" required="true"
                                  id="currentYear"/>That works, what I want to do is call a method from my faces-config file as such:
        <managed-property>
              <property-name>currentYear</property-name>
              <value>#{UserBean.someMethod}</value>
         </managed-property>But that returns an error
    javax.faces.FacesException: Detected cyclic reference to managedBean UserBean...Any ideas what I'm doing wrong?

    BalusC wrote:
    You indeed cannot let the managed bean preinstantiate itself before setting any value in self. That would cause an infinite loop of managed bean creations, that's why this "cyclic reference" error is been thrown.
    The only solution is to use the constructor for that instead:public UserBean() {
    currentYear = someMethod();
    Thank you Balus!! That was so easy it's scary :)

  • Calling a method on backing bean in response to contextual event

    Hi
    I am using Jdeveloper 11.1.1.6.0 and using ADF contextual events..
    I have a drop down list and i am rasiing a contextual event on changing the current selection. In response to that event i want to call a backing bean method with parameters.. But when i click on the subscriber section for the contextual event, i can see only some bindings of the page.. How can i call a method on backing bean as a subscriber..
    Thanks
    Raghu

    Hi,
    this article has a use case for the POJO approach: http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html
    Another is to define a method binding in the receiving PageDef file and configure it as explained here
    http://java.net/projects/smuenchadf/pages/ADFSamplesBindings/revisions/3#SMU164
    Frank

  • Why is my JavaServiceFacade persist() method is receiving NULL object

    My jDeveloper version is 11.1.1.3.0
    I have a jspx in which i want to save an employee into my DB on the click of submit button.
    I have made an entity object(Employee.java) made from a table EMPLOYEE. I then exposed this entity bean using a JavaServiceFacade. This JavaServiceFacade class has a method with signature persistEmployee(Employee employee).
    In my UI, i have made made a Submit button by dragging the persistEmployee() method from my DataControls pallette to my jspx, and the actionListener binding for this is ="#{bindings.persistEmployees.execute}".
    Now when i click on the submit button, the persistEmployee() method throws an exception which is below...
    ______ java.lang.IllegalArgumentException: Object: null is not a known entity type_______
    I found that the persistEmployee() method is not receiving an Employee object as an argument due to which this error is thrown.
    Can somebody pls guide me on what could be the issue.
    BELOW ISTHE CODE WHICH I HAVE USED.
    .......button code in my jsp.......
    <af:commandButton text="Submit"
    binding="#{backing_LdapUserCreation.cb5}"
    id="cb5"
    actionListener="#{bindings.persistEmployees.execute}"
    disabled="#{!bindings.persistEmployees.enabled}"/>
    .......method code which got generated in teh javaservicefacade..(here the employee argument received by the first line is NULL).....
    public Employees persistEmployees(Employees employees) {
    System.out.println("IS employees NULL ? = "+employees);
    return (Employees)_persistEntity(employees);
    .......binding code in my pagedefinition.........
    <methodAction id="persistEmployees" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="persistEmployees"
    IsViewObjectMethod="false" DataControl="EmployeeService"
    InstanceName="EmployeeService.dataProvider"
    ReturnName="EmployeeService.methodResults.persistEmployees_EmployeeService_dataProvider_persistEmployees_result">
    <NamedData NDName="employees" NDType="model.test.Employees" />
    </methodAction>

    Hi,
    when you dragged the persist method from the DataControls panel, a dialog opens that in its lower area shows the argument that the method expects. This argument needs to be pointed to <iterator name> | currentRow | data provider. To do this, click into the method argument value field and click the button on its right to bring up the EL editor. Then expand the iterator node under the Bindings node. Expand currentRow and select dataProvider.
    You can do this after creating the method binding as well. Select the PageDef file in the Application Navigator and open the Structure Window. Expand the persist method: it shoudl have a child element. Select the child item and in the Property Inspector set its NDValue property
    Frank

  • Calling a method from a UICommand Object

    How do I call an action method from a UICommand object?
    I create a HtmlCommandLink in my backing bean, and I think I should be setting the action, but with what? The method takes a MethodBinding but I can't find much detail on how to get that. I just want to call a method like linkAction1_action() in the example below, but you cannot pass a method.
    public class Page1 extends AbstractPageBean {
      private HtmlPanelGroup panel = new HtmlPanelGroup();
      public HtmlPanelGroup getPanel() {
        return panel;
      public void setPanel(HtmlPanelGroup panel) {
        this.panel = panel;
      public Page1() {
        HtmlCommandLink link = new HtmlCommandLink();
        link.setAction(/* what do I put here */);
        this.panel.getChildren().add(link);
      public String linkAction1_action() {
        return "GoBack";
    }

    OK. A couple days later and I am able to answer my
    own question. Anyway, I will lay it out there for
    anyone interested. This worked for me...
    public class Page1 extends AbstractPageBean {
    private HtmlPanelGroup panel = new HtmlPanelGroup();
    public HtmlPanelGroup getPanel() {
    return panel;
    public void setPanel(HtmlPanelGroup panel) {
    this.panel = panel;
    public Page1() {
    HtmlCommandLink link = new HtmlCommandLink();
    link.setAction(
    FacesContext.getCurrentInstance()
    .getApplication()
    .createMethodBinding("#{Page1.linkAction1_action}",
    new Class[0]));
    this.panel.getChildren().add(link);
    public String linkAction1_action() {
    return "GoBack";
    Since you're setting the action from within the Page1 object, why don't you create a method binding manually? This will be much more performant that using the application to create and EL-based binding.
    Try:
    link.setAction(new MethodBinding()
          public Object invoke(FacesContext facesContext, Object[] objects) throws EvaluationException, MethodNotFoundException
            return linkAction1_action();
          public Class getType(FacesContext facesContext) throws MethodNotFoundException
            return String.class;
    });Note that you also avoid any naming convention - you do not require your Page1 object to be configured as a managed bean "Page1".

  • SelectOneChoice value needed for find-method to refresh table

    I would like to implement a filter that will filter the dataset, resultset returned by my adf-table.
    The user has to select a value in the dropdown-list and after he has made a selection the table has to be refreshed using the value of the dropdown as a parameter-value for the find-method.
    I'm using a partialtrigger to raise the refresh-event on my table, autosubmit on my dropdown and partialtrigger-attribute on my table. Now I want to pass the value of the selectOneChoice to the key-value pair used for the find-method in my pageDefinition-file.
    What's the best practice to add this parameter-value?

    Frank,
    We tried the ValueChangeListener already on the selectOneChoice-component, but the listener doesn't get fired when you choose a new value in the selectOneChoice. Only the first time the method in our backing bean is accessed, and no other times.
    We are using datacontrols based on ejb 3.0 session beans as our persistence layer instead of BC and we would like to put the chosen value of the selectOneChoice-component in the parameter of our method binding. We should be able to it in the same manner as you've mentioned in the example, by accessing the paramMap.
    Thanks for the advise !

  • Am method and popup

    When I drag and drop a AM method in a main (non popup) page as a ADF BUTTON it works fine.
    But when I drag and drop the same AM method in a popup page as a ADF BUTTON it does not work.
    Any idea why please?

    880887 wrote:
    I already had a method action in pagedef. Now I added a Invokeaction also in the Executables section and set as "as needed".
    it calls the method now.
    Another issue now I am facing is , in the popup the inputtextfield is myfield1. when I enter that value and click this button,
    I am reading that myfield1 in AM method. Somehow it returns a null .
    Any clue.Invoke action is not right way to go specially under executable section. You need method binding under bindings section.
    You cannot read the values in AM method from inputText field (if it is not persistence) you can read values in managed bean method in a View Controller project.
    if you clearly define your use case then one can help you better.....if this issue is resolved close this thread and open another one.....
    Zeeshan

  • Import/Export code using Memory ID in BO Method

    Hi experts,
    I am having a approver name and other relevant data in my report. I don't want to write the entire code I want to bring it into my BO method by using import/export memory id. Pl. guide me what should I do ? Is it possible or not?
    Thank you,
    Saquib

    I am a bit confused that what you are trying to achieve. In any case I think you can forget any export/import memory ID related solutions - they will not work!
    The workflow (or its step/task) is executing your BO method, right? You want this method to have some data when it gets executed? Normally you would want to populate the data to the workflow (or task) container, for example with function SAP_WAPI_WRITE_CONTAINER (you just need the work item ID). Then when this data is in the container, you can use it in your method (binding required).
    Somehow I feel that you looking a difficult solution for a simple problem. If you need some relevant data in your workflow, let the workflow to find it (add a new step to the workflow, and copy/paste the relevant part of the code of your report to this step). (Or try to give the data to the workflow already when it gets started, if possible). Don't try to mix things with some separate report, unless it is completely necessary, and if it is, then writing into the container is most likely the best approach.
    Regards,
    Karri

  • Adding and Calling custom method to the application module or view object

    My project uses jheadstart 10.1.2.
    I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
    I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
    THANKS for your help

    Yes, method binding has been added to the page UI model.
    I have find some clue that When I darg and drop metod as a submitButton, the code "
    <SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
    is added to the uix page code. I change this code like this;
    <button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
    by adding onClick method and changed submitButton to button tag..
    Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

  • How to call a method defined in AM when I select any value in LOV

    Lets say there is a LOV. The scenario is as soon as I select any value in LOV, a method needs to be called which I have written in the AM. And the output of the method is displayed in a output text box.
    I am not able to understand how to call a method when the user selects any value in LOV.
    This is wht I did. I had created the binding for the method. Changed the autosubmit property of the LOV to True, and in the properties of the output box, in the partial submit trigger property, passed the ID of the LOV. But I didnt get any place where I need to call the method. I am also not able to drop an action listener on the LOV

    Hi,
    +"its showing an error(underlined in orange)."+
    Any reason you don't share this error with us? Anyway, here is how it goes
    1. LOV, set autosubmit="true" and configure a value change listener
    2. Expose the AM method as a method binding in the PageDef file
    3. In the value change listener:
    BindingContext bctx = BindingContxt().getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    OperationBinding method = (OperationBinding) bindings.get("name of method binding in PageDef");
    method.getParamsMap().put("argument name1", value1);
    method.getParamsMap().put("argument name2", value2);
    Object retVal = method.execute();
    if(!method.getErrors().isEmpty()){
      //handle errors
    else{
      //write retVal to the managed bean variable that is referenced by the outputText value property
      //PPR output text component
      ADFFacesContext.getCurrentInstance().addPartialTarget(outputTextRef);
    }Note that you may have to set clientComponent = "true" on the output text component
    Frank

  • JSF Declarative Component - Using a method?

    Hello. I'm creating a declarative component that has a submit button. I want the submit button to be defined, but I want the person using the component to define the action (ex, they specify which method from an AM to execute) How can I do this? I tried defining a method and setting the buttons action to comp.whatever. However, when the person defines the button and points the method to the binding layer, it can never located the method.
    Thanks, Graeme.

    Hi Shay, thanks for the response. I have read the tutorial. The only difference is in the tutorial it's executing a method on the view object. I need to execute a method on my application module. I defined it on my declarative component as:
    <af:commandButton text="commandButton 1" id="dc_cb1"
    actionListener="#{comp.submitRegistrationForm}"/>
    As this kind of method attribute
    <method-attribute>
    <attribute-name>
    submitRegistrationForm
    </attribute-name>
    <method-signature>
    void submitRegistrationForm(oracle.jbo.ViewObject)
    </method-signature>
    <required>
    false
    </required>
    </method-attribute>
    Then I dragged in my custom component and defined my submit button as #{bindings.sendRegistration.execute} The sendRegistration is a method in my AM. I created a method binding for this as
    <methodAction id="sendRegistration"
    InstanceName="RegistrationAMDataControl.dataProvider"
    DataControl="RegistrationAMDataControl"
    RequiresUpdateModel="true" Action="invokeMethod"
    MethodName="sendRegistration" IsViewObjectMethod="false"
    ReturnName="RegistrationAMDataControl.methodResults.sendRegistration_RegistrationAMDataControl_dataProvider_sendRegistration_result">
    <NamedData NDName="vo" NDValue="#{bindings.FirstName.attributeValue}"
    NDType="oracle.jbo.ViewObject"/>
    </methodAction>
    However, everytime I hit the button I get an error the method does not exist. Method not found: UserRegistrationFormComponent[oracle.adf.view.rich.component.fragment.UIXInclude$ContextualFacesBeanWrapper@1572ca2, id=urf1].SubmitRegistrationForm(javax.faces.event.ActionEvent)
    Is it possible to call this to my AM?
    Thanks.

Maybe you are looking for

  • Javax.print problem: data not of declared type

    Hi all, I'm trying to print a simple text-only document with the below code but it keeps giving me an illegal argument exception. By the way, I've tried all the combinations of DocFlavor.*.* and SERVICE_FORMATTED.PRINTABLE and SERVICE_FORMATTED.PAGEA

  • Java Mapping for HTTP Post

    Hi Im following this blog http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/09/12/html-form-upload-using-http-plain-adapter-with-java-mapping but I have encountered an issue which I cannot solve. My issue is, in addition to the required ou

  • Solaris 8 for intel boot disk.

    My Solaris 8 for intel boot disk was delivered to me corrupted and will not boot in serveral of my machines, how do I go about creating another one or should I request a replacement. Thanks.

  • Problem uploading attachments with Safari 4 & gmail.

    I didn't have this problem with the beta, but with the release version whenever I upload an attachment, after I select the file nothing happens. Anyone else have this problem, or is this a pebcak problem?

  • Model number not listed

    I just bought this L655-s5117 Two weeks ago and cant find it listed on toshiba site. Best buy does not show it exsist. unable to list for support. Wassup? Solved! Go to Solution.