Get a binding value in a jsp variable

Hello,
I need to get the value of <c:out value="${bindings.PreviousSet.enabledString}" /> in a variable that I'm using in JSP.
Do you know how can I do it?
I need to do that because the image that I'm going to show in a page depends on that value.
I have the following line
<input type="image" src="images/wizard/anterior.gif" name="event_PreviousSet" value="PreviousSet" <c:out value="${bindings.PreviousSet.enabledString}" />/>
if the value is enabled I'll show an image otherwise I'll show anotherone.
Thanks

In the case of the first question you can use the binding expressions directly in other JSTL expressions, not just c:out, for instance you can use a <c:if test="${bindings.PreviousSet.enabledString eq 'true'}>
to conditionally print something in the page.
The expression here refers to a "bindings" attribute on the request, so likewise if you want to get at the value in code you can use request.getAttribute("bindings") and work on down.
Pauls question - you have to think slightly differently because everything is abstracted through the ADF model layer. A good place to start would be the ADF Primer:
http://otn.oracle.com/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html
Also check out:
http://otn.oracle.com/products/jdev/tips/shmeltzer/setwhereclause/index.html

Similar Messages

  • Assigning a javascript value to a JSP variable

    How do i assign a javascript value to a JSP variable?
    eg
    <%
    String JSPvar;
    %>
    <script language="JavaScript1.2">
    <!--
    var javascriptVar="hey"
    -->
    </script>
    <%
    JSPvar = javascriptVar ???
    %>

    You do know that the JSP runs on the server and generates HTML, including Javascript, that is executed on the client, don't you?

  • How to get the bind value of a portlet in a page.

    I want to get the bind value of a portlet on a page. Can you tell me how can I get that.
    I used :
    portal30.wwv_name_value.get_string( l_arg_names, l_arg_values, '');
    It works ok when we run the report alone .But when we add the report as a portlet in page , it does not return any value. Can you tell me which Api does it.
    null

    Here is an example...
    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var doc = activeDocument;
    var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1));
    var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5));
    var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14));
    alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3);
    var decColour = eyeDropperRGB(40,doc.height-14);
    alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]);
    app.preferences.rulerUnits = originalUnits;
    function GetHexColour(reqHex){
    var out='';
    for(No in colours = reqHex){
    out = out.concat(zeroPad(d2h(reqHex[No]),2));
    return out;
    function eyeDropperRGB(x,y) {
    var x2 = x + 1;
    var y2 = y + 1;
    var out = new Array(3);
    activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false);
    for(ch in list = ["Red", "Green", "Blue"]) {
    histogram = activeDocument.channels[list[ch]].histogram;
      for (i = 0; i <= 255; i++) {
       if (histogram[i]) {
        out[ch] = i;
        break;
      return out; 
    function d2h(d) {return d.toString(16);}
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;

  • Assigning html input value to a jsp variable

    I have the following problem: I need to assign the value of html <input> field to a jsp variable. This should be done without submittion of the form.
    <form name="main">
    <table>
    <tr>
    <td><input type="text" name="gantry" value="123"></td>
    </tr>
    <table>
    </form>
    Is there any way to access main.gantry.value from jsp and assign it to a variable? I tried
    <% prevGantry = main.gantry.value; %>
    but it didn't work, and the problem is not with parsong or initialisation. Please, can anyone help?
    Best regards, SoVa.

    No it can't be done. You are mixing up java with javascript.
    Java/JSP runs on the server end. Generates an HTML page and stops running.
    The page loads in the browser, and and can run javascript locally.
    The only way to run java code again is to go through the request/response process. ie submit a form, click a link, make an Ajax call...
    The only way to get a field from the screen into a java variable is via request.getParameter().

  • Unable assign a BPM Object field value to a JSP Variable using "invoke"

    Hi,
    I'm unable to retrieve a value returned by a BPM Object Method and use it in JSP. Here is what I'm trying to achieve:
    BPM object named : "myObject" has a method "getRequiredValue" which returns a "String". I want to assign the value returned by "getRequiredValue" to a JSP Variable "myVariable" using invoke method as below:
    <% String myVariable = ""; %>
    <f:invoke var="${myObject}" methodName="getRequiredValue" retAttName="myVariable"/>
    <% out.println ("myVariable: " + myVariable); %>
    When I execute the above code I don't get the value being returned by "getRequiredValue" into "myVariable".
    Any help would be highly appreciated!
    regards,
    MK

    1. Make sure you mark the "Server Side Method" property of the getRequiredValue method to "Yes".
    2. I guess you dont need to specify "<% String myVariable = ""; %>". Try removing it.
    3. Replace "<% out.println ("myVariable: " + myVariable); %>" by <c:out value="${myVariable}"/> just in case!
    4. Lastly, I hope "myObject" is the name of the instance variable in your screenflow, and not the BPM object name.
    Hope this helps
    -Hemant

  • How to Get User entered value in a text variable

    Hi,
    I have made a text variable to show the user entered value in the column header.
    The user enteres value in a formula variable ABC whose default value is say '30'.
    I am using customer exit to capture this value in the text variable. The code is as follows
    IF i_vnam EQ 'txtvar'.
    if i_step = 2.
    LOOP AT i_t_var_range INTO loc_var_range
    WHERE vnam = 'ABC'.
    CLEAR l_s_range.
    l_s_range-low = loc_var_range-low.
    l_s_range-opt = 'EQ'.
    l_s_range-sign = 'I'.
    APPEND l_s_range TO e_t_range.
    EXIT.
    ENDLOOP.
    endif.
    endif.
    Now when I am executing the query I am getting the default value in the column header i,e, 30. But when the user changes this default value to something else while executing the query, I simply get blank in the column. The changed value is not getting captured in the text variable.
    Thanks

    Hi,
    Insted of  going for exit,
    just create a Text variable proceesing typr Default/ Manual Entry and set the default value as u wish,
    use it in the KF header; dont use the same Text Variable for Query Title.
    Now i tried this for you and it is working fine.
    Regards
    ReddY A

  • How to get javascript variable in jsp variable

    Hi all,
    i have a variable str in my javascript function
    var str = somevaluei want this str value in jsp variable in the same page...
    how can this be done..???
    any ideas...
    Thanks

    I dont know if its possible or not.
    Actually it depends on what do you want to do with the variable.
    as far as assisginng value to the hidden variable is concerned it can be done this way.
    <% jsp code
    String hiddenVar = "";
    %>
    < html code
    <input type type = "hidden" name="hidden" vale="<%=hiddenVar %>"
    html ends>
    while in js function you can assign vale to the hidden variable which will ultimately assign value to the JSP variable as follows.
    var str = "value";
    document.form_name.hidden_field_name.value = str.
    hope this hepls.

  • How to Open URL value stored in a variable in JSP

    Hi all,
    I want to know how i can use value of a string variable in a JSP as url to open.
    <% String abc="some url value" ; %>
    then i want to open abc as URL in JSP
    Please suggest something on this.
    any help in advance will be highly appreciated.
    thanks,
    savdeep.

    thanks rahul but,
    I want to open the URL in
    <% String URLvariable="abc.htm" ; %>
    <% out.println("< a href=URLvariable>"+rs.getString("Some JSP value")+"</a>"); %>
    please suggest how should i open the above URL value stored in JSP variable.
    any help will be highly appreciated.
    thanks,
    savdeep.

  • Seting a JSp variable to session scope in JSp page itself

    Hi,
    I have code like this
    <HTML>
         <HEAD>
              <TITLE>Change Password</TITLE>
              <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet/vclinical.css" TITLE="Style">
    </HEAD>
    <BODY>
    <form name="form">
    <select name="ss" onChange="this.form.qq.value=options[selectedIndex].value;getit()">
    <option value=1>ss1</option>
    <option value=2>ss2</option>
    </select>
    <input type="text" name="qq" value="">
    <%
    String asd=request.getParameter("qq");
    session.setAttribute("Stored", asd);
    System.out.println("value is"+asd);
    %>
    </form>
    </BODY>
    </HTML>
    here i want to set value of a JSP variable qq to session scope and here i am not invoking any servlet i want value of qq in next JSP page i am not submitting the page so how i can handle this. this code does not work so please tell me how to do this i am using struts frame work

    if you are using the struts framework, then you can make an ActionForm with getters and setters for the stuff that you are writing in the JSP i mean the radio buttons and text boxes etc
    from that action form you can get the values any time any where
    you just need to enter some thing like below in the struts-config.xml file
    <form-bean name="the action form name" type="package name.Actionform name" />
    <action path="/controller " type="package name.controller name" name="Action form name" scope="session">
    you can either put the action form in request scope or session scope

  • Get value from Table/Recordset Cell into a JSP variable

    Can anyone please help with this ?...
    I need to get a cell value from a selected row of a table into a variable to pass to a java bean.
    1 - The dynamic table is populated by a recordset named "rs" and has a submit button for each row .
    2 - The user clicks on the corresponding button to select the row.
    3 - The recordset retrieved the ID for that row in the query, but does not display it in the table.
    I have tried :
    <% String ID = rs.getString("bookid");%>
    <% Library.bookConfirm(ID);%>
    But this fails saying that it "cannot resolve variable rs..."
    Yet the recordset populates correctly and its name is "rs"
    Is there another way to do this perhaps ?... ie: put the id in a column of the table and get the cell value ?...
    What would be the syntax to get the ID cell value of that selected row on the button click ?...
    Your feed back would be greatly appreciated.
    Thank you.

    Create a new rs
    ResultSet rs1 = statement.executeQuery(query);
    and use getstring to access the individual cell.

  • Binded variables change value of modbus PLC variable when application starts

    Hello,
    I have a front panel with controls binded to some shared variables that use a modbus server to control a PLC. There is no logic behind that front panel, all I want to do is to be able to read/write some variables on the PLC.
    I binded the control with datasocket. The reason I did not use PSP is that I would like to bind the controls programmatically so if the client change the server (that holds the library and the citadel BD) the only thing he would have to do is to change the name of the server in the configuration file. It's seems that there is a bug in the Data Bindingath Property and it always return me an error when I try to bind dynamically (Which is not the case with the DataSocket:URL Property) .
    Now the PROBLEM: 
    Lets say a certains variable on the PLC holds the value 10. When I open my panel, I can see that value (10) a very short moment (milliseconds) and the value shifts to '0'. That undesirable '0' is indded written on the shared variable on the server and on the PLC. After that I can change the same value back and everything works properly. Its seems to me that the problem occurs only at the first connection. Same thing apend with booleans controls.
    I would like to be able to open my application, see the '10' in my control, update it if I want, close the application and get the last value when I re-open it.
    I'm running an executable with the DSC run-time.
    Thanks in advance for your help!
    Vincent

    Hello Vincent,
    This was reported to R&D (#161821) for further investigation.  I noticed that this only happens for controls in subVIs.  Perhaps you could restructure your program so that it no longer needs to view the front panel of its subVIs.  I will let you know if I find any other workarounds.  Thanks for the feedback!
    Regards,
    Burt S

  • Passing struts-tag value to java / javascript variable in JSP

    Hello all,
    Im trying to pass the value got from the struts-tag to the java variable in the Jsp. However Im not able to get the o/p. Can u guys help me on this pls...
    <logic:notEmpty name="TreeBean" property="list">
        <logic:iterate id="Type" name="TreeBean" property="list" indexId="i">
         <br/><bean:write name="Type" />
        </logic:iterate>
    </logic:notEmpty>Here the list can be populated in the jsp page. However i want the values into jsp list. Im not able to populate the same..
    <% List jspList = null;
    %> I want the values into the jspList variable for further processing. Can u guz pls help me on this....

    Which do you want it in?
    A java variable for use in <% scriptlet code %> or a javascript variable for use on the client end?
    scriptlet:
    <jsp:useBean id="TreeBean" type="java.util.List" class="java.util.ArrayList" scope="?????" />
    Having scriptlet code on the page is considered bad coding style.
    What is it you are trying to accomplish by making the value accessible?
    What are you trying to do in java / javascript that can't be done with JSP tags?

  • How to assign bean value to a local variable in JSP using struts.

    Hi everybody!
    I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
    we can have someting like this to display the value
    <bean:write name="detailService" property="status" />or
    <bean:define id="theStatus" name="detailService" property="status"/>
         This is country: <%=theStatus%>but an error occured when I tried like this:
    String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
    or
    String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
    Any help pretty much appreciated

    Java != JSP.
    The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
    The <bean:write> tag naturally just writes out what you tell it to.
    The <bean:define> tag defines a local variable, and gives it a value.
    this should do it.
    <bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
    <%
      String currentStatus = theStatus;
    %>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write.

  • Passing JavaScript values to JSP variables

    Can any body correct the follwing code
    <Script language="JavaScript">
    function test( x )
    <%
    int num = x;
    num = num * 2;
    %>
    v.value = "<%out.print(num);%>";
    <input type="button" name="b" value="test" onClick="test(5)">
    <input type="text" name="v" value="0">
    In short, I am trying to pass JavaScript value to JSP variable. I hope that it is possible to do that. If it is possible then how can I do it. I want to assing the variable x passed to the JavaScript function called test to the JSP variable called num.
    Regards,
    Ageel

    Thank you for your reply,,,
    I think then the only way to do it is to post the
    value on the server and then use request.getParameter
    method in jsp code
    but the question now how can I post values to the
    server using JavaScript without reloading the pageyes... you can to it by create a new popup window which will submit the value to server after page was loaded... then, server return a value to the same window in html/jsp page which then using javascript to set it back to the opener and close up the window... however, this is not a good choice unless you have no other alternative...
    >
    There is other possible solution
    if I can get the text field value from the same page
    without reloading it that would work fine and will
    solve my problem, is it possible?yes... you can get the value from the textfield...
    for example :
    function showValueInTextField()
        alert(document.forms[0].elements["mytextfieldname"].value);
    >
    My final question> can jsp change things on the same
    page without reloading it. I mean can it work like
    JavaScript so that I can use it's internal functions
    instead of using java script :S
    not really know what you trying to say here...

  • Help needed urgently to get the values from the jsp page.

    hi,
    I am badly stuck into this problem.Please help me and find a solution.
    I am using ms-access and jsp.
    my database structure is as given below:
    m_emp_no | from_date | to_date | approver| status |
    1002 | 22/9/2008 | 23/9/2008|1003 |pending
    1004 | 29/9/2008 | 30/9/2008|1003 |pending
    2044 | 15/9/2008 | 16/9/2008|3076 |pending
    now this is exactly a leave apply scenario where a page is displayed and the user has to fill in the details to apply leave.then the approver has to approve that leaves so even, he should get the details in his account.
    for example here 1003 has to approve leaves for 1002 & 1004.i am able to fetch data from database for the particular approver here is the coding:
    <html>
    <body>
    <h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
    Approval Requests</font></span></b></u></h2>
    <form method="POST" name="f1" action="update.jsp">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
    PreparedStatement p=null;
    p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
    ResultSet r=p.executeQuery();
    while(r.next())
    %>  <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
        <tr>
          <td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
        </tr>
      </table>
      <table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
        <tr>
          <td width="100%" height="165" valign="top">
            <p align="left"><b>User ID</b>        :
    <input type="text" name="id" value="<%=r.getString(1)%>"  size="4   
         <b>status</b>:<%=r.getString(5)%</p>
    <p><b>Leave From</b> : <%=r.getString(2)%></p>
    <p><b>Leave From</b> : <%=r.getString(3)%></p>
    <p><b>Approve</b> : <select  size="1" name="approved">
            <option value="Approved">Approved</option>
            <option value="Cancelled">Cancelled</option>        </select></p>
    <%
    con.close();
    %>
      <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
              <tr>
                <td width="100%" bgcolor="#999966">
                  <p align="center"><input type="reset" value="Clear" name="B1"> 
                  <input type="submit" value="Submit" name="B2"></td>
              </tr>
            </table>
            </td>
        </tr>
      </table>
    </form>
    </body>
    </html>{code}
    this will display both the rows but when i try to retrieve the values into update.jsp using the code given below it gives me only one value which is the first 1002.
    {code}approved=(String)request.getParameter("approved");
    id=(String)request.getParameter("id");{code}
    but i need both the values to be inserted into the update.jsp only then the approver will be able to approve the leaves individually with respect to the m_emp_no.
    please help me out.
    thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My comments below are all between (((((( and ))))))
    <html>
    <body>
    <h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
    Approval Requests</font></span></b></u></h2>
    <form method="POST" name="f1" action="update.jsp">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
    PreparedStatement p=null;
    p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
    ResultSet r=p.executeQuery();
    while(r.next())
    %> <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
    </tr>
    </table>
    <table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" height="165" valign="top">
    <p align="left"><b>User ID</b> :
    <input type="text" name="id" value="<%=r.getString(1)%>" size="4   
    ((((((( in the statement above, name="id" should be changed to something like name="id"<%=ii%>
    Where ii is a counter that tells you how many times you have gone through the loop so far.
    The reason for this is that each textfield you generate must have a unique name rather than all have the same name
    such as 'id'. This change will give them names such as id0, id1, id2. Then when you submit the page, you can uniquely
    identify each input textfield.))))))
    <b>status</b>:<%=r.getString(5)%</p>
    <p><b>Leave From</b> : <%=r.getString(2)%></p>
    <p><b>Leave From</b> : <%=r.getString(3)%></p>
    <p><b>Approve</b> : <select size="1" name="approved">
    (((( the above select also has to have a unique name for each time through the loop. Change it to name="approved"<%=ii%>
    <option value="Approved">Approved</option>
    <option value="Cancelled">Cancelled</option> </select></p>
    <%
    con.close();
    %>
    <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
    <tr>
    <td width="100%" bgcolor="#999966">
    <p align="center"><input type="reset" value="Clear" name="B1">
    <input type="submit" value="Submit" name="B2"></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    (((((((note you would be better off long term to put your business logic in a servlet and dispatch to the JSP page which will only have the responsiblity to display the data.
    Also, connection pooling is better than the above.

Maybe you are looking for

  • Can i get the report output in HTML format?

    Hello everybody, I have developed a report whose output needs to be printed in HTML format. Can anybody suugest how this can be accomplished by coding in program itself using any function modules if necesary? Helpful answers will surely be rewarded.

  • How to change the web icon in the browser window

    i have created my site and cant find how to change the icon in the browser window (like they have done at the top of this page with the Adobe icon before the  Adobe Forums: text )would anyone be kind enough to give me some help??

  • Downgrading window 8 to window 7 on hp pavilion-15-p045tx

    can you please tell me how to downgrde winddow 8 to window 7 on my hp pavilion-15-p045tx becuse i doesn't like window 7. so please tell me how to downgade windowby step by step. thanks in advance 

  • WF_NOTIFICATION

    I am using WF_NOTIFICATION(ATTRS,<attr1>,<attr2>..) in my message body. Now i need to dispay an URL using this WF_NOTIFICATION. Is it possible?

  • Scan a range of addresses

    Is there an easy way to use a router to ping or scan a subnet to see what IP's are currently active.