JSPs and tree displays

Has anyone made a tree display (like you can with javascript) using JSPs? If so, can you give me some direction as to how to get it accomplished?
I want to grab the items from the backend and use JSPs to display the items in a tree structure similar to an explorer folders display.

excuse me for my english
It really depend on the way you design you database.
Assume you have a table that contains item and it's parent id and a itemtype to indicates the category and items. So, the first level category's parent id will always be 0. So, you first select all category id with parent id equals zero and the you write a recursive function which will return you a string with it's child.
hope this will help.

Similar Messages

  • JSP and servlets(displaying Data On JSP page)

    Hiii all
    i am new to JSP ...also to servets
    tell me hw to print my data on the JSP page,
    i can print my data on the server,that data i want to print on JSP page
    if u all have e.g's it will be very good
    Thanks in advance
    Take Care
    Rahul :)

    What do you mean "print data on a JSP?" If you simply mean display dynamic content, you should def read up both on sun's resources and other googled resources for JSP walkthroughs...

  • How to send object arraylist from servlet to jsp and display using jstl

    Hi All....
    I have a simple application and problem with it.
    Once user logged in to system the user will redirect to LoginServlet.java controller.
    Then in LoginServlet I want to redirect user to another page called book_details.jsp.
    this is my login servlet.
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              PrintWriter out = response.getWriter();
              ArrayList<BankAccountDTO> account_list = new ArrayList();
              ResultSet resultSet = null;
              LowFairAirDB airDB = null;
              try{
                   airDB = new LowFairAirDB();
                   String query = "SELECT account_id, type, description, balance, credit_line, begin_balance, begin_balance_time_stamp FROM bank_account";
                   airDB.sqlSelect(query);
                   resultSet = airDB.getResultSet();
                   while(resultSet.next()){
                        account_list.add(new BankAccountDTO(resultSet.getInt(1),
                                                                     resultSet.getInt(4),
                                                                     resultSet.getInt(5),
                                                                     resultSet.getInt(6),
                                                                     resultSet.getString(2),
                                                                     resultSet.getString(3),
                                                                     resultSet.getString(7)));
              }catch(Exception ex){
              }finally{
                   try{resultSet.close();}catch(Exception ex){}
                   airDB.sqlClose();
         }I set bank account values to BankAccountDTO.java objects and add them to the arrayList.
    Next I want to send this objects arrayList to books_details.jsp and wanna display each objects values using JSTL.
    I still finding a way to go through this.
    1. Can anyone say how can I do it?
    2. Is there any other method to do the same thing without using JSTL?
    thanks in advance,
    Dil.

    Naishe wrote:
    In your servlet,
    request.setAttribute("account_list", account_list);
    requestDispatcher.findForward("/your/display/jsp");
    Good. I would only follow the Java naming conventions. E.g. accountList or accounts instead of the ugly PHP/C conventions.
    In the JSP,
    lst = (List< BankAccountDTO >)request.setAttribute("account_list");
    for(BankAccountDTO b: lst){
    populate your HTML tags or whatever
    Wrong. 1) You need getAttribute() and 2) you should not use scriptlets. Use JSTL c:forEach, e.g.<table>
        <c:forEach items="${accounts}" var="account">
            <tr>
                <td>${account.id}</td>
                <td>${account.type}</td>
                <td>${account.description}</td>
            </tr>
        </c:forEach>
    </table>To the topicstarter: for future JSP/JSTL related questions please use JSP/JSTL forum.
    Here it is: [http://forums.sun.com/forum.jspa?forumID=45].

  • Tree View through JSP and Java Script

    Hi,
    I am looking for code or ideas of a Tree Structure as shown in in the left side frame of admin console of Sun App server 7 on the browser. I need to create a tree structure which will work on the browser like it works on the Sun App Server 7 admin console. If you had any idea or code, please share with me. I would like to have some idea before I start building it. The tree will be build from the database. So any database design is also helpful. I am planning to have that tree using JSP and EJB.
    Please help. If you are not clear what I am looking for, then please drop a line in this forum, so that I can explain it fine.
    Thanks in advance.
    Amit

    You can use the JSP Tree Tag I have developed. This helps you both structuring the tree model itself + it takes care of displaying the tree in a nice way. You can change all HTML code used to display the tree. Also you can build trees dynamically instead of just displaying static trees. Take a look at it here:
    http://www.jenkov.dk/projects/treetag/treetag.jsp
    Kind Regards,
    Jakob Jenkov

  • How to display an xml file contents in jsp as tree view

    hi,
    Iam trying to read an xml file and display the structure in jsp as tree view, can any one help me

    Use a [XML or DOM parser|http://java-source.net/open-source/xml-parsers] to read a XML file into a tree structure of Java objects.
    Use the [Collections API|http://java.sun.com/docs/books/tutorial/collections/index.html] to get hold of the relevant elements in a tree structure.
    Use JSTL´s [c:forEach|http://java.sun.com/javaee/5/docs/tutorial/doc/bnakh.html] tag to iterate over a Collection in JSP.
    Use HTML´s [<ul>/<li>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.2] or [<dl>/<dt>/<dd>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.3] tags to represent a tree in HTML.

  • How to pass arraylist of object from action class to jsp and display in jsp

    I need to do the following using struts
    I have input jsp, action class and action form associated to that. In the action class I will generate the sql based on the input from jsp page/action form, create a result set. The result set is stored as java objects in a ArrayList object.
    Now I need to pass the arraylist object to another jsp to display. Can I put the ArrayList object in the request object and pass to the success page defined for the action? If this approach is not apprpriate, please let me know correct approach.
    if this method is okay, how can I access the objects from arraylist in jsp and display their property in jsp. This java object is a java bean ( getter and setter methods on it).
    ( need jsp code)
    Can I do like this:
    <% ArrayList objList = (ArrayList)request.getattribute("lookupdata"): %> in jsp
    (***I have done request.setattribute("lookupdata", arraylistobj); in action class. ***)
    Assuming the java object has two properties, can I do the following
    <% for (iint i=0. i<objList.size;I++){ %>
    <td> what should i do here to get the first property of the object </td>
    <td> what should i do here to get the first property of the object </td>
    <% }
    %>
    if this approach is not proper, how can I pass the list of objects and parse in jsp?
    I am not sure what will be the name of the object. I can find out how many are there but i am not sure I can find out the name
    thanks a lot

    Double post:
    http://forum.java.sun.com/thread.jspa?threadID=5233144&tstart=0

  • Pass ArrayList to jsp and display first index of resultset?

    Is it possible for me to pass an ArrayList to a jsp, and display the each resultset stored in the ArrayList by the ArrayList index?
    The code below gets passed two paramaters. An invorg, and item. It then creates resultset based upon the Object and puts the results into an ArrayList.
    The resultset returned varies, but the largest resultset that I have received back has not been bigger thatn 10 resultset rows, and the largest number of columns has been 27 columns.
    I would then like to pass the whole ArrayList to the jsp and display the contents for each row based on the index it is on.
    Is this possible?
    public class RunReportAction extends MTDAction
        ArrayList results;   
        public RunReportAction()
        public boolean execute(HttpServletRequest _req, HttpServletResponse _res) throws ServletException, IOException
            String item = _req.getParameter("itemsToAdd");
            String invorg = _req.getParameter("invorg");
            try
                if (rep_type.equals("Vendor"))
                    runVendorReport(item, invorg);
                else if (rep_type.equals("Purchase Order"))
                    runPOReport(item, invorg);
                else if (rep_type.equals("Inventory"))
                    runInventoryReport(item, invorg);
                else if (rep_type.equals("Item Usage"))
                    runWhereUsedReport(item, invorg);
                else if (rep_type.equals("Cost/Purchasing"))
                    runCostReport(item, invorg);
                else if (rep_type.equals("Planning"))
                    runPlanningReport(item, invorg);
            catch (Exception e)
                setView("SSMErrorPage.jsp");
                model = e;
            model = results;
            view = "SSM_Reports";
            return true;
        boolean runInventoryReport(String item, String invorg) throws MTDException
            try
                CallableStatement cs = conn.prepareCall("{call CTI_SSM_PKG.get_inventory_report(?,?,?)}");
                cs.registerOutParameter(3, OracleTypes.CURSOR);
                cs.setObject(2, item, Types.VARCHAR);
                cs.setObject(1, invorg, Types.VARCHAR);
                cs.execute();
                ResultSet rs = (ResultSet)cs.getObject(3);
                while (rs.next())
                    InventoryObj inventory = new InventoryObj();
                    inventory.setInvOrg(rs.getString(1));
                    inventory.setItem(rs.getString(2));
                    inventory.setItemDescription(rs.getString(3));
                    inventory.setInvFlag(rs.getString(4));
                    inventory.setStockEnabled(rs.getString(5));
                    inventory.setTransactable(rs.getString(6));
                    inventory.setRevQtyControl(rs.getString(7));
                    inventory.setReservable(rs.getString(8));
                    inventory.setCheckShortage(rs.getString(9));
                    inventory.setLotControl(rs.getString(10));
                    inventory.setShelfLife(rs.getString(11));
                    inventory.setLotStartPrefix(rs.getString(12));
                    inventory.setLotStartNumber(rs.getString(13));
                    inventory.setLotCycleCount(rs.getString(14));
                    inventory.setPosMeasureError(rs.getString(15));
                    inventory.setNegMeasureError(rs.getString(16));
                    inventory.setSerialGeneration(rs.getString(17));
                    inventory.setSerialNumbStart(rs.getString(18));
                    inventory.setSerialPrefixStart(rs.getString(19));
                    inventory.setLotStatus(rs.getString(20));
                    inventory.setSerialStatus(rs.getString(21));
                    inventory.setLotSplit(rs.getString(22));
                    inventory.setLotMerge(rs.getString(23));
                    inventory.setLocatorControl(rs.getString(24));
                    inventory.setToday(rs.getString(25));               
                    results.add(inventory); 
                    System.out.println(results);
            catch (SQLException e)
                throw (new MTDException("Failed to run report in database.", e));
            //model = results;
            //setView("SSM_Reports.jsp");
            return true;
    }jsp code:<%@ page import="java.util.*"%>
    <%@ page import="ssmmtd2.InventoryObj"%>
    <html>
    <head>
    <title> SSM 2 Inventory Report </title>
    <style>
              A {text-decoration:none;color:black;}
              A:Hover {color:Blue}
    </style>
    </head>
    <%
      ArrayList inventory;
      if (request.getAttribute("model") != null)
        if ((request.getAttribute("model").getClass().getName()).equals("java.util.ArrayList"))
          inventory = (ArrayList)request.getAttribute("model");     
          if (inventory != null && inventory.size() > 0)
          %>
        <body  bgcolor="#FFFFFF">
          <table border = "1" width="755" cellpadding="0" cellspacing = "0">
          <tr>
            <td colspan="3" width="755" align="center">
              <p align="center"><big><b><font color="#000080">Inventory Report</font></b></big>
            </td>
          </tr>
          </table>
          <table border="1" width="755">
            <tr>
              <td width="100%">
                <form>
                  <table>
                <%
                  Iterator i = inventory.iterator();
                  while (i.hasNext())
                    InventoryObj invObj = (InventoryObj)i.next();
                %>
                  <TR>
                    <TD><B>ITEM:</B>
                      <align="left" valign="center"><%=invObj.getItem()%>
                    <td><B>DESCRIPTION:</B>
                      <align="left" valign="center"><%=invObj.getItemDescription()%>
                  <TR>
                  </TR>
                  <TR>
                  </TR>
                  <TR>
                  </TR>
                    <td><B>ORGANIZATION:</B>
                      <align="left" valign="center"><%=invObj.getInvOrg()%>
                    </TD>
                    <TD>
                      <B>CURRENT DATE:</B>
                        <align="left" valign="center"><%=invObj.getToday()%></TD>
                    </TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                    <TR>
                      <TD><B>INVENTORY ITEM</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getInvFlag()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>STOCK ENABLED</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getStockEnabled()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>TRANSACTABLE</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getTransactable()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>REVISION QTY CONTROL</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getRevQtyControl()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>RESERVABLE TYPE</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getReservable()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>CHECK SHORTAGES</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getCheckShortage()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>LOT CONTROL</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotControl()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>SHELF LIFE DAYS</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getShelfLife()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>STARTING LOT PREFIX</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotStartPrefix()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>STARTING LOT NUMBER</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotStartNumber()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>CYCLE COUNT</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotCycleCount()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>POSITIVE MEASUREMENT ERROR</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getPosMeasureError()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>NEGATIVE MEASUREMENT ERROR</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getNegMeasureError()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>SERIAL GENERATION</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getSerialGeneration()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>STARTING SERIAL NUMBER</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getSerialNumbStart()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>STARTING SERIAL PREFIX</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getSerialPrefixStart()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>LOT STATUS</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotStatus()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>SERIAL STATUS</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getSerialStatus()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>LOT SPLIT</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotSplit()%>
                      </TD></TR>
                    <TR>
                      <TD><B>LOT MERGE</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLotMerge()%>
                      </TD>
                    </TR>
                    <TR>
                      <TD><B>LOCATOR CONTROL</B>
                      <TD align="left" valign="center"><b>:</B>  <%=invObj.getLocatorControl()%>
                      </TD>
                    </TR>
                <%} %>
                  </table>
                <input type="hidden" name="SearchValue">
                <BR>
                <img src="images/close11.bmp" style="cuinvObjor:hand" onmouseover='this.src="images/close12.bmp"' onmouseout='this.src="images/close11.bmp"' onClick="window.close()">     
                <img src="images/print1.bmp" style="cuinvObjor:hand" onmouseover='this.src="images/print2.bmp"' onmouseout='this.src="images/print1.bmp"' onClick='this.src="images/print3.bmp"; window.print()' >
                </form>
              </td>
            </tr>
          </table>
        </body>
    <%
    %>
    </html>

    Your arraylist object should be a list of inventory bean objects and then, If you are using struts, you could use logic:iterate tags.. or something equivalent.. you could use forEach in jstl..

  • JSP ADF Tree Binding in JDeveloper 10g

    I am attempting to create a JSP hierarchical tree structure in JDeveloper 10g. I can successfully create the tree structure for two levels only. I need to be able to create a tree 5 or more levels deep. I have created an ADF Master Detail structure using the sample OE schema for three levels and to the best of my knowledge, I have set up the rules correctly using the Tree Binding Editor accessed by a creating a new binding under Create Binding > Input > Tree for the UIModel of the test web application I created. However, in the JSP page, I can only access the first two levels. The code I'm using is as follows:
    <c:forEach var="masterRow" items="${bindings.CustomerOrdersTree.rootNodeBinding.children}">
    <c:out value="${masterRow.CustomerId}"/> -
    <c:out value="${masterRow.CustFirstName}"/>
    <c:out value="${masterRow.CustLastName}"/><br>
    <c:forEach var="ordersChildRow" items="${masterRow.children}">
    <c:out value="${ordersChildRow.OrderId}"/><br>
    <c:forEach var="Row2" items="${ordersChildRow.children}">
    </c:forEach>
    </c:forEach>
    </c:forEach>
    The first two levels display fine, but the third level is not displaying. What syntax should I be using to traverse further levels of the tree binding? Is it even possible? Thanks.
    Note: I didn't connect any event handlers for collapsing or expanding data. I'm just trying to display everything right now.

    I have the nodeExpanded attribute on the second level, set up exactly as the first level. I have a toggleSelection method on the second level (View Object) as well. I've stepped through this method and the arguments are passed correctly and the transient attribute is updated correctly. I'm calling this method through a second DataAction like treeHandler, and this works as far as calling the correct method with the correct argument values.
    The breakdown occurs back on the JSP. Even though the transient attibute gets populated accurately according to the toggleSelection method, when accessing that attribute on the JSP, it returns a null value. I can access all the other attributes from the same View Object, except for the transient attribute. I'm not sure what else to try.
    I'm starting to doubt this is even the best solution for a tree structure. With the way Oracle's example is set up, you would have to nest so many if-then structures in order to keep track of all the nodeExpanded attributes and which data to display or not, and I anticipate view state issues and caching problems.

  • Double click in ALV tree display....

    Hi all,
    I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
    My code as of now is as below:
    Please tell how to handle events in this report tree display and how and where to write the code for this functionlity of double click.
    FORM alv_tree.
    PERFORM build_sort_table.  “----
    table is sorted
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      CREATE OBJECT l_custom_container
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            i_parent              = l_custom_container
            i_node_selection_mode =
                                  cl_gui_column_tree=>node_sel_mode_multiple
            i_item_selection      = 'X'
            i_no_html_header      = ''
            i_no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader.
      PERFORM build_comment USING
                     lt_list_commentary. “----
    already created
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    register events
      PERFORM register_events.
    create hierarchy
      CALL METHOD tree1->set_table_for_first_display
              EXPORTING
                   it_list_commentary   = lt_list_commentary
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
              CHANGING
                   it_sort              = gt_sort[]
                   it_outtab            = itab_outtab
                   it_fieldcatalog      = t_fieldcat. "gt_fieldcatalog.
    expand first level
      CALL METHOD tree1->expand_tree
             EXPORTING
                 i_level = 1.
    optimize column-width
      CALL METHOD tree1->column_optimize
               EXPORTING
                   i_start_column = tree1->c_hierarchy_column_name
                   i_end_column   = tree1->c_hierarchy_column_name.
    ENDFORM.                    " alv_tree
    FORM register_events.
    define the events which will be passed to the backend
      data: lt_events type cntl_simple_events,
            l_event type cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      append l_event to lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      append l_event to lt_events.
      call method tree1->set_registered_events
        exporting
          events = lt_events
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    ENDFORM.                    " register_events

    hi
    (also check u have refresh the field)
    Check the demo program,In this double click the data fields it will display some field in screen,You can check it
    BCALV_GRID_DND_TREE
    Thanks
    Edited by: dharma raj on Jun 17, 2009 7:41 PM

  • How to use ShowValue within a UIX/JSP page to display an active link?

    I am storing URL's in the DB and want to display them as active links on a UIX/JSP page. I thought that I had this working some time ago, but now it no longer works.
    Using <bc4juix:RenderValue datasource="ds1" dataitem="myTextField" /> will display "http://www.otn.oracle.com" as an inactive link using UIX/XML which is expected.
    Using <jbo:ShowValue datasource="ds1" dataitem="myTextField" /> will display an active link using if using BC4J/JSP, which is expected.
    However, I have not been able to do this using a UIX/JSP page.
    Is it possible to use ShowValue within a UIX/JSP page to display an active link?
    Thanks,
    Bill G

    Hi Juan,
    I've done the following and it does not work for me;
    --- snip ---
    <uix:form name="form1" method="GET">
    <bc4juix:Table datasource="ds1" >
    <uix:columnHeaderStamp>
    <uix:styledText textBinding="LABEL"/>
    </uix:columnHeaderStamp>
    <%--
    <jbo:AttributeIterate id="dsAttributes" datasource="ds1" hideattributes="UixShowHide">
    <bc4juix:RenderValue datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
    </jbo:AttributeIterate>
    --%>
    <bc4juix:RenderValue datasource="ds1" dataitem="FacilityDesc" />
    <bc4juix:RenderValue datasource="ds1" dataitem="LocationId" />
    <bc4juix:RenderValue datasource="ds1" dataitem="LocationDesc" />
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <uix:rawText>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    </uix:rawText>
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <uix:contents>
    <uix:rawText>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    </uix:rawText>
    </uix:contents>
    --- snip ---
    Bill G...

  • Communication between jsp and abstractportalcomponent

    Hello All
    Communication between jsp and abstractPortalComponent.
    jsp contains one input text field and one submit button.
    when the user clicks on submit button it will call the component and that input value will
    display in same jsp page.
    how this communication will happen?
    Rgrds
    Sri

    Hi Srikanth,
    In the JAVA File, 
    OnSubmit Event,
    String inputvalue ;
    InputField myInputField = (InputField) getComponentByName("Input_Field_ID");
    if (myInputField != null) {
                   inputvalue = myInputField.getValueAsDataType().toString();
    request.putValue("textvalue", inputvalue);
    request is IPORTALCOMPONENTREQUEST Object.
    In JSP File,   to retreive the value,
    <%
    String  textstring = (String) ComponentRequest.getValue("textvalue");
    %>
    In PORTALAPP.XML File,
    <component name="component name">
          <component-config>
            <property name="ClassName" value="classname"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
    Using the code above, You can pass and read values between abstract portal component and Jsp Page.
    Instead of this, I suggest you to use JSPDYNPAGE Component for Data Exchange.
    Check the [Link|http://help.sap.com/saphelp_nw2004s/helpdata/de/ce/e0a341354ca309e10000000a155106/frameset.htm].
    Hope this helps you.
    Regards,
    Eben Joyson

  • Error when running a JHeadstart generated two-level tree display

    Dear All,
    I have a simple master detail VO/VO datamodel based on which I'd like to generate a two-level tree display. I've followed the JHeadstart dev guide meticulously.
    When I run the page I get an error:
    javax.faces.el.PropertyNotFoundException: Error getting property 'name' from bean of type oracle.jbo.uicli.binding.JUCtrlHierTypeBinding
    It turns out that this generated code in a region file is the root cause:
    <af:switcher facetName="#{node.hierType.name}">
    <!-- DEBUG:BEGIN:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2 -->
    <f:facet name="MutatieSoortTypenNode">
    <af:outputText value="#{node.Omschrijving}"/> </f:facet>
    <!-- DEBUG:END:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2-->
    <!-- DEBUG:BEGIN:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2 -->
    <f:facet name="MutatieSoortenBijTypeNode">
    <af:outputText value="#{node.Omschrijving}"/> </f:facet>
    <!-- DEBUG:END:TREE_NODE : default/misc/tree/treeNode.vm, nesting level: 2-->
    </af:switcher>
    When I substituted the <af:switcher> .... </af:switcher> xml code by <af:outputText value="#{node.Omschrijving}"/>, the page displayed correctly.
    Given the fact that the code is generated, there doesn't seem to be much that I can do about it.
    We're using JDeveloper version 10.1.3.3.0 and JHeadstart version 10.1.3.2.41.
    Any help or suggestion would be much appreciated.
    Kind regards,
    Ibrahim

    Ibrahim,
    I cannot reproduce this. You are using a non-production build. Can you upgrade to JHeadstart 10.1.3.2.52?
    If the problem persists, you can work around it by creating a custom template for tree.vm which includes the af:switcher statement.
    Steven Davelaar,
    JHeadstart team.

  • Need help in JSP and Servlets

    Hi friends,
    [please forgive me if i am posting this in the wrong forum, all seems same to a fresher]
    Now, to my problem..i need a suggestion, a way or a method to implement the following!
    I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task?
    Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSP
    Thanks in adavance

    arun_ramachandran wrote:
    [please forgive me if i am posting this in the wrong forum, all seems same to a fresher]Then you should learn to be more observant - after all, we have JSP and Servlet fora, further down the list. :)
    I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task? You can store the data in your session object. You can even use JavaBeans and the jsp:usebean tag.
    [http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html]
    Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSPA wise approach - I wish more prople woiuld be as thoughtful.

  • Tree and Tree Node Components - Threadinar7

    Hi All,
    This is the seventh in the "Threadinar" series , please see Threadinar6 at
    http://forum.sun.com/jive/thread.jspa?threadID=100601 for details
    In this Threadinar we will focus on the
    "Tree" and "Tree Node" Components
    Let us begin our discussion with the Tree Component.
    Tree Component
    You can drag the Tree component from the Palette's Basic category to the Visual Designer to create a hierarchical tree structure with nodes that can be expanded and collapsed, like the nodes in the Outline window. When the user clicks a node, the row will be highlighted. A tree is often used as a navigation mechanism.
    A tree contains Tree Node components, which act like hyperlinks. You can use a Tree Node to navigate to another page by setting its url property. You can also use a Tree Node to submit the current page. If the the Tree Node's action property is bound to an action event handler, selecting the node automatically submits the page. If the Tree Node's actionListener property is bound to an action listener, opening or closing the node automatically submits the page. You set Tree Node properties in the Tree Node Component Properties window.
    * If you use this component to navigate between pages of a portlet, do not use the url property to link to a page. Instead, use the Navigation editor to set up your links to pages.
    * Events related to tree node selection do not work correctly in portlets because the component uses cookies to pass the selected node id back and forth, and cookies are not correctly handled by the portlet container. You cannot handle tree node selection events in portlet projects.
    Initially when you drop a tree on a page, it has one root node labeled Tree and one subnode labeled Tree Node 1. You can add more nodes by dragging them to the tree and dropping them either on the root node to create top level nodes or on existing nodes to create subnodes of those nodes. You can also right-click the Tree or any Tree Node and choose Add Tree Node to add a subnode to the node.
    Additionally, you can work with the component in the Outline window, where the component and its child components are available as nodes. You can move a node from level to level easily in the Outline window, so you might want to work there if you are rearranging nodes. You can also add and delete tree nodes in the Outline window, just as in the Visual Designer.
    The Tree component has properties that, among other things, enable you change the root node's displayed text, change the appearance of the text, specify if expanding or collapsing a node requires a trip to the server, and specify whether node selection should automatically open or close the tree. To set the Tree's properties, select the Tree component in your page and use the Tree Component Properties window.
    The following Tutorial ("Using Tree Component") is very useful to learn using Tree components
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/sitemaptree.html
    See Also the Technical Article - "Working with the Tree Component and Tree Node Actions"
    http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/tree_component.html
    Tree Node Component
    You can drag the Tree Node component from the Palette's Basic category to a Tree component or another tree node in the Visual Designer to create a node in a hierarchical tree structure, similar to the tree you see in the Outline window.
    The tree node is created as a subnode of the node on which you drop it. If you drop the node on the tree component itself, a new node is created as a child of the root node. You can see the hierarchical structure clearly in the Outline window, where you can also easily move nodes around and reparent them.
    You can also add a tree node either to a Tree component or to a Tree Node component by right-clicking the component and choosing Add Tree Node.
    A Tree Node component by default is a container for an image and can be used to navigate to another page, submit the current page, or simply open or close the node if the node has child nodes.
    * If you select the Tree Node component's node Tree Node icon in the Outline window, you can edit its properties in the Tree Node Properties window. You can set things like whether or not the Tree Node is expanded by default, the tooltip for the Tree Node, the label for the tree node, and the Tree Node's identifier in your web application.
    * You can use a Tree Node to navigate to another page by setting its url property. You can also use a Tree Node to submit the current page. If the the Tree Node's action property is bound to an action event handler, selecting the node automatically submits the page. If the Tree Node's actionListener property is bound to an action listener, opening or closing the node automatically submits the page.
    - Note: If you use this component to navigate between pages of a portlet, do not use the url property to link to a page. Instead, use the Navigation editor to set up your links to pages. In addition, events related to tree node selection do not work correctly in portlets because the component uses cookies to pass the selected node id back and forth, and cookies are not correctly handled by the portlet container. You cannot handle tree node selection events in portlet projects.
    * If you select the image in the Tree Node, you can see that its icon property is set to TREE_DOCUMENT. If you right-click the image on the page and choose Set Image, you can either change the icon to another one or choose your own image in the Image Customizer dialog box. For more information on working with an image in a tree node, see Image component.
    - Note: The image used in a tree node works best if it is 16x16 or smaller. Larger images can work, but might appear overlapped in the Visual Designer. You can right-click the component and choose Preview in Browser feature to check the appearance of the images.
    Please share your comments, experiences, additional information, questions, feedback, etc. on these components.
    ------------------------------------------------------------------------------- --------------------

    One challenge I had experience was to make the tree
    always expanded on all pages (I placed my tree menu
    in a page fragment so I can just import it in my
    pages).Did you solve this problem. It would be interesting to know what you did.
    To expand a node you call setExpanded on the node. Here is some code from a tutorial that a coworker of mine is working on.
    In the prerender method:
           Integer expandedPersonId = getRequestBean1().getPersonId();
             // If expandedPersonId is null, then we are not coming back
            // from the Trip page. In that case we do not want any trip
            // nodes to be pre-selected (highlighted) due to browser cookies.
            if (expandedPersonId==null) {
                try {
                    HttpServletRequest req =(HttpServletRequest)
                    getExternalContext().getRequest();
                    Cookie[] cookies = req.getCookies();
                    //Check if cookies are set
                    if (cookies != null) {
                        for (int loop =0; loop < cookies.length; loop++) {
                            if (cookies[loop].getName().equals
                                    ("form1:displayTree-hi")) {
                                cookies[loop].setMaxAge(0);
                                HttpServletResponse response =(HttpServletResponse)
                                getExternalContext().getResponse();
                                response.addCookie(cookies[loop]);
                } catch (Exception e) {
                    error("Failure trying to clear highlighting of selected node:" +
                            e.getMessage());
            }                  ... (in a loop for tree nodes)...
                      personNode.setExpanded(newPersonId.equals
                                    (expandedPersonId));In the action method for the nodes:
           // Get the client id of the currently selected tree node
            String clientId = displayTree.getCookieSelectedTreeNode();
            // Extract component id from the client id
            String nodeId = clientId.substring(clientId.lastIndexOf(":")+1);
            // Find the tree node component with the given id
            TreeNode selectedNode =
                    (TreeNode) this.getForm1().findComponentById(nodeId);
            try {
                // Node's id property is composed of "trip" plus the trip id
                // Extract the trip id and save it for the next page
                Integer tripId = Integer.valueOf(selectedNode.getId().substring(4));
                getRequestBean1().setTripId(tripId);
            } catch (Exception e) {
                error("Can't convert node id to Integer: " +
                        selectedNode.getId().substring(4));
                return null;
    It would also be great if I can set the tree
    readonly where the user cannot toggle the expand
    property of the tree (hope this can be added to the
    tree functionality).

  • Character Encoding for JSPs and HTML forms

    After having read loads of postings on character encoding problems I'm still puzzled about the following problem:
    I have an instance (A) of WL 8.1 SP3 on a WinXP machine and another instance (B) of WL 8.1 without any SP on a Win2K machine. The underlying Windows locale is english(US) in both cases.
    The same application deployed as a war file to these instances does not behave in the same way when it comes to displaying non-Latin1-characters like the Euro symbol: Whereas (A) shows and accepts these characters as request-parameters, (B) does not.
    Since the war file is the same (weblogic.xml, jsps and everything), the reason for this must either be the service-pack-level or some other configuration setting I overlooked.
    Any hints are appreciated!

    Try this:
    Prefrences -> Content -> Fonts & Color -> Advanced
    At the bottom, choose your Encoding.

Maybe you are looking for