Horizontal Scroll in TableView cell

Hi,
I'm creating an app where I will be displaying data in a tableview. I need to be able to show a variable amount of data which is stored in a mutable array (I was thinking in the forms of labels) and have it all in one cell. The table itself also needs to scroll vertically. I currently am loading the cells from a nib file but I can change that if need be. Any suggestions on how to implement some kind of horizontal scrolling or how to display the data would be really appreciated.
Thanks,
Erin

Hey Erin - Thanks for posting your solution!! Do you think you could help with this thread: [http://discussions.apple.com/thread.jspa?threadID=2127252&tstart=0]?
\- Ray

Similar Messages

  • TableView and horizontal scroll bar

    Hi
    I need to show horizontal scroll bar in my TableView - there are many columns in my view. I tried to put it into the ScrollPane but it takes no any effect.. Is there any ability to make scrollable treeview via FXML layout file?
    My code is
    <ScrollPane fitToHeight="true" fitToWidth="true" hbarPolicy="ALWAYS" VBox.vgrow="ALWAYS">
    <content>
    <TableView fx:id="resultsTbl">
    <columns>
    <TableColumn text="col 1" prefWidth="60" />
    <TableColumn text="col 2" prefWidth="60" />
    <TableColumn text="col 3" prefWidth="130" />
    ........cut....
    </columns>
    <items>
    </items>
    </TableView>
    </content>
    </ScrollPane>
    Thanks
    Edited by: 918392 on 02.03.2012 4:51

    OK. If I understand you correctly, you want the table view to fill the scroll pane width when the total column width is less than the scroll pane width, but show a scroll bar when the total column width is greater than the scroll pane width. Is that right? If so, I don't believe that is currently supported. I think there is a feature request for it, but JIRA is down right now so I can't tell for sure.
    Feel free to submit a feature request for this if you like, and we'll mark it as a duplicate if necessary.

  • Start a horizontal scroll in the middle of a table?

    Hello,
    My demanding users are at it again. Although I am learning alot but lest I digress;-) Lets say I have a tableview with 72 columns that is one month for each year spanning over 6 years. No biggie but instead of the horizontal scroll starting at the left most point I would like start the scroll in the middle (say at column 36 or something) of the tableview. So if my tableview starts at 03/2002 in column 1 and goes to 03/2008 in column 72 I want the horizontal scroll to start at 03/2005(current month)in column 36 each time the table is rendered. I am using MVC and the tableview iterator(which I love).
    I was hopeing that I could find something similar to a dropdown i.e. pre-populate a selected value and the dropdown starts at that selection not the top most one. Any one have any ideas where I could begin? I have searched this forum for 'horizontal' and 'scrolling' but no hits.
    TIA,
    Rich

    Hello!
    I gave the example from Thomas Ritter to the JS person here and he got it working. I can't take credit but I wanted to share it with the forum. Basically what happens is that the horizontal scroll will scroll to the right till the date column that is close to the current date. I say close to because some of the columns are in months so if the current date is 21-MAR-05 then the horizontal scroll will scroll right until MAR-05. Either way here is the code. As I said before I take no credit for it. I do have another question though. Anyone have any ideas how to change it so that I can pass it a date and have it scroll there instead of the current date?
    <code>function lockCol(tblID) {
         var table = document.getElementById(tblID);     
         var cTR = table.getElementsByTagName('tr');  //collection of rows
         var coords = { x: 0, y: 0 };
         var now = new Date();
         var strMonthArray = new Array(12);
         strMonthArray[0] = "Jan";
         strMonthArray[1] = "Feb";
         strMonthArray[2] = "Mar";
         strMonthArray[3] = "Apr";
         strMonthArray[4] = "May";
         strMonthArray[5] = "Jun";
         strMonthArray[6] = "Jul";
         strMonthArray[7] = "Aug";
         strMonthArray[8] = "Sep";
         strMonthArray[9] = "Oct";
         strMonthArray[10] = "Nov";
         strMonthArray[11] = "Dec";
         strMonth = strMonthArray[now.getMonth()];
         year = new String(now.getYear());
         var today = now.getDate() + "-" + strMonth + "-" + year.substr(2,2);
         if (table.rows[0].cells[0].className == '') {
              for (i = 1; i < cTR.length; i++) {
                   var tr = cTR.item(i);
                   if(i == 1){
                        tr.cells[0].className = 'firstLocked';
                        innerloop:
                        for (j = 2; j < 100 ; j++) {
                             if(compareDate(today, tr.cells[j].innerText)) {                         
                                  elt = tr.cells[j];
                                  while (elt) {
                                       coords.x += elt.offsetLeft;
                                       elt = elt.offsetParent;
                             break innerloop;
                   else{tr.cells[0].className = 'locked'}
         else {
              for (i = 1; i < cTR.length; i++){
              var tr = cTR.item(i);
              tr.cells[0].className = '';
         document.getElementById('tbl-container').scrollLeft = coords.x - 69;
    function compareDate(date1, date2){
         a = date1.split("-");
         b = date2.split("-");
         day1 = parseInt(a[0]);
         month1 = a[1];
         year1 = a[2];
         day2 = parseInt(b[0]);
         month2 = b[1];
         year2 = b[2];
         if(year1 == year2) {
              if(month1 == month2) {
                   if((day2 >= day1)) {return true;}
                   else {return false;}
              else {return false;}     
         else {return false;}
    }</code>
    Cheers,
    Rich

  • JTabel Horizontal scroll bar problem

    Hi,
    I want a horizontal scroll bar added to my table
    hence I do this
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    but the problem is If I increase the size of frame
    the cells do not resize hence there is a gap after
    the last column.
    How do I remove this gap

    Please reduce the container size in the screen thru SE51 that automatically create the scroll
    or check whether in the attributes of the screen "Hold scroll positio" not to be checked

  • No horizontal scroll bar on the Jtable. In order to see long column.....

    No horizontal scroll bar on the tJable.
    In order to see long cell data we have to eliminate other columns of the table.
    I need an horizontal scroll bar on the JTable if the data in a cell is longer.
    Could somebody help me out?
    Thanks in advance.

    in the jtable use following method :
    myTable.setAutoResizeMode(this.AUTO_RESIZE_OFF);
    KR,
    Jan

  • Horizontal scrolling with captioned images?

    Hey everybody I'm helping a friend with his new site and need help figuring this out:
    - I want to add left-aligned text captions below each of the horizonal scrolling images.
    - I also want the images/captions to automatically resize to fit every window size (as the images currently do) - would be great if the image caption texts would automatically resize and become smaller with smaller window sizes.
    Example here (this is a test without captions): http://briankokoska.com/indextest2.html
    If somebody could please try to code the page including the word "caption" left-aligned underneath each of the images I would be very greatful. This way i can add the proper captions myself.
    Thanks in advance for your help!!!

    Horizontal scrolling and fixed divisions don't work well in mobile devices.
    Try this code in a new, blank document and SaveAs test.html.  This works much better in mobile/tablet devices.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>BRIAN KOKOSKA</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <style>
    margin: 0;
    padding: 0;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    body {
    width: 98%;
    color: #000;
    padding: 0 1%;
    font-size: 125%;
    font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
    header {
    position: fixed;
    top: 0;
    right: 3%;
    margin: 0;
    width: 35%;
    font-weight: bold;
    text-align: right;
    background: rgba(255,255,251,0.5)
    header * { padding-right: 1% }
    header address a {
    padding-top: 25px;
    margin-bottom: 0;
    color: red
    header p { margin-top: 25px; }
    header h2 a {
    color: blue;
    font-size: 75%;
    margin-top: -10px;
    section { display: table; }
    article { display: table-row; }
    /**Captions**/
    article p {
    display: table-cell;
    vertical-align: middle;
    margin: 2%;
    padding: 2%;
    color: red;
    /**re-usable classes**/
    .center { text-align: center }
    .right { text-align: right }
    .red { background: rgba(255,0,0,0.5); }
    .white { background: rgba(204,204,204,0.5) }
    .blue { background: rgba(0,102,204,0.5) }
    /**links**/
    a img { border: none }
    a {
    text-decoration: none;
    color: #000;
    display: block;
    line-height: 2em;
    a:hover, a:active, a:focus { text-decoration: underline }
    /* Special Rules for Mobile, Tablets */
    @media only screen and (max-width: 1024px) {
    body { font-size: 90% }
    img { width: 100% }
    header {
    width: 100%;
    position: static;
    padding: 0.5%
    article p {
    display: block;
    padding: 0;
    font-size: 90%
    </style>
    </head>
    <body>
    <header>
    <h1 class="right">BRIAN KOKOSKA</h1>
    <address>
    <a href="mailto:[email protected]">[email protected] </a>
    </address>
    <h2><a href="http://mfineart.ca/artists/brian-kokoska-selected-works/" target="_blank">Macaulay &amp; Co. Fine Art</a></h2>
    <p class="blue"><a href="http://briankokoska.com/installationviews">INSTALLATION VIEWS</a><p>
    <p class="white"><a href="http://briankokoska.com/selectedworks">SELECTED WORKS</a></p>
    <p class="red"><a href="http://briankokoska.com/info">INFORMATION</a></p>
    </header>
    <section>
    <article>
    <p>Caption goes here...</p>
    <p><a href="http://lvl3gallery.com/post-hope-1262013-2172013/#1" target="_blank">
    <img src="http://briankokoska.com/briankokoska_posthope_smallest.jpg">
    </a> </p>
    <p>Caption goes here...</p>
    <p><a href="http://lvl3gallery.com/post-hope-1262013-2172013/#1" target="_blank">
    <img src="http://briankokoska.com/briankokoska_posthope_smallest2.jpg">
    </a> </p>
    <p>Caption goes here...</p>
    <p><a href="http://voxpopuligallery.org/exhibitions/painting-bitten-by-a-man/" target="_blank">
    <img src="http://briankokoska.com/briankokoska_paintingbittenbyaman_smallest.jpg">
    </a> </p>
    <p>Caption goes here...</p>
    <p><a href="http://voxpopuligallery.org/exhibitions/painting-bitten-by-a-man/" target="_blank">
    <img src="http://briankokoska.com/briankokoska_paintingbittenbyaman_smallest2.jpg">
    </a></p>
    <p> Caption goes here... </p>
    <p>image here</p>
    Etc.....
    </article>
    </section>
    </body>
    </html>
    Nancy O.

  • DataGrid Horizontal Scroll Problem when datagrid contains Item renderer

    I have datagrid with horizontal scroll policy enabled. Grid
    contains some item renderer also.One of the item renderer is
    datefield when i select a date from the datefield and say the
    adjacent cell of the grid also contain datefield itemrenderer
    and i am selecting date from that itemrenderer also.When i
    scroll horizontally the date in the itemrender changes to any one
    of the two itemrenderer.Some time it works fine.I am getting the
    issue for combobox itemrender also.Can any one help me to solve
    this issue.

    "happybrowndog" <[email protected]> wrote in
    message
    news:ge11ag$jdo$[email protected]..
    >
    quote:
    Originally posted by:
    ravi_bharathii
    > I have datagrid with horizontal scroll policy enabled.
    Grid contains some
    > item
    > renderer also.One of the item renderer is datefield when
    i select a date
    > from
    > the datefield and say the adjacent cell of the grid also
    contain datefield
    > itemrenderer
    > and i am selecting date from that itemrenderer also.When
    i scroll
    > horizontally
    > the date in the itemrender changes to any one of the two
    itemrenderer.Some
    > time
    > it works fine.I am getting the issue for combobox
    itemrender also.Can any
    > one
    > help me to solve this issue.
    >
    > Ravi, I am having a similar problem. I subclass a
    TextInput as an
    > itemrenderer for a column in a datagrid. My subclassed
    TextInput checks
    > to see
    > the value in the overriden set() method, and depending
    on the value, sets
    > the
    > background color of the TextInput to green. When the
    datagrid scrolls
    > horizontally, some unrelated cell colors also change
    green and some of the
    > data
    > gets duplicated in the cells. The underlying data
    provider's data is not
    > confused however. Seems the rendering is screwed up when
    the Datagrid
    > scrolls.
    >
    > Did you find a solution to this problem? I think
    Datagrid is a piece of
    > screwed up code.
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
    Q2

  • JList in JScrollPane never shows horizontal scroll bar

    I have a JList inside a JScrollPane. When I add a lot of cells to the list, the vertical scroll bar appears as expected. However, if I add a cell that would require lots of horizontal space in which to render, the horizontal scroll bar never appears.
    Is there a way to make the JList take on the width of the widest rendered cell?
    Josh

    Here's some code that will demonstrate the problem. Run the code, then resize the window so that the horizontal scroll bar should appear.
    Code for jds.toys.Main:
    package jds.toys;
    import javax.swing.DefaultListModel;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    public class Main extends JFrame {
         protected DefaultListModel model;
         public Main()
              super("JList in JScrollPane");
              model = new DefaultListModel();
              model.addElement("A very very very very very very long String");
              model.addElement("A very very very very very very very long String");
              model.addElement("A very very very very very very very very long String");
              model.addElement("A very very very very very very very very very long String");
              model.addElement("A very very very very very very very very very very long String");
              model.addElement("A very very very very very very very very very very very long String");
                      JList list = new JList(model);
                      list.setSize(300,300);
                      list.setFixedCellHeight(30);
                      list.setCellRenderer(new MyCellRenderer());
                      JScrollPane scrollPane = new JScrollPane(list);
                      add(scrollPane);
                      setSize(400,400);
        public static void main(String[] args) throws InterruptedException {
             final Main m = new Main();
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                     m.setVisible(true);
    Code for jds.toys.MyCellRenderer:
    package jds.toys;
    import java.awt.Component;
    import java.awt.Graphics;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.ListCellRenderer;
    public class MyCellRenderer extends JPanel implements ListCellRenderer
         private Object currentValue;
         private JList currentList;
         public MyCellRenderer()
         public Component getListCellRendererComponent(     JList list,
                                             Object value,
                                       int index,
                                       boolean isSelected,
                                       boolean cellHasFocus)
              currentValue = value;
              currentList = list;
              return this;
         public void paintComponent(Graphics g)
              int stringLen = g.getFontMetrics().stringWidth(currentValue.toString());
              int ht = currentList.getFixedCellHeight();
              g.setColor(getBackground());
              g.fillRect(0,0,stringLen,ht);
              g.setColor(getForeground());
              g.drawString(currentValue.toString(),0,ht/2);
    }

  • Disable horizontal scroll in multicolumn listbox

    I'm using a Multicolumn listbox and I programmatically change the cell to be edited using UP, DOWN, RIGHT and LEFT keyboard keys.
    Everything is working exept for the rightmost column: when I press the RIGHT key, the cursor moves to the next cell inside the rightmost column but all the table scrolls to the right (even if not really necessary) preventing the user from seeing the first column (leftmost). Is it possible in some way to lock or totally disable the horizontal scroll?
    Every idea would be welcome.

    I don't think there's a way to completely disable scrolling (once you ask the MCLB to show you a cell, it will probably do whatever it can to show it to you), but you can start by making the scrollbar invisible and by setting the Top Left Visible Cell property to [X, 0] every time you move a cell. If this doesn't work, you should upload your code. We play better when we have what to work with.
    Try to take over the world!

  • WAD - how to get fixed display of colums when horizontal scrolling

    Hi All,
    Is it possible in the Web Application Designer to have the first 2 or 3 columns at a fixed position (meaning no horizontal scroll) while the other columns (next to them) will scroll horizontaly (using the horizontal scroll bar). Like the 'protect' function as you have in Excel.
    Best regards,
    Josh

    Dear Josh,
    basicly there a to options to achieve scrolling with fixed cells:
    1. BW Standard Scrolling
       Use Scrolling function of the Web Template Item, it
       create icon below the table
    2. Use CSS based scroll feature
       like: http://www.imaputz.com/cssStuff/bigFourVersion.html
    search google for "css table scroll"
    Regards Marcus

  • Horizontal scroll Bars not coming in JTable

    Hi,
    If a user streches any column of the jtable to the right such that its values are not visible properly. Then should the horizontal scroll bar come in the scrollpane in which table is there.??
    If Yes then how can I do it?
    I have seen when no of rows becomes more than the display area of the table then vertical scrollbar are coming automatically. but not Horizontal scroll bars.
    Please help

    sorry for my previous mistype, here is the right solutions to your problem.
    As default the JTable will auto resize your column width, if you want horizon scrollbar
    you must do following below steps:
    JTable tableview = new JTable (model) ;
    tableview.setAutoResizeMode (JTable.AUTO_RESIZE_OFF) ;
    JScrollPane scrollpane = new JScrollPane (tableview,
    ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED) ;
    JPanel p ;
    p.add (scrollpane) ;
    This can works for you !

  • Matrix Horizontal Scroll Bar

    When I have too many columns to fit in my matrix I get a horizontal scroll bar (which is good). However, when I refresh my matrix the horizontal scroll positions itself to the right and the first few columns are out of view.
    Is there any way to control this? I did not see any API for this but perhaps there is a workaround?
    (AutoResizeColumns does not help)

    I think the re-drawing is based on where the cursor was last placed within the matrix.
    Try placing the cursor in the first column of the matrix (using the Click method on one of the cells).  When the matrix redraws it should start with the first column.
    John.

  • Help with code for inserting horizontal scroll bar in photo gallery in Business Catalyst site?

    Hi,
    I am using Business Catalyst and Dreamweaver to create a trial site.
    I am not sure if this is the correct forum to post this request but anyway I have inserted a photo gallery module at the bottom of the sidebar in the homepage of my test site.
    Can anyone advise on whether jquery or any other code can be inserted into the page or module code that will replace the "next" hyperlink below the first 4 photos with a horizontal scroll bar at bottom of the gallery so users can just scroll through all 12 images ?
    Kind Regards, Matt.
    http://craftime-bs6.businesscatalyst.com/

    Alyssa,
    Have you tried putting this rule back as it was originally:
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
        left: auto; /*was 9px*/
        color: #EF9CCF;
        background-color: #FFF;
    That is, changing your 9px back to auto.
    And giving  us a link (as you did) is much better than printing out the code for us! Thanks!
    Beth

  • How to read vales from dropdownlistbox placed in tableView Cells

    Hi,
      Thanks for reply.. I got problem of reading values from Dropdownlist box placed in tableView Cells. Please correct me or give some sample to read vales from dropdownlistbox placed in tableView Cells.
    TableView column defined as
            <htmlb:tableViewColumn columnName = "OT_REASON_CODE"
                                   title      = "OT Reason"
                                   type       = "User"
                                   width = "6"
                                   edit       = "true" >
              <htmlb:dropdownListBox id                = "rcode"
                                     table             = "<%= I_YH008 %>"
                                     nameOfKeyColumn   = "OT_REASON_CODE"
                                     nameOfValueColumn = "OT_REASON_DESC" />
            </htmlb:tableViewColumn>
    OnInput processing I am trying to read dorpdown list values selected.
              W_YH022-ENDUZ = TABLE_EVENT->GET_CELL_VALUE(
              ROW_INDEX = SY-TABIX
              COLUMN_INDEX = 3 ).  " Get time
    DATA: data TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
    DATA: value type string.
         value = TABLE_EVENT->GET_CELL_ID( row_index    = SY-TABIX
                                      column_index = '7').  " get Cell ID
    data ?= CL_HTMLB_MANAGER=>GET_DATA(
                                     request = runtime->server->request
                                     name    = 'dropdownlistbox'
                                     id      = value
    IF data IS NOT INITIAL.
    W_YH022-OT_REASON_CODE = data->selection. " +Cell Values...I am not getting cell values here+
    endif.

    Hi:
    Do like this
    Layout
          <htmlb:dropdownListBox id="mydropdownlist" >
            <htmlb:listBoxItem key   = "bpno"
                               value = "Business Partner Details" />
            <htmlb:listBoxItem key   = "bpaddress"
                               value = "Business Partner Address" />
          </htmlb:dropdownListBox>
    OnInpurProcessing event - >
    DATA: lcl_dropdown TYPE REF TO cl_htmlb_dropdownlistbox.
    data : selection2 type string.
    lcl_dropdown ?= cl_htmlb_manager=>get_data(
        request = runtime->server->request
        name    = 'dropdownListBox'
        id      = 'mydropdownlist' ).   
    IF NOT lcl_dropdown->selection IS INITIAL.
      selection2 = lcl_dropdown->selection.
    ENDIF.
    Regards
    Shshi

  • How to get the Horizontal Scroll Bar for a Table?

    Hi All,
    As per my requirement, I am displaying several records in a Screen in a Tabular Format. But here I have to show 21 Columns in that table which is too high. I am able to display it but due to it I am getting a Horizontal scroll bar for the whole screen since all the columns are not getting displayed in the normal window screen space. But its looking too odd since once I am scrolling it to right the columns are getting displayed but the above Header Bar and Global buttons are not displaying, they are bound to the normal screen space.
    Is there a way to have a Horizontal scroll bar only for that table instead of the entire screen so that on scrolling that bar only the table rows will beshifted ant got displayed?
    With Thanks
    Kumar Gautam

    try this approach.
    include a raw text item before and table item.
    include the appropriate HTML tags in raw text item to enable horizontal scroll
    --Prasanna                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • JRockit with -Xmanagement & JBoss 4 does not start

    Hi, I tried to start JBoss 4 with the management console: a fresh JBoss 4, just compiled from source with no special application on it, that starts alright with JRockit without the management console (and also with Sun JVM jdk 1.5). Does anybody know

  • I deleted some photos by mistake, can i get them back?

    i deleted some photos by mistake, is there any way to get them back?

  • Autodiscover Error in Outlook 2010

    Hi Guys; I have users with a problem when tries to configure a OOF or everything have to be with the autodiscover. I ran the Test E-Mail AutoConfiguration and it returned the following screens. If someone have any idea please let me know. I will be t

  • Satellite A300 - no illumination with WXP

    Hi, Excuse me for my bad English. My Toshiba (Sat A300-1EC) OS was changed from Vista to XP. Easy keys, hot keys and illumination stopped operating. Thanks to much information from this forum, I downloaded four drivers from Toshiba Support (Common, H

  • Please anyone help me with this

    Hi guys, Check this out: http://www.large-online.nl/partnerimg/4/436794.jpg How do you remove the letter in photoshop cs5? I wanted it removed while maintaining the hair. please explain me step by step. thank you!