[richfaces-issues] [JBoss JIRA] (RF-11551) The scrollbar of rich:extendedDataTable disappears inside rich:tabPanel (switchType=ajax) and problems with switchType=client

Yuriy Pogorzhelskiy (JIRA) jira-events at lists.jboss.org
Fri Aug 31 15:16:33 EDT 2012


    [ https://issues.jboss.org/browse/RF-11551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715219#comment-12715219 ] 

Yuriy Pogorzhelskiy commented on RF-11551:
------------------------------------------

Duplicated: https://issues.jboss.org/browse/RF-12033

Bug is in JavaScript part. 
When EDT is placed on hidden page (tab) parent DIV has attribute display=none, and in this case invocation: this.element.clientWidth returns 0.

Source-code: RichFaces-4.2.2.Final

extendedDataTable.js#updateLayout 
Line 283: var width = Math.max(0, this.element.clientWidth - offsetWidth);
width == 0 and we have this 
Line 307: this.normalPartStyle.display = "none";

Hidden parent is a root cause.

As a workaround i can suggest the next changes
extendedDataTable.js#initialize:
Lines 396: this.updateLayout();
Lines 396: this.updateScrollPosition(); //TODO Restore horizontal scroll position

replace with:
if (this.element.parentNode.clientWidth > 0) {
    this.updateLayout();
    this.updateScrollPosition(); //TODO Restore horizontal scroll position	
}

More elegant solution would be some hook - when parent div is become visible - updateLayout is invoked, but I don't see the way in which we can do it now.
                
> The scrollbar of rich:extendedDataTable disappears inside rich:tabPanel (switchType=ajax) and problems with switchType=client
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: RF-11551
>                 URL: https://issues.jboss.org/browse/RF-11551
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-panels-layout-themes, component-tables
>    Affects Versions: 4.1.0.Milestone2
>         Environment: Tomcat6, Firefox 7, IE 8, myfaces 2.1.3
>            Reporter: Rene O
>              Labels: waiting_on_user
>             Fix For: 4.3-Tracking
>
>         Attachments: jsftest.war
>
>
> A testcase to reproduce this issue is attached.
> Steps to reproduce this issue:
> 1. http://localhost:8080/jsftest/tabandtable.jsf
> 2. switch to tab "Tab with Table" -> table has scrollbar
> 3. switch to tab "Tab with Table2" -> table has no scrollbar, which is not the expected behaviour
> 4. switch again to tab "Tab with Table" -> table has now also no scrollbar, which is not the expected behaviour
> If you use switchType=server everything works as expected.
> If you use switchType=client there is another problem:
> The content of the tables is not visible. It is visible after you use the dataScroller. But there is also no scrollbar visible.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list