Calling a Java method in a page JSFF fragment.

Can someone tell me how I can call a Java method in a page JSFF fragment?

Here's an excerpt from my jsff (My.jsff):

< af:column sortProperty = "CrtdByUserid" sortable = "false".
headerText = "#{customstoregroupviewcontrollerBundle.USER_LABEL} '"
ID = "user" align = "center" >
< af:outputText value = "#{rank." CrtdByUserid}"id ="ot5"/ >
< / af:column >

Here is the method of my Java (MyBacking.java)

public String resolveUserName (String pUserId) {}
try {}
JCCRoleHelper jccrh = new JCCRoleHelper();
Return jccrh.getUserName (pUserId);
} catch (Exception e) {}
return pUserId;
}
}

I would replace "#{rank." CrtdByUserid}"in My.jsff with a call to the java method"resolveUserName (String pUserId)"of My.java by passing the value of" #{rank. " CrtdByUserid}"to return the string to fill the 'af:outputText = value'.

Any help would be greatly appreciated.

Hello

create and save a bean inside taskflow, for example, name it userResolverBean.

The bean code

import java.util.HashMap;

public class UserResolverBean {

    private HashMap _user;

    public UserResolverBean() {
        _user = new HashMap() {
                @Override
                public Object get(Object key) {
                    if(key == null)
                        return null;
                    return resolveUserName(key.toString());
                }
            };
    }

    public String resolveUserName(String pUserId) {
        try {
            JCCRoleHelper jccrh = new JCCRoleHelper();
            return jccrh.getUserName(pUserId);
            } catch (Exception e) {
            return pUserId;
        }

    }

    public HashMap getUser() {
        return _user;
    }
}

and use it like this




Cheers!

Kind regards

Published by: Santosh Vaza on August 8, 2012 11:48

Tags: Java

