ICEfaces
  1. ICEfaces
  2. ICE-9646

Display issues when using an ace:dataTable in an ace:dialog

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.2.0.GA, EE-3.3.0.GA, EE-3.3.0.GA_P01
    • Fix Version/s: 4.0.BETA, EE-3.3.0.GA_P02, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P2
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      The setting of the width of the dialog seems to help resolve both of these issues.

      Description

      A scrollable ace:dataTable is being used in an ace:dialog. There are a few display issues seen when using these components:

      Issue #1: The dialog is set to be displayed in the center of the view port. On the initial display it is shown up against the left most side of the view port. Closing the dialog and re-opening it positions the dialog correctly. This seems to only be an issue when there is a dataTable in the dialog.

      Issue #2: The scrollable dataTable is initially shown with miss-aligned columns. Upon re-size of the dialog, the columns align correctly. This is also only an issue when used in an ace:dialog and also when an input component (h:commandButton, h:inputText) is in the same dialog.

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case and screen shots of the issue. Note: the icefaces.jar, icefaces-ace.jar, and icefaces-compat.jar need to be added to run the war file.

        Show
        Arran Mccullough added a comment - Attached test case and screen shots of the issue. Note: the icefaces.jar, icefaces-ace.jar, and icefaces-compat.jar need to be added to run the war file.
        Hide
        Arturo Zambrano added a comment -

        I have tried many approaches, but none of them completely solves these issues. It seems that the jQuery UI Dialog widget needs a specific width set in order to make the correct calculations when there's a data table. The reason why things work after resizing the dialog and/or closing the dialog is that a width is explicitly set by the Dialog widget after those events. So, all the approaches so far have been oriented towards pre-calculating a width and set it explicitly.

        Another workaround I found was simply to add a <h:inputText style="visibility:hidden;"/> component as a sibling of the data table. That way all positions and sizes are calculated correctly the first time for some reason. If the inputText is not a sibling of the table, then it doesn't work.

        Show
        Arturo Zambrano added a comment - I have tried many approaches, but none of them completely solves these issues. It seems that the jQuery UI Dialog widget needs a specific width set in order to make the correct calculations when there's a data table. The reason why things work after resizing the dialog and/or closing the dialog is that a width is explicitly set by the Dialog widget after those events. So, all the approaches so far have been oriented towards pre-calculating a width and set it explicitly. Another workaround I found was simply to add a <h:inputText style="visibility:hidden;"/> component as a sibling of the data table. That way all positions and sizes are calculated correctly the first time for some reason. If the inputText is not a sibling of the table, then it doesn't work.
        Hide
        Philip Breau added a comment -
        Show
        Philip Breau added a comment - similar issue: http://jira.icesoft.org/browse/MOBI-908
        Hide
        Arturo Zambrano added a comment - - edited

        Committed fix at revision 38664.

        As mentioned above, when the jQuery UI Dialog widget is initialized with a specific width, the sizes and positions of the table and the dialog are calculated correctly. This also works when setting a percentage width. So, the solution consists in setting a width of 99% when at least one ace:dataTable is found inside the dialog with no explicit width set (including any of it's ancestor nodes). The data table root node has the class .ui-datatable, which is defined with 'width:100%' in datatable.css. So, ace:dataTables try to use as much width as possible, and therefore setting the dialog width to 99% is a good measure (100% makes the dialog be wider than the viewport, which doesn't look good). When there's no ace:dataTable at all inside the dialog, everything works as before (i.e. setting width:auto; ).

        Show
        Arturo Zambrano added a comment - - edited Committed fix at revision 38664. As mentioned above, when the jQuery UI Dialog widget is initialized with a specific width, the sizes and positions of the table and the dialog are calculated correctly. This also works when setting a percentage width. So, the solution consists in setting a width of 99% when at least one ace:dataTable is found inside the dialog with no explicit width set (including any of it's ancestor nodes). The data table root node has the class .ui-datatable, which is defined with 'width:100%' in datatable.css. So, ace:dataTables try to use as much width as possible, and therefore setting the dialog width to 99% is a good measure (100% makes the dialog be wider than the viewport, which doesn't look good). When there's no ace:dataTable at all inside the dialog, everything works as before (i.e. setting width:auto; ).
        Hide
        Arturo Zambrano added a comment -

        Backported fix to 3.3 EE maintenance branch at revision 38723.

        Show
        Arturo Zambrano added a comment - Backported fix to 3.3 EE maintenance branch at revision 38723.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: