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..

Similar Messages

  • Sorting columns of Tree table structure

    Hi ,
    We have developed Tree Table structure based on the tutorial, but the data in the columns are not in the right order. Can anyone tell me how to do column sorting for Tree table structure, I know how to do column sorting on normal table structure but that logic does not work for Tree table structures
    Appreciate your help
    Som

    Hi Som,
    If you are using TutWD_TreeByNestingTableColumn project as example, this code can help you:
      //@@begin javadoc:onActionSortTree(ServerEvent)
      /** Declared validating event handler. */
      //@@end
      public void onActionSortTree(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSortTree(ServerEvent)
         sort(wdContext.nodeCatalogEntries());
        //@@end
      private void sort(IPrivateTreeTableView.ICatalogEntriesNode catalogEntriesNode) {
           if(null==catalogEntriesNode) return;
         catalogEntriesNode.sortElements(COMPORATOR);
         int size = catalogEntriesNode.size();
         for(int i=0;i<size;i++) {
              sort( catalogEntriesNode.nodeChildCatalogEntries(i) );
      private static final Comparator COMPORATOR = new CatalogEntriesComparator();
      private static class CatalogEntriesComparator implements Comparator {
         public int compare(Object o1, Object o2) {
              IPrivateTreeTableView.ICatalogEntriesElement ot1 = (IPrivateTreeTableView.ICatalogEntriesElement)o1;
              IPrivateTreeTableView.ICatalogEntriesElement ot2 = (IPrivateTreeTableView.ICatalogEntriesElement)o2;
              return Collator.getInstance().compare(     ot1!=null ? ot1.getTITLE() : "",
                                                      ot2!=null ? ot2.getTITLE() : "");
         public boolean equals(Object obj) {
              return false;
    Best regards, Maksim Rashchynski.

  • Resizing columns and making multiple selections in Pages 5.0

    Using Pages 5.0 (using OS X), I am no longer able to resize columns in a table by dragging a selection handle as I could in the old Pages (2009, I think it was). Dragging now adds the adjacent column to the selection. Anyone know how to resize the columns by dragging?
    Also, in the previous Pages, I could select multiple noncontiguous words by holding down the command key. Doesn't work anymore. Does anyone know how to do that?

    Apple has removed 90+ features from Pages5:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&mforum=iworktipsn trick
    Pages '09 should still be in your Applications/iWork folder:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&mforum=iworktips ntrick
    Trash/Archive Pages 5 after exporting any Pages 5 files back to Pages '09 format.
    Then rate/review Pages 5 in the App Store.
    Peter

  • How to get sequence number for tree level in tree table

    Hi,
    User would like to add a column as "Sequence" in the beginning of tree table. The tree table look like as following:
    Sequence Tasks Date
    1 ItemA
    subItem1 12/31/12
    subItem2 12/31/13
    subItem3 12/31/14
    2 ItemB
    subItem1 12/31/12
    subItem2 12/31/13
    subitem3 12/13/14
    How to add this sequence column in tree table?
    Thanks!
    Susan

    Check this sample:
    <af:form id="f1">
                    <af:treeTable value="#{bindings.Departments.treeModel}" var="node" styleClass="AFStretchWidth"
                                  columnStretching="last" selectionListener="#{bindings.Departments.treeModel.makeCurrent}"
                                  rowSelection="single" id="tt1">
                        <f:facet name="nodeStamp">
                            <af:column id="c1" headerText="Department Name" width="200">
                                <af:outputText value="#{node.index + 1} #{node.DepartmentName}" id="ot1"
                                               visible="#{bindings.Departments.treeModel.depth == 0}"/>
                            </af:column>
                        </f:facet>
                        <f:facet name="pathStamp"></f:facet>
                        <af:column id="c2" headerText="Employee Name">
                            <af:outputText id="ot4" value="#{node.FirstName} #{node.LastName}"/>
                        </af:column>
                    </af:treeTable>
                </af:form>Thanks,
    Navaneeth

  • Why table getWidth and setWidth is not working when resize column the table

    hi all,
    i want to know why the setWidth is not working in the following code,
    try to uncomment the code in columnMarginChanged method and run it wont resize the table.
    i cont set width(using setWidth) of the other table column using getWidth of the main table column.
    and i want to resize the right side columns only (you can check when you resize the any column the left and right side columns also resizing)
    any suggestions could be helpful.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.TableColumnModelEvent;
    import javax.swing.event.TableColumnModelListener;
    import javax.swing.table.TableColumnModel;
    public class SynTableResize extends JFrame implements TableColumnModelListener, ActionListener
        JTable  table1       = new JTable(5, 5);
        JTable  table2       = new JTable(5, 5);
        JTable  table3       = new JTable(5, 5);
        JButton btn          = new JButton("refresh");
        JPanel  pnlcontainer = new JPanel();
        public SynTableResize()
            setLayout(new BorderLayout());
            pnlcontainer.setLayout(new BoxLayout(pnlcontainer, BoxLayout.Y_AXIS));
            pnlcontainer.add(table1.getTableHeader());
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table2);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table3);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            table1.getColumnModel().addColumnModelListener(this);
            table3.setColumnModel(table1.getColumnModel());
            table2.setColumnModel(table1.getColumnModel());
            table2.getColumnModel().addColumnModelListener(table1);
            table3.getColumnModel().addColumnModelListener(table1);
            btn.addActionListener(this);
            getContentPane().add(pnlcontainer, BorderLayout.CENTER);
            getContentPane().add(btn, BorderLayout.SOUTH);
            setSize(new Dimension(400, 400));
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] args)
            new SynTableResize();
        public void columnAdded(TableColumnModelEvent e)
        public void columnMarginChanged(ChangeEvent e)
            TableColumnModel tcm = table1.getColumnModel();
            int columns = tcm.getColumnCount();
            for (int i = 0; i < columns; i++)
                table2.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getWidth());
                table3.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getWidth());
                // the following commented code wont work.
    //            table2.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getPreferredWidth());
    //            table3.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getPreferredWidth());
    //            table2.getColumnModel().getColumn(i).setWidth(tcm.getColumn(i).getWidth());
    //            table3.getColumnModel().getColumn(i).setWidth(tcm.getColumn(i).getWidth());
            SwingUtilities.invokeLater(new Runnable()
                public void run()
                    table2.revalidate();
                    table3.revalidate();
        public void columnMoved(TableColumnModelEvent e)
        public void columnRemoved(TableColumnModelEvent e)
        public void columnSelectionChanged(ListSelectionEvent e)
        public void actionPerformed(ActionEvent e)
            JTable table = new JTable(5, 5);
            table.setColumnModel(table1.getColumnModel());
            table.getColumnModel().addColumnModelListener(table1);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table);
            pnlcontainer.validate();
            pnlcontainer.repaint();
    }thanks
    dayananda b v

    hi,
    thanks for your replay,
    yes i know that, you can check the following code it works fine.
    actually what i want is, when i resize table column it shold not automaticaly reszie when table resized and i dont want horizontal scroll bar, meaning that all table columns should resize with in the table size(say width 300)
    if i make table autoresize off than horizontal scroll bar will appear and the other columns moved and i want scroll to view other columns.
    please suggest me some way doing it, i tried with doLayout() no help,
    doLayout() method only can be used when table resizes. first off all i want to restrict table resizing with in the limited size
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.ChangeEvent;
    import javax.swing.table.TableColumnModel;
    public class TempSycnTable extends JFrame
        JTable  table1       = new JTable(5, 5);
        MyTable table2       = new MyTable(5, 5);
        MyTable table3       = new MyTable(5, 5);
        JPanel  pnlcontainer = new JPanel();
        public TempSycnTable()
            JScrollPane src2 = new JScrollPane(table2);
            JScrollPane src3 = new JScrollPane(table3);
    //        table1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        table2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        table3.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        src2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    //        src3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            table3.setColumnModel(table1.getColumnModel());
            table2.setColumnModel(table1.getColumnModel());
            table2.getColumnModel().addColumnModelListener(table1);
            table3.getColumnModel().addColumnModelListener(table1);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            setLayout(new BorderLayout());
            pnlcontainer.setLayout(new BoxLayout(pnlcontainer, BoxLayout.Y_AXIS));
            pnlcontainer.add(table1.getTableHeader());
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(src2);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(src3);
            getContentPane().add(pnlcontainer, BorderLayout.CENTER);
            setSize(new Dimension(300, 300));
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] args)
            new TempSycnTable();
        class MyTable extends JTable
            public MyTable()
                super();
            public MyTable(int numRows, int numColumns)
                super(numRows, numColumns);
            public void columnMarginChanged(ChangeEvent event)
                final TableColumnModel eventModel = table1.getColumnModel();
                final TableColumnModel thisModel = getColumnModel();
                final int columnCount = eventModel.getColumnCount();
                for (int i = 0; i < columnCount; i++)
                    thisModel.getColumn(i).setWidth(eventModel.getColumn(i).getWidth());
                repaint();
    }thanks
    daya

  • Af:tree column in af:table

    I have af:tree as a column in an af:table and the expand/collapse functionality of af:tree behaves in a way that it works only on the last row added to the table and moreover while working on the last row it expands/collapses all trees in all other rows. All the other rows won't work at all.
    All rows have their own instance of TreeModel. Any clue why this happens ? Does anybody use af:tree as a column in a table ?
    JDev/ADF 10.1.3.3.0.4157
    Thanks for any help
    <af:table binding="#{bean.table}"
    value="#{bean.listTree}"
    banding="row" bandingInterval="1"
    var="row">
    <f:facet name="selection">
    <af:tableSelectMany binding="#{editor.component}"
    text=""
    shortDesc="Select">
    </af:tableSelectMany>
    </f:facet>
    <af:column id="treeLogCol" headerText="Tree" sortable="false">
    <af:tree id="treeLog"
    var="sel" value="#{row.testModel.model}"
    disclosureListener="#{bean.testDisclosureListener}"
    focusRowKey="#{row.testModel.model.focusRowKey}">
    <f:facet name="nodeStamp">
    <af:commandLink text="#{sel.label}" action="#{sel.getOutcome}"/>
    </f:facet>
    </af:tree>
    </af:column>
    </af:table>

    A workaround that seems to work fine is to define a disclosureListener as following -
    public void testDisclosureListener(DisclosureEvent disclosureEvent)
    CoreTree tree = (CoreTree)disclosureEvent.getComponent();
    TableRowWrapper row =
    (TableRowWrapper) ((UIXTable) _table).getRowData();
    PathSet set = tree.getTreeState();
    try
    set.setTreeModel(row.getTreeModel());
    catch(Exception e)
    if (disclosureEvent.isExpanded())
    set.add();
    else
    set.remove();
    // comment the following row since it will expand/collapse all trees in the column
    // AdfFacesContext.getCurrentInstance().addPartialTarget(_table);
    }

  • Resizing columns in a simple table

    Hello,
    I have several simple tables in my structured FM files.  They were copied from unstructured FM when we went DITA.  I want to resize the columns so the tables look presentable.  I tried to do Table > Resize Colums, but when I run the map through the DITA OT for .pdf output, the columns revert back to what they were, which is all the same width.  Do I need to change the element in some way to get the column width I want?

    Any knowledgeable people who can help?

  • Disable sorting and resizing columns on table view

    Is there a way to disable sorting and resizing columns on table view?
    Thanks

    Use
    setSortable(false)
    setResizable(false)
    on each TableColumn

  • ADF Tree Table - Multiple Commandlinks in one column

    Hi,
    We are building a hierarchy using tree table. The hierarchy looks as follows
    +Root Object
    ++ Child Object One
    +++ Child 1.1
    +++ Child 1.2
    +++ Child 1.3
    ++ Child OBject Two
    At each level, the object is used by more than one users. We want to display the list of users who are using that object in one the column called "Users". We want to provide hyperlink to each of the user that is displayed here. So my question so how do we build set of af:commandlinks with in one column? Or is there any other way this problem can be solved? What is ADF recommended pattern here?
    Thanks,

    How about putting a af:panelGroupLayout in the column and add multiple af:commandLinks into the panel=
    Timo

  • How to create tree table with column headers

    hi,
    when i drag and drop a view object onto my .jspx page as a af: tree table ,
    am not able to get the column header of each column. all the columns in the table are just clubbed together not separated as in af:table.
    can anyone say how the column headers are created for the columns when we drop a view object as a tree table?

    Hi,
    this is not an option with the treeTable as it gets rendered by default when dragging and dropping the collection to the page. I haven't tried it, but I think you will have to check which node is getting rendered and based on this information add your own row layout . Sounds like a bit of coding work
    Frank

  • 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

  • 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

  • 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 resize column width in report?

    hi all,
    i read somewhere here that in order to resize column width in a report, you need to go to report attributes, then edit the column you wish to resize and then go to the CSS Style and place something like "width=600px". while this works very well in Internet Explorer, it somehow has no effect in Firefox 3.0. is there a way to make it work both browsers?
    thanks
    allen

    Hi,
    Sorry, I misunderstood. There are several methods you could use:
    1 - Use the span tags around the data itself - this would require adding the tags into the sql statement itself
    2 - Use javascript to set the column widths by adding a style to the TD tags for each cell
    3 - Create a new Report Template and use COL tags immediately after the TABLE tag in the Before Rows section to specify the widths of all columns
    Option 3 may be the easiest?
    Andy

  • 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>

Maybe you are looking for