3 Replies Latest reply on Sep 26, 2012 3:05 PM by user475229

    Dynamically adjust table row height based on data in column

      Hi all,

      I'm using JDeveloper and have a requirement for a table to adjust the height of its rows depending on the data in the columns. One of the columns in the table is a rich text description field and I have the 'rows' property set to 13. This field could have twenty lines of text/images or just one. The users would like the page to show all twenty lines of text without having to scroll but the table has the same height for all the rows (that I set to 13) and provides a scroll bar when the data exceeds this size. My users do not like to scroll, and want the height of each row to be determined by the data in it. I looked at a few options and also did a search online, but was unable to find anything to fulfill this requirement. Do you know of how I could change the height of each row in the table so that it fits the data that it holds?

      I have an example of my table at: <b>Table with Set Row Height</b>

      As you see, the picture has to be scrolled so that the whole picture is visible. The user requirement is to adjust the row height to show the full picture. Ideally the next two rows would shrink, but that would be a nice to have.

      Thanks in advance for any pointers or help.
        • 1. Re: Dynamically adjust table row height based on data in column
          Frank Nimphius-Oracle

          the "rows" property doesn't have an effect in rich table. Instead you would need to set the af:table autoHeightRows properties to the number of rows you want to have.

          The number of rows used to size the component height. The default value is -1 (no auto-sizing for any number of rows).

          - The height of the component can grow to a maximum of 'autoHeightRows' after which a scrollbar is displayed.
          - A value of 0 can be used to default the autoHeightRows to the current fetchSize.
          - 'autoHeightRows' value cannot be larger than "fetchSize" attribute.
          -'autoHeightRows' works with contentDelivery=immediate/lazy/whenAvailable.
          - Important: When the component is placed in a layout-managing container, such as panelSplitter, it will be sized by the container (no auto-sizing will occur).

          So you need to dynamically compute the autoHeightRows

          1 person found this helpful
          • 2. Re: Dynamically adjust table row height based on data in column
            Hi Frank,

            Thank you for replying to my question, I truly appreciate your help.

            I tried to use the autoHeightRows to adjust the height of my rows but was unsuccessful. If I understand the autoHeightRows property correctly, this is used for setting the height of the whole table. If this is incorrect and it can be used for setting the height of individual rows in the table, please correct me. I have the 'Rows' property of the richTextEditor set to 13 and this is the height that I would like to make dynamic based on the data.

            My users requirement is for the height to be big enough for the data in each row of the table (the table has a description column and the height of each row should be determined by the data contained in it). I updated my <u><b>Screen Shot</b></u> to show the desired layout and what is currently being generated though ADF (http://www.flickr.com/photos/87583386@N05/) .

            I have three rows in the example (in actuality these are around 50) and the text in each row can vary. The users would like to see the full text/image in each row without having to scroll each row. Currently my table is within Panel Box, which is inside a PanelGroupLayout-Scroll which is in a PanelStretchLayout. I tried to put the table by itself with the autoHeightRow modifications you suggested but thsi did not help either. I am using JDeveloper

            Is this possible with an ADF Table? If it is, is the autoHeight property the only one that I am setting incorrectly? If not, is there another component I can use to get the desired functionality? My users are very strict about this requirement and will not accept the application without this.

            • 3. Re: Dynamically adjust table row height based on data in column
              I found that not setting the number of rows on the rich text field resizes the rows according to the data. I removed the number of rows and my rows are now formatting as needed.