Similar Questions

  • Call the java method lunch application

    Hello

    I use JDev 12.1.3 with MAF, I want to call the java method of the project ViewController lunch application, how can I do this?

    Thank you

    Hello

    Can you explain usecase? What features do you need perform the start-up of the application?

    You can run java code in an application LifeCycleListener - https://docs.oracle.com/middleware/maf210/mobile/develop-maf/maf-apps-register-listeners.htm#ADFMF25120

  • How to call a Java method n map the output of this method to a table in ODI

    Hello

    I am new to ODI. I wrote an interface that links the two tables (source) to a file (in the target). Now, I must apply a method (java call) on each element in a column in the target. Now my questions are:

    1. all I know is to use the procedure using BeanShell Java or Jython. Can you give some examples of commands to achieve such a feature?

    2. where should I actually apply this procedure? Is it possible to apply this procedure within the Interface during the mapping (so that I can map directly the result in the output file)?

    Thanks in advance :)

    Not sure why you want to call a java method for each column.
    But as others have mentioned, an ODI procedure won't help you do.

    However, there are other options you can exercise:
    (1.) assuming that you are using Oracle, you can compile the Java class and wrap it as a PL/SQL function and then call this function from pl/sql to the ODI interface. This procedure will be called like any other function oracle for example. Upper (col1).

    (2.) as I understand, it's that you want to apply the Java method for all columns.
    Assuming that you have knowledge with Jython and the code inside the KMs, you can customize the KM to include the Java method around the columns. But this approach is complex if you are a beginner.

    Hope that helps

  • What is the best way to call the Java method in JSP in weblogic 10.3

    Hello

    What is the best way to call the Java method in JSP in weblogic 10.3?

    Thank you for your help in advance.

    Thank you
    Manu

    Hello Manu,

    If I understand your question, all you need to do is import the Java class you want to create / obtain an instance of it (if you're not calling a static method), then call the method, the entire interior of the JSP. It works the same way in Weblogic that it works in any JSP.

    Kevin

  • How to call a Java method, pl/SQL from within ApEx

    I want to call a Java method, which I intend to use to add members to a collection at the ApEx of another source of data.



    How does one call a Java from ApEx method?



    Thank you

    Gregory


    Hello

    Curious, the link works fine for me.

    Anyway, here is another, a thread on AskTom site that addresses the basic concepts you need-

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:952229840241

    Hope this helps,

    John.
    --------------------------------------------
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    AWARDS: Don't forget to mark correct or useful posts on the forum, not only for my answers, but for everyone!

  • Attention Shay/Frank: &lt; af:goLink &gt; adding tags on a page dynamically fragment

    Hello guru ADF!

    I have a need to add < af:goLink > tags dynamically on a page jsff fragment. This page fragment will be an activity view of a taskflow which must be packaged as an ADFLibrary. I wonder if this is possible.

    Any help will be appreciated.

    THX.

    Lalit

    Published by: Lalit Arora on September 23, 2009 14:47

    A bean to support, you can use something like:

    containercomponent.getChildren () .add (newComponent)

  • How to call the bean support just after JSFF / fragment of page loads?

    Hello

    I have a simple requirement - call the Backing Bean method for my page-fragment AFTER that its loading. The JSFF is delimited to the workflow.

    I tried the solution given here: http://fortunefusionminds.blogspot.com.au/2013/04/how-to-invoke-backing-bean-method-right.html but it does not work for me.

    Every time I tried to access any link layer (i.e. the PanelFormLayout DepartmentId) attribute/property within the refreshRegion method below gives NullPointerException.

    My DepartmentId property is exposed to the Backing Bean by using the Bindings property in the property inspector.

    @Override

    {} public boolean refreshRegion (RegionContext regionContext)

    int refreshFlag = regionContext.getRefreshFlag ();


    if(refreshFlag == RegionBinding.PREPARE_MODEL) {}

    System.out.println (getDepartmentId.GetValue ())

    }

    regionContext.getRegionBinding (.refresh (refreshFlag));

    Returns false;

    }


    {} public void setDepartmentId (RichInputText departmentId)

    this.departmentId = departmentId;

    }

    public RichInputText getDepartmentId() {}

    return departmentId.

    }

    Any help please?

    Thank you

    Hitesh Patel


    Hi all

    Here's how it works for me.

    1. in your backing bean create property & its get accessor for afterPageLoad as below. We don't need a setter method.

    private; channel afterPageLoad

    public String getAfterPageLoad() {}

    If (!.) {AdfFacesContext.getCurrentInstance.isPostBack ()}

    initPage();

    }

    Return afterPageLoad;

    }

    private void initPage() {}

    System.out.Print ("I'm initPage() and called exactly once");

    }

    2. create a hidden field to the bottom of your JSFF page as below.

    Thanks - Hitesh

  • call the default Java methods UCM services?

    Hello!

    I have a custom Java method that I call the definition of custom service UCM. This method of Java, one of the tasks is to call standard UCM UPDATE_DOCINFO service to update the metadata for that document. What is the right way to call the AAU services the default JAVA methods?

    Thanks a lot for your help!

    I use the lines below...

    DataBinder binder = new DataBinder();
    String cmd = "";
    this.m_requestImplementor.executeServiceTopLevelSimple(binder, cmd, this.m_userData);
    

    You can add the parameter to the service of "binder".

    binder.putLocal("", "");
    

    This doesn't cause pollution data.

  • Call a java script function, the loading of the page while in ebiz

    Hi gurus of the OFA.
    I have a requirement for a java script to each page renders OFA function call or charges.
    That is when any OAF page load or make in Oracle e - biz, I have a java script function that should be called is possible to implement the above mentioned requirements.

    Thanks in advance...
    Sourav

    OK, I have your condition. It's one of the basis OFA classes then you can try class decompile OAPageBean. I tried yesterday, there are many interesting ways you can add JavaScript and recompile class. do the backup of old, of course. And your JavaScript will work on any page of the OFA

  • How can we call java methods in ODI?

    Hello

    I have java jars.i would call java methods of ODI

    how it is possible in ODI?

    Please help consider myself the same

    Thank you

    Version unsupported major.minor 50.0

    error comes when you use different java version 2

    version 50.0 means also that you use a class that are compiled with the help of JAVA 6
    Try to run ODI with JAVA 6

  • Cancel the deployment of a Web application using a Java method or call

    Hi, I have an application that is running on weblogic I want to cancel the deployment using a Java method or a call.
    Is it possible to do it with a specific API to weblogic or something like?
    Thank you!

    Hi CarolinaCunha,

    Please visit the following link to cancel the deployment of Applications using the Java method:

    http://jaysensharma.WordPress.com/2010/01/15/Undeploying-application-using-Java-method-JMX/

    Thank you
    Jay SenSharma

  • BrowserField IllegalStateException to call the RequestContent method

    Hello world.

    I'm IllegalStateException when you try to view another page HTML on my BrowserField. This happens when BrowserField Manager calls the removeField() method.

    The paper said: to remove is field with focus - index: 0 - fieldDebugTree: net.rim.device.api.ui.component.NullField (0, 0) + (0, 0) * home * \n - managerDebugTree: net.rim.device.api.browser.field2.BrowserField (0, 0) + (480, 70) [480, 70] \n net.rim.device.api.ui.component.NullField (0, 0) + (0, 0) \n

    Everyone knows that kind of problem before?

    Thanks before.

    Never mind. I found the solution to this problem after doing some more research on this forum.

    Here is the link to the post with the solution: http://supportforums.blackberry.com/t5/Java-Development/BrowserField-refresh-throwing-IllegalStateEx...

  • Page jsff ADF and the F5 key

    Hello

    I use jdeveloper 11.1.1.6

    My situation is, there is a table on page jsff, and there is a button "Refresh" that, when click on it, will update the table with the most recent values, it works fine.

    Now the user want when press the "F5" key, will be the same as clicking on the button "Refresh", not "recharge" the jsff page.

    I think JavaScript is the only way to do it, and I can find many examples of code press 'F5' (keycode 116), but how does leave jsff page capture the 'F5' key and call the JavaScript? I know that the way in which clientlistener adds a component, for example a button and when clicked to call JavaScript, but have no idea how to call JavaScript on button, tried document.onkeypress, but did not work.

    Thank you

    On the definition of the button refresh, the java script function is only triggered on the events button on the Refresh button.

    Here is the code example to manage the F5 key:

    
         
              
         
              
                   window.onkeydown = function (event) {
                        if ((event.which || event.keyCode) == AdfKeyStroke.F5_KEY) {
                             alert("F5 Pressed")
                             //Write your logic here
                        }
                   }
         
    
    

    Jean Lou

  • Shares of personalized service with java methods

    Hello!  I need a hand on a creation of a personalized service and the correct way to trigger the Java methods that I want to execute following call for this service.

    This service must have 4 methods of java, each of them would run based on the parameter I want to send.

    For example, if I call the service EUM_START_APPROVAL_PROCESS with the parameter "WFSTEP = START" ("myserver" / idcplg?) IdcService = EUM_START_APPROVAL_PROCESS & WFSTEP = START), I need to run the 'javamethodSTART' method and none of the other methods!

    < b >

    < td > < table > EUM_START_APPROVAL_PROCESS

    DocService < td >

    32

    null

    null

    value Null < br >

    Failed to retrieve the query provider page. < table >

    3:javamethodSTART:0:null < td >

    3:javamethodAPPROVE:0:null

    3:javamethodREJECT:0:null

    3:javamethodEND:0:null < table >

    < /tr >

    What is the correct syntax, I need to use in the field of actions: "3:javamethodSTART:0:null."

    Thank you very much for your help, I tried to read the news online, but can't find the solution I need (or perhaps missed somehow)!

    Anya

    Use a Java method in your service definition. It is a Java method that determines (based on the parameters that you pass) which of the 4 methods to call Java.

    Jonathan

    http://jonathanhult.com

  • Invoke the "return of workflow" to a Java method

    Hi, I have the following problem:

    I have a link that calls a taskFlow call. This workflow has a Java method as a default activity. In this Java method, I make little validation and if the validation fails, I want to return to the original page.

    Can I do this if I use:

    ExternalContext ectx is FacesContext.getCurrentInstance () .getExternalContext ();.

    HttpServletResponse response = (HttpServletResponse) ectx.getResponse ();

    String url = ectx.getRequestContextPath () + "page." 

    response.sendRedirect (url);

    But this way, I lose the context and I can't show a message in the FacesContext like this:

    FacesContext context = FacesContext.getCurrentInstance ();

    FacesMessage msg is new FacesMessage (FacesMessage.SEVERITY_FATAL, "Information", "message");.

    context.addMessage (null, msg);

    I want to know if I can call it the 'task flow back' this method of java (or any other form of redirecting to the page) so that I can keep the context and display the message correctly.

    I use JDeveloper 11.1.2.3.0.

    I appreciate if anyone can help. Thank you.

    You can add a default activity navigation case to the stream return axtivity task. Then, you set the action of the method to the results chain and return the name of navigation to the workflow of return if your validation fails, otherwise, you return the case of normal navigation.

    Timo

Maybe you are looking for