Passing a method call to a facelet tag

Hello,
I am trying to create a JSF confirmation box that replaces the Javascript confirm() function. I am using Seam and Rich Faces 3.2.1. The confirm box is a facelet tag that pops up a modal box with 'cancel' and a 'continue' buttons. Everything is working correctly except for one crucial piece; passing the method call for continue button.
Here is the set up for the facelets tag in the main xhtml page:
<at:confirm
    id="confirm"
    title="Confirm"
    message="Do you want to continue"
    buttonText="Continue"
    backingBean="#{confirmAction}"
    method="testMethodTwo"
/>Here is the code for the button inside the facelets tag:
<a4j:commandLink
    styleClass="rdSplGr1"
    href="#"
    action="#{backingBean[method]}">
    <s:span>#{buttonText}</s:span>
</a4j:commandLink>The method simply does nothing when the use clicks the button. I am assuming this is due to the lack of "()" however there does not seem to be a way to get those in there. I have tried the following:
1) placing the parens like this - method="testMethodTwo()"
2) placing the parens like this - action="#{backingBean[method]()}"
The first does nothing, the second causes an EL exception.
I know that it has nothing to do with the modal as I have also placed a button like this into the modal:
<a4j:commandLink
    styleClass="rdSplGr1"
    href="#"
    action="#{confirmAction.testMethodOne()}">
     <s:span>MethodOne</s:span>
</a4j:commandLink>That button as you can see has what I am trying to create dynamically and it works like a charm.
So how do I pass a method call correctly? Or if that is impossible how do I solve the problem of having a the continue button having a different method assigned to it?
Thanks for any insight into this.
Edited by: Rhythmicdevil on Aug 4, 2008 7:57 AM

I agree, reflection should be a last resort. An
interface would not be useful if you don't know what
method you want to invoke at compile time. Interfaces
are useful when you know the method you want to
invoke, but not the class.That's not true. This is a really lame-ass example but it shows the point.
public interface RuntimeMethod
   public void method();
class AClass {
   public static void main(Sting[] args)
      new AClass.handleAtRuntime(
         Factory.getRuntimeMethod(Integer.parse(args[0])));
   public void handleAtRuntime(RuntimeMethod runtime)
      runtime.method();
class Factory
   public static getRuntimeMethod(int method)
      switch(method)
         case 0: return new RuntimeMethod
            public void method()
               methodA();
         case 2: return new RuntimeMethod
            public void method()
               methodB();
         default:
            throw new IllegalArgumentException("bad input");
}

Similar Messages

  • Method call in html anchor tag

    I have read about how to place a hyperlink in JTable cell in other threads. i have a method called Details() which has a mouse pressed event which responds on left click on the first column cells of my JTable. then i get the column and row positions and open up a JDialog.
    so Now i have to show the first column cells as hyperlinks(underlined and handcursor on visit).
    i have done something like this,
    setText( "<html><a href=\"\">" + (String)(value==null?"":value ) +"</a></html>"); this makes the cell values blue colored as well as underlined as soon as the table is loaded.
    how can i make it behave like a hyperlink ? that is colored, underlined and handcursor only when mouse is placed on it.
    Can i have the call to Details() method inside the anchor tag which i have shown above?
    Thanks,

    Well what do you know, I was doing everything correctly.
    Firefox does not allow local file links from a web page.
    http://kb.mozillazine.org/Firefox_:_Issues_:_Links_to_Local_Pages_Don%27t_Work

  • Passing input parameters to the method call in ADF task flow.

    Hi,
    I have the following use case:
    There is a task flow with 2 jspx pages. In the first page I have 2 input search parameters and search button. the search button calls the webservice data control execute (GET_ACCOUNTOperation) method .
    Displaying the search results in the same page is not a problem , but my requirement is that the search results are to be displayed in the second page in tabular form.
    To achieve this, I dragged the execute method as the method call in the task flow and specified the input parameters for the method call (right click and add parameters) . I am getting the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.lang.String, java.lang.String)
         at com.sun.el.util.ReflectionUtil.getMethod(Unknown Source)
         at com.sun.el.parser.AstValue.getMethodInfo(Unknown Source)
         at com.sun.el.MethodExpressionImpl.getMethodInfo(Unknown Source)
         at oracle.adf.controller.internal.util.ELInterfaceImpl.getReturnType(ELInterfaceImpl.java:214)
         at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:135)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1035)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:921)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:820)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:552)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:148)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
         at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:43)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    even though the execute method is there and the service is up and running. I am not sure whether its the correct way of doing it. Please shed some light on how to solve this use case
    Some additional info:
    Under the data controls pallete, the GET_ACCOUNTOperation method has a parameters section , which has "part" (java.lang.Object) as
    the input parameter.
    Regards,
    Rampal

    Hi,
    thanks for the quick turn-around. Jdev version that i am using is Studio Edition Version 11.1.1.6.0. And i am using SOAP. Isnt there a way without using a backing bean? I am planning to use it as a portlet. Would'nt creating a backing bean cause a problem in that case?? Also i am confused here . The method that i am dragging is GET_ACCOUNTOperation(Object). I tried passing the hashmap . It gave the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.util.HashMap)
    Rampal

  • How to pass attribute values after ExecuteWithParam to method call

    Hi,
    I am using Jdev 11.1.1.6.
    My use case is that I have mainPage BTF which has ExecuteWithParam as the default activity. This filters the VO using params. I have a requirement to store some of the attributes from current row to pageFlowScope which needs to be passed to multiple child taskflows.
    I can introduce a method call after ExecuteWithParam activity and before the page renders but not sure how should I pass the current row (or something) to this method call to store the values on pageFlowScope.
    What should I pass to this managed bean to store the values on pageFlowScope? Is there any alternative?
    Thanks,
    Jai

    I see two possible ways to get to the attributes. First you can get the iterator current row and get the attributes from there. Second you add attribute bindings to the methods pageDef file for all attributes you are interested in. Then you access them using the attribute binding. I never tested the 2nd method but I guess the framework will fill the attribute bindings like it does in a normal page.
    Sorry, can't give you sample code on this add I'm not in front of a PC.
    Timo

  • Passing the OUT parameter in method call after connection

    Hi,
        I have created the rfc connection through SAP.net Connector. Now when i want to show all the data of the particular RFC. i need to provide all the fields name and the tables name in method call.
    In that method call i need to provide one paramet which is of type OUT what is that and what i need to provide in that parameter.
    Can anybody suggest on this.
    I can send the code if u need to understand, what exactly i want.
    Regards,
    +Naren

    Its done i am able to connect.

  • Taskflow Method call receiving null parameter.

    Hi all,
    I am using 11.1.1.6. I have created in my application an extra project which is pure Java objects and exposed a master class as a POJO DC. In my application, I have a taskflow where I have dragged and dropped one method from my POJO DC - 2 of the parameters of this methods are coming from an application scope bean. I have debugged the application, and made sure that the object being returned by the getter of my app scope bean is not null. So basically, when the breakpoint is in the return statement of my getter the oject is not null and it has been correctly initialized. Just after that, the next breakpoint is in the class receiving the parameter in my POJO DC class. In there, the object is NULL.
    Does anyone knows wat could be the reason??

    Hi Frank Nimphius-Oracle,
    That is precisely the problem.  The object is being passed as to the taskflow as an input parameter (getting it from my application scope bean). If I access the pageFlowScope inside my taskflow I see it and its there, correctely intialized. However, when I call a method call activity that consumes that object as parameter, all what it gets is null.
    The method that consumes this object is in a separate project, and its exposed in a POJO DC. I don't know if it has to be with the complexity of the object I am passing or what but I don't understand why its not being passed correctly to the DC Method.

  • Closing an anonymous stream in method call

    Will an anonymous stream in a method call be closed in the same manner an anonymous stream that is created in an object instantiation will be?
    I know this will close the anonymous FileInputStream:
    DataInputStream in =
    new DataInputStream(new FileInputStream("filename.txt"));
    /* ... code ... */
    in.close();But will this?
    MyPropertiesClass myPropertiesClass = new MyPropertiesClass();
    myPropertiesClass.store(new FileOutputStream("file.txt"));MyPropertiesClass extends Properties, and uses its store().
    I know the JavaDoc for Properties says:
    "After the entries have been written, the output stream is flushed. The output stream remains open after this method returns."
    My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?
    Thanks for any insight,
    KJ

    My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? > myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?Your only hope would be if FileOutputStream overrode finalize and closed the stream there -- but it doesn't (check the API -- finalize isn't overridden). I doubt if Properties retains a reference to the OutputStream you pass to store -- why would it need to? In any case, the bottom line is that output stream isn't being closed until your process exits.
    Why not bite the bullet and rewrite that line of code so that you can explicitly close the stream?
    OutputStream out = new FileOutputStream("file.txt");
    try {
        myPropertiesClass.store(out);
    } finally {
        out.close();
    }It's not one line, but who cares? You could wrap it up in a short utility method:
    static void storeProperties(Properties properties, String path) {...}

  • Passing Bound values to templates containing choice tags

    I have a template which loads a DataObjectList into a
    <choice> tag.
    The values im passing in, to be used for the column name: are not being interperted correctly.
    The tag is using them as values to be rendered. i.e. 'output text'.
    The value are actually column names within my table. For example:
    <choice data:name="myChoiceBoxName@ui:rootAttr">
    <contents data:childData="hashMapKey@dataProviderName">
    <option data:text="dbColumnNameOne@ui:rootAttr"
    data:value="dbColumnNameTwo@ui:rootAttr" />
    </contents>
    </choice>
    I am certain the values passed in are correct.
    The option tag is displaying the bound value as text.
    I need this value to be interperted as a db column.
    If I hardcode the column name in the 'text' field and hardcode the column name in the 'value' field it works fine. That approach is unacceptable and renders the template useless.
    Is this expected behavior for this senario or is their some additional documention, besides Chapter 4 UIX Developer's Guide, that would clear this up?
    Tks for any information.
    Booker Northington II

    Lets say you have a database table. Within that table you have a column called Address. I am passing the string 'Address' into the template.
    Within the option tag, when I bind the value, instead of it going to the db and returning the 'value' of 'Address', it prints 'Address' within the choice box, once the box is rendered.
    Now, If I hardcode 'Address' within the option 'value' field, when the choice box is rendered, it displays, '1004 AnywhereInUSA'.
    Why dose it work when I hardcode the value, but when I try to bind, a bound value (the value passed in), it read as text?
    Tks
    Booker Northington II

  • How can i pass rowiterator method

    hi how can i pass rowiterator method
    i got below method how can i pass it to my postchanges mothod e.g
    SmsPropertiesImpl property = getSmsProperties();
    am in jdeveloper 11.1.2.1.0
    public class SmsPartyAddressImpl extends EntityImpl {
        public RowIterator getSmsProperties() {
            return (RowIterator)getAttributeInternal(SMSPROPERTIES);
        public void postChanges(TransactionEvent e) {
            /* If current entity is new or modified */
            if (getPostState() == STATUS_NEW ||
            getPostState() == STATUS_MODIFIED) {
            /* Get the associated property for the postaladdress */
           // SmsPropertiesImpl property = getSmsProperties();
            //SmsPropertiesImpl property  = getSmsProperties();
                SmsPropertiesImpl property = new SmsPropertiesImpl();
               // SmsPartyAddressImpl property = new SmsPartyAddressImpl();
            /* If there is an associated property */
            if (property != null) {
            /* And if its post-status is NEW */
            if (property.getPostState() == STATUS_NEW) {
            * Post the property first, before posting this
            * entity by calling super below
            property.postChanges(e);
            super.postChanges(e);
    }

    hi how can i pass rowiterator method
    i got below method how can i pass it to my postchanges mothod e.g
    SmsPropertiesImpl property = getSmsProperties();
    am in jdeveloper 11.1.2.1.0
    public class SmsPartyAddressImpl extends EntityImpl {
        public RowIterator getSmsProperties() {
            return (RowIterator)getAttributeInternal(SMSPROPERTIES);
        public void postChanges(TransactionEvent e) {
            /* If current entity is new or modified */
            if (getPostState() == STATUS_NEW ||
            getPostState() == STATUS_MODIFIED) {
            /* Get the associated property for the postaladdress */
           // SmsPropertiesImpl property = getSmsProperties();
            //SmsPropertiesImpl property  = getSmsProperties();
                SmsPropertiesImpl property = new SmsPropertiesImpl();
               // SmsPartyAddressImpl property = new SmsPartyAddressImpl();
            /* If there is an associated property */
            if (property != null) {
            /* And if its post-status is NEW */
            if (property.getPostState() == STATUS_NEW) {
            * Post the property first, before posting this
            * entity by calling super below
            property.postChanges(e);
            super.postChanges(e);
    }

  • A method call question.

    I am trying to check if leg1 is a positive integer, but I method call checkleg, and perform my if statement, but it will not return a 'valid = true' to my public static main. It is always false. please help!
    * TriangleTest.java
    * Created on October 3, 2007, 4:10 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package triangletest;
    * @author Nate
    import java.util.Scanner;
    public class TriangleTest {
        /** Creates a new instance of TriangleTest */
        public TriangleTest() {
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
         System.out.println ("**Triangle Validation Tool**");
         int leg1 = 0;
         int leg2 = 0;
         int leg3 = 0;
         int sumOfLegs;
         int count = 0;
         Boolean validIs = false;
         Boolean valid = false;
         Scanner input = new Scanner (System.in);
            System.out.println("Please enter the length of leg #1:");
            leg1 = input.nextInt();
            checkleg (leg1);
            System.out.println(valid);
            System.out.println("Please enter the length of leg #2:");
            leg2 = input.nextInt();
            System.out.println("Please enter the length of leg #3:");
            leg3 = input.nextInt();
            sumOfLegs = leg1+leg2+leg3;
            if (sumOfLegs != 180)
                System.out.println("Sorry, legs of lengths " + leg1+ ", "
                        + leg2+ ", and " + leg3 + " do NOT form a triangle!");
            else
                System.out.println("Congrats!");
        public static Boolean checkleg (int leg1){
            Boolean valid = false;
            if (leg1>0){
            valid = true;
            System.out.println(valid);
        return valid;
        }}Thanks

    Yippee!! the code tag button is back!!
    Please see comments:
         Boolean validIs = false;  // probably want to use "boolean" not "Boolean"
         Boolean valid = false;  // ditto
         Scanner input = new Scanner (System.in);
            System.out.println("Please enter the length of leg #1:");
            leg1 = input.nextInt();
            checkleg (leg1); // see my previous post
            sumOfLegs = leg1+leg2+leg3;
            if (sumOfLegs != 180)  // I hope you will correct this logic.
                System.out.println("Sorry, legs of lengths " + leg1+ ", "
                        + leg2+ ", and " + leg3 + " do NOT form a triangle!");
            else
                System.out.println("Congrats!");
        public static Boolean checkleg (int leg1){
            // note that while your local "valid" variable has the same name as the class "valid"
            // variable, they are both different variables and changing one will NOT change the other.
            Boolean valid = false;
            if (leg1>0){
            valid = true;
            System.out.println(valid);
        return valid;
        }}

  • Error: The AcquireConnection method call to the connection manager failed with error code 0xC0202009 using DB2 connection

    I have a SSIS project that I am newly running on the SQL server (2005) .  It was previously run on my PC.  I am importing data from a DB2 server to the SQL server.
    I am in the SA group on the server
    My connection to DB2 works
    When open the package and run it in preview mode, I can retrieve the data.
    When I execute the package I get the below errors:
    [MIDAS OLE DB Source [1]] Error: The AcquireConnection method call to the connection manager "NGMDSPA.alharris" failed with error code 0xC0202009.
    [DTS.Pipeline] Error: component "MIDAS OLE DB Source" (1) failed validation and returned error code 0xC020801C.
    What I have already done that has not worked:
    The original Protection level was set to EncryptSensitiveWithPassword. 
    I have reset the Package Password.
    I have set the protection level to DontSaveSensitive
    I saved the package on the server and set a Package Password.
    I created a new package, set the Protection level to DontSaveSensitive, set a package password in a configuration file using the Package Configuration Wizard.
    Error continues

    Yes.  The Drivers are installed and I have a successfull connection.  I am trouble shooting the issue on the server in BIDS.  I can connect to the DB2 server via the Connectionmanager.  I can also preview the data in the OLE
    DB source connection.  Therefore I know that I have a proper connection
    If you're setting option as DontSaveSensitive then you need to pass the connection information from configuration file/ config table. Otherwise it wont be able to use it for connecting to your source/destination servers. This is the recommended way as it
    will enable you to change connection info at runtime.
    If you want connection info to persist you need to use protection level as EncryptSensitiveUsingUserKey or EncryptSensitiveUsingPassword and set a password.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Lead to Oppy Method call or Workflow

    Hi All,
    When shall we use the option of method call and workflow for automatic creation of Oppt from lead.
    We can use method call and also workflow for  it. but whats the pros and cons of these two methods.when do we use what.
    Sanjana

    Hi Sanjana
    The correct (and customizable) way to do so is to use the so-called post processing framework (PPF), which exists in CRM only. In transaction sppfcadm you can define an action profile with an action which calls a COPY_DOCUMENT and passes as a parameter the opportunity process type. You then have to define a start condition (e.g. qualification status = hot) and a planning condition (e.g. status = closed) and then it runs automatically.
    Please also have a look at the existing examples for the opportunity sales methodology, in standard customizing there is something similar set up between activities and opportunities.
    Regards, Kai

  • Dynamic method calls in bounded task flows?

    Hi!
    I have the following scenario:
    We are developing a framework in which we would include modules as ADF libraries (as JAR files) with bounded task flows. This framework contains a bean class with bindings for some UI components in framework which I enable or disable (depends on user action). That is the main reason bean class should be present in framework application.
    I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component.
    How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods? That is dynamic method calls for bean.
    I'm using JDeveloper 11.1.2.1.0
    Thanks for your help
    Regards, Marko

    Hi,
    I explained this; +"I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component. How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods?"+ a couple of times already (not sure if it was all for you) and don't think I change my position here. I also explained how to use a ValueExpression to lookp a managed bean containing component bindings (should be in requestscope).
    Frank

  • A tricky way to twick ValueBinding language to bind a method call

    Here is the scenario:
    I'd like component can bind value to method call(with parameters) to a java instance, of course including backingBean.
    I wish this solution would be useful, especially when you are working in iteration component such as ForEach, TreeView or DataTable, EL ValueBinging language might be too restricted to complex expression. This way, you can pass iteration items as parameters into a method can and return a value to you page by valuebinding language
    In JSP:
        <h:outputText value="#{Page1.callHelper[Page1]['targetMethod']['James'][Page1.callEnd]}"/>In PageBean:
         public String targetMethod(String name){
             return "Hello, " + name +"!";
        private CallHelper callHelper = new CallHelper();
         public CallHelper getCallHelper() {
              return callHelper;
         public void setCallHelper(CallHelper callHelper) {
              this.callHelper = callHelper;
         private CallEnd callEnd = new CallEnd();
         public CallEnd getCallEnd() {
              return callEnd;
         public void setCallEnd(CallEnd callEnd) {
              this.callEnd = callEnd;
         }Util classes:
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.LinkedHashMap;
    import java.util.List;
    import java.util.Map;
    public class CallHelper extends LinkedHashMap {
         private CallHelper parent;
         public Object get(Object key){
              if(key instanceof CallEnd)return getRoot().methodCall();
              else{
                   Object value = super.get(key);          
                   if(value == null){
                        value = new CallHelper();
                        put(key, value);
                        ((CallHelper)value).parent = this;
                   return value;
         public boolean containsKey(Object key){
              return true;
         public boolean realContainsKey(Object key){
              return super.containsKey(key);
        protected CallHelper getRoot(){
             CallHelper root = this;
             if(root.parent==null)return root;
             else return root.parent.getRoot();
         protected Object methodCall(){
              Object result = null;
             List callParameters = new ArrayList(2);
             listCallParameters(callParameters, this);
             if(callParameters.size()>1){
                  Object instance = callParameters.get(0);
                  String methodName = callParameters.get(1).toString();
                  List methodParameters = new ArrayList();
                  for(int i=2; i<callParameters.size(); i++){
                       methodParameters.add(callParameters.get(i));
                  Method method = findMethod(instance, methodName, methodParameters);
                  if(method != null){
                       try {
                             result = method.invoke(instance, methodParameters.toArray());
                        } catch (IllegalArgumentException e) {
                        } catch (IllegalAccessException e) {
                        } catch (InvocationTargetException e) {
              this.clear();
              return result;
         private void listCallParameters(List list, Map map){
              if(map==null || !map.keySet().iterator().hasNext())return;
              Object key = map.keySet().iterator().next();
              if(key instanceof CallEnd)return;
              list.add(key);
              listCallParameters(list, (Map)map.get(key));
         private Method findMethod(Object instance, String methodName, List parameters){
              Method result = null;
              Method[] methods = instance.getClass().getMethods();
              for(int i=0; i<methods.length; i++){
                   if(methods.getName().equals(methodName)){
                        System.out.println(methodName);
                        Class[] paraClasses = methods[i].getParameterTypes();
                        if(paraClasses.length==parameters.size()){
                             boolean match = true;
                             for(int j=0; j<paraClasses.length; j++){
                                  if(parameters.get(j)!=null && !paraClasses[j].isInstance(parameters.get(j))){
                                       match = false;
                                       break;
                             if(match){
                                  result = methods[i];
                                  break;
              return result;
    public class CallEnd {
    Improvement:
    Anyone can make it thread safety and bind callhelper and callend directly to FacesContext properties rather than each backingBean.
    Have fun!
    And feel free to contect me at:
    [email protected]
    [email protected]

    You must seperate your parameter preparing and action method calling for sure.
    It depends on what kind of parameters you need to pass in:
    1. If action method is bound to several buttons, and it just wants to know which button was clicked, you can set actionListener to prepare it for you. Because the event includes the information you need.
    2. For other kinds of parameters, you can use ValueBinding Language to bind parameter values to backingBean, then the action method(without parameters) can pick parameters up from backingBean.

  • Understanding Regex replace method call involving delegate

    Hello,
    I am trying to understand the $regex.replace static method call below (I came across this code snippet in the cookbook).
    $replacer = {
    param($match)
    $chars = $match.Groups[0].Value.ToCharArray()
    [Array]::Reverse($chars)
    $chars -join ''
    $regex = [Regex] "\w+"
    $regex.Replace("Hello World wide", $replacer)
    What I do not understand is the below overloaded definitions for replace method do not seem to match the above replace call. So how exactly is this working? The above call has 2 parameters passed where as none of the below overloads have less than
    3 parameters.
    PS C:\WINDOWS> [regex]::replace
    OverloadDefinitions
    static string Replace(string input, string pattern, string replacement)
    static string Replace(string input, string pattern, string replacement, System.Text.RegularExpressions.RegexOptions options)
    static string Replace(string input, string pattern, string replacement, System.Text.RegularExpressions.RegexOptions options, timespan matchTimeout)
    static string Replace(string input, string pattern, System.Text.RegularExpressions.MatchEvaluator evaluator)
    static string Replace(string input, string pattern, System.Text.RegularExpressions.MatchEvaluator evaluator, System.Text.RegularExpressions.RegexOptions options)
    static string Replace(string input, string pattern, System.Text.RegularExpressions.MatchEvaluator evaluator, System.Text.RegularExpressions.RegexOptions options, timespan
    matchTimeout)

    What you are looking at are the static methods ([regex]::) and their appropriate parameters which in this case have a minimum of 3 parameters to properly perform the Replace using the input, pattern and replacement
    value. If you were to use the constructor of [regex] to create a pattern like this:
    $Regex = [regex]'\w'
    You will see that the Replace method here allows for only 2 parameters because you have already satisfied the pattern when you created the Regex object.
    $Regex.Replace
    OverloadDefinitions
    string Replace(string input, string replacement)
    string Replace(string input, string replacement, int count)
    string Replace(string input, string replacement, int count, int startat)
    string Replace(string input, System.Text.RegularExpressions.MatchEvaluator evaluator)
    string Replace(string input, System.Text.RegularExpressions.MatchEvaluator evaluator, int count)
    string Replace(string input, System.Text.RegularExpressions.MatchEvaluator evaluator, int count, int startat)
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

Maybe you are looking for

  • Not able to process open items using F-53

    Hello All, I am trying to process open items using F-53, I  m getting error message as "Entry SAG1 is missing in table T043G". This was working fine for GL accounts, but failing for vendors. I checked the tolerance group for same and its fine and als

  • Help!! My linked text file disappears from the links palette

    I've set my preferences so that InDesign creates a link when placing text and spreadsheet files, and when I first place the file it appears in the Links palette just fine. However, as soon as I make a change in the original text file, it disappears f

  • Display Applet On Browser

    Hi, The code displays teh image on the appletwindow but not on the browser(IE 7,mozilla and firefox) HTML CODE.............................<HTML> <APPLET CODE="ImageTest.class" WIDTH=350 HEIGHT=350> <PARAM NAME="imageName" VALUE="output2.tif"> </APPL

  • Cumulative Column - Date Range

    Hi, we have defined a sales cube with following strucuture (example) example (sample data as stored in info cube) Date   company_code sales_value 050905      C1            $2300 060905      c1           $2000 070905      c1           $2500 Now the ex

  • Lenovo A1 GPS Not Working

    I recently installed ICS on my Lenovo A1 but I have since switched back to Gingerbread , Everything works fine except for the GPS. Any assistance that you can provide to restore the GPS would be appreciated .