Two managed beans in same jsp page

Hello
First this could be a stupid question, but i just can't find a solutions on this problem.
I wondering that could it be a two managed beans in same jsp page, here is a example:
index.jsp
<t:commandLink disabled="#{listBean.currentPage == 1}" id="previous2" type="button" immediate="true" style="font-size:small" action="#{listBean.previousPage}">
<h:outputText value="Edellinen" id="prev"/>
</t:commandLink>
<t:commandLink disabled="#{listBean.currentPage == listBean.totalPages}" id="next2" type="button" immediate="true" style="font-size:small;" action="#{listBean.nextPage}">
<h:outputText value="Seuraava" id="next"/>
</t:commandLink>
then i have a dataTable like this:
<t:dataTable value="#{customerListBean.customerBeans}"
binding="#{customerListBean.dataTable}" preserveDataModel="true" style="text-align:left">
My problem is that when i push a commandLink it doesn't refresh a dataTable. Does anyone know a solution here or is this just a impossible way to do it?
Thanks for help.

when i push nextPage (commandLink) it's call action
and count a new range of dataset and after that it's
calls a method which is declared on subClass and that
method get a new data of database on given params.
and put it on DataTable.
So listBean is upper class and customerListBean
extends on ListBeanNo, it doesn't work that way as you expected. You have created two independent instances. They doesn't communicate automatically with each other or so. Just use one CustomerListBean instance and call the inherited methods of ListBean on the #{customerListBean} managed bean instance.

Similar Messages

  • Regarding incorporate the two page nations in the same JSP page

    Hi folks,
    i am unable to do two page nations in the same JSP page using paging tag libray,I am getting the follwoing problem while setting the offset value to the Pager.offset.
    I have written the code like this.
    <pg:pager items="<%=size%>" export="sreenyOffset=offset, currentPageNumber=pageNumber;" isOffset="true" scope="request">
         <pg:index export="totalItems=itemCount">
         <% System.out.println("Before currentPageNumber:"+currentPageNumber); %>
         <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" nowrap>
              <tr class="pagenation" >
                   <td width="1%">&nbsp<br><br></td>
                   <td width="40%" align="left"> 
                        <pg:page export="firstItem, lastItem">Displaying results <strong><%= firstItem %>-<%= lastItem %></strong> of <strong><%=      totalItems %></strong> found</pg:page></td>
                             <td width=20%></td>
                        <pg:prev export="pageUrl,firstItem" >
                             <td width="5%" align="right" height="22">
                             <a href="javascript:submitSearchForm(document.organizationForm,'<%= firstItem %>')"><b>Previous</b></a></td>
                        </pg:prev>
                        <pg:pages export="pageUrl,firstItem,pageNumber">
                        <%
                             System.out.println("pageNumber :"+pageNumber+"^currentPageNumber:"+currentPageNumber);
                        %>
                             <% if (pageNumber == currentPageNumber) { %>
                                       <td width="2%" align="right" height="22"><font color=#FFFFFF><%= pageNumber %></font></td>
                             <% } else { %>
                             <td width="2%" align="right" height="22">
                                       <a href="javascript:submitSearchForm(document.organizationForm,'<%= firstItem %>')"><font color=#415481> <%= pageNumber %> <font></a>
                   </td>
                        <% } %>
                        </pg:pages>
                        <pg:next export="pageUrl,firstItem" ifnull="<%= true %>">
                             <% if (pageUrl != null) { %>
                   <td width="5%" align="right" height="22">
                        <a href="javascript:submitSearchForm(document.organizationForm,'<%= firstItem %>')"><b>Next</b></a></td>
                        <% } %>
                        </pg:next>
              </tr>
         </table>
         </pg:index>
              <html:hidden property="offset" value="0"/>
              <html:hidden property="pager.sreenyOffset" value="0"/>
    </pg:pager>
    I need some clarification for following things.
    1)i have given the export like this
    export="sreenyOffset=offset, currentPageNumber=pageNumber;"
         but while setting the offest for pager, i am doing like this
                   <html:hidden property="pager.sreenyOffset" value="0"/>
         can i customize the pager.offset to pager.(someting) like that.
    2)if i use pager.offset for two page nations in the same page pager.offset value is overriding,So i am unable to maintian the page nations.
    3)i can change the offset value into sreenyoffset in the export property of pager tag,if iam able to change the pager.offset value to customized value my problem will solve.
    4)
    can i declare the export property like this.
    <pg:pager items="<%=size%>" export="sreenyOffset=offset, currentPageNumber=pageNumber;" isOffset="true" scope="request">
    Please give me your valuable suggestions,it will be very helpful to me.
    Also give me some suggestions how to do the two page nations in the same page.I am desperately waiting for response.
    Thanks & Regards,
    Sreeny Reddy.

    Hi,
    I was trying the pagination concept in jsp. I am getting a lot of errors. Can u help me for displaying this pagination.i need to display dynamic records according to search criteria. In search criteria, an area is selected and the data related to that area should be displayed from a table in mysql . It has 100+ records each
    with 6 columns, each page should be displaying 10 records, what we call pagination. I was trying this(in java jsp)( should not do in struts, should be done only in jsp) for a long time. By ur faq, i understood u hava already done it. Pls try to help me. Can u pls send me a sample program regarding this?
    I would be very grateful if u help me.
    thanks in advance,
    regards,
    mv.

  • How update the info on same Jsp page

    i have a Jsp page.on left side of this page having menu bar. in this menu bar having links of some colleges.
    i want when i click on link of first college name, same page should be updaed with updated menu bar where i can show the information of the concerning college.
    please focus on this.

    I have two Jsp pages named bestschool.jsp and schoolnames.jsp.
    I am calling schoolnames.jsp from bestschool.jsp.
    I want when I click the link on INDUS School. It can show all concerning link of INDUS School links like profile, result, facility etc. in the same place instead of other naming school links.
    my requiremet main is i want to update the information on same Jsp page.
    How can I implement this with in Servlets/Jsp.
    Please review below JSP’s files
    schoolnames.jsp
    <table width="200" border="0" align="center" cellpadding="5">
    <tr>
    <td height="100" bgcolor="#476bc0">
    <div align="center" class="boldhead"><font size="+1">
    School list</font></div>
    </td>
    <tr>
    <td height="30" bgcolor="#5577C6">
    <a href="" class="smalltext">INDUS School</a></td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">Vaise School</a>
    </td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">D.G.V School</a></td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">D.P.S School </a></td>
    </tr>bestschool.jsp
    <html>
    <head>
    <title>Best school</title>
    <link href="mystyle.css" rel"stylesheet" type="text/css">
    </head>
    <body>
    <div align="center"><font size="+2">
    Best Schools in Rohtak</font>
    </div>
    <table width="700" height="500" border="0" align="left"
    cellspacing="0">
    <td width="200" rowspan="2" valign="top">
    <%@ include file="schoolnames.jsp" %>
    </td>
    <td height="328" bgcolor="#476BC0" valign="top">
    <p> </p><p> </p><p> </p>
    </html>please suggest.

  • More than one business component (views) in the same JSP page

    Hi, I am trying to have more than one business component (views) in the same JSP page as Input Form.
    For example:
    There are two BC4J:
    Person:
    Code.
    Name.
    Address:
         Person_code
         Street.
         City.
    There is a master detail relationship between them and there is a link between both views in the application module.
    I want to create a JSP page with an Input form for both views. When the user decides to create a Person, I need to insert in both tables.
    Insert code and name into Person table.
    Insert Person_code, Street and City into Address table.
    It is possible to do in Forms but I am not sure if I can be able to do this in JDeveloper 10G.
    Thanks

    Sorry I lost the tabs
    Person has two attributes Code and Name.
    Address has three attributes Person_coden Street, City.

  • Dynamicaly populating textbox in same same jsp page

    hi,
    i have a list box like
    <select name="ss">
    <option value="1">one
    <option value="2">two
    <option value="3">three
    </select>
    if i select "one" from list box than two text should be populated in same jsp page.
    please tell me how to achive this.

    It isn't a disturbance, it just looked different then what it is.
    My favorite way of doing this is to create the three text boxes, but hide two of them (and disable them). Then use the javascript function to show and enable them... like this:
    <html>
    <head>
    <script type="text/javascript">
      function showBoxes() {
        selectElem = document.getElementById("ss");
        selectedValue = selectElem.options[selectElem.selectedIndex].value;
        text2 = document.getElementById("text2");
        text3 = document.getElementById("text3");
        if (selectedValue==1) {
          text2.style.display = "none";
          text2.disabled = "disabled";
          text3.style.display = "none";
          text3.disabled = "disabled";
        if (selectedValue==2) {
          text2.style.display = "inline";
          text2.disabled = null;
          text3.style.display = "none";
          text3.disabled = "disabled";
        if (selectedValue==3) {
          text2.style.display = "inline";
          text2.disabled = null;
          text3.style.display = "inline";
          text3.disabled = null;
    </script>
    </head>
    <body>
    <form>
    <select name="ss" id="ss" onchange="showBoxes();">
      <option value="1" selected="selected">One</option>
      <option value="2">Two</option>
      <option value="3">Three</option>
    </select><br/>
    <input type="text" name="text1" id="text1" style="display:inline;"/>
    <input type="text" name="text2" id="text2" style="display:none;" disabled="disabled"/>
    <input type="text" name="text3" id="text3" style="display:none;" disabled="disabled"/><br/>
    <input type="submit"/>
    </form>
    </body>
    </html>

  • Error while trying to open the same JSP page.

    Hi partners,
    After solving some issues with JSP deployment, we are getting another error message.
    This is when we try to open the same JSP page at the same time.
    500 Internal Server Error
    javax.servlet.jsp.JspException: oracle.express.idl.util.OlapiException: ORA-22275: invalid LOB locator specified at oracle.dss.addins.jspTags.PresentationTag.doStartTag(PresentationTag.java:194) at Principal.jspService(_Principal.java:68) [SRC:/Principal.jsp:6] at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:513)
    I mean this is a concurrency problem.
    Any information about this will be really appreciated.
    Best regards!!!!!
    Francisco Mtz.

    After running the BI_Checkconfig tool I got an inconsistent OLAP API Metadata
    result, it was because a partner was modifying the OLAP metadata without saving
    the changes.
    After saving the changes in the OLAP metadata, I ran the BI_Checkconfig tool
    again with success (no metadata errors).
    Now the pages are displayed without any error message.
    Best regards!!!!
    Francisco Mtz.

  • Geting response on same JSP page

    hi everybody
    i want to select an item from dropdown box and want to display
    all data related with this selected item on same jsp page
    plz help me out
    thx in advance

    hi friends
    i am a newbie to java, i have some problem, can any one help me out?
    my form has few entries like
    USERNAME(text field),
    PASSWORD(text field),
    COUNTRY(select field - drop down list box),
    STATE (select field -drop down list box) n so on
    i have successfully populated countries list in the drop down list box taken from database dynamically using jsp
    "HERE COME THE COUNTRY CODE"
    <select size="1" name="country">
    <option selected value="Select">Select</option>
    <%
    while(rscoun.next())
         String coun=rscoun.getString(1);
         %>
         <option value ="<%=coun%>"><%=coun%></option>
         <%
         } %>
    </select>
    now when the user selects the country (say INDIA) , states list should be populated dynamically depending on the user selection
    and all this should happen on the same page
    please let me know how to achieve this , i need the help badly
    thanks inadvance
    kind regards
    suman

  • I want to post the values of the form in the same Jsp Page

    I want to post the values of the form in the same Jsp page.

    Was that a question? Or are you just informing the world of your grand intentions?
    But yeah, all you need to do is direct your action to the same page you're in. So, if this is your foo.jsp, it'd be something like...
    <%
    if(request.getParameter("bar") != null) out.println("Hello");
    %>
    <form method="post" action="foo.jsp">
       <input type="text" name="bar" value="baz">
       <input type="submit">
    </form>When you submitted your form, it would post the value to the same JSP page as you're already in, and print out Hello to the screen. "Hello" would not print out on the first visit, as the request would obviously not contain the parameter "bar" yet.

  • I want to display many records in the same jsp page

    Hi,
    i want to display many records with in the same jsp page providing the next,previous,first last .
    give me clear idea how to do that one
    note :only using servlets,jsp,jdbc and javascript

    I believe that this is the fourth time this question has been asked by the same person
    http://forum.java.sun.com/thread.jspa?threadID=720977&messageID=4159465#4159465
    http://forum.java.sun.com/thread.jspa?threadID=720945&messageID=4159338#4159338
    http://forum.java.sun.com/thread.jspa?threadID=720919&tstart=0

  • Two buttons in same jsp page

    hello to java people
    My ? is, jsp page named as login.jsp, In this page i want to use two buttons.
    If i click on one buton it will goto sucess.jsp and for another button it will go to find.jsp.
    i.e, two actions in same page, is it possible ?
    help me by giving sample code.
    thanks

    thanks balu for ur answer.
    pure java ?
    But my doubt is see we take one form
    <form action="sucess.jsp">
    <input text...>
    <input text...>
    <input type=submit name=sucess>
    <input type=submit name=find>
    </form>
    means whether i take two buttons as submit and names r diff..
    but at top only one action is there .
    how can they know to which page it has to go?
    do u understand my ?
    can u please give some sample code so that i can understand
    thanks

  • Two Identical forms on the same JSP page.???

    Hi want to have two identical submit forms on the same form but for some reason a get a javascript error when i add the second form to the JSP page... can you help me...

    I assume you meant "two identical submit buttons", instead of "two identical submit forms". Seeing your description of the problem, I believe you can reproduce it with a pure .html page, that is, a page containing not JSP code. So it is not a problem in JSP domain proper.
    I was going to direct you to the Technologies>>Internet>>Dynamic Services forum at
    http://forums.oracle.com/forums/thread.jsp?forum=95
    Then I found you have posted the same question as thread 298169 there.

  • Is it possible to use two diff forms in same jsp/jsf page?

    Hi all,
    My requirement is to submit the form based on selection of radio button.
    since half part needs to be jsp based which is not using any tags etc.
    But i am trying to use some jsf based component which requires to be inside <f:view><h:form> of
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    i.e. some <c:comboBox>
    </h:form> </f:view>
    Now earlier i was submitting the form as
    <form action="/techstacks-v2_1/reportAction.do" method="post" name=doSearch id='doSearch'>
    But now i found, in order to use combo box component which is entirely jsf based i need to use <f:view><h:form> which is kind of taking over the previous form submission mechiansm.
    I am trying to keep them separate as two differnt forms.
    one entirely jsp based and other as jsf based.
    Now my question is can i use such way of doing so or is there any better way of implementing so.
    My friend suggested that i can pass the value of jsf based form in hidden form to a input box of form to be submitted finally instead of submitteing two diff forms.
    but in that case also i ahev to use two forms in a single jsp/jsf page.
    suggest me something which can really work out.
    thanks
    vijendra

    You can use as many forms as you want as long as you don't nest forms. The HTML spec probibits that.

  • Multi user concept of same jsp page

    i have a problem i the jsp page used when there are multi users for the same page.....example when 2 users login at the same time..the id for the second user is same as the first one is displayed but his original id..what can be done for this..please help me out as soon as possible its very urgent

    Your posting is a little hard to understand...but if I am guessing your problem is that you have two users whose data is being shown to the other user... the problem could be either of the following:
    1. If you used a bean to hold the data, your scope for the bean is set incorrectly...you may have it at "Application" when it should have been "Session".
    2. If you used a JSP variable to hold the value, you declared it as static by using <! String x = "myString"; />
    Good luck.

  • Sharing a bean information through jsp pages

    Morning,
    I want to use a java bean in two jsp pages, so is it possible to share it (to set its properties in the 1st page and retrieve them in the 2nd)?
    If not, what should I do? Could I use forward and set param?
    Here is my 1st jsp
    ==================
    <%@page language="java" %>
    <jsp:useBean id="doctorConn" scope="session" class="beans.DoctorBean" >
         <jsp:setProperty name="doctorConn" property="*" />
    </jsp:useBean>
    <%
    if(doctorConn.getUserId().equals("") ||doctorConn.getPassword().equals(""))
         response.sendRedirect("notAuthorised.jsp");
    System.out.println("user id : " + doctorConn.getUserId()+ " password : " +doctorConn.getPassword());
    if(doctorConn.isAuthorised(doctorConn.getUserId(), doctorConn.getPassword())) {
    %>
         <jsp:forward page="doctorApp.jsp" />
    <%
    else response.sendRedirect("notAuthorised.jsp");
    %>
    ==================
    my second
    =================
    <%@page language="java" %>
    <%@page import ="java.sql.*" %>
    <%@page import ="java.lang.Exception"%>
    <jsp:useBean id="doctorConn" scope="session" class="beans.DoctorBean" />
    <jsp:useBean id="appointment" scope="session" class="beans.Appointment" >
         <jsp:setProperty name="appointment" property="*" />
    </jsp:useBean>
    ...etc
    ===========================
    I am using Tomcat 4 and in the 2nd page I am getting an error about doctorConn
    Thank you,

    Yes ofcorse. You can do it in many ways.
    Firstly, declare properties of your bean as static that you want to share between pages and create new instance of bean on each page.
    Secondly you can store the same instance of the bean in you session. On th other page, you can retrive same instance of the bean whenever needed.
    Otherwise, you can create a gateway class that maitain static reference of you bean class.

  • Problem with bean in a JSP page

    I have developped a JSP pages in wich I call a bean with
    <jsp:useBean id="db" scope="request" class="SQLBean.class" />
    The bean SQLBean.class is in the same directory as the JSP page.
    When I execute the JSP, I have the following error:
    SQLBean.class db = (SQLBean.class) JSPRuntime.instantiateBean("db", "SQLBean.class", "request", __db_was_created, pageContext, request, session, application);
    Syntax error: [expected after this token
    Syntax error: "]" inserted to complete ArrayAccess
    Syntax error: "AssignmentOperator AssignmentExpression" inserted to complete StatementExpression
    I use JRUN with IIS
    Thanks for the help

    I am assuming your class name is SQLBean.
    use:
    <jsp:useBean id="db" scope="request" class="SQLBean" />
    instead of:
    <jsp:useBean id="db" scope="request" class="SQLBean.class" />

Maybe you are looking for