Auto-Repeating Layouts: Printing a Table's Rows Across and Down

Hi All,
I am trying to do the following: I have a VO that i currently display in an Advanced Table on my page. However, the table displays the rows like this:
<Row 1>
<Row 2>
<Row 3>
<Row 4>
And so on. My customer has required something like this:
<Row 1> <Row 2>
<Row 3> <Row 4>
My question is: is this even possible? I have been toying around with rowLayout, tableLayout and CellFormat but i haven't found a combination that displays the above layout. Do you know a way of doing it?
Thanks for the time!
Thiago

Hi All,
I am trying to do the following: I have a VO that i currently display in an Advanced Table on my page. However, the table displays the rows like this:
<Row 1>
<Row 2>
<Row 3>
<Row 4>
And so on. My customer has required something like this:
<Row 1> <Row 2>
<Row 3> <Row 4>
My question is: is this even possible? I have been toying around with rowLayout, tableLayout and CellFormat but i haven't found a combination that displays the above layout. Do you know a way of doing it?
Thanks for the time!
Thiago

Similar Messages

  • Auto-repeating Layout problem

    Hi all,
    I am having issues when to create an auto-repeating layout and was hoping someone may be able to point me in the right direction.
    I have a parent VO called QuestionsVO and a child VO called linesVO. I have also created a VL linked on questionId, QuestionsToLinesVL. I have then added both view objects to the AM and created the parent/child structure in my OA page as detailed in the user guide, specifying the ‘child view instance, child view attribute and view link instance’ for each.
    I notice that when I add the VO’s to the AM it can be done in one of two ways, either separately or as the child via the parent and VL. Done through the VL all responses appeared under all questions, done separately the questions do not appear at all. I assume that the first way is the correct way as this allows the link to be associated with the AM however I was expecting the link to ensure that only the related responses appear under each question.
    I have not written any java code, I have not even needed to initialise the VO’s. Does anyone have any thoughs on what I am doing wrong?
    Any help would be much appreciated,
    Mike

    Hi, thanks for helping me out!
    I tried to use anchors, but they had no effect when connecting top of 3 to bottom of 2, got the same layout.
    I then tried to create frames with vertical elasticity expand around both rep frame 2 and rep frame 3, and it seems to do the job.
    - Repeating Frame1 - gives 1 record, contains all other frames, variable vertical elasticity
    - - Frame2 - contains all frames beneath - variable vertical elasticity
    - - - Frame3 - variable vertical elasticity
    - - - - some boilerplates
    - - - - Frame 4 - vertical elasticity expand
    - - - - - - Repeating Frame 2 - various number of records, fixed vertical elasticity, height 100
    - - - - Frame 5 - vertical elasticity expand
    - - - - - - Repeating Frame 3 - various number of records, fixed vertical elasticity, height 30
    and so on..
    Thanks again

  • Auto-Repeating Layouts & LOV's

    Hi,
    I am creating an Auto-Repeating Layout with one of the fields being a messageLovInput item. The fields repeat perfectly based on the number of records in the VO, but when n click on the LOV icon the LOV region does not launch, nothing happens.
    Can I use messageLovInput items in a Auto-Repeating Layout? Is there someting I am missing here?
    Any help is highly appreciated.
    Best Regards,
    Andries Hanekom

    HI
    <p>apologies, but now when I click on LOV Javascript errors are generated!
    <p> I don't know why
    <p> what could be wrong here
    <p> can anybody please suggest!
    <p> when I click on javascript icon, it show message
    "value is null or not an object"
    how do I debug this?
    thanks
    - Ejaz

  • DataGrid Moving rows up and down

    I have this function to move rows up in a datagrid , yet i am having problems when it comes to move to rows down. I have tried changing the following line to +1 but it dint work any hints please.
                ac.addItemAt(itemToShift,dg.selectedIndex-1);
    This is the code
    public function up():void
                if(dg.selectedIndex == -1)
                    Alert.show("Select the row which you want to up.");
                    return;
                if(dg.selectedIndex == 0)return;
                var selectedRowInx : Number = dg.selectedIndex;
                var itemToShift : Object = ac.getItemAt(selectedRowInx) as Object;
                ac.addItemAt(itemToShift,dg.selectedIndex-1);
                ac.removeItemAt(dg.selectedIndex);
                dg.invalidateDisplayList();

    Okay.  So, I made the code a little simpler than what I said. With my code, you could have selected a row, clicked a cut button, then selected a another row to past afterwards or whatever.  Here is the code for simply moving the row up and down.
    I added code to catch if the row was at the top or the bottom of the data.  Also, I created two indexes, one for the grid and one for the array collection.  It will probably work with the one index, but I was trying to see if I could do the move on a sorted datagrid, but that is basically pointless.
    protected function moveUpBtn_clickHandler(event:MouseEvent):void
    var upSelectedIndex:int = myDataGrid.selectedIndex;
    // Move Item
    if(upSelectedIndex > -1) {
      if(upSelectedIndex > 0) {
       // Get the selected Object
       var moveObject:Object = myArrayCollection.getItemAt(upSelectedIndex);
       // Get actual Object location if grid is sorted
       var upActualIndex:int = myArrayCollection.getItemIndex(moveObject);
       // Remove selected item at actualIndex
       myArrayCollection.removeItemAt(upActualIndex);
       myArrayCollection.refresh();
       // Move both indexes
       upActualIndex--;
       upSelectedIndex--;
       // insert item at actualIndex
       myDataGrid.dataProvider.addItemAt(moveObject, upActualIndex);
       myArrayCollection.refresh();
       // select grid at selectedIndex
       myDataGrid.selectedIndex = upSelectedIndex;
      } else {
       Alert.show("Item is currently at the top of the list.", "Move Alert",  Alert.OK, this);
    } else {
      Alert.show("No Item Selected.", "Move Alert",  Alert.OK, this);
    protected function moveDownBtn_clickHandler(event:MouseEvent):void
    var downSelectedIndex:int = myDataGrid.selectedIndex;
    if(downSelectedIndex > -1) {
      // Move Item
      if(downSelectedIndex < myArrayCollection.length -1) {
       // Get the selected Object
       var moveObject:Object = myArrayCollection.getItemAt(downSelectedIndex);
       // Get actual Object location if grid is sorted
       var downActualIndex:int = myArrayCollection.getItemIndex(moveObject);
       // Remove selected item at actualIndex
       myArrayCollection.removeItemAt(downActualIndex);
       myArrayCollection.refresh();
       // Move both indexes
       downActualIndex++;
       downSelectedIndex++;
       // insert item at actualIndex
       myDataGrid.dataProvider.addItemAt(moveObject, downActualIndex);
       myArrayCollection.refresh();
       // select grid at selectedIndex
       myDataGrid.selectedIndex = downSelectedIndex;
      } else {
       Alert.show("Item is currently at the bottom of the list.", "Move Alert",  Alert.OK, this);
    } else {
      Alert.show("No Item Selected.", "Move Alert",  Alert.OK, this);
    Here is the blog post with the working DataGrid and Source View
    Message was edited by: DeanLoganBH  - Had to set the Down Move to look for the Length of the ArrayCollection -1, because the DataGrid row starts at 0, it is one less than the total length of the ArrayCollection.

  • My final version of a table with row headers and column footers

    This version is superior to the one I posted yesterday
    as it is better designed and responds to changes in
    size correctly. You can also have a header/footer with
    multiple columns/rows.
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableColumnModel;
    import java.awt.*;
    import java.awt.event.AdjustmentListener;
    import java.awt.event.AdjustmentEvent;
    import java.awt.event.ComponentListener;
    import java.awt.event.ComponentEvent;
    public class HeaderFooterTablePanel extends JPanel {
        static abstract class AbstractHeaderFooterTableModel extends AbstractTableModel {
            public abstract int getRowHeaderColumnCount();
            public abstract Object getRowHeaderValueAt(int rowIndex,
                                                       int columnIndex);
            public abstract int getFooterRowCount();
            public abstract Object getFooterValueAt(int rowIndex,
                                                    int columnIndex);
        static class RowHeaderTableModel extends AbstractTableModel {
            private AbstractHeaderFooterTableModel abstractHeaderFooterTableModel;
            public RowHeaderTableModel(AbstractHeaderFooterTableModel abstractHeaderFooterTableModel) {
                super();
                this.abstractHeaderFooterTableModel = abstractHeaderFooterTableModel;
            public String getColumnName(int column) {
                return "";
            public int getColumnCount() {
                return abstractHeaderFooterTableModel.getRowHeaderColumnCount();
            public int getRowCount() {
                return abstractHeaderFooterTableModel.getRowCount();
            public Object getValueAt(int rowIndex, int columnIndex) {
                return abstractHeaderFooterTableModel.getRowHeaderValueAt(rowIndex, columnIndex);
        static class ColumnFooterTableModel extends AbstractTableModel {
            private AbstractHeaderFooterTableModel abstractHeaderFooterTableModel;
            public ColumnFooterTableModel(AbstractHeaderFooterTableModel abstractHeaderFooterTableModel) {
                super();
                this.abstractHeaderFooterTableModel = abstractHeaderFooterTableModel;
            public String getColumnName(int column) {
                return "";
            public int getColumnCount() {
                return abstractHeaderFooterTableModel.getColumnCount();
            public int getRowCount() {
                return abstractHeaderFooterTableModel.getFooterRowCount();
            public Object getValueAt(int rowIndex, int columnIndex) {
                return abstractHeaderFooterTableModel.getFooterValueAt(rowIndex, columnIndex);
        static class SyncColumnWidths implements TableColumnModelListener {
            private final JTable centerTable;
            private final JTable footerTable;
            public SyncColumnWidths(JTable centerTable,
                                    JTable footerTable) {
                this.centerTable = centerTable;
                this.footerTable = footerTable;
            // Change the column widths of the footer table when the column widths
            // of the center table change.
            public void columnMarginChanged(ChangeEvent e) {
                TableColumnModel centerTableColumnModel = centerTable.getColumnModel();
                TableColumnModel footerTableColumnModel = footerTable.getColumnModel();
                for (int i = 0; i < centerTableColumnModel.getColumnCount(); i++) {
                    int width = centerTableColumnModel.getColumn(i).getPreferredWidth();
                    footerTableColumnModel.getColumn(i).setPreferredWidth(width);
            public void columnSelectionChanged(ListSelectionEvent e) {
            public void columnAdded(TableColumnModelEvent e) {
            public void columnMoved(TableColumnModelEvent e) {
            public void columnRemoved(TableColumnModelEvent e) {
        private JTable centerTable;
        private JTable rowHeaderTable;
        private JTable columnFooterTable;
        public HeaderFooterTablePanel(AbstractHeaderFooterTableModel abstractHeaderFooterTableModel) {
            super();
            // Create the center, rowHeader and columnFooter tables
            centerTable = new JTable(abstractHeaderFooterTableModel);
            rowHeaderTable = new JTable(new RowHeaderTableModel(abstractHeaderFooterTableModel));
            columnFooterTable = new JTable(new ColumnFooterTableModel(abstractHeaderFooterTableModel));
            // Disabled column re-ordering
            centerTable.getTableHeader().setReorderingAllowed(false);
            columnFooterTable.getTableHeader().setReorderingAllowed(false);
            // We are using scroll panes, so no auto resizing of table.
            centerTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            columnFooterTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            // Only allow the user to change the column widths from the center table, not the
            // columnFooter.
            columnFooterTable.getTableHeader().setResizingAllowed(false);
            // When the center table column widths change, change those in the columnFooter table.
            SyncColumnWidths syncColumnWidths = new SyncColumnWidths(centerTable, columnFooterTable);
            centerTable.getColumnModel().addColumnModelListener(syncColumnWidths);
            // Set the width of the row header before adding it to the center scroll pane
            // as the row header.
            Dimension rowHeaderSize = rowHeaderTable.getPreferredScrollableViewportSize();
            rowHeaderSize.width = rowHeaderTable.getPreferredSize().width;
            rowHeaderTable.setPreferredScrollableViewportSize(rowHeaderSize);
            rowHeaderTable.setRowHeight(centerTable.getRowHeight());
            // Create the center scroll pane and set the row header table as the row header.
            final JScrollPane centerScrollPane = new JScrollPane(centerTable);
            centerScrollPane.setRowHeaderView(rowHeaderTable);
            // We will handle horizontal scrolling with our own scrollbar.
            centerScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            // Now we create the panel to hold the columnFooter table and the horizontal
            // scrollbar.
            final JPanel columnFooterPanel = new JPanel(new BorderLayout());
            // Keep the space below the row header empty.
            Component westGlue = Box.createHorizontalStrut(rowHeaderSize.width);
            // Set height of the columnFooterTable before adding it to the columnFooter scroll pane
            // as the view.
            Dimension columnFooterSize = columnFooterTable.getPreferredScrollableViewportSize();
            columnFooterSize.height = columnFooterTable.getPreferredSize().height;
            columnFooterTable.setPreferredScrollableViewportSize(columnFooterSize);
            columnFooterTable.setRowHeight(centerTable.getRowHeight());
            // The scroll pane which holds the columnFooterTable.
            final JScrollPane columnFooterScrollPane = new JScrollPane(columnFooterTable);
            // We do our own horizontal scrolling and the columnFooterScrollPane never scrolls vertically.
            columnFooterScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            columnFooterScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
            // The scrollbar we use to scroll horizontally.
            final JScrollBar horizontalScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
            // Sync up all the scrolling. See the method for details.
            syncScrolling(centerScrollPane, horizontalScrollBar, columnFooterScrollPane);
            // Keep the space below the vertical scrollbar empty.
            final JScrollBar verticalScrollBar = centerScrollPane.getVerticalScrollBar();
            int verticalScrollBarWidth = verticalScrollBar.getPreferredSize().width;
            final Component eastGlue = Box.createHorizontalStrut(verticalScrollBarWidth);
            // Set the center viewport size to match to table size
            Dimension centerTablePreferredsize = centerTable.getPreferredSize();
            centerTable.setPreferredScrollableViewportSize(centerTablePreferredsize);
            centerScrollPane.getViewport().setSize(centerTablePreferredsize);
            // The panel that holds the columnFooterTable and the horizontal scrollbar below it.
            final JPanel footerPanel = new JPanel(new BorderLayout());
            footerPanel.add("North", columnFooterScrollPane);
            footerPanel.add("South", horizontalScrollBar);
            footerPanel.setMinimumSize(footerPanel.getPreferredSize());
            // Assemble our columnFooterPanel.
            columnFooterPanel.add("West", westGlue);
            columnFooterPanel.add("Center", footerPanel);
            columnFooterPanel.add("East", eastGlue);
            // This keeps the columnFooterPanel at its minimum height
            JPanel northPanel = new JPanel(new BorderLayout());
            northPanel.add("North", columnFooterPanel);
            // Assemble the center scroll pane, below it the panel containing the column
            // footer panel, and then vertical glue to eat up any available vertical space.
            Box box = Box.createVerticalBox();
            box.add(centerScrollPane);
            box.add(northPanel);
            box.add(Box.createVerticalGlue());
            // Hide/show the eastGlue and the horizontalScrollBar, and recalculate the
            // minimum size of the footerPanel in response to size and visibility changes.
            syncScrollBarVisibility(centerScrollPane, eastGlue, horizontalScrollBar, footerPanel);
            setLayout(new BorderLayout());
            add("Center", box);
        private void syncScrollBarVisibility(final JScrollPane centerScrollPane,
                                             final Component eastGlue,
                                             final JScrollBar horizontalScrollBar,
                                             final JPanel footerPanel) {
            // Hide/show the eastGlue accoring to whether or not the vertical scrollbar
            // is visible.
            centerScrollPane.getVerticalScrollBar().addComponentListener(new ComponentListener() {
                private void checkVisibleStatus(boolean b) {
                    if (eastGlue.isVisible() != b) {
                        eastGlue.setVisible(b);
                public void componentHidden(ComponentEvent e) {
                    checkVisibleStatus(false);
                public void componentMoved(ComponentEvent e) {
                public void componentResized(ComponentEvent e) {
                public void componentShown(ComponentEvent e) {
                    checkVisibleStatus(true);
            // Hide/show the horizontal scrollbar according to whether or not it's needed.
            centerScrollPane.getViewport().addComponentListener(new ComponentListener() {
                public void componentHidden(ComponentEvent e) {
                public void componentMoved(ComponentEvent e) {
                public void componentResized(ComponentEvent e) {
                    int centerScrollPaneWidth = centerScrollPane.getViewport().getSize().width;
                    int centerTablePreferredWidth = centerTable.getPreferredSize().width;
                    if (centerScrollPaneWidth >= centerTablePreferredWidth) {
                        horizontalScrollBar.setVisible(false);
                    } else {
                        horizontalScrollBar.setVisible(true);
                public void componentShown(ComponentEvent e) {
            // Set the minimum size of the footerPanel according to whether or not the
            // horizontalScrollBar is visible.
            horizontalScrollBar.addComponentListener(new ComponentListener() {
                public void componentHidden(ComponentEvent e) {
                    footerPanel.setMinimumSize(footerPanel.getPreferredSize());
                public void componentMoved(ComponentEvent e) {
                public void componentResized(ComponentEvent e) {
                public void componentShown(ComponentEvent e) {
                    footerPanel.setMinimumSize(footerPanel.getPreferredSize());
        private void syncScrolling(final JScrollPane centerScrollPane,
                                   final JScrollBar columnFooterScrollBar,
                                   final JScrollPane columnFooterScrollPane) {
            // When the view of the center scroll pane changes position,
            // change the value of the columnFooterScrollBar to match.
            centerScrollPane.getViewport().addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    int x = ((Component) e.getSource()).getLocation().x * -1;
                    JViewport viewport = (JViewport) e.getSource();
                    int extentWidth = viewport.getExtentSize().width;
                    int viewWidth = viewport.getViewSize().width;
                    int value = Math.max(0, Math.min(viewport.getViewPosition().x, viewWidth - extentWidth));
                    columnFooterScrollBar.setValues(value, extentWidth, 0, viewWidth);
            // When the columnFooterScrollBar (horizontal scroll bar) value changes,
            // change the position of the view in the center scroll pane to match.
            columnFooterScrollBar.addAdjustmentListener(new AdjustmentListener() {
                public void adjustmentValueChanged(AdjustmentEvent e) {
                    JViewport viewport = centerScrollPane.getViewport();
                    viewport.setViewPosition(new Point(e.getValue(), viewport.getViewPosition().y));
                    viewport = columnFooterScrollPane.getViewport();
                    viewport.setViewPosition(new Point(e.getValue(), viewport.getViewPosition().y));
            // When the view of the row header changes position,
            // change the value of the vertical scrollbar of the center
            // scroll pane to match.
            centerScrollPane.getRowHeader().addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    JViewport viewport = (JViewport) e.getSource();
                    int extentHeight = viewport.getExtentSize().height;
                    int viewHeight = viewport.getViewSize().height;
                    int value = Math.max(0, Math.min(viewport.getViewPosition().y, viewHeight - extentHeight));
                    centerScrollPane.getVerticalScrollBar().setValues(value, extentHeight, 0, viewHeight);
        public JTable getCenterTable() {
            return centerTable;
        public JTable getRowHeaderTable() {
            return rowHeaderTable;
        private JTable getColumnFooterTable() {
            return columnFooterTable;
        public static void main(String[] args) {
            AbstractHeaderFooterTableModel tableModel = new AbstractHeaderFooterTableModel() {
                public int getRowCount() {
                    return 25;
                public int getColumnCount() {
                    return 10;
                public Object getValueAt(int rowIndex, int columnIndex) {
                    return "Cell " + rowIndex + ":" + columnIndex;
                public String getColumnName(int column) {
                    return "Column #" + column;
                public Object getRowHeaderValueAt(int rowIndex, int columnIndex) {
                    return "Header " + rowIndex + ":" + columnIndex;
                public int getRowHeaderColumnCount() {
                    return 2;
                public Object getFooterValueAt(int rowIndex, int columnIndex) {
                    return "Footer " + rowIndex + ":" + columnIndex;
                public int getFooterRowCount() {
                    return 3;
            JFrame frame = new JFrame();
            HeaderFooterTablePanel tablePanel = new HeaderFooterTablePanel(tableModel);
            // Render the cells in the row header and footer like the center table column headers.
            TableCellRenderer columnRenderer = tablePanel.getCenterTable().getTableHeader().getDefaultRenderer();
            tablePanel.getRowHeaderTable().setDefaultRenderer(Object.class, columnRenderer);
            tablePanel.getColumnFooterTable().setDefaultRenderer(Object.class, columnRenderer);
            frame.getContentPane().add("Center", tablePanel);
            frame.setSize(300, 300);
            frame.setLocation(300, 200);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }

    i was wondering why this topic has NO replies! and then i realized that there is NO question??? so do you have a question, or are you just starting a new thread cuz you feel like it???
    just trying to work out why you didnt post this is the old thread???
    http://forum.java.sun.com/thread.jspa?threadID=5130131&messageID=9466400#9466400

  • Read only af:table first row select and focus on form load

    I use a read only af:table in my page. When my page loads and I click on my table, then I can use up / down arrow keys to navigate in my table's rows. But if I don't click on the table, I can't navigate in my table's rpws.
    What can do in my page to give the first focus to my table's first row and navigate in my rows without using mouse clicks....
    findElementById function in javascript does not work in jdeveloper 11...
    Do you help me for this?
    Thanks..

    Hi,
    actually findElementById does work, but you should use the ADF client side framework for this. Add a clientListener to the component that intercepts the keyboard usage and make it callin the next record on the table.
    I'll take a note for a how-to to put on my blog as I don't have the code ready. However, its possible this way
    Frank

  • Af:Table retains rows selected and selection listener doesnt work

    Hi
    I have a table with a list of objects passed to it to be rendered. When the user selects an object and clicks on the launch button above the table, it launches a new page and on the new page when the user clicks on cancel it brings back to the same page where the table is present. While coming back to this page, the row that was earlier selected by the user is highlighted and a click on the same row doesnt enable the selection listener. I have to click on some other row and then click the old row if I want to relaunch the old page
    <af:table var="row" rowBandingInterval="0" id="tblProcedures" emptyText="#{dbProcedureMsg.TABLE_EMPTY_TEXT}"
    summary="#{dbProcedureMsg.TABLE_SUMMARY_TEXT}"
    value="#{pageFlowScope.db_provisioning_DeploymentProcedurePageModel.collectionModel}" filterVisible="false"
    columnStretching="column:colDescription" rowSelection="single" width="99.7%"
    selectionListener="#{pageFlowScope.db_provisioning_DeploymentProcedurePageModel.processSelection}">
    There is one more table which behaves the same way. But other tables which are part of my application work correctly.
    Any idea on what I might be doing wrong ?
    Thanks in advance

    Hi,
    To be honest Million rows in excel its questionable for me
    I would try to find alternate solution rather than killing ADF on client and then your DBA will call you for a urgent meeting. Even if you make it work with ADF, people will not going use it due to huge amount of data load.
    What you can do is to call external report like Jasper, BIRT etc. etc. and provide option there to export to Excel based on your criteria (but million rows is again questionable)
    OR
    one idea is to give option at client side to request a report with button at af:TABLE toolbar ...then you can schedule a job at database server level using PL/SQL dbms_scheduler package with OS script to generate text file on server and FTP it to some machine.
    Hope it help,
    ZB

  • Front Row up and down now nothing..

    Hey All
    I brought a brand new MacBookPro last week and all is good. Front Row worked ok at the start then i noticed a few probs a few days later.. I clicked the menu button and it wouldnt open.. id move the laptop into another room and it would work.. this happened for a while and was very up and down connecting to FR....now when i click menu i get nothing..
    I dont see any IR receiver tab to click and unclick in prefs>Security, heck the IR doesnt show up in System Profiler under usb.. my isight cam works perfectly. I have repaired permissions as i do all the time but to no avail..
    how can i fix this? any tips? Surely i dont need a new battery after a week? ive hardly used it.. the thing is brand new..
    any help would be appreciated.

    well i had to call apple tonight for peace of mind.. we ran a series of tests, zapping pram, trying out a new account etc and the IR Receiver is deader than a do do, i know the remote works because i held it up to the camera in isight and saw the dot flashing.. anyway im taking it to my local apple dealer tomorrow to get fixed.. a one week old macbook pro and this happens.. how does it happen on a brand new machine? very strange!

  • My version of a table with row headers and column footers

    I checked the web and some java books over the
    weekend. Didn't find any examples so I'm
    probably not the only one wanting this.
    Here's my version:
    import javax.swing.*;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableColumnModel;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class RowHeaderColumnFooterTableExample extends JFrame {
        private static class TableDataModel extends AbstractTableModel {
            public TableDataModel() {
                super();
            public String getColumnName(int column) {
                return "Column #" + column;
            public Object getRowHeader(int rowIndex) {
                return "Row #" + rowIndex;
            public Object getRowFooter(int columnIndex) {
                return "Footer #" + columnIndex;
            public int getColumnCount() {
                return 25;
            public int getRowCount() {
                return 25;
            public Object getValueAt(int rowIndex, int columnIndex) {
                return "Cell " + rowIndex + ":" + columnIndex;
        private static class RowHeaderTableModel extends AbstractTableModel {
            private TableDataModel tableDataModel;
            public RowHeaderTableModel(TableDataModel tableDataModel) {
                super();
                this.tableDataModel = tableDataModel;
            public String getColumnName(int column) {
                return "";
            public int getColumnCount() {
                return 1;
            public int getRowCount() {
                return tableDataModel.getRowCount();
            public Object getValueAt(int rowIndex, int columnIndex) {
                return tableDataModel.getRowHeader(rowIndex);
        private static class FooterTableModel extends AbstractTableModel {
            private TableDataModel tableDataModel;
            public FooterTableModel(TableDataModel tableDataModel) {
                super();
                this.tableDataModel = tableDataModel;
            public String getColumnName(int column) {
                return tableDataModel.getRowFooter(column).toString();
            public int getColumnCount() {
                return tableDataModel.getColumnCount();
            public int getRowCount() {
                return 0;
            public Object getValueAt(int rowIndex, int columnIndex) {
                throw new RuntimeException("This model holds column names only - no values.");
        private static class SyncColumnWidths implements TableColumnModelListener {
            private final JTable centerTable;
            private final JTable footerTable;
            public SyncColumnWidths(JTable centerTable,
                                    JTable footerTable) {
                this.centerTable = centerTable;
                this.footerTable = footerTable;
            // Change the column widths of the footer table when the column widths
            // of the center table change.
            public void columnMarginChanged(ChangeEvent e) {
                TableColumnModel centerTableColumnModel = centerTable.getColumnModel();
                TableColumnModel footerTableColumnModel = footerTable.getColumnModel();
                for (int i = 0; i < centerTableColumnModel.getColumnCount(); i++) {
                    int width = centerTableColumnModel.getColumn(i).getPreferredWidth();
                    footerTableColumnModel.getColumn(i).setPreferredWidth(width);
            public void columnSelectionChanged(ListSelectionEvent e) {
            public void columnAdded(TableColumnModelEvent e) {
            public void columnMoved(TableColumnModelEvent e) {
            public void columnRemoved(TableColumnModelEvent e) {
        public RowHeaderColumnFooterTableExample() {
            super();
            // Create the main table data model
            TableDataModel tableDataModel = new TableDataModel();
            // Create the center, rowHeader and footer tables
            final JTable centerTable = new JTable(tableDataModel);
            final JTable rowHeaderTable = new JTable(new RowHeaderTableModel(tableDataModel));
            final JTable footerTable = new JTable(new FooterTableModel(tableDataModel));
            // Render the cells in the row header like the column headers.
            rowHeaderTable.setDefaultRenderer(Object.class, new JTableHeader().getDefaultRenderer());
            // Disabled column re-ordering
            centerTable.getTableHeader().setReorderingAllowed(false);
            footerTable.getTableHeader().setReorderingAllowed(false);
            // We are using scroll panes, so no auto resizing of table.
            centerTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            footerTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
            // Only allow the user to change the column widths from the center table, not the
            // footer.
            footerTable.getTableHeader().setResizingAllowed(false);
            // When the center table column widths change, change those in the footer table.
            SyncColumnWidths syncColumnWidths = new SyncColumnWidths(centerTable, footerTable);
            centerTable.getColumnModel().addColumnModelListener(syncColumnWidths);
            // Set the width of the row header before adding it to the center scroll pane
            // as the row header.
            Dimension rowHeaderSize = rowHeaderTable.getPreferredScrollableViewportSize();
            rowHeaderSize.width = rowHeaderTable.getPreferredSize().width;
            rowHeaderTable.setPreferredScrollableViewportSize(rowHeaderSize);
            rowHeaderTable.setRowHeight(centerTable.getRowHeight());
            // Create the center scroll pane and set the row header table as the row header.
            final JScrollPane centerScrollPane = new JScrollPane(centerTable);
            centerScrollPane.setRowHeaderView(rowHeaderTable);
            // We will handle horizontal scrolling with our own scrollbar.
            centerScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            // Now we create the panel to hold the footer table and the horizontal
            // scrollbar.
            JPanel footerPanel = new JPanel(new BorderLayout());
            // Keep the space below the row header empty.
            Component westStrut = Box.createHorizontalStrut(rowHeaderSize.width);
            // Set height of the footer table before adding it to the footer scroll pane
            // as the view.
            Dimension footerSize = footerTable.getPreferredScrollableViewportSize();
            footerSize.height = footerTable.getPreferredSize().height;
            footerTable.setPreferredScrollableViewportSize(footerSize);
            footerTable.setRowHeight(centerTable.getRowHeight());
            // The scroll pane which holds the footer table.
            final JScrollPane footerScrollPane = new JScrollPane(footerTable);
            // We do our own horizontal scrolling and the footer never scrolls vertically.
            footerScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            footerScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
            // The scrollbar we use to scroll horizontally.
            final JScrollBar footerScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
            // The panel that holds the footer table and the horizontal scrollbar below it.
            JPanel footerCenterPanel = new JPanel(new GridLayout(2, 0));
            footerCenterPanel.add(footerScrollPane);
            footerCenterPanel.add(footerScrollBar);
            // Sync up all the scrolling. See the method for details.
            syncScrolling(centerScrollPane, footerScrollBar, footerScrollPane);
            // Keep the space below the vertical scrollbar empty.
            JScrollBar verticalScrollBar = centerScrollPane.getVerticalScrollBar();
            int verticalScrollBarWidth = verticalScrollBar.getPreferredSize().width;
            Component eastStrut = Box.createHorizontalStrut(verticalScrollBarWidth);
            // Assemble our footer Panel.
            footerPanel.add("West", westStrut);
            footerPanel.add("Center", footerCenterPanel);
            footerPanel.add("East", eastStrut);
            // Final assembly.
            Container contentPane = getContentPane();
            contentPane.setLayout(new BorderLayout());
            contentPane.add("Center", centerScrollPane);
            contentPane.add("South", footerPanel);
        private void syncScrolling(final JScrollPane centerScrollPane,
                                   final JScrollBar footerScrollBar,
                                   final JScrollPane footerScrollPane) {
            // When the view of the center scroll pane changes position,
            // change the value of the footer scrollbar to match.
            centerScrollPane.getViewport().addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    int x = ((Component) e.getSource()).getLocation().x * -1;
                    JViewport viewport = (JViewport) e.getSource();
                    int extentWidth = viewport.getExtentSize().width;
                    int viewWidth = viewport.getViewSize().width;
                    int value = Math.max(0, Math.min(viewport.getViewPosition().x, viewWidth - extentWidth));
                    footerScrollBar.setValues(value, extentWidth, 0, viewWidth);
            // When the footer scroll bar (horizontal scroll bar) value changes,
            // change the position of the view in the center scroll pane to match.
            footerScrollBar.addAdjustmentListener(new AdjustmentListener() {
                public void adjustmentValueChanged(AdjustmentEvent e) {
                    JViewport viewport = centerScrollPane.getViewport();
                    viewport.setViewPosition(new Point(e.getValue(), viewport.getViewPosition().y));
                    viewport = footerScrollPane.getViewport();
                    viewport.setViewPosition(new Point(e.getValue(), viewport.getViewPosition().y));
            // When the view of the row header changes position,
            // change the value of the vertical scrollbar of the center
            // scroll pane to match.
            centerScrollPane.getRowHeader().addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    JViewport viewport = (JViewport) e.getSource();
                    int extentHeight = viewport.getExtentSize().height;
                    int viewHeight = viewport.getViewSize().height;
                    int value = Math.max(0, Math.min(viewport.getViewPosition().y, viewHeight - extentHeight));
                    centerScrollPane.getVerticalScrollBar().setValues(value, extentHeight, 0, viewHeight);
        public static void main(String[] args) {
            RowHeaderColumnFooterTableExample rowHeaderColumnFooterTableExample = new RowHeaderColumnFooterTableExample();
            rowHeaderColumnFooterTableExample.setSize(300, 300);
            rowHeaderColumnFooterTableExample.setLocation(300, 200);
            rowHeaderColumnFooterTableExample.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            rowHeaderColumnFooterTableExample.setVisible(true);
    }null
    Message was edited by:
    NY_Consultant
    Message was edited by:
    NY_Consultant

    Just for reference, you can also check here for a RowHeader example
    http://www.crionics.com/products/opensource/faq/swing_ex/JTableExamples1.html
    and here for a column footer (or total row)
    http://www.crionics.com/products/opensource/faq/swing_ex/JTableExamples3.html
    as well as numerous other useful ideas. The source can also be found at
    http://www.physci.org/codes/tame/
    though without the screen shots.

  • Advance Table - Add Row button and coloumn issue

    Hi all,
    I have created Advanced Table wth four coloumns.
    for two columns item style as messagtextinput and the rest are same as DATE.
    But when the page is rendering the table columns shows as messagestyletext , which means messagetextinput style item is not appearing.
    Kindly help me if am missed anything wrong.
    and also can u help me to create add row button featurs in advance table
    Thanks in advance.
    Senthur

    Senthur,
    I hv done this using row status initialised.I couldnt get the above lines.
    I have another doubt also. In Advanced table there is coloumn header, is there any Row header.There is nothing as such RowHeader. Let me know ur exact requirement.
    Name age salary
    empid1 xxx 21 100
    empid2 yyy 22 200Create a VO which return the above attributes and attach the same to the Adavanced Table Bean.
    Regards,
    Gyan

  • How to move rows up and down on a SharePoint List Item

    Hello,
    I have created a simple Project Plan Template for my team using a SharePoint list.
    I have listed a sample below:
         Date  
                                Tasks        
                                               Owner
    03/09/14                             Gather requirement                        
        X
    05/09/14                             Develop                          
                          Y
    07/09/14                             Deploy                          
                            Y
    Currently there is no functionality in the template to add another task to update the Plan. eg: I want to add another task with a due date 04/09/14 to confirm requirements.
    So basically I want to be able to add an item (task) towards the end and then move it to desired position depending on the due date.
    Please suggest how this can be implemented without complex code changes as I am new to working with SharePoint.
    Many Thanks in advance,
    BH

    Hi ,
    Thanks for the response.
    But I am looking to move the rows in a particular list A and not between 2 separate list items A and B according to the date.
    List Project A has separate tasks defined which needs to accomplished in a timely manner for the project to complete on schedule.
    I want to be able to move these tasks which are in a table on the SharePoint List.
    Hope this is clear.
    Please let me know if you have suggestions for this.
    -BH

  • Moving datagrid rows up and down

    I have a datagrid and I want to be able to move one row at a time, up or down. What would be the best way to make this happen? Is there a built in function for this?
    I currently want to be able to select a row and then push an up or down button to move it. Could I just take the dataProvider and get the items current index and do an addItemAt(new index);
    Thanks for your help.

    Hi,
    I have written this code simply for the up. You can write similarly for the down. Pls check this code.Let  me know if you have any issue.
    MainApplication.mxml
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            [Bindable]
            private var ac : ArrayCollection = new ArrayCollection([
            {name : 'Smith',age : '45'},
            {name : 'Jake',age : '44'},
            {name : 'Carls',age : '43'},
            {name : 'Robert',age : '33'},
            public function up():void
                if(dg.selectedIndex == -1)
                    Alert.show("Select the row which you want to up.");
                    return;
                if(dg.selectedIndex == 0)return;
                var selectedRowInx : Number = dg.selectedIndex;
                var itemToShift : Object = ac.getItemAt(selectedRowInx) as Object;
                ac.addItemAt(itemToShift,dg.selectedIndex-1);
                ac.removeItemAt(dg.selectedIndex);
                dg.invalidateDisplayList();
        ]]>
    </mx:Script>
       <mx:DataGrid id="dg" width="350" dataProvider="{ac}">
          <mx:columns>
             <mx:DataGridColumn dataField="name" />
             <mx:DataGridColumn dataField="age" />
          </mx:columns>
       </mx:DataGrid>
    <mx:Button label="Up the Row" click="up()"/>
    </mx:Application>

  • Printing the table

    Hi,
        I have requirement like without touching driver program that means using perform,form routines i have to call table data in print program.
    that means in the external program using form routines i have to print the table data rows and columns. like this:
                    vbeln           erdat            netwr      posnr      matnr
                    111111111  11/12/2006    345.00   1313111   13141
                    111111112  12/12/2006    345.00   1313112   13142
                    etc.
    Can any one tell me this?.

    ur data is in internal table....Using perform <routinue> using <internaltable>....Inside this perform u can display the data according to ur format...

  • Move over the table rows using the up and down arrows using the javascript

    i had a dynamically generated html table in jsp .
    i need to move over the rows up and down .
    when the up and down arrow keys are pressed Highlight the row and after moving when i press the enter key other required page is to be displayed .
    please help me as soon as possible what events are to be used for the arrow keys and Highlight the row

    i got the code for it
    if (navigator.appName == "Microsoft Internet Explorer") {     
         document.onkeydown = processKeys;
    } else {
         document.onkeypress = processKeys;
    function processKeys(e) {  
         var keyID = (window.event) ? event.keyCode : e.keyCode;
         switch (keyID){
         // Key up.
         case 38:
              if (parseInt(currentRow) == parseInt(0)) {
                   // reached the top of the table; do nothing.
                   return true;
              } else {
                   // move one row up.
                   currentRow = parseInt(currentRow - 1);
                   setCurrentRow (currentRow, currentRow + 1);
                   return false;
              break;
         // Key down.
         case 40:
              if (currentRow == (numRows - 1)) {
                   return true;
              } else {          
                   currentRow++;
                   setCurrentRow (currentRow, (currentRow - 1));
    if (currentRow > VISIBLE_ROWS) {
    return true;
    } else {
                   return false;
              break;
         // enter key     
         case 13:
              var curRowId = boardMemberListTable.rows[currentRow].id;          
              return false;
              break;
    //onclick
    function selectRow(row) {
         inQuad3Edit = false;
         searching = false;
         var eleTableRows = boardMemberListTable.getElementsByTagName("tr");
         for (var i = 0; i < eleTableRows.length; i++) { 
              if (eleTableRows.id != row.id){
                   eleTableRows[i].className = "board-row-normal";
              } else {
                   currentRow = i;          
         row.className = "board-row-sel";

  • Table ActiveX Library control with buttons + - Up and Down

    Hi all,
    I have seen an ActiveX control in the Library of the Adobe Layout. It can be added to the Table. I gives me four buttons + (add row), - (delete row), up and down to move the fields up and down.
    I cannot find this Control. Can you please guide me where to find it in the Library.
    Thanks,
    FS

    I think I do not need to write any Code for this Control.

Maybe you are looking for

  • Need to re-install iTunes

    I have a problem with my iTunes, everytime I try to sync my iPhone 4 it says "backing up" and doesn't seem to progress anymore. I need to cancel the sync everytime because it just doesn't do anything and then I need to end iTunes through Windows Task

  • Avoid Depreciation for particular asset

    Sir , Is there any possibility to avoid to run depreciation for particular or specified assets. Tamil Selvan.

  • Automatic payments with no Business Area aggregation

    Hello, I am trying to run an automatic payment program for one vendor and the system splits the open items by Business area. But I donu2019t want that. I would like to aggregate line items in one, if my payment is just one. I've check my customizatio

  • How do I revert to the default printer settings? I'm stuck on 4 sheets per page.

    I selected 4 sheets per page for a job a few days ago.  Since then, every time I go to print from Reader, 4 sheets per page shows up as the default.  I have to manually change it to "custom" with 1 by 1 and then it will print normally (1 sheet per pa

  • Debugging in ecc6

    hai i am using ecc6 and when i am going in debugging mode it is going into exclusive session even after prgram exectuion the debug session is on , is there any setting so that once the proram executed the debug session closes thanx in advance reagrds