Nested Tableview column in HTMLB

Hi Gurus,
I need your help again. We are trying to modify a standard monitoring BSP application.
The BSP application has 12 columns for each month of a year.
We now want to add 3 more columns for each of the month.
The existing html page is using htmlb:tableview.
Please let me know how can I add 3 columns under an existing table column.
Cheers,
Chaithanya.

Hi,
I need to design the table equivalent to Heirarchial table view in Webdynpro.
i.e., I have a column called 'January' Under this column I need 3 more columns 'Actual' 'Target' and 'Status'.
I hope this gives a better clarity.
I want to attach a excel (To show exactly how it looks), but not able to find a option to attach.
Please help.
Cheers,
Chaith.

Similar Messages

  • Htmlb tableview column width

    Hello
    I need to set the column width of tableview Columns. I have width information in number of char. Basically i know the Column data type length and column title length. and i have to set the width equal to maximum of above two.
    But in tableview Column, we can only set the width in pixel. And this option give different result on desktop computer and laptop.
    Please let me know if anyone faced this problem before. It is very urgent for me.
    Regards
    Saurabh Garg

    Hi Saurabh,
    Lets say you have 10 coulumns.....then keep the width of tableView as 100%...
    using 160% will make it bigger than the screen....and then set eaxch coulumn width as 10%.
    Also if you are using iterator or tableViewControltab ColoumnDefinitions, then use the wrapping property...This will wrap the text in multiple lines...provided there is a space in between....
    This should work...
    Thanks,
    Tatvagna.
    Message was edited by:
            Tatvagna Shah

  • How to put custom check box in a tableview column

    Hi,
    I would like to put a custom checkbox in a tableview column for each row of the table.
    Such that when the user selects the rows and among those rows if for fews rows this checkbox is active, i need to do some special processing. how can i add a custom check box to a tableview column.
    Can anyone help me in this regard?
    Thanks and Regards,
    Kumar

    Hi,
    You can use the checkbox code within your tableview column:
    <htmlb:tableView id = ".."
    >
    <htmlb:tableViewColumn id = " "
    type = "USER"
    >
    <htmlb:checkBox id = ".."
    selected = " "
    />
    </htmlb:tableViewColumn>
    </htmlb:tableView>
    I hope it helps.
    regards,
    Rohit

  • Trigger how to get new and old value for nested table column?

    Hi,
    I have created a nested table based on the following details:
    CREATE TYPE typ_item AS OBJECT --create object
    (prodid NUMBER(5),
    price NUMBER(7,2) )
    CREATE TYPE typ_item_nst -- define nested table type
    AS TABLE OF typ_item
    CREATE TABLE pOrder ( -- create database table
    ordid NUMBER(5),
    supplier NUMBER(5),
    requester NUMBER(4),
    ordered DATE,
    items typ_item_nst)
    NESTED TABLE items STORE AS item_stor_tab
    INSERT INTO pOrder
    VALUES (800, 80, 8000, sysdate,
    typ_item_nst (typ_item (88, 888)));
    Now I would like to create a trigger on table pOrder for after insert or update or delete
    and I would like to track the new and old value for the columns inside nested table.
    Can anybody direct me how to do it?
    I would like to know the sytax for it like:
    declare
    x number;
    begin
    x := :new.nestedtablecolumn;--how to get the new and old value from nested table columns
    end;
    Hope my question is clear.
    Thanks,
    Lavan

    Hi,
    Try like this:
    CREATE OR REPLACE TRIGGER PORDER_I
    BEFORE INSERT
    ON PORDER
    REFERENCING OLD AS old NEW AS new
    FOR EACH ROW
    DECLARE
      items_new typ_item_nst;
      ordid_NEW NUMBER;
    BEGIN
    FOR i IN :new.items.FIRST .. :new.items.LAST LOOP -- For first to last element
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').prodid: ' || :new.items(I).prodid );
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').price:  ' || :new.items(I).price );
    END LOOP;
    END;Regards,
    Peter

  • Problem in truncate/drop partitions in a table having nested table columns.

    Hi,
    I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table? IF I change column types from nested table to varray type, will it help?
    Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
    Thanks in advance.

    >
    I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table?
    >
    Unfortunately you can't do those operations when a table has a nested table column. No truncate, no drop, no exchange partition at the partition level.
    A nested table column is stored as a separate table and acts like a 'child' table with foreign keys to the 'parent' table. It is these 'foreign keys' that prevent the truncation (just like normal foreign keys prevent truncating partions and must be disabled first) but there is no mechanism to 'disable' them.
    Just one excellent example (there are many others) of why you should NOT use object columns at all.
    >
    IF I change column types from nested table to varray type, will it help?
    >
    Yes but I STRONGLY suggest you take this opportunity to change your data model to a standard relational one and put the 'child' (nested table) data into its own table with a foreign key to the parent. You can create a view on the two tables that can make data appear as if you have a nested table type if you want.
    Assuming that you are going to ignore the above advice just create a new VARRAY type and a table with that type as a column. Remember VARRAYs are defined with a maximum size. So the number of nested table records needs to be within the capacity of the VARRAY type for the data to fit.
    >
    Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
    >
    Sure - just CAST the nested table to the VARRAY type. Here is code for a VARRAY type and a new table that shows how to do it.
    -- new array type
    CREATE OR REPLACE TYPE ARRAY_T AS VARRAY(10) OF VARCHAR2(64)
    -- new table using new array type - NOTE there is no nested table storage clause - arrays stored inline
    CREATE TABLE partitioned_table_array
         ( ID_ INT,
          arra_col  ARRAY_T )
         PARTITION BY RANGE (ID_)
         ( PARTITION p1 VALUES LESS THAN (40)
         , PARTITION p2 VALUES LESS THAN(80)
         , PARTITION p3 VALUES LESS THAN(100)
    -- insert the data from the original table converting the nested table data to the varray type
    INSERT INTO PARTITIONED_TABLE_ARRAY
    SELECT ID_, CAST(NESTED_COL AS ARRAY_T) FROM PARTITIONED_TABLENaturally since there is no more nested table storage you can truncate or drop partitions in the above table
    alter table partitioned_table_array truncate partition p1
    alter table partitioned_table_array drop partition p1

  • TableView: column header text alignment?

    How can I change the text alignment of a TableView column caption/header? I'd like some of my column headers to be right aligned for example?
    It works for regular table cells when I change f.i. the css of the custom DataFX MoneyTableCell cell:
    .money-cell {
       -fx-alignment: TOP_RIGHT;
    }but it won't work for the ".table-view .column-header" style of the standard TableView:
    .table-view .column-header,
    .table-view .filler,
    .table-view .column-drag-header {
        -fx-alignment: TOP_RIGHT;
    }

    Just after raising this I realised the problem is that the text is a label on top of the header. You can right align by using the following selector:
    .table-view .column-header .label {
        -fx-alignment: TOP_RIGHT;
    }

  • Nested Table columns and ADF BC 11.1.2

    I'm thinking ahead to a new application design, including a new database design. In this application, there are users who may not change the production tables directly, but their changes must be approved (and possibly modified) before they are applied to the production tables. The production tables are part of an existing system, and are fairly well normalized, with a master table and several detail tables.
    So for the new design, I want to have a staging table, mirroring the master table, where user changes are stored until they are approved and applied to the production tables. The staging table contains a few extra columns for "add, change or delete", user who submitted the change, date the change was requested. After applying the change, the staging record is to be copied to a change history table, and deleted from staging. That way, the staging table never has a lot of data in it.
    Here's the question:
    I need to deal with the detail tables. I could have staging versions of each detail table, but I was thinking that it might be easier to handle if the detail tables were included as nested table columns of the master staging table. Most of the detail tables only contain a few rows per master row. But can ADF BC 11.1.2 handle nested table columns? Is it easy to use in an application?

    Thanks for the quick response. I was thinking I might get a response from someone who had tried it, so I didn't waste time trying it myself. I consider your response is pretty authoritative, and I'll take that as a sign that I should forget the nested tables design.
    No, polymorphic views probably won't do the job. I think I'll just go ahead and create staging versions of each detail table with foreign keys back to the master staging table. Then I'll let the wizard create the needed association objects and view links in ADF BC. It will complicate the procedure for applying changes, particularly adding a row to the change history table. But that's the price we'll need to pay.
    OTOH - I just had a thought - since the change history table is mostly for auditing, it appears in some reports, but has no CRUD in the application, other than the insert when the changes are applied. If I did that insert with a trigger or some other PL/SQL, then the change history could still be a single table with nested table columns for the details.

  • Problem when expanding Tree - Tree with nested table column

    Hi, i have created the tree using the Tree with nested table column.
    I have created a node called TREE_ROOT in the context.
    This node has few attributes which includes children_loaded, is_leaf, is_expanded.
    I have created the recursive node TREE_SUB for the above node TREE_ROOT.
    In the view, i have created the table with the master column. The above attributes have been mapped accordingly. I have created the action handler for load_children.
    In this action handler method, i receive the context_element correctly. In this method, i determine the children of the selected element and the resulting children are attached to this context_element.
    But the problem is: when i add elements to context_elements in the method load_children, these
    elements get added to the node TREE_ROOT as well.
    Please help.
    thanks and best regards,
    Pramod

    I just use some types defined in this user... Well, I hope you know what is the type definition of d_period_sec,
    don't you ? I didn't ask to provide all types existed now, only types you are
    using.
    Anyhow you have been granted with execute privilege for types you are using:
    SQL> conn tau_tll/tau_tll;
    Connected.
    SQL> create or replace type d_period_sec as object (date# date);
      2  /
    Type created.
    SQL> grant execute on d_period_sec to public with grant option;
    Grant succeeded.
    SQL> conn scott/tiger
    Connected.
    SQL> CREATE OR REPLACE TYPE unit_function AS OBJECT (
      2  xi NUMBER,
      3  yi NUMBER,
      4  xe NUMBER,
      5  ye NUMBER,
      6  xm NUMBER,
      7  ym NUMBER,
      8  v NUMBER,
      9  a NUMBER,
    10  f NUMBER,
    11  descr VARCHAR2 (20)
    12  );
    13  /
    Type created.
    SQL> grant execute on unit_function to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
      2  (
      3  p tau_tll.d_period_sec, -- from user TAU_TLL
      4 
      5  m unit_function
      6  )
      7  /
    Type created.
    SQL> grant execute on unit_moving_point to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
      2  /
    Type created.
    SQL> grant execute on moving_point_tab to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE moving_point AS OBJECT (u_tab moving_point_tab);
      2  /
    Type created.
    SQL> grant execute on moving_point to master;
    Grant succeeded.
    SQL> conn master/master
    Connected.
    SQL> CREATE TABLE MPOINTS (
      2  id NUMBER,
      3  mpoint scott.Moving_Point)
      4  NESTED TABLE mpoint.u_tab store as moving_tab;
    Table created.Rgds.

  • TableView columns headers customization using CSS

    Hi,
    I'm trying to customize the TableView columns headers using CSS, but up until now, I was not able to find the CSS class name for the previously mentioned elements.
    Can anyone point me to a document or link where I can find all the available CSS classes for TableView and, why not for all the JAVA FX 2.0 widgets.
    Thanks,
    Alin

    Here's the Oracle CSS Reference guide for JavaFX:
    http://docs.oracle.com/javafx/2.0/api/javafx/scene/doc-files/cssref.html#tableview
    You can also look at caspian.css inside the javafx runtime as it is the default CSS sheet for JavaFX applications and is a good place to see a lot of the style classes in use. The particular class you want is .table-view .column-header{} for individual columns or .table-view .column-header-background{} for the whole table header in general. Hope that helps.

  • Error deploying Tree By Nesting Table Column

    Hi
    Im using Tree By Nesting Table Column. When I deploy the application, I get the following exception:
    [code]
    java.lang.NullPointerException
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter$TreeTableRows._initialize(TableAdapter.java:9703)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.TableAdapter.setViewAndNodeElement(TableAdapter.java:345)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:285)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:93)
         at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.getAdapterFor(AbstractAdapter.java:495)
         at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FlowLayoutAdapter$Items.getControl(FlowLayoutAdapter.java:368)
         at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutItemFragment(FlowLayoutRenderer.java:252)
         at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutFragment(FlowLayoutRenderer.java:208)
         at com.sap.tc.ur.renderer.ie6.FlowLayoutRenderer.render(FlowLayoutRenderer.java:47)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
         at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:627)
         at com.sap.tc.ur.renderer.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:72)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:52)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:435)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:134)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:1025)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.fillDynamicTemplateContext(HtmlClient.java:455)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:1172)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.retrieveData(HtmlClient.java:217)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doRetrieveData(WindowPhaseModel.java:595)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:157)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:344)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:298)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:705)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:659)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:227)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:150)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:56)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:40)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    [/code]
    What could be wrong?
    Thanks
    oj

    Hi
    There is no missing value in the property of the MasterColumn element. My context is like this:
    Cardinality:0...n, Selection 0...1 for all nodes
    HeaderData
       |-HeaderID
       |-HeaderText
    SubnodeData
       |-HeaderID
       |-SubnodeText
    SubNode
       |-Children (recursive Node - SubNode)
       |-SubnodeText
    Expanded (boolean)
    Im still getting the error. Im on NW2004s, SP06, using NWDS 7.0.06.
    Could there be a problem with the java runtime? if so, what should I do?
    Thanks
    oj

  • Tableview tag in htmlb visible controls

    hi gurus,
    i am trying to create a table view using the "tableView" tag presents in the htmlb visible controls.
    i am using the"help.sap.com" as reference website.i understood the details given there partially.so i couldnt complete my task.
    if anybody completed these type of task please send me ur sample code for reference with the codes for  jsp file,model (bean) and controller (.java file).....
    regards,
    tamil

    Hi,
    In JavaDeveloper role you have working examples of TableView.
    I am pasting the code, incase you dont have JavaDeveloper on your server.
    TableViewExample.java
    import bean.TableViewBean;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.event.TableNavigationEvent;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.htmlb.table.TableView;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    public class TableViewExample extends PageProcessorComponent {
      public DynPage getPage() {
        return new MyDynPage();
      // JSPDynPage
      public class MyDynPage extends JSPDynPage {
        public TableView table;
        TableViewBean myBean;
        Used for user initialization. called when the application is started
        public void doInitialization() {
          // Get the request, context and profile from portal platform
          IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
          IPortalComponentContext myContext = request.getComponentContext();
          IPortalComponentProfile myProfile = myContext.getProfile();
          // Initialization of bean
          TableViewBean myBean = new TableViewBean();
          setBeanFromProfile(myProfile, myBean);
          // Put the bean into the application context
          myContext.putValue("myBeanName", myBean);
      Used for handling the input. Generally called each time
        after doInitialization
        public void doProcessAfterInput() throws PageException {
          // Get the request, context and profile from portal platform
          IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
          IPortalComponentContext myContext = request.getComponentContext();
          IPortalComponentProfile myProfile = myContext.getProfile();
          // Get the bean from application context
          table = (TableView) this.getComponentByName("myTableView");
          myBean = (TableViewBean) myContext.getValue("myBeanName");
          setBeanFromProfile(myProfile, myBean);
          myBean.setOldTableView(table);
      Used for handling the output. This method is always called.
        public void doProcessBeforeOutput() throws PageException {
          // set the name of your JSP page
          setJspName("tableview.jsp");
        public void onMyOnNavigate(Event event) throws PageException {
          // NAVIGATION - get the event to recover the actual position
          TableNavigationEvent tne = (TableNavigationEvent) event;
          // With the event we can use method getFirstVisibleRowAfter(); which gives
          // us the actual position (after the event)
          if (myBean != null) { // just for the first time, when there is no bean
            // set the new visibleRow
            myBean.setVisibleFirstRow(new Integer(tne.getFirstVisibleRowAfter()).toString());
        public void onMyOnHeaderClick(Event event) throws PageException {
        public void onMyOnCellClick(Event event) throws PageException {
        public void onMyOnRowSelection(Event event) throws PageException {
        private void setBeanFromProfile(IPortalComponentProfile myProfile, TableViewBean myBean) {
          myBean.setDesign(myProfile.getProperty("design"));
          myBean.setHeaderVisible(myProfile.getProperty("headerVisible"));
          myBean.setFooterVisible(myProfile.getProperty("footerVisible"));
          myBean.setFillUpEmptyRows(myProfile.getProperty("fillUpEmptyRows"));
          myBean.setNavigationMode(myProfile.getProperty("navigationMode"));
          myBean.setSelectionMode(myProfile.getProperty("selectionMode"));
          myBean.setHeaderText(myProfile.getProperty("headerText"));
          myBean.setVisibleFirstRow(myProfile.getProperty("visibleFirstRow"));
          myBean.setVisibleRowCount(myProfile.getProperty("visibleRowCount"));
          myBean.setRowCount(myProfile.getProperty("rowCount"));
          myBean.setTableWidth(myProfile.getProperty("width"));
    D:\usr\sap\J2E\JC00\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.pct.pdk.htmlbcontrols\pagelet\tableview.jsp
    <%--- TableView.jsp --%>
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    <%--- Get the Bean named myBeanName from the application context --%>
    <jsp:useBean id="myBeanName" scope="application" class="bean.TableViewBean" />
    <hbj:content id="myContext" >
      <hbj:page title="Template for a portal component">
       <hbj:form id="myFormId">
        <hbj:tableView
                   id="myTableView"
                   model="myBeanName.model"
                   design="<%=myBeanName.getDesign() %>"
                   headerVisible="<%=myBeanName.isHeaderVisible() %>"
                   footerVisible="<%=myBeanName.isFooterVisible() %>"
                   fillUpEmptyRows="<%=myBeanName.isFillUpEmptyRows() %>"
                   navigationMode="<%=myBeanName.getNavigationMode() %>"
                   selectionMode="<%=myBeanName.getSelectionMode() %>"
                   headerText="<%=myBeanName.getHeaderText() %>"
                   visibleFirstRow="<%=myBeanName.getVisibleFirstRow() %>"
                   visibleRowCount="<%=myBeanName.getVisibleRowCount() %>"
                   rowCount="<%=myBeanName.getRowCount() %>"
                   width="<%=myBeanName.getTableWidth() %>"
                   onNavigate="myOnNavigate">
                   <% myTableView.setOnHeaderClick("myOnHeaderClick");
                      myTableView.setOnCellClick(1,"myOnCellClick");
                      myTableView.useRowSelection(myBeanName.getOldTableView());
                      myTableView.setOnRowSelection("myOnRowSelection"); %>
        </hbj:tableView>
        </hbj:form>
      </hbj:page>
    </hbj:content>
    TableViewBean.java
    package bean;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    import com.sapportals.htmlb.table.TableColumn;
    import com.sapportals.htmlb.table.TableView;
    // Bean for dataexchange between DynPage and JSP
    public class TableViewBean {
      public String design;
      public String headerVisible;
      public String footerVisible;
      public String fillUpEmptyRows;
      public String navigationMode;
      public String selectionMode;
      public String headerText;
      public String visibleFirstRow;
      public String visibleRowCount;
      public String rowCount;
      public String tableWidth;
      public DefaultTableViewModel model;
      private TableView oldtableview;
      public TableView getOldTableView() {
        return this.oldtableview;
      public void setOldTableView(TableView table) {
        this.oldtableview = table;
      public DefaultTableViewModel getModel() {
        return model;
      public void setModel(DefaultTableViewModel model) {
        this.model = model;
      public String getDesign() {
        return design;
      public void setDesign(String design) {
        this.design = design;
      public String isHeaderVisible() {
        return headerVisible;
      public void setHeaderVisible(String headerVisible) {
        this.headerVisible = headerVisible;
      public String isFooterVisible() {
        return footerVisible;
      public void setFooterVisible(String footerVisible) {
        this.footerVisible = footerVisible;
      public String isFillUpEmptyRows() {
        return fillUpEmptyRows;
      public void setFillUpEmptyRows(String fillUpEmptyRows) {
        this.fillUpEmptyRows = fillUpEmptyRows;
      public String getNavigationMode() {
        return navigationMode;
      public void setNavigationMode(String navigationMode) {
        this.navigationMode = navigationMode;
      public String getSelectionMode() {
        return selectionMode;
      public void setSelectionMode(String selectionMode) {
        this.selectionMode = selectionMode;
      public String getHeaderText() {
        return headerText;
      public void setHeaderText(String headerText) {
        this.headerText = headerText;
      public String getVisibleFirstRow() {
        return visibleFirstRow;
      public void setVisibleFirstRow(String visibleFirstRow) {
        this.visibleFirstRow = visibleFirstRow;
      public String getVisibleRowCount() {
        return visibleRowCount;
      public void setVisibleRowCount(String visibleRowCount) {
        this.visibleRowCount = visibleRowCount;
      public String getRowCount() {
        return rowCount;
      public void setRowCount(String rowCount) {
        this.rowCount = rowCount;
      public String getTableWidth() {
        return tableWidth;
      public void setTableWidth(String tableWidth) {
        this.tableWidth = tableWidth;
      public TableViewBean() {
        String[][] data = createData();
    // get a new array for the titles
        String[] colNames = {"LASTNAME", "FIRSTNAME", "STREET", "ZIP", "CITY"};
    // set titles
    /// By default the title also defines the column name - we use both methods to create a
    /// proper title and a column name that is better to work with. You should omit
    /// blanks or other special characters in the column name.
    /// The column name is important later (Part 2) to retrieve data from the tableView
        model = new DefaultTableViewModel(data, colNames);
        model.setKeyColumn(1);
        // To set the cell event we have to get the column and set the setOnCellClick
        // for every column.
        // Get the column with the specified column name.
        TableColumn column = model.getColumn("LASTNAME");
        // Set the event.
        column.setOnCellClick("onMyOnCellClick"); // set the TableCellClickEvent
        column.setTitle("Last Name");
        // Repeat that with the other column. Every cell can have its own onCellClick
        // method names of course. We use the same event method for all cells.
        column = model.getColumn("FIRSTNAME");
        column.setOnCellClick("onMyOnCellClick"); // set the TableCellClickEvent
        column.setTitle("First Name");
        column = model.getColumn("STREET");
        column.setOnCellClick("onMyOnCellClick"); // set the TableCellClickEvent
        column.setTitle("Street");
        column = model.getColumn("ZIP");
        column.setOnCellClick("onMyOnCellClick"); // set the TableCellClickEvent
        column.setTitle("ZIP - Code");
        column = model.getColumn("CITY");
        column.setOnCellClick("onMyOnCellClick"); // set the TableCellClickEvent
        column.setTitle("City");
      private String[][] createData() {
        // just a simple way to produce data, not real life indeed
        String[][] retVal = {
          {"Backer", "Melissa", "528 34th Ave", "94121", "San Francisco"},
          {"Hamilton", "Ann", "4752 17th St", "94117", "San Francisco"},
          {"Hudson", "Bree", "16 Hudson Ct", "94124", "San Francisco"},
          {"Watson", "David", "168 Cervantes Blvd", "94123", "San Francisco"},
          {"Eastwood", "Kenneth", "3367 Troy Dr", "90068", "Los Angeles"},
          {"Peter", "Smith", "524 Arvin St", "93308", "Bakersfield"},
          {"Antony", "Miller", "10430 Wilshire Blvd", "90024", "Los Angeles"},
          {"Moore", "Roger", "1815 W 82d", "90001", "Los Angeles"},
          {"Jackson", "Michael", "3450 Sawtelle Blvd", "90066", "Los Angeles"}
        return retVal;
    Greetings,
    Praveen Gudapati
    [Points are always welcome for helpful answers]

  • Functionality to dynamically sort tableview columns

    Has anybody successfully tried sorting columns of a tableview component by clicking on its header? I need to sort a column containing dates in mm/dd/yyyy format. Please share your hints or code. BR, Maulin

    Hi,
    Here is the code, no support included :-):
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Vector;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    public class SortTableModel extends DefaultTableViewModel implements Comparator {
         protected int currCol;
         protected Vector ascendCol; // this vector stores the state (ascending or descending) of each column
         protected Integer one = new Integer(1);
         protected Integer minusOne = new Integer(-1);
         public SortTableModel() {
              super();
              ascendCol = new Vector();
         public SortTableModel(Vector vec) {
              super(vec);
              ascendCol = new Vector();
         public SortTableModel(Vector vec, Vector vec2, int numberOfColumns) {
              super(vec, vec2);
              ascendCol = new Vector();
              setSortOrder(numberOfColumns);
    This method is the implementation of the Comparator interface.
    It is used for sorting the rows
         public int compare(Object v1, Object v2) {
              // the comparison is between 2 vectors, each representing a row
              // the comparison is done between 2 objects from the different rows that are in the column that is being sorted
              int ascending = ((Integer)ascendCol.get(currCol)).intValue();
              if (v1 == null && v2 == null) {
                   return 0;
              } else if (v2 == null) { // Define null less than everything.
                   return 1 * ascending;
              } else if (v1 == null) {
                   return -1 * ascending;
              Object o1 = ((Vector)v1).get(currCol);
              Object o2 = ((Vector)v2).get(currCol);
              // If both values are null, return 0.
              if (o1 == null && o2 == null) {
                   return 0;
              } else if (o2 == null) { // Define null less than everything.
                   return 1 * ascending;
              } else if (o1 == null) {
                   return -1 * ascending;
              if (o1 instanceof Number && o2 instanceof Number) {
                   Number n1 = (Number)o1;
                   double d1 = n1.doubleValue();
                   Number n2 = (Number)o2;
                   double d2 = n2.doubleValue();
                   if (d1 == d2) {
                        return 0;
                   } else if (d1 > d2) {
                        return 1 * ascending;
                   } else {
                        return -1 * ascending;
              } else if (o1 instanceof Boolean && o2 instanceof Boolean) {
                   Boolean bool1 = (Boolean)o1;
                   boolean b1 = bool1.booleanValue();
                   Boolean bool2 = (Boolean)o2;
                   boolean b2 = bool2.booleanValue();
                   if (b1 == b2) {
                        return 0;
                   } else if (b1) {
                        return 1 * ascending;
                   } else {
                        return -1 * ascending;
              } else {
                   // default case
                   if (o1 instanceof Comparable && o2 instanceof Comparable) {
                        Comparable c1 = (Comparable)o1;
                        Comparable c2 = (Comparable)o2; // superflous cast, no need for it!
                        try {
                             return c1.compareTo(c2) * ascending;
                        } catch (ClassCastException cce) {
                             // forget it... we'll deal with them like 2 normal objects below.
                   String s1 = o1.toString();
                   String s2 = o2.toString();
                   return s1.compareTo(s2) * ascending;
    This method sorts the rows using Java's Collections class.
    After sorting, it changes the state of the column -
    if the column was ascending, its new state is descending, and vice versa.
         public void sort() {
              Collections.sort(dataVector, this);
              Integer val = (Integer)ascendCol.get(currCol);
              ascendCol.remove(currCol);
              if (val.equals(one)) // change the state of the column
                   ascendCol.add(currCol, minusOne);
              else
                   ascendCol.add(currCol, one);
         public void sortByColumn(int column) {
              this.currCol = column;
              sort();
         public void setSortOrder(int numberOfColumns) {
              for (int i = 0; i < numberOfColumns; i++) {
                   ascendCol.add(one);

  • Multiple Columns within tableview column

    Hi All,
    I need to display a tableview which will have multiple columns within a column. It is much like using 'fixedColumn' attribute in tableviewcolumn for rows.
    Can a similar functionality be implemented for multiple columns?
    Thanks in advance,
    Rohit

    hi
    One method is already told you here is another method of doing this:
    let say you want your third column to be another table do it like this with out using iterator
    even you can control its display by embedding if... endif on layout
    simply write this:
    <htmlb:tableView id                  = "tbl"
                               table               = "<%= itab %>"
                               selectionMode       = "LINEEDIT"
                               columnHeaderVisible = "TRUE"
                               allRowsEditable     = "FALSE" >
    <htmlb:tableViewColumn columnName = "PERNR" title="Personnal No"/>
    <htmlb:tableViewColumn columnName = "REQID" title="Request id"/>
    <htmlb:tableViewColumn columnName = "user" type= "USER" title="another table">
                  <htmlb:tableView id                  = "tbl"
                                   table               = "<%= itab2 %>"
                                   selectionMode       = "LINEEDIT"
                                   columnHeaderVisible = "TRUE"
                                   allRowsEditable     = "FALSE" />
                </htmlb:tableViewColumn>
              </htmlb:tableView>
    where itab1 is main table and itab2 is another table displayed at column3.
    itab1 and itab2 both are filled up internal tables.
    if you want itab2(column3) to be displayed on some condition put if... endif condition prior to it.
    remember giving type attribute of a tableviewcolumn = "USER" embeds next htmlb to that column as per defined.
    Revert back for any problem or help,
    regards.

  • Object Modelling Question: How do I create multiple nested table columns in one table

    Hi there,
    I have a XML doc which is as follows:
    <PERSON>
    <ADDRESSLIST>
    <ADDRESS>111, Hamilton Ave </ADDRESS>
    <ADDRESS>222, Cambell Ave </ADDRESS>
    </ADDRESSLIST>
    <PHONELIST>
    <PHONENO>4085551212 </PHONENO>
    <PHONENO>6505551212</PHONENO>
    </PHONELIST>
    </PERSON>
    I need a table that looks as follows:
    Create table person
    (addresslist address_table,
    phonelist phone_table
    I would like to create a table called person with columns addresslist and phonelist. Each defined as object type table of address and table of phones.
    Can anybody please tell me how can I do this.
    I have seen that there can only be one nested table per table. If so, how do we do this.
    Thanks so much
    Pramod

    pelle.k wrote:
    peets wrote:Hehe because it's less typing!
    Good one!
    Also, it's by far the more dynamic method.
    If you want to get pedantic, it's also far less efficient in terms of execution time: each iteration of the loop forks a new process, whereas using a single mkdir command forks only once.  The "best" way is the curly-braces method demonstrated above by chimeric.

  • Retrieving nested table columns through a REF CURSOR in php

    Hello.
    I have been able to execute REF CURSORS returned by pl/sql functions succesfully with php. I have also been able to bind collections to the input/output of pl/sql functions/procedures.
    However, what I am unable to do, is to execute a cursor returned by a pl/sql function that has one of the columns a named datatype (a simple one-dimensional nested table):
    create type stab is table of varchar2(255);
    create table lp_landing (
    token varchar2(255),
    text varchar2(512),
    country varchar2(255),
    creator varchar2(255),
    is_active char(1),
    css_file char(1),
    autofollowing stab default stab(),
    constraint lp_landing_pk primary key (token)) organization index
    nested table autofollowing store as lp_landings_af_nt
    (constraint autofollowing_pk primary key (nested_table_id,column_value)) organization index compress
    function landings_usercountry (in_uname in lp_users.uname%type, in_country in lp_country.cname%type) return Landing_curType
    is
    ret Landing_curType;
    begin
    open ret for
    select * --token,text,country,creator,is_active,css_file,tab2str(autofollowing) as autofollowing
    from lp_landing
    where country = (select country
    from lp_permissions
    where country = in_country and uname = in_uname);
    return ret;
    end landings_usercountry;
    here is the php:
    $sql = 'BEGIN :res := LP_PKG.landings_usercountry(:user, :country); END;';
    $stmt = oci_parse($c, $sql);
    $cursor = oci_new_cursor($c);
    oci_bind_by_name($stmt,':user',$name, 32);
    oci_bind_by_name($stmt,':country',$country, 32);
    oci_bind_by_name($stmt,':res', $cursor, -1, OCI_B_CURSOR);
    $name = "root";
    $country = "Spain";
    try {
       @oci_execute($stmt);
       $m = oci_error($stmt);
       if($m){
           throw new Exception($m['message'], $m['code']);
       }else{
           @oci_execute($cursor);
           $m = oci_error($cursor);
           if($m){
               throw new Exception($m['message'], $m['code']);
           }else{
               while ( $entry = oci_fetch_object($cursor) ) {
                    var_dump($entry);
    } catch (Exception $e) {
       print_r($e);
    With "select *" in the function, the autofollowing column (of datatype stab) fails to bind, giving an ORA-932 error. The workaround for the moment is to convert the nested table to a comma delimited string (via the tab2str function).
    However, I would like to be able to tell php to accept a collection within the cursor, but I cannot figure out how to do this.
    Any ideas?
    thx in advance

    yes, it is an ORA-932:
    Warning: oci_fetch_object() [function.oci-fetch-object]: ORA-00932: inconsistent datatypes: expected CHAR got ADT in /home/apolion/apache2/htdocs/old/test1.php on line 104

Maybe you are looking for