How to assign and display an attribute value from backing bean?

Hello all,
I am using Jdev 11g. I have a form page which has two inputText attributes The first one implements a valueChangeListener feature. When the user enters a value in the first field, a backing bean function will be invoked through the valueChangeListener . In this backing bean function, based on the value in the first field, I want to assign the value to the second field and display it on the page. Can somebody help me how to achieve this?
Thanks,
John

Hi John,
Here is small example.
Create two string variables in your backing bean and generate accessors for them.
    private String text;
    private String text1;
    public void setText(String text) {
        this.text = text;
    public String getText() {
        return text;
    public void setText1(String text1) {
        this.text1 = text1;
    public String getText1() {
        return text1;
    }Bind this variables to the value property of the input texts you have. Add the valuechangedlistener for the first input text (and also set autosubmit to true for that item). Also, add the id of the first input text as partial triggers for the second input text. Like,
        <af:inputText label="Label 1"
                      binding="#{backingBeanScope.backing_untitled1.it1}"
                      id="it1"
                      valueChangeListener="#{backingBeanScope.backing_untitled1.textValueChanged}" autoSubmit="true"
                      value="#{backingBeanScope.backing_untitled1.text}"/>
        <af:inputText label="Label 2"
                      binding="#{backingBeanScope.backing_untitled1.it2}"
                      id="it2"
                      value="#{backingBeanScope.backing_untitled1.text1}"
                      partialTriggers="it1"/>Finally, put the logic on your value changed listener. Like,
    public void textValueChanged(ValueChangeEvent vce){
        this.setText1("Hi " + vce.getNewValue());
    }Now, when you run the page and enter your name in the first input text, the second input text will display Hi <your_name>
HTH.
-Arun

Similar Messages

  • How to get and set a session variable from backing bean?

    Hi im using Jdev 11.1.1.2.0 and i need to set and get a session variable from backing Bean.
    Any idea?

    the class :
    package arq.resources;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class SesionSigef {
    public FacesContext context;
    public HttpSession session;
    public SesionSigef() {
    super();
    context = FacesContext.getCurrentInstance();
    session = (HttpSession)(context.getExternalContext().getSession(true));
    public Object getVariableSesion(String atributo){
    return session.getAttribute(atributo);
    public void setVariableSesion(String atributo,Object valor){
    session.setAttribute(atributo, valor);
    the example of use :
    SesionSigef se = new SesionSigef();
    DatosRec da = new DatosRec();
    da.setDocumentoCip("Aprobar");
    se.setVariableSesion("DatosRec", da);
    thanks
    Joaquin

  • How To Customize displaying  of JSP page From Backing Bean

    I would like to customize the displaying of jsp page from backing bean based on user Roles
    For example
    - if the Role is Admin then backing bean should display Admin.jsp
    - if the Role is Guest then backing bean should display Guest.jsp
    Any pointers/suggestions will be highly appreciated
    Regards
    Bansi

    Thanks to all for providing thoughts
    I wanna make it more Dynamic. In the sense
    "Backing Beans should drive the rendering of first jsp page in the application " and not jsp page driving the backing bean or not to put some kind of hard coding in jsp page to see if its admin user then display certain set of UI Components or certain set of other UI components for other users.
    As we have atleast 10 different Roles and there can be Composite Roles i.e. combination of two roles. In this case how does the Backing Bean drives the rendering of jsp page?
    Regards
    Bansi

  • Web services and ADF 11g- get Result from backing bean

    I'm executing an action from backing bean (call Web service that returns complex data types)
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("unesiPonudu");
    Object result = operationBinding.execute();
    result is instance of oracle.adf.model.adapter.dataformat.XMLHandler$DataCollection but DataCollection is not accessible.
    How to get results from method?
    Tnx,
    Andreja

    Hi,
    there should be a result iterator in the Executables section which cotnains the result. If not, create it from the WS result entry in the DC palette. Once this iterator gets updated, you get the data from this iterator as it would be the case of a table accesses the WS
    Frank

  • How to access and display a Web Service from a WSDL in JSP or JSTL ?

    Dear All,
    We need to access a Web Service which is hosted as WSDL How to access a WSDL file from JSP or JSTL, parse and display the SOAP response in JSP page.
    Any simple example or URL as reference to an example will be useful for me.
    It seems io tags of jakarta is able to send soap message, but how to display it in JSP.
    Yours,
    Sankar.B

    Dear Sir,
    Yes. I would like to know more about the Forte and how to consume WSDL file from JSTL. The following are my querirs.
    1. How to connect the declared JNDI from a JSP page. i.e: the Datasource - ex: booksDS
    2. We connect the Tomcat server using JNDI as jdbc/scott. But, if I give jdbc/scott in JSTL as datasource={jdbc/scott}, we could not able to connect. We use the following code in a JSP page to connect the DB from a JSP page. (Its quite easy to modify, so we use the connection in a JSP page.)
    3. How to Consume a WSDL url from JSTL. Ex: If there is a URL : http://localhost/ws/MathService.asmx?wsdl OR http://www.xmethods.com/test/BabelFish
    4. How to display the result. We tried via SOAP from io taglib of Jakarta, but gives us an SOAP (it also looks like xml) response. But, how to use the value from that soap response in IE client thru JSTL/JSP.
    5. Whether this JSTL tool will be available with Forte Enterprise/Community Edition. If so EE, whats the price.
    Please Reply Immediatly. We tried, trying, going to try to display a wsdl response, but not able to display in IE thru JSP/JSTL. But, weve tested the www.gotdotnet.com examples of asp.net web services, we are thru. Its quite easy it seems in .NET. But, we feel whether even there is not even one example in JSTL/ Java Web Services Dev. Pack to utilise a web service in full cycle. The example which uve given is thru servlets. We dont use servlets. Cos, its very easy to edit JSP pages, instead of compiling the serv. and using it.
    I hope ull reply for all the above queries, since ur from SUN.
    Expecting your fav. reply.
    Yours,
    Sankar.B

  • How to fetch and display arbitrary log files from a managed host?

    We are creating a small management portal for a custom application and need a way to display, in a browser, the contents of an arbitrary log file located on an EM managed host. The effect we are looking for is similar to what you get when you show the contents of a database alert log using EM.
    I want to extend the EM agent to get the log and display the contents, but see two problems: (1) it seems like we would have to schedule the fetch of the log contents to happen on a regular basis and would not be able to do it on demand and (2) storing the results in the EM repository seems like it could consume a pile of storage, even if it only stores the logs for 24 hours.
    I am pretty sure we can bypass the repository somehow because I think the "show database alert log" EM process does so. Of course, I can't really be sure how this code is getting the alert log, but it seems reasonable to assume it is using the management agent.
    Is there some API for the EM Agent that I am missing?
    Any ideas would be appreciated.

    From within OEM it doesnt look possible. User defined metrics (UDM) can only return number or a string. The alertlog fetch is done via alertlogViewer.pl while being passed a couple of parameters.
    OEM does have a preliminary/rough api available at http://www.oracle.com/technology/products/oem/emx/index.html but I havent seen anyone make use of it yet.
    If you use just a web connection then you will probably run into security issues as a web server can usually only view/access stuff under their htmldoc dir.
    Seems like some non-OEM very custom code is what you seek..

  • How to call the show method of Popup from backing bean?

    Hi!
    I wanted to display the results of a search form in a dialog that is placed in popup.
    That is The content of the popup will be rendered from the backing bean, dynamically .
    And so when the form is filled and the submit button is clicked, the form fields have to be submitted to the server, and the results are to be displayed in the dialog,after the PPR response has arrived, and not at the time of calling the PPR.
    Could you explain How this can be achieved?
    Samba

    Samba,
    The fix for the popup in a template is to give the template an id say "template" and reference the popup in the JavaScript as "template:popupId", where popupId is the value of the af:popup's id attribute.
    Regarding DWR, Joe really did a nice job with this framework. I have to say he got my attention. The one issue though is that JavaScript is an absolute must when using DWR and other frameworks that have a heavy JavaScript tilt. Dealing with JS can be a bit of a hassle due to x-browser idionsyncrascies as well as slow exection of JS. That said I believe Joe has one of the best JS solutions around.
    On the flip side of this ADF Faces is trying to do something a bit different. Firstly, we want to avoid JS. The user should handle as little as JS as possible. In addition,
    ADF Faces has the benefit of a server-side component framework we want to leverage this to make sure there is a limited amount of JS execution on the client.
    So if you want to work with JS, DWR is a good solution. If you want to work with, Java, standards, and a great tooling environement ADF Faces is a better choice.
    Finally, "Reverse AJAX" is a marketing term for "Push". You probably have also heard the term Comet. There are some varations on the protocols used but all-in- all. We are talking about one thing, the ability for the server to "Push" information to the client. Luckily, we provide this ability in a feature called active data channels. You will see this feature in the next preview. By setting an attribute value in a pageDef trees, tables, and BAM components can recieve data from the server via "Push".
    Thanks,
    Ric

  • Value from backing bean in javascript confirm in 10.1.3

    Hallo,
    Please help
    I have 2 problems:
    Page with 1 record, where 8 items are updatable.
    In entity I 've a method where I set a value in bean. (BotId1 is one of these 8 updatebale items)
    What I expect: when I change a value in BotId1 the value of botId in ValiderenBotBean will be also changed
    public void setBotId1(Number value) {
    setAttributeInternal(BOTID1, value);
    EL.set("#{ValiderenBotBean.botId}",BotId.toString());
    My bean (session scope):
    package viewcontroller.pagedefs.produceren.backing;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ValiderenBotBean
    private static Log log = LogFactory.getLog(ValiderenBotBean.class);
    private String botId;
    public ValiderenBotBean() {
    // accessors
    public void setBotId(String botId) {
    log.debug("setBotId : " + botId);
    this.botId = botId;
    public String getBotId() {
    log.debug("getBotId : " + this.botId);
    return this.botId;
    Op my generaten page I have the button:
    <af:commandButton actionListener="#{bindings.Commit.execute}"
    action="Commit" onclick="if (validateForm('dataForm')){return(confirm(#{ValiderenBotBean.botId} + 'la')}"
    rendered="#{(((jhsUserRoles['JDMR_PRD03']) or (jhsUserRoles['JDMR_PRD03'])) or (jhsUserRoles['JDMR_PRD03'])) or (jhsUserRoles['JDMR_PRD03'])}" textAndAccessKey="#{nls['SAVE_BUTTON_LABEL_KOPPELENPRODUCTIEGEGEVENS']}"
    id="KoppelenProductiegegevensSaveButton">
    <af:resetActionListener/>
    </af:commandButton>
    I get the following error:
    Foutdetails webpagina
    Gebruikersagent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; AskTB5.6)
    Tijdstempel: Thu, 17 Feb 2011 13:54:46 UTC
    Bericht: Syntaxisfout
    Regel: 3744
    Teken: 1
    Code: 0
    URI: http://172.16.6.108:8988/demeter/adf/jsLibs/Common10_1_3_2_0.js
    The code from Common:
    3732 function _callChained(
    3733 a0,
    3734 a1,
    3735 a2
    3736 )
    3737 {
    3738 if(a0&&(a0.length>0))
    3739 {
    3740 if(a2==(void 0))
    3741 {
    3742 a2=a1.window.event;
    3743 }
    3744 var a3=new Function("event",a0);
    3745 a1._tempFunc=a3;
    3746 var a4=a1._tempFunc(a2);
    3747 a1._tempFunc=(void 0);
    3748 return!(a4==false);
    3749 }
    3750 else
    3751 {
    3752 return true;
    3753 }
    3754 }
    Problem nr.1:
    When I call the button I do not see any logging that indicate that the value is set in backing bean
    Workaround: I made item on my page depending on item where I put my code.
    Result: I have to press 2 times on my button to execute the button code. First time to make the validation and the second time the button code itself.
    Not nice. The validation is also slow.
    But ok:
    Problem 2:
    I still get the same error, I see logging of execution of my validation.
    There is also the difference between loggings is 2 cases:
    If I use
    onclick="if (validateForm('dataForm')){return((#{ValiderenBotBean.botId} + 'la')}"
    what I really want instead of
    onclick="if (validateForm('dataForm')){return'la')}"
    I get:
    17-feb 14:28:40 DEBUG (ValiderenBotBean) -getBotId : -1
    17-feb 14:28:40 DEBUG (ValiderenBotBean) -getBotId : -1
    It means that value is obtained correctly.
    But still the same error.
    If I put for test purpose
    the following code into my bean:
    public String getBotId() {
    log.debug("getBotId : " + this.botId);
    botId = "23";
    return this.botId;
    I do not get any error.
    Any ideas?
    Please help

    Thanks, Amit,
    I will try it tomorrow.
    Some remarkes:
    1. I need javascript for confirmation
    2. I really do not PPR. It takes so long. The user use the scanner to put the value into input items in order speed up the process. And now PPR...
    3. My transient attribute will depend on 8 items. Even more waiting process.
    What I really want is to execute my db function only 1 time "onclick" or "oncommit" and according to outcome of db-function ask user for confirmation of commit.
    I tried already to implement dialog from ADF with launchDialog function.
    But ReturnListener did not function while I launch the Dialog manually.
    Anna

  • What tag to use to print STRING value from Backing Bean

    Hi;
    I would like to achieve the objective as below:
    Displaying 4 buttons (pagination) in my jsf page:
    1) Go First
    2) Go Previous
    3) Go Forward
    4) Go Last
    <h:commandButton image="images\first(on).gif" type="submit" action="#{alertSetBean.goFirst}"/>
    <h:commandButton image="images\previous(on).gif" type="submit" action="#{alertSetBean.goPrevious}"/>
    <h:commandButton image="images\forward(on).gif" type="submit" action="#{alertSetBean.goForward}"/>
    <h:commandButton image="images\last(on).gif" type="submit" action="#{alertSetBean.goLast}"/>In order to make sense for user, when the page is displaying first set element records, the icon should be disabled for
    -Go First
    -Go Previous
    and same goes to last set element records, icon to disable for
    -Go Forward
    -Go Last
    To disable, i will substitute
    <h:commandButton image="images\forward(on).gif" type="submit" action="#{alertSetBean.goForward}"/>
    with
    <h:graphicImage value="images\previous(off).gif" />
    It looks very messy in jsf page. Therefore, I would like to call a method in Backing Bean, where it will do check pagination by returning the long string as following:
    <h:commandButton image="images\first(on).gif" type="submit" action="#{alertSetBean.goFirst}"/>
    <h:commandButton image="images\previous(on).gif" type="submit" action="#{alertSetBean.goPrevious}"/>
    <h:commandButton image="images\forward(on).gif" type="submit" action="#{alertSetBean.goForward}"/>
    <h:commandButton image="images\last(on).gif" type="submit" action="#{alertSetBean.goLast}"/>Unfortunately, i'm using
    <h:outputLabel
    <h:outputText
    The JSF page DOES NOT render the code, and it print the string instead. Please, I need advise.
    Thanks;
    Yoke Yew

    Hi Balu;
    Before i received your great response, i was in the midst debugging
    Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    with my following JSTL code
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    <tr>
           <td align="right">            
                </f:verbatim>
                <h:outputLabel value="#{alertSetBean.totalCnt}" styleClass="lbl"></h:outputLabel>
                <h:outputLabel value="  Total  " styleClass="lbl"></h:outputLabel>
              <c:if test="${alertSetBean.pagination == 1}">
                   <h:graphicImage value="images\first(off).gif"/>
                <h:graphicImage value="images\previous(off).gif" />
                <h:commandButton image="images\forward(on).gif" type="submit" action="#{alertSetBean.goForward}"/>
                <h:commandButton image="images\last(on).gif" type="submit" action="#{alertSetBean.goLast}"/>
              </c:if>          
              <c:if test="${alertSetBean.pagination == 2}">
                   <h:commandButton image="images\first(on).gif" type="submit" action="#{alertSetBean.goFirst}"/>
                <h:commandButton image="images\previous(on).gif" type="submit" action="#{alertSetBean.goPrevious}"/>
                <h:commandButton image="images\forward(on).gif" type="submit" action="#{alertSetBean.goForward}"/>
                <h:commandButton image="images\last(on).gif" type="submit" action="#{alertSetBean.goLast}"/>
              </c:if>
                <c:if test="${alertSetBean.pagination == 3}">
                     <h:commandButton image="images\first(on).gif" type="submit" action="#{alertSetBean.goFirst}"/>
                <h:commandButton image="images\previous(on).gif" type="submit" action="#{alertSetBean.goPrevious}"/>
                <h:graphicImage value="images\forward(off).gif"/>
                <h:graphicImage value="images\last(off).gif" />
                </c:if>
                <f:verbatim>
           </td>
      </tr>I hope somebody can point where is my mistake, and i will refer to your previous solution suggested. Thanks in advance.

  • How to read and display table data entries from ERP in CRM

    Hello experts,
    I am new to CRM. I need to read data base entries from ERP in CRM system. What would be the best way to do . The table is a standard SAP table with a custom include (several customer fields). Calling a web service would be the best way..? or is there any other way that I can do it too.
    Also, to display these entries what would be the best tool? Should I built my own transaction/report to do it?
    Any advise or guidance would be a great kick start to learn the CRM development environment.
    Regards,
    jaffery

    Hi,
    Check the below wiki link if it helps.
    http://wiki.sdn.sap.com/wiki/display/CRM/Howtodisplayaz-tableinanassignmentblock
    Also, you can try an option of transaction launcher.
    Hope this helps.
    Regards,
    Chandrakant

  • How to get readonly text field value in backing bean?

    Below is my code in JSF.
    <h:inputText id="prodLine" value="#{fbackingBean.value}" required="true" styleClass="readOnlyField" readonly="true"/>
    This is a readonly field, and the value will been pass in by a pop up window. after the value had been passed in, i try to store the data which i had selected, but the value in readonly field (which show in above) return a null value.
    May i noe how can i get the readonly field value in backing bean? thanks!

    Why not keep track of the value in the backing bean? If it's a read only value set from a backing bean it should be simple to retrieve from a backing bean.
    I'm new to JSF, but one thing that I have figured out is to try to put everything in the backing beans possible and to do as little as possible within the JFS web page components.

  • How to get value in backing bean from application module

    Hi all.. I'm new in jdeveloper and adf..
    I need to use value from backing bean and use that value in application module.
    But I don't know how to get it.
    Do you a have any solution?

    suppose you have myMethod(String argumentName1,String argumentName2) in your Application Module
    then to access a method binding from a managed bean, use the following code,
      BindingContext bctx = BindingContext.getCurrent();
      BindingContainer bindings = bctx.getCurrentBindingsEntry();
      OperationBinding operationBinding =
           bindings.getOperationBinding("name_of_method_binding");
      //Here you can pass the parameters value to the AM method
      operationBinding.getParamsMap().put("argumentName1",value1);
      operationBinding.getParamsMap().put("argumentName2",value2);
      //invoke method
      operationBinding.execute();
      if (!operationBinding.getErrors().isEmpty()) {
         //check errors
         List errors = operationBinding.getErrors();
      //optional
      Object methodReturnValue = operationBinding.getResult();

  • How can I access the Attribute Values from the Search Region

    Hi all,
    I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
    I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
    Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
    I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
    Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
    If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
    SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
    I don't know how can I access the data from the Search Region.
    Please Help.
    Regards,
    Ranjith

    you could access the parameters entered in search region by the user as follows:
    You can get handle to the value entered by the user using queryListener method in af:query.
    You can intercept the values entered as described
    public void onQueryList(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
    for ( Criterion c : searchList) {
    if (c instanceof AttributeCriterion ) {
    AttributeCriterion a = (AttributeCriterion) c;
    a.getValues();
    for ( Object o : a.getValues()){
    System.out.println(o.toString());
    //call default Query Event
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    public void onQueryTable(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
    MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
    me.invoke(elctx, new Object[]{queryEvent});
    Thanks,
    Navaneeth

  • How to get attribute value from standard page ?

    Hi,
    How to get attribute value from standard page ?
    String str = (String)vo.getCurrentRow().getAttrbute("RunId");
    But this value is returning a null value ....
    Can anyone help me to get this attribute value which is actually having a actual value .

    getCurrentRow() would always return null if no setCurrentRow() is used.
    Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
    vo.reset();
    vo.next();
    Regards
    Sumit

  • How to get attribute value from an object inside an object in Xpress

    Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
    <ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
    <ObjectRef type='Resource' name='Google Apps'/>
    </ResourceInfo>
    I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.

    If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
    <invoke name='getResourceName'>
      <ref>myResInfo</ref>
    </invoke>

Maybe you are looking for

  • How to display String/text in a JFrame ?

    Hi, I set up a simple browser and pinging a server (say localhost). Then under that server directory, I am looking for a file. Then, I use input or output stream to bounce the text back to browser to display out on the screen. It was successful. But,

  • Need the escaletion template in excel format

    Hi, Please send me the escalation template for which we need to prepare for customer post go live, sp that he can submit his cooncerns in that template and it can be addressed. Thanks, Manu

  • Return a recordset in script or procedure

    Hi ALL, How can I use "select * "statement in script or procedure? Example DECLARE V_PRVSP_REFNO Number; BEGIN select * from tb; END;

  • Oracle Wallet manager error

    Hi all, Inorder to test SSL, i created a certificate request in OWM.Then i got a trial certificate from verisign for this request.What should i do now ? I tried to import that certificate in Oracle Wallet manager but getting this error. "Trusted Cert

  • SAP api tools...

    Hi, what kind of facilities or api tools does SAP Porter offer to save/get preferences? For example, in some portals (like Vignette), there is an admin page in which a portlets display parameters can be adjusted.  After user clicks the 'update' butto