Maintain State of a Tree Table

Hi,
I am using Tree Table with EJB Datacontrol. I am fetching child records on Disclose icon of a treetable. I have added context menu on tree table to navigate to another taskflow. I want to maintain the same state i.e. Tree Table should be in Expanded State for those nodes which were disclosed by user previously) of a tree table when use clicke on Back button of a another taskflow.

Hi Bill,
I think that that is the only example I've seen of anyone storing tree node selections.
The only other thing that springs to mind would be to use a "region pull" and put the report on another page and have the click of a node trigger the Ajax call that sets a PK value (or whatever would be required for a report) and then pulls the report into a DIV on the tree's page. That way, the page isn't even reloaded. Of course, that is for a report - not sure if it would work ok for forms
Andy

Similar Messages

  • Tree Table Error : Missing from in a select statement

    Created a view link
    Created a view criteria on source vo which has attribute of destination vo
    Dragged the source view criteria to form a tree table.
    But upon invoke of jspx page even if tree table is appearing Error : Missing from in a select statement is shown. Log shows no specific file/line number. Search is also throwing same error
    If i remove attribute of destination vo from view criteria error is not appearing. Any pointers?

    Hi,
    Well, If the user always enter a list as selection (no range, exclusion, ...), I can understand the need.. otherwise this is indeed a bit strange... In case they only need to use single element list in SO, you could restrict all other SO features with the FM SELECT_OPTIONS_RESTRICT and then loop on values and select each single vendor...
    E.g under your INITIALIZATION event:
    * Only option 'EQ' and sign 'I' are allowed
      lt_opt_list-name        = 'ONLY_EQ'.
      lt_opt_list-options-eq  = 'X'.
      APPEND lt_opt_list TO ls_restriction-opt_list_tab.
      lt_***-kind             = 'S'.        "select-option
      lt_***-name             = 'S_LIFNR'.  "name of select-option
      lt_***-sg_main          = 'I'.        "only inclusive
      lt_***-sg_addy          = space.
      lt_***-op_main          = 'ONLY_EQ'.
      lt_***-op_addy          = space.
      APPEND lt_*** TO ls_restriction-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          restriction            = ls_restriction
        EXCEPTIONS
          too_late               = 1
          repeated               = 2
          selopt_without_options = 3
          selopt_without_signs   = 4
          invalid_sign           = 5
          empty_option_list      = 6
          invalid_kind           = 7
          repeated_kind_a        = 8
          OTHERS                 = 9.
    Then just loop on SO table, select single and check subrc...
    Kr,
    Manu.

  • In a popup the tree table data is not getting displayed properly

    Hi,
    I have a taskflow which contains a tree table within a panelStetchLayout. Following is the taskflow code :
    <af:panelStretchLayout id="SecurityAdminManageRoles" bottomHeight="0" topHeight="auto" inlineStyle="width:725px;height:400px;">
    <f:facet name="center">
    <af:treeTable value="#{bindings.WebCenterSecurityDCPermission.treeModel}" var="node" expandAllEnabled="true" fetchSize="150" verticalGridVisible="false" horizontalGridVisible="true" columnSelection="none" rowBandingInterval="0" columnStretching="last" contentDelivery="immediate" summary="#{uib_o_w_w_r_WebCenter.SECURITY_PERMISSIONS}" disclosedRowKeys="#{webcenterAdminSecurityBean.disclosedRowKeySet}" inlineStyle="border:none" binding="#{webcenterAdminSecurityBean.rolesTable}" id="tt2" styleClass="AFStretchWidth" autoHeightRows="150">
    <f:facet name="nodeStamp">
    <af:column width="260"
    selected="false" noWrap="false" id="c3">
    <f:facet name="header">
    <af:outputText value="#{uib_o_w_w_r_WebCenter.LABEL_PERMISSIONS}"
    id="ot5"/>
    </f:facet>
    <af:panelGroupLayout id="pgl26">
    <af:forEach items="#{bindings.getRoleHeaders.result}" var="role">
    <af:outputText value="#{role.value}" visible="false" id="ot1"/>
    <af:selectBooleanCheckbox selected="#{node.dataProvider.serviceActions[role.value]}"
    rendered="#{!node.dataProvider.serviceHeader}"
    label="#{null}"
    disabled="#{(node.dataProvider.readOnly and role.seededRole) or node.dataProvider.actionDisabledMap[role.value] == true}"
    simple="true" id="sbc2">
    <f:attribute name="permission" value="#{node}"/>
    </af:selectBooleanCheckbox>
    </af:forEach>
    <af:spacer width="5" id="s2"/>
    <af:outputText value="#{node.name}" noWrap="false" id="ot2"
    inlineStyle="#{node.dataProvider.serviceHeader? 'font-weight:bolder;': ''}"/>
    </af:panelGroupLayout>
    </af:column>
    </f:facet>
    <af:column headerText="#{uib_o_w_w_r_WebCenter.LABEL_DESCRIPTION}" rowHeader="unstyled" noWrap="false" id="c1">
    <af:outputText value="#{node.description}" noWrap="false"
    inlineStyle="color:grey;" id="ot3"/>
    </af:column>
    </af:treeTable>
    </f:facet>
    </af:panelStretchLayout>
    </jsp:root>
    This taskflow is included as a region within another page :
    <af:commandToolbarButton id="cb3"
    shortDesc="#{uib_o_w_w_r_WebCenter.LABEL_EDIT_PERMISSION_HINT}"
    icon="/adf/webcenter/edit_sm_ena.png"
    text="#{uib_o_w_w_r_WebCenter.LABEL_EDIT_PERMISSION}"
    inlineStyle="align:left">
    <af:showPopupBehavior popupId="managePopup"/>
    </af:commandToolbarButton>
    <af:popup id="managePopup" contentDelivery="lazyUncached">
    <af:dialog modal="true" type="cancel"
    title="#{requestContext.formatter[uib_o_w_s_r_Spaces.EDIT_ROLE][pageFlowScope.o_w_wa_spacesRoleBacker1.selectedRole.value == webcenterAdminSecurityBean.spacesUsersRole ? uib_o_w_s_r_Spaces.LABEL_AUTH_USER : pageFlowScope.o_w_wa_spacesRoleBacker1.selectedRole.value]}"
    titleIconSource="/adf/webcenter/empty.png" id="d4">
    <af:region value="#{bindings.editroletaskflow.regionModel}"
    id="r2"/>
    <f:facet name="buttonBar">
    <af:commandButton partialSubmit="true"
    text="#{uib_o_w_w_r_WebCenter.LABEL_SAVE}"
    actionListener="#{o_w_w_i_v_b_webCenterViewUtilsBean.saveChangesAndCloseWCLinksPopup}"
    id="cb4">
    <f:attribute value="#{bindings.editroletaskflow.regionModel}"
    name="wcRegionModel"/>
    <f:attribute value="bindings.saveRoles.execute"
    name="wcMethodToExecute"/>
    </af:commandButton>
    </f:facet>
    </af:dialog>
    </af:popup>
    In the main page, there is a table, I select one row and then click on this commandButton, which launches the popup.
    The problem here is that when I launch the popup, there are many rows in the table and hence a scroll bar appears. Scroll down the popup and close the popup.
    Again I launch the popup, I see that the popup displays in the same state as it was closed before, i.e the scrollbar is at the bottom and the first row is not displayed.

    ...also do not forget to:
    1. adjust the Active property for the task flow binding (in the pageDef).
    Set property value to the true on popupFetchListener, and to the false when closing popup
    2. for the af:popup containing region, set childCreation to deffered

  • Issue with ADF Tree Table

    Hi,
    I have the following requirement where i need to display a tree table. Here is how the initial implementation is:
    I have created the read only view for : ManagersVO > PoolsVO > MachinesVO. Where 'MachinesVO' is the destination view. And created view links between ManagersVO & PoolsVO using ManagerId and PoolsVO & MachinesVO using PoolId.
    And using this implementation, successfully created tree table on the UI. Now we got an enhancement for this:
    i.e., MachinesVO should return list of machines as per user logs in. i.e., we have 4 different roles. 'Super Admin', 'Sys Admin', 'App Admin', 'End User'. The default query for MachinesVO is for 'Super Admin'. The query for other user roles is different except the SELECT statement.
    The requirement is to dynamically change the query of MachinesVO based on user logs in and display the tree table accordingly. To implement the same i have tried using setQuery() operation on 'MachinesVO' which results with the following error:
    JBO-26016: InvalidOperException
    Cause: You cannot set customer query (calling setQuery()) on a view object if it is the detail view object in a master detail view link.
    Action: Do not call setQuery() if the view object is a detail.
    Can one suggest me a best solution to implement this.
    Thanks & Regards,
    Kiran

    Hi Navaneetha Krishnan,
    Here is how i implemented based on your comments. As i have tree table based 3 different VO's, created the following method at middle view(i.e., PoolsVO).
    1.Tree Model hierarchy
    ManagersVO > PoolsVO > MachinesVO
    I actually want to filter the data at Machines level. Hence wrote a method at PoolsVOImpls and exposed it in the PoolsVO client interface. Here is the code that i have placed in the PoolVOImpl
    public class PoolsVOImpl extends ViewObjectImpl implements PoolsVO{
         * This is the default constructor (do not remove).
        public PoolsVOImpl () {
      public void filterMachinesDataByUserRole(String userRole,String vzId){
        Row row = getCurrentRow();
        String query = "";
        if(row != null){
          RowSet rowSet = (RowSet)row.getAttribute("MachinesVO");
          if(rowSet != null){
            MachinesVOImpl machinesVOImpl = (MachinesVOImpl)rowSet.getViewObject();
            if(userRole.equalsIgnoreCase("SYS ADMIN")){
                    machinesVOImpl .setWhereClause(query related to sysadmin);
             //Similarly for other user roles.
             executeQuery();
    }And this piece of code needs to be executed before the jsff(which has the tree table) renders. Hence, i created a this methodAction as a default activity in the respective taskflow where the jsff is placed. Once this method get executed, the page should render the machines specific to the user.
    Here is the issue: getCurrentRow() method call is returning always NULL.
    Please correct me if i'm doing something wrong. I do tried the above mentioned approach by creating the method at '*ManagersVOImpl*' level too. Still the same issue.
    Thanks & Regards,
    Kiran

  • Row Selection for second and subsequent level nodes in tree table

    Hi All,
    We have a .jsff page with tree bindings to display a three-level hierarchy tree table.Suppose the hierarchy is
    -> Department
    ->-> Employees
    ->->-> Employee details.
    I have a use case where-in when we add the employee node within a department,the department node must expand and the newly added employee node must be selected.
    In both the cases(for new department or employee), we are following the approach mentioned below:
    1. Get the treeTable Iterator.
    2.Adding the new object to the java ArrayList which is bound to the corresponding level in the tree.
    3.Refreshing the treeTable iterator.
    4.Execute treeTable.setSelectedRowKeys()
    5.Add a partial target to the treetable.
    The issue is that the new employee gets added but the upper-level department node collapses and no selection is performed on the new employee node.
    But when we add a new department node, it gets selected on creation.
    Is there any additional steps to be performed for second-level row selection?

    Hi,
    Thanks for the reply.
    I looked at the code given in sample 61.
    In the sample, a new node is not added dynamically (for ex.either new location or its child nodes.)
    As mentioned in the above post, after adding a new node at a level in our use case, when we perform the refresh of the tree-table's iterator,the selection state of the rows is not shown on the table.
    If the tree-table's iterator is not refreshed and the treeTable.setSelectedRowKeys() is executed, the rows get selected but the subsequent node additions do not show up in the table as the table's iterator is not refreshed.
    Any sample code is available where in both the addition of new node and its selection is performed at the same time?
    Thanks.

  • Resizing Columns in Tree Table

    hi all!
    Iam using TreeTable's in my application. It is already developed by somebody. Now what is my problem is when I try to resize the column the subsequent columns are not resizing.
    Can any body help me out to fix this issue
    Thanks in Advance

    I think you got this code from site na?
    I have already seen this code in the net. But I didn't found mistake in our code. What actually is it was developed by somebody.
    If you don't mind I will send that code can you please observe it for the mistake.
    Here is my code:
    Here all the things beginning:
    private void configureForm()
    setBorder(editor.buildBorder(presenter
    .doGetProperty("vmtp.info.testCaseSelector.title")));
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    tree = new TestCaseTree(presenter, testCaseIn, testCaseOut);
    ActionTreeTablePanel actionTreeTablePanel = new ActionTreeTablePanel(tree, presenter);
    this.add(actionTreeTablePanel);
    Here is the TestCaseTree.java file:
    public class TestCaseTree extends ActionTreeTable implements TreeExpansionListener
    public TestCaseTree(Presenter presenter, TestCaseTO testCaseIn, TestCaseTO testCaseOut)
    super(presenter, testCaseOut, testCaseOut.getActions(), new TestCaseTreeToolbar(presenter));
    addTreeExpansionListener(this);
    ActionBaseTO.enumerateActions(testCaseOut.getActions());
    * This statement causes tooltip to display for child nodes
    setToolTipText(testCaseIn.getName());
    /* (non-Javadoc)
    * @see javax.swing.JTree#isPathEditable()
    @Override
    public boolean isPathEditable(TreePath path)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
    DefaultMutableTreeNode parent = (DefaultMutableTreeNode)node.getParent().getParent();
    * Commenting out below lines to enable editing of parameter values for
    * action groups in a test case
    //if(parent != null && parent.getUserObject() instanceof ActionTreeTableNode)
    //if(((ActionTreeTableNode)parent.getUserObject()).getAction().isGroup())
    // return false;
    return super.isPathEditable(path);
    public void setVecTreeStateBookmark(Vector treeState) {
         BookmarkTO bookmark = VmtpSession.getVmtpSession().getBookmark();
         BookmarkItemTO bookmarkItem = bookmark.getLastMarkedItem();
         if (bookmarkItem != null && parentObject != null
         && bookmarkItem.getObjectId() == ((TestCaseTO)parentObject).getId()
         && bookmarkItem.getObjectType() == BookmarkItemType.TESTCASE) {
         bookmarkItem.setTreeState(treeState);
    public void updateVecTreeStateBookmark() {
              BookmarkTO bookmark = VmtpSession.getVmtpSession().getBookmark();
              BookmarkItemTO bookmarkItem = bookmark.getLastMarkedItem();
              Vector rowVec = currentExpandedPath();
              if (bookmarkItem != null
                        && parentObject != null
                        && bookmarkItem.getObjectId() == ((TestCaseTO) parentObject)
                                  .getId()
                        && bookmarkItem.getObjectType() == BookmarkItemType.TESTCASE) {
                   bookmarkItem.setTreeState(rowVec);
    private Vector currentExpandedPath() {
              Vector rowVec = new Vector();
              for (int i = 0; i < getRowCount(); i++) {
                   String expandedPath = null;
                   String currPathExpanded = getPathExpanded(i);
                   if (!currPathExpanded.equals("")) {
                        expandedPath = i + getPathExpanded(i);
                        rowVec.add(expandedPath);
              return rowVec;
    private String getPathExpanded(int row) {
         String str = "";
         TreePath path = getPathForRow(row);
         int noofrows = this.getRowCount();
         for(int i = row; i < noofrows; i++) {
              TreePath currPath = this.getPathForRow(i);
              if(i==row || currPath.isDescendant(path)) {
                   if(this.isExpanded(currPath)) {
                        str = str + "," + (i - row);
         return str;
    public Vector getVecTreeStateBookmark() {
         BookmarkTO bookmark = VmtpSession.getVmtpSession().getBookmark();
         BookmarkItemTO bookmarkItem = bookmark.getLastMarkedItem();
         if (bookmarkItem != null && parentObject != null
         && bookmarkItem.getObjectId() == ((TestCaseTO)parentObject).getId()
         && bookmarkItem.getObjectType() == BookmarkItemType.TESTCASE)
         return bookmarkItem.getTreeState();
         return null;
         public void treeCollapsed(TreeExpansionEvent event) {
              updateVecTreeStateBookmark();
              // TODO Auto-generated method stub
         public void treeExpanded(TreeExpansionEvent event) {
              updateVecTreeStateBookmark();
              // TODO Auto-generated method stub
    Here is ActionTreeTable.java
    public abstract class ActionTreeTable extends JTree
    protected Presenter presenter;
    protected DefaultMutableTreeNode top;
    private ActionTreeTableModel treeModel;
    protected List<ActionTO> actions;
    private ParameterTO selectedParameter;
    private JScrollPane scrollPane;
    protected ActionTreeTableToolbar toolbar;
    protected AbstractToolbarTable selectedTable;
    //A jtableheader to be propogated to the parametertablemodel
    protected JTableHeader                    header;
    * The parent object to actions, such as test case, action group etc.
    protected AbstractTO parentObject;
    private Collection<ParameterTable> tables = new ArrayList<ParameterTable>();
    private int tableWidth = 100;
    public ActionTreeTable(Presenter presenter, AbstractTO parentObject,
              Collection<ActionTO> actions, ActionTreeTableToolbar toolbar)
    super();
    this.parentObject = parentObject;
    this.actions = (List<ActionTO>)actions;
    this.toolbar = toolbar;
    this.presenter = presenter;
    toolbar.setTree(this);
    configureTreeTable();
    * bad programming but needs to be done to adhere to the existing design of the table
    * header and the tree tables
    * @param tableHeader
    public void setHeader(JTableHeader tableHeader) {
         this.header = tableHeader;
         if(header != null && tables.size() >= 1) {
              Object[] currTables = tables.toArray();
              for(int i = 0; i < currTables.length; i++) {
                   ParameterTableLite currLiteTable = (ParameterTableLite)currTables;
                   ParameterTableModel model = currLiteTable.getParameterModel();
                   model.setTableHeader(tableHeader);
         // adding a mouse listener to the header that updates the tree when the
              // mouse is clicked on the header and all the table models are sorted
              // according to the desired column
              tableHeader.addMouseListener(new MouseListener() {
                   public void mouseClicked(MouseEvent e) {
                        repaint();
                   public void mouseEntered(MouseEvent e) {
                        // ignored
                   public void mouseExited(MouseEvent e) {
                        // ignored
                   public void mousePressed(MouseEvent e) {
                        // ignored
                   public void mouseReleased(MouseEvent e) {
                        // ignored
    public JTableHeader getHeader() {
         return header;
    private void configureTreeTable()
    this.setRootVisible(false);
    this.setShowsRootHandles(true);
    this.setMaximumSize(new Dimension(2000, 2000));
    buildTree();
    //expandTreePerBookmark();
    public synchronized boolean buildTree()
    boolean outcome = false;
    addMouseListener(new ActionTreeTableMouseListener(this));
    try {
    top = new DefaultMutableTreeNode(null);
    treeModel = new ActionTreeTableModel(top, actions);
    setModel(treeModel);
    addActionsToRoot(actions);
    if (this.getRowHeight() <= 0)
    // Temporary change to non-zero height
    this.setRowHeight(1);
    this.setRowHeight(0);
    //ActionTreeTableCellRenderer renderer=new ActionTreeTableCellRenderer();
    //System.out.println(renderer.getComponent(1));
    this.setCellRenderer(new ActionTreeTableCellRenderer());
    this.setCellEditor(new ActionTreeTableCellEditor(this));
    this.setEditable(true);
    this.validateTree();
    outcome = true;
    } catch (Exception e) {
    // log.log(Level.SEVERE, "Can't load data", e);
    } finally {
    return outcome;
    * Set the expanded nodes in the tree in the bookmark
    * @param treeExpanded true if tree is expanded, false if tree is collapsed
    public abstract void setVecTreeStateBookmark(Vector treeState);
    * Get tree's previous state from bookmark
    * @return true if tree was previously expanded, false if collpased
    public abstract Vector getVecTreeStateBookmark();
    public void addActionsToRoot(Collection<ActionTO> newActions)
    this.addActionsToTree(newActions, top, false);
    public void addActionsToTree(Collection<ActionTO> newActions, DefaultMutableTreeNode parent, boolean groupActions)
    Iterator iterator = newActions.iterator();
    ActionTO actionTO;
    DefaultMutableTreeNode node;
    ParameterTable parameterTable = null;
    while (iterator.hasNext())
    actionTO = (ActionTO)iterator.next();
    node = new DefaultMutableTreeNode(new ActionTreeTableNode(actionTO));
    if(actionTO.isGroup())
    this.addActionsToTree(actionTO.getActionGroup().getActions(), node, true);
    else
    JPanel tablePanel = new JPanel();
    ParameterTableModel model =
    new ParameterTableModel(actionTO, actionTO,
              ParameterTableModel.MODE_IMPLEMENTATION, presenter);
    if(groupActions)
    model.setGroupAction(true);
    parameterTable = new ParameterTableLite(tablePanel, presenter, model, this);
    parameterTable.setToolbar(toolbar);
    tables.add(parameterTable);
    parameterTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    parameterTable.setAutoscrolls(true);
    node.add(new DefaultMutableTreeNode(parameterTable));
    * When creating ActionGroups this will be executed when we are adding new
    * actions to the tree.
    if(newActions != actions && parent == top)
    actions.add(actionTO);
    * Passing -1 as index means that the underlying collection of ActionTOs
    * won't be affected. This has already been taken care of above.
    // treeModel.insertNodeInto(node, parent, parent.getChildCount());
    treeModel.insertNodeInto(node, parent, -1);
    treeModel.reload();
    public void removeActionFromTree(MutableTreeNode node)
    treeModel.removeNodeFromParent(node);
    public void moveActionUp(TreePath path)
    DefaultMutableTreeNode nodeToMove = (DefaultMutableTreeNode)path.getLastPathComponent();
    this.moveAction(nodeToMove, -1);
    public void moveActionDown(TreePath path)
    DefaultMutableTreeNode nodeToMove = (DefaultMutableTreeNode)path.getLastPathComponent();
    this.moveAction(nodeToMove, 1);
    public void moveAction(DefaultMutableTreeNode nodeToMove, int offset)
    treeModel.moveAction(nodeToMove, offset);
    setSelectionRow(treeModel.getIndexOfChild(top, nodeToMove));
    * @param selectedParameter The selectedParameter to set.
    public void setSelectedParameter(ParameterTO selectedParameter)
    this.selectedParameter = selectedParameter;
    public AbstractToolbarTable getSelectedTable()
    TreePath path = this.getSelectionPath();
    if(path != null)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
    if(node.getUserObject() instanceof JTable)
    return (AbstractToolbarTable)node.getUserObject();
    return null;
    public ParameterTO getSelectedParameter()
    TreePath path = this.getSelectionPath();
    if(path != null)
    DefaultMutableTreeNode node =
    (DefaultMutableTreeNode)path.getLastPathComponent();
    if(node.getUserObject() instanceof AbstractToolbarTable)
    AbstractToolbarTable table =
    (AbstractToolbarTable)node.getUserObject();
    if(table.getSelectedRow() != -1)
    return (ParameterTO)table.getTableModel().getRowData(table.getSelectedRow());
    return null;
    public void collapseTree()
    int row = getRowCount() - 1;
    while (row >= 0)
    collapseRow(row);
    row--;
    public void expandTree()
    int row = 0;
    while (row < getRowCount())
    expandRow(row);
    row++;
    * @return Returns the scrollPane.
    public JScrollPane getScrollPane()
    return scrollPane;
    * @param scrollPane The scrollPane to set.
    public void setScrollPane(JScrollPane scrollPane)
    this.scrollPane = scrollPane;
    public void setEnabled(boolean isEnabled)
    // super.setEnabled(isEnabled);
    setEditable(isEnabled);
    ParameterTable tmpTable;
    for(Iterator i = tables.iterator() ; i.hasNext() ;)
    tmpTable = (ParameterTable)i.next();
    * Commented out below lines to enable editing of parameter values
    * for action groups in a test case
    //if(tmpTable.isGroupAction())
    // tmpTable.setEnabled(false);
    //else
    // tmpTable.setEnabled(isEnabled);
    tmpTable.setEnabled(isEnabled);
    toolbar.setToolbarEnabled(isEnabled);
    public void setBounds(int x, int y, int w, int h)
    clearSelection();
    super.setBounds(x, y, w, h);
    private int calculateTableWidth(JTable table)
    JViewport viewPort = getScrollPane().getViewport();
    int vpW = viewPort.getWidth();
    int tableX = table.getLocation().x;
    return getScrollPane().getWidth() - 80;
    * @return Returns the toolbar.
    public AbstractTableToolbar getToolbar()
    return toolbar;
    * @param selectedTable The selectedTable to set.
    public void setSelectedTable(AbstractToolbarTable selectedTable)
    this.selectedTable = selectedTable;
    /* (non-Javadoc)
    * @see javax.swing.JTree#fireValueChanged(javax.swing.event.TreeSelectionEvent)
    @Override
    protected void fireValueChanged(TreeSelectionEvent event)
    if(getSelectionPath() != null && ((DefaultMutableTreeNode)getSelectionPath().
    getLastPathComponent()).getUserObject()
    instanceof ActionTreeNode && isEditable())
    toolbar.setNodeToolsEnabled(true);
    else
    toolbar.setNodeToolsEnabled(false);
    if(selectedTable != null)
    this.selectedTable.clearSelection();
    super.fireValueChanged(event);
    /* (non-Javadoc)
    * @see javax.swing.JTree#isPathEditable()
    @Override
    public boolean isPathEditable(TreePath path)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
    if(node.getUserObject() instanceof ActionTreeNode)
    return false;
    return super.isPathEditable(path);
    And finally here is ActionTreeTablePanel.java
    public class ActionTreeTablePanel extends JPanel
    * Width and height is set based on the BoxLayout used by
    * the parent container. This might need to be modified
    * if the parent container layout is changed.
    private final int HEADER_WIDTH = 3000;
    private final int HEADER_HEIGHT = 18;
    private final int FIRST_COLUMN_WIDTH = 41;
    private final int LAST_COLUMN_WIDTH = 60;
    private ActionTreeTable tree;
    private JTable defaultTable = null;
    private Presenter     presenter;
    //a variable to give the reference of the tableheader of the main scrollPane to the
    //parametertablemodel to enable sorting
    //the parametertablemodel implements the view to model technique and makes
    //the necessary changes to the model and captures events for the tableheader
    private JTableHeader header = null;
    * Constructs an <code>ActionTreeTable</code> as a ready component
    * to be used in an application.
    * @param tree
    public ActionTreeTablePanel(ActionTreeTable tree, Presenter presenter)
    this.tree = tree;
    this.presenter = presenter;
    this.buildPanel();
    * Called from the constructor to build the component.
    private void buildPanel()
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    JScrollPane scrollPane = new JScrollPane(tree);
    scrollPane.setVerticalScrollBarPolicy(
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    tree.setScrollPane(scrollPane);
    this.add(getDefaultTableInScrollPane());
    //header needs to be the same as the
    tree.setHeader(header);
    this.add(scrollPane);
    if(tree.getToolbar() != null)
    this.add(tree.getToolbar());
    * Helper method to build the header for the <code>ActionTreeTable</code>
    * @return
    private JScrollPane getDefaultTableInScrollPane()
    if(defaultTable == null)
    defaultTable = new JTable();
    final JTableHeader tableHeader = defaultTable.getTableHeader();
    TableColumn column = new TableColumn();
    defaultTable.setMaximumSize(new Dimension(HEADER_WIDTH, HEADER_HEIGHT));
    defaultTable.setPreferredSize(new Dimension(HEADER_WIDTH, HEADER_HEIGHT));
    defaultTable.setSize(new Dimension(HEADER_WIDTH, HEADER_HEIGHT));
    // defaultTable.setAutoResizeMode(4);
    column.setHeaderValue(" ");
    column.setWidth(FIRST_COLUMN_WIDTH);
    column.setMaxWidth(FIRST_COLUMN_WIDTH);
    tableHeader.setAlignmentX(FIRST_COLUMN_WIDTH);
    // tableHeader.set;
    // tableHeader.getColumnModel().addColumn(column);
    for(int i=0 ; i < ParameterTableModel.columnNamesImpl.length ; i++)
    column = new TableColumn(i);
    column.setHeaderValue(presenter.doGetProperty(ParameterTableModel.columnNamesImpl[i]));
    tableHeader.getColumnModel().addColumn(column);
    column = new TableColumn();
    column.setHeaderValue(" ");
    column.setWidth(LAST_COLUMN_WIDTH);
    column.setMaxWidth(LAST_COLUMN_WIDTH);
    // tableHeader.getColumnModel().addColumn(column);
    tableHeader.setResizingAllowed(true);
    tableHeader.setReorderingAllowed(false);
    header = defaultTable.getTableHeader();
    //doing the same changes as before and adjusted the size of the columns manually
    //and the size of the columns do not change by listening to user events.
    TableColumn typeColumn = defaultTable.getColumnModel().getColumn(
    ParameterTableModel.TYPE_COL_ID ); // Empty col
    typeColumn.setWidth(ParameterTable.WIDTH_TYPE_COLUMN );
    typeColumn.setMaxWidth(ParameterTable.WIDTH_TYPE_COLUMN);
    TableColumn requiredColumn = defaultTable.getColumnModel().getColumn(
    ParameterTableModel.REQUIRED_COL_ID); // Empty col
    requiredColumn.setWidth(ParameterTable.WIDTH_REQURIED_COLUMN + FIRST_COLUMN_WIDTH);
    requiredColumn.setPreferredWidth(ParameterTable.WIDTH_REQURIED_COLUMN + FIRST_COLUMN_WIDTH);
    requiredColumn.setMaxWidth(ParameterTable.WIDTH_REQURIED_COLUMN + FIRST_COLUMN_WIDTH);
    TableColumn valueColumn = defaultTable.getColumnModel().getColumn(
    ParameterTableModel.VALUE_COL_ID); // Empty col
    valueColumn.setWidth(ParameterTable.WIDTH_VALUE_COLUMN + LAST_COLUMN_WIDTH);
    valueColumn.setPreferredWidth(ParameterTable.WIDTH_VALUE_COLUMN + LAST_COLUMN_WIDTH);
    valueColumn.setMaxWidth(ParameterTable.WIDTH_VALUE_COLUMN + LAST_COLUMN_WIDTH);
    JScrollPane scrollPane = new JScrollPane(defaultTable);
    scrollPane.setMaximumSize(new Dimension(HEADER_WIDTH, HEADER_HEIGHT));
    scrollPane.setPreferredSize(new Dimension(HEADER_WIDTH, HEADER_HEIGHT));
    scrollPane.setSize(new Dimension(HEADER_WIDTH, HEADER_HEIGHT));
    return scrollPane;
    Please guys help me out. My boss is angry upon me..

  • Maintaining State with OAS 4.8 and PL/SQL

    Hi,
    I am working on a package that displays 5 pages with 83 application questions. To maintain state for all 83 questions, I am using a procedure that maintains the data on a string (~400 characters) and passes it to each page (We decided to avoid writing to the database before the application is completed). Since the pages were expiring randomly, I added NEXT and PREVIOUS buttons. One procedure, the one that maintains the string, has 83 parameters.
    The package contains 8-10 procedures, 180 constants and global variables (we tried without using global variables but global variables make the code easier to read and the package smaller (around 4000 lines). The complete application uses 4 packages.
    During development, the package seemed to be working well, until I added more realistic data. Right now, I get The error message: The page cannot be found. The first time, I got this message, just by pressing enter again will cause the page to display. At times it will take 3 or 4 times pressing the enter key on the URL. Slowly, it became more and more difficult to make the browser display the first page. Today, no matter how many times I press the enter key, the page does not display.
    Questions:
    1. Are there any limits on parameters, global variables and data on OAS 4.08. I tested reducing the package parameters, global variables and data to half the size, but the procedure still does not display. Compiling an older copy of the procedure does not seem to work either.
    2. Is there a better way to maintain state without writing to the database?
    I am not sure what is causing the problem. I have an open TAR.
    null

    Patricia Blais (guest) wrote:
    : I have bought the book "The complete reference SQL" which came
    : with a trial software CD of Oracle 8. I want to know if it is
    : possible to create a program in PL/SQL (create a procedure) in
    : SQLPLUS v.8 which is also included with the book. If it is
    : possible, I would like to know how, by a small example. I have
    : tried some of the exercices in the volume and they do not
    work.
    : No error messages are given and the program had to be
    : interrupted. Please answer in another way then repeating an
    : example in the book.
    : Thanks in advance.
    ok some code example:
    Let's gues you want to display 2 collums of the view all_tables
    in html format:
    First create a procedure with a editor (i use to do so).
    create or replace procedure get_html (owner_in in varchar2) as
    var1 number(12,0);
    var2 varchar2(100);
    begin
    dbms_output.putline('<table>');
    for fr_rec in (
    select table_name, owner
    from all_tables
    where owner like '%'

  • How to select the data from a Maintainance View into an internal table

    Hi All,
    Can anybody tell me how to select the data from a Maintainance View into an internal table.
    Thanks,
    srinivas.

    HI,
    You can not retrieve data from A mentenance view.
    For detail check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    Regards,
    Anirban

  • Cannot sort child rows in multilevel tree table

    Hi,
    I originally hijacked a two-year-old forum thread that was vaguely similar to my issue, but a kind forum moderator split my post away
    (and deleted my other hijack post asking this same question)
    so that my inquiry might be viewable on its own.
    Hopefully someone can pay attention to my issue instead of getting it confused with those other old forum threads.
    So, here we go ...
    Is sorting in a treeTable at a particular level possible? Just want to let you I have tried the following approaches to do this. But it dis not work for me.
    I have tree table with 2 levels. I am trying to sort the child rows based on its column say "Display Sequence".
    User can type in number in this column which contains input text. On value change event of the this field, all the
    child rows in the level 2 need to be sorted. This needs to be done without committing the data. On commit it works,
    because it sorts based on order by clause. I want the child rows to be sorted on value change event. Following
    various approaches I tried.
    TreeModel tModel = (TreeModel)treeTable.getValue();
    SortCriterion sortCriterion = new SortCriterion("DisplaySequence",true);
    List<SortCriterion> sortCriteriaList = new ArrayList<SortCriterion>();
    sortCriteriaList.add(sortCriterion);
    tModel.setSortCriteria(sortCriteriaList);
    The above code does not work, As "DisplaySequence" is not available in the parent view object.
    Here is approach no 2
    JUCtrlHierBinding treeTableBinding = null;
    JUCtrlHierNodeBinding nodeBinding = null;
    JUCtrlHierNodeBinding parentNodeBinding = null;
    JUCtrlHierTypeBinding nodeHierTypeBinding = null;
    Key rowKey;
    Object dispSeqObj;
    Number displaySequence = null;
    Map<Key,Number> keyValueMap = null;
    Set<Key> emptyValueKeySet = null;
    Map<Key,Number> sortedKeyValueMap = null;
    DCIteratorBinding target = null;
    Iterator iter = null;
    int rowIndex = 1;
    RowSetIterator rsi = null;
    Row currentRow = null;
    Row row = null;
    RowKeySet selectedRowKey = lookupTreeTable.getSelectedRowKeys();
    Iterator rksIterator = selectedRowKey.iterator();
    if (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    System.out.println("key :"+key);
    treeTableBinding = (JUCtrlHierBinding) ((CollectionModel)lookupTreeTable.getValue()).getWrappedData();
    nodeBinding = treeTableBinding.findNodeByKeyPath(key);
    parentNodeBinding = nodeBinding.getParent();
    //rsi = nodeBinding.getParentRowSetIterator();
    rsi = parentNodeBinding.getChildIteratorBinding().getRowSetIterator();
    keyValueMap = new LinkedHashMap<Key,Number>();
    emptyValueKeySet = new LinkedHashSet<Key>();
    // Gets the DisplaySequence by iterating through the child rows
    while(rsi.hasNext()) {
    if(rowIndex==1)
    row = rsi.first();
    else
    row = rsi.next();
    rowKey = row.getKey();
    dispSeqObj = row.getAttribute("DisplaySequence");
    if(dispSeqObj!=null && dispSeqObj instanceof Number) {
    displaySequence = (Number)dispSeqObj;
    keyValueMap.put(rowKey, displaySequence);
    }else {
    emptyValueKeySet.add(rowKey);
    rowIndex++;
    rowIndex = 0;
    // Sort the numbers using comparator
    DisplaySequenceComparator dispSeqComparator = new DisplaySequenceComparator(keyValueMap);
    sortedKeyValueMap = new TreeMap<Key,Number>(dispSeqComparator);
    sortedKeyValueMap.putAll(keyValueMap);
    rsi.reset();
    nodeHierTypeBinding = nodeBinding.getHierTypeBinding();
    System.out.println("nodeHierTypeBinding :"+nodeHierTypeBinding);
    String expr = nodeHierTypeBinding.getTargetIterator();
    if (expr != null) {
    Object val = nodeBinding.getBindingContainer().evaluateParameter(expr, false);
    if (val instanceof DCIteratorBinding) {
    target = ((DCIteratorBinding)val);
    ViewObject targetVo = target.getViewObject();
    System.out.println("targetVo :"+targetVo);
    targetVo.setAssociationConsistent(true);
    //ri = target.findRowsByKeyValues(new Key[]{rowData.getRowKey()});
    rsi = parentNodeBinding.getChildIteratorBinding().getRowSetIterator();
    //rsi = nodeBinding.getParentRowSetIterator();
    // Rearrange the tree rows by inserting at respective index based on sorting.
    ViewObject vo = nodeBinding.getViewObject();
    iter = sortedKeyValueMap.keySet().iterator();
    while(iter.hasNext()) {
    currentRow = rsi.getRow((Key)iter.next());
    rsi.setCurrentRow(currentRow);
    rsi.setCurrentRowAtRangeIndex(rowIndex);
    //rsi.insertRowAtRangeIndex(rowIndex, currentRow);
    rowIndex++;
    iter = emptyValueKeySet.iterator();
    while(iter.hasNext()) {
    currentRow = rsi.getRow((Key)iter.next());
    rsi.setCurrentRow(currentRow);
    rsi.setCurrentRowAtRangeIndex(rowIndex);
    //rsi.insertRowAtRangeIndex(rowIndex, currentRow);
    rowIndex++;
    rsi.closeRowSetIterator();
    AdfFacesContext.getCurrentInstance().addPartialTarget(treeTable);
    private class DisplaySequenceComparator implements Comparator {
    Map<Key,oracle.jbo.domain.Number> dispSeqMap = null;
    public DisplaySequenceComparator(Map<Key,oracle.jbo.domain.Number> dispSeqMap) {
    this.dispSeqMap = dispSeqMap;
    public int compare(Object a, Object b) {
    Key key1 = (Key)a;
    Key key2 = (Key)b;
    oracle.jbo.domain.Number value1 = dispSeqMap.get(key1);
    oracle.jbo.domain.Number value2 = dispSeqMap.get(key2);
    if(value1.getValue() > value2.getValue()) {
    return 1;
    } else if(value1.getValue() == value2.getValue()) {
    return 0;
    } else {
    return -1;
    In the above code I tried to perform sorting of DisplaySequence values using comparator, then tried to rearrange
    nodes or rows based on sort resurts. But rsi.insertRowAtRangeIndex(rowIndex, currentRow) give
    DeadViewException...unable to find view reference. While setting current row also does not work.
    Approach 3.
    DCIteratorBinding iter1 =
    bindings.findIteratorBinding("childIterator");
    iter1.executeQuery();
    SortCriteria sc = new SortCriteriaImpl("DisplaySequence",false);
    SortCriteria [] scArray = new SortCriteria[1];
    scArray[0] = sc;
    iter1.applySortCriteria(scArray);
    Any help in Sorting Child nodes ADF treeTable is appreciated. Thanks in Advance.
    Abhishek

    Hi Frank,
    Thanks for your reply. I have tried similar approach for sorting tree table child rows based on user specified number and it works. But there is a limitation for this. This sorting works only for read only/transient view object. For updatable view object after sorting, data cannot be saved or updated, as it cannot find the rowid. Here is what I tried
    In the ParentViewImpl class,
    1. overrode the method createViewLinkAccessorRS, so that this method is forcefully executed.
    @Override
    protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl associationDefImpl,
    oracle.jbo.server.ViewObjectImpl viewObjectImpl,
    Row row,
    Object[] object) {
    ViewRowSetImpl viewRowSetImpl = super.createViewLinkAccessorRS(associationDefImpl, viewObjectImpl, row, object);
    return viewRowSetImpl;
    2. Added the following method, which will be invoked on valueChange of DisplaySequence in child row. Expose this method through client interface. This method accept a parameter i.e. parent row key of the child row.
    public void sortChildRecords(Key parentKey) {
    ViewObject viewObject = null;
    String type = null;
    if(parentKey==null) {
    Row [] row = this.findByKey(parentKey, 1);
    RowSet rowSet = (RowSet)row[0].getAttribute("ChildVO");
    viewObject = rowSet.getViewObject();
    viewObject.setSortBy("DisplaySequence asc");
    }else {
    Row row = getCurrentRow();
    RowSet rowSet = (RowSet)row.getAttribute("ChildVO");
    viewObject = rowSet.getViewObject();
    viewObject.setSortBy("DisplaySequence asc");
    this.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES |
    ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    this.executeQuery();
    For custom sort, lets say all the numbers should be display first in ascending order, and null or empty values to be display at the end need to override the getRowComparator method in the ChildViewImpl class,
    Here is the code for the same
    @Override
    public Comparator getRowComparator() {
    SortCriteria sortCriteria = new SortCriteriaImpl("DisplaySequence",false);
    SortCriteria [] sortCriterias = new SortCriteria[1];
    sortCriterias[0] = sortCriteria;
    return new DisplaySequenceComparator(sortCriterias);
    private class DisplaySequenceComparator extends RowComparator {
    public DisplaySequenceComparator(SortCriteria [] sortCriterias) {
    super(sortCriterias);
    public int compareRows(Row row1, Row row2) {
    Object dispSeqObj1;
    Object dispSeqObj2;
    Number dispSeq1 = null;
    Number dispSeq2 = null;
    boolean compareRow1 = true;
    boolean compareRow2 = true;
    if(row1!=null) {
    dispSeqObj1 = row1.getAttribute("DisplaySequence");
    if(dispSeqObj1!=null && dispSeqObj1 instanceof Number) {
    dispSeq1 = (Number)dispSeqObj1;
    }else {
    compareRow1 = false;
    if(row2!=null) {
    dispSeqObj2 = row2.getAttribute("DisplaySequence");
    if(dispSeqObj2!=null && dispSeqObj2 instanceof Number) {
    dispSeq2 = (Number)dispSeqObj2;
    }else {
    compareRow2 = false;
    if(compareRow1 && compareRow2) {
    if(dispSeq1.getValue() > dispSeq2.getValue()) {
    return 1;
    } else if(dispSeq1.getValue() == dispSeq2.getValue()) {
    return 0;
    } else {
    return -1;
    if(!compareRow1 && compareRow2)
    return 1;
    if(compareRow1 && !compareRow2)
    return -1;
    return 0;
    The above solution works properly, and sorts the child tree rows. But while saving the changes, update fails. I also came to know that in-memory sorting is applicable to read-only/transient view objects from some blogs and also mentiond in this link http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvvo.htm
    Is there any way that updatable view objects can be sorted and saved as well?
    Thanks,
    Abhishek
    Edited by: 930857 on May 2, 2012 7:12 AM

  • Tree Table is not getting refreshed properly in Jdev 11.1.2.0

    Hi,
    I am seeing a peculiar issue with tree table not getting refreshed in Jdev 11.1.2.0.
    Let me explain you my use case.
    I have a tree table in a page, where the first column is displayed as selectBooleanRadio component. When user selects this selectBooleanRadio component, that treetable node should get expanded and at the same time all the child records(I have a select boolean check box component(transient attribute) at the child level) for that node should get selected. This is to allow user to unselect the child records, which he/she does not want to process further(some functionality).
    Now when the user selects any radio button, the tree table node is not expanded, but the arrow beside the radio button for that node can be seen as expanded.
    I thought it may be a partial trigger issue, so i tried refreshing the tree table programatically as well. But it was of no use.
    Then I set the partial triggers wrt to SelectBooleanRadio component on the parent container of the TreeTable. After which somehow the node got expanded but the tree table shrinks in width and the actual disclosure functionality of a tree table is lost.
    The same use case works perfectly fine in Jdev 11.1.1.5.
    For reference:
    I created a sample test case(Dept/Emp) in jdev version 11.1.1.5, which works fine. Workspace: http://adf-use-cases.googlecode.com/files/TreeTable1.rar
    But the same test case, when i created in jdev version 11.1.2.0, gives issues. Workspace: http://adf-use-cases.googlecode.com/files/TreeTableUseCase.rar
    If you download the application and run in respective jdev version, you will get to know more about the issue.
    Please let me know, If I am doing anything wrong in the implementation of this use case.
    Any help/suggestions are appreciated.
    Thanks
    Umesh
    Note: My complete application is in Jdev 11.1.2.0, so I can't degrade my jdev version to 11.1.1.5.

    Thanks Frank for the reply.
    But upgrading the jdeveloper to 11.1.2.2 is not an ideal solution for us now, because of the size of the project.
    Some how, the issue of refreshing the tree table is resolved. I am using a command button with clientComponent to true and causing a full page refresh.
    I am not sure, if this is a perfect solution.
    As you said, that this behavior may be an issue with the Jdev version 11.1.2.0, I am using. I am going with the above said approach.

  • How to use tree tables with CRUD operation for begineers ADF 11g

    This is Friday night call for help.
    This is only few sample ressources on the web for tree table and only one with CRUD operation.
    I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
    And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
    Depending if the user selection in the tree, the code insert from the master node to the children node.
    Any other options because it is not working well.
    Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
    then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
    Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "model.DepartmentsView";
    final String empViewDefName = "model.EmployeesView";
    if (ri != null && selectedNodeKey != null) {
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    Row foundRow = found[0];
    String nodeDefname =
    foundRow.getStructureDef().getDefFullName();
    if (nodeDefname.equals(deptViewDefName)) {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    parents.insertRow(childrow);
    } else {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    childrow.setAttribute("DepartmentId",
    foundRow.getAttribute("DepartmentId"));
    parents.insertRow(childrow);
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    }

    I am looking for a sample that describe how to design a jsf page with a tree table.
    So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
    I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
    I got part of it working but not good enough.
    By problem is the get insertion working
    I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
    To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
    #{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
    Is it the right approach?
    First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
    we run this code
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    //ViewObjectImpl vo = getDepartmentsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    A new blank entry appears in the parent node and we enter a value.
    The the problem starts when we want to add a child to this parent.
    We select the created parent and press the insert button, this code get executed
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    childRows.insertRow(childrow);
    But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
    Do you see something wrong with the code?
    The full code og my create children method is there below
    I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
    Thanks for your help
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
    final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
    if (ri != null && selectedNodeKey != null) {
    // last row
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    // foundRow is the row selected
    Row foundRow = found[0];
    // The row selected can be the parent node or the child node
    String nodeDefname = foundRow.getStructureDef().getDefFullName();
    // if parent row
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    //works but we try to resolve the creation of a parent
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    //childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
    System.out.println("insert child row from master");
    childRows.insertRow(childrow);
    } else
    //RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
    //RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
    Row childrow = ri.createRow();
    System.out.println("insert child row from child ");
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    } else {
    System.out.println(" param null try creating for first row : " +
    ri + " * " + selectedNodeKey);
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    }

  • [SOLVED] Multiple Dynamic View Objects and View Links - ADF Tree Table

    Hi all,
    I've got a method that creates 3 dynamic viewobjects using this:
                ViewDefImpl Level1ViewDef = new ViewDefImpl("Level1View");
                Level1ViewDef.addViewAttribute("LevelDescription","LEVEL1_DESCRIPTION",String.class);
                Level1ViewDef.addViewAttribute("SetOfBooksId","SET_OF_BOOKS_ID",Number.class);
                Level1ViewDef.addViewAttribute("CodeCombinationId","CODE_COMBINATION_ID",Number.class);
                Level1ViewDef.addViewAttribute("Level1","LEVEL1",String.class);
                Level1ViewDef.addViewAttribute("AccountType","ACCOUNT_TYPE",String.class);
                Level1ViewDef.addViewAttribute("PeriodYear","PERIOD_YEAR",Number.class);
                Level1ViewDef.addViewAttribute("PeriodNum","PERIOD_NUM",Number.class);
                Level1ViewDef.addViewAttribute("PeriodName","PERIOD_NAME",String.class);
                Level1ViewDef.addViewAttribute("PtdActual","PTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("YtdActual","YTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("LtdActual","LTD_ACTUAL",Number.class);
                Level1ViewDef.addViewAttribute("BudgetName","BUDGET_NAME",String.class);
                Level1ViewDef.addViewAttribute("BudgetVersionId","BUDGET_VERSION_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdBudget","PTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("YtdBudget","YTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("LtdBudget","LTD_BUDGET",Number.class);
                Level1ViewDef.addViewAttribute("EncumbranceType","ENCUMBRANCE_TYPE",String.class);
                Level1ViewDef.addViewAttribute("EncumbranceTypeId","ENCUMBRANCE_TYPE_ID",Number.class);
                Level1ViewDef.addViewAttribute("PtdCommitment","PTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("YtdCommitment","YTD_COMMITMENT",Number.class);
                Level1ViewDef.addViewAttribute("LtdCommitment","LTD_COMMITMENT",Number.class);
                Level1ViewDef.setQuery(sql_level1);
                Level1ViewDef.setFullSql(true);
                Level1ViewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
                Level1ViewDef.resolveDefObject();
                Level1ViewDef.registerDefObject();
                ViewObject vo1 = createViewObject("Level1View",Level1ViewDef);I can create the view objects fine and create a single viewlink between two of them, however i'm getting problems with 2 view links.
    This is how I'm creating a view link:
                ViewLink Level2Level1FKLink = createViewLinkBetweenViewObjects("Level2Level1FKLink1",
                                                        "Level2View",
                                                        vo1,
                                                        new AttributeDef[]{
                                                          vo1.findAttributeDef("Level1")
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level1")
                                                        "LEVEL1 = :Bind_Level1");
                ViewLink Level3Level2FKLink = createViewLinkBetweenViewObjects("Level3Level2FKLink1",
                                                        "Level3View",
                                                        vo2,
                                                        new AttributeDef[]{
                                                          vo2.findAttributeDef("Level2")
                                                        vo3,
                                                        new AttributeDef[]{
                                                          vo3.findAttributeDef("Level2")
                                                        "LEVEL2 = :Bind_Level2");I can get the data to display on an adf tree table if i'm only using a single view link, but when i try and implement 2 view link (for 3 levels on the adf tree table) i'm getting problems displaying the data.
    I'm getting the following error:
    Aug 10, 2007 2:44:39 PM oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer encodeAll
    SEVERE: Error during partial-page rendering
    oracle.jbo.NoDefException: JBO-25058: Definition Level3View of type Attribute not found in Level2View_Level2Level1FKLink1_Level2ViewThe thing is, Level3View isn't in the Level2Level1FKLink viewlink.
    I've been reading about something similar here
    BC4J Master-Detail-Detail
    but I am still unsure of what the problem is.
    Thanks in advance.

    I found the answer here:
    http://radio.weblogs.com/0118231/stories/2004/06/10/correctlyImplementingMultilevelDynamicMasterDetail.html

  • Insert an HTML Table tag as a value in a Tree Table

    Hi helper,
    Can I insert an HTML Table tag inside a TreeTable (Hierarchical data) using AdvancedDataGrid as a value?
    I need to create a Tree table in flex and I have beside normal int values some cells that need to show a certain images in an HTML Table I will create.
    Is it possible?
    Please advice
    Thanks
    Jo

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>It depends on where you get the list of images<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Alex Harui<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Flex SDK Developer<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><a href="http://www.adobe.com/"><span style='color:blue'>Adobe<br />Systems Inc.</span></a><o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Blog: <a href="http://blogs.adobe.com/aharui"><span<br />style='color:blue'>http://blogs.adobe.com/aharui</span></a><o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Yossi Bar<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Monday, February 09, 2009 1:14 AM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> Re: Insert an HTML Table tag as a value in a Tree Table<o:p></o:p></span></p><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new message was posted by<br />Yossi Bar in <br><br /><br><br /><b>Developers</b> --<br><br />  Insert an HTML Table tag as a value in a Tree Table<br><br /><br><br />Thanks Alex, <br><br />What is the way to implement HorizontalLIst of images for<br />AdvancedDataGridColumn? <br><br /><br><br />In the code here I create a tree table and in Actual column I show an image: <br><br /><br><br />&lt;mx:AdvancedDataGrid width=&quot;100%&quot; height=&quot;100%&quot;<br />folderClosedIcon=&quot;{null}&quot; folderOpenIcon=&quot;{null}&quot;<br />defaultLeafIcon=&quot;{null}&quot;&gt; <br><br /><br><br />&lt;mx:dataProvider&gt; <br><br />            &lt;mx:HierarchicalData<br />source=&quot;{dpHierarchy}&quot;/&gt; <br><br />        &lt;/mx:dataProvider&gt; <br><br />        &lt;mx:groupedColumns&gt; <br><br />         &lt;mx:AdvancedDataGridColumn<br />headerText=&quot;&quot; width=&quot;50&quot;/&gt; <br><br />            &lt;mx:AdvancedDataGridColumn<br />dataField=&quot;Region&quot; backgroundColor=&quot;haloSilver&quot;<br />headerText=&quot;Region title&quot;<br />headerRenderer=&quot;mx.controls.Label&quot;/&gt; <br><br />            &lt;mx:AdvancedDataGridColumnGroup<br />headerText=&quot;Group Header&quot;<br />headerRenderer=&quot;mx.controls.Label&quot;&gt; <br><br />&lt;mx:AdvancedDataGridColumn dataField=&quot;Territory_Rep&quot;<br />headerText=&quot;Territory Rep&quot;<br />headerRenderer=&quot;mx.controls.Label&quot;/&gt; <br><br />&lt;mx:AdvancedDataGridColumn dataField=&quot;Actual&quot;<br />headerText=&quot;Actual title&quot;<br />headerRenderer=&quot;mx.controls.Label&quot;&gt; <br><br />&lt;mx:itemRenderer&gt; <br><br />&lt;mx:Component&gt; <br><br />&lt;mx:VBox horizontalAlign=&quot;center&quot;&gt; <br><br />&lt;mx:Image width=&quot;50&quot; source=&quot;{data.Actual}&quot;/&gt; <br><br />&lt;/mx:VBox&gt; <br><br />&lt;/mx:Component&gt; <br><br />&lt;/mx:itemRenderer&gt; <br><br />&lt;/mx:AdvancedDataGridColumn&gt; <br><br /><br><br />&lt;mx:AdvancedDataGridColumn dataField=&quot;Estimate&quot;<br />headerText=&quot;Estimate title&quot; headerRenderer=&quot;mx.controls.Label&quot;/&gt;<br /><br><br />            &lt;/mx:AdvancedDataGridColumnGroup&gt;<br /><br><br />        &lt;/mx:groupedColumns&gt; <br><br />    &lt;/mx:AdvancedDataGrid&gt; <br><br /><br><br />Please advise, <br><br /><br><br />Thanks <br><br /><br><br />Jo <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b7d1ae/2">Insert an HTML Table tag<br />as a value in a Tree Table</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b7d1ae!folder=.3c060fa3">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div>

  • Question on the ADF Tree Table

    Hi, I am using Jdev 10.1.3.2 and ADF BC. I have created a ADF Tree Table to display multiple attributes, both the master and detail VO are based on the same EO. It seems all of attributes are displayed in one colume, and there is no column heading, is that possible to add column heading and display in multiple columns?
    Thanks!

    Hi,
    actually the node stamp doesn't accept more than one column element
    Frank

  • How to add a button in the child node of the Tree Table?

    Hi All,
    I am having a requirement to create a tree table and it should have a delete button to each child node (screenshot attached).
    Can anyone provide me a sample for how to implement this.
    Thanks in Advance
    Aravindh

    Hi Aravindhan,
    Try something like this:
    var ttDesvios = new sap.ui.table.TreeTable();
      var cbDesviacion = new sap.ui.commons.CheckBox();
      ttDesvios.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Col1"}),
      template: new sap.ui.commons.Label({text: "Info"}),
      width: "50px",
      ttDesvios.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Action"}),
      template: new sap.ui.commons.Button({text: "Delete"}).bindProperty("visible", "pathPropertyChild", function(value){
              if(value .............){ return true;} //For child
              else{ return false;} //For parent
      width: "160px",
    Regards
    EDIT: Wrong paste code, that's better!

Maybe you are looking for