[jira] [Created] (TOBAGO-1390) Can't parse to any measure
Bernhard Stadler created TOBAGO-1390: Summary: Can't parse to any measure Key: TOBAGO-1390 URL: https://issues.apache.org/jira/browse/TOBAGO-1390 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-2 Environment: Firefox 28.0 Reporter: Bernhard Stadler In our application, there are frequent occurences of IllegalArgumentExceptions in org.apache.myfaces.tobago.layout.Measure line 79 (function valueOf(String)), which is being called by org.apache.myfaces.tobago.renderkit.PageRendererBase line 86 (function decodePageState(FacesContext, AbstractUIPage)). I wasn't able to create a reproducing example, but I have been able to isolate the conditions and causes under which this happens in our application: Apparently it is caused by JavaScript code (tobago.js, storeClientDimension) sending decimal values (e.g. 1298.4px) as positions or dimensions. Measure.valueOf only checks whether the String received ends with px and removes it if necessary, but doesn't have any means to handle decimals. In the JavaScript code, I found out that the non-integer value stems from the following lines in function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) in jquery-1.10.2.js: {code} // at this point, extra isn't border nor margin, so remove border if ( extra !== margin ) { val -= jQuery.css( elem, border + cssExpand[ i ] + Width, true, styles ); } {code} Removing the following lines from our CSS file seems to stop the errors from occurring: {code} .tobago-page { width: 90%; height: 99%; // ... } {code} I'm not sure whether this is a correct use of CSS but I guess it shouldn't cause a RuntimeException, especially as it is caused by unsanitized client data. I don't know what the best course of action might be: a) Change the JavaScript code to remove decimal places b) Change Measure to remove decimal places c) Change Measure to actually store decimals instead of integers -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (TOBAGO-1388) Wandering popup
Bernhard Stadler created TOBAGO-1388: Summary: Wandering popup Key: TOBAGO-1388 URL: https://issues.apache.org/jira/browse/TOBAGO-1388 Project: MyFaces Tobago Issue Type: Bug Affects Versions: 2.0.0-beta-1 Environment: Custom Theme Reporter: Bernhard Stadler I have a tc:page containing a tc:popup with a tc:sheet inside. For the sheet, paging is enabled. I'll attach an example. Every time the page is changed, the popup changes its position for some amount. We have a custom theme and I was able to isolate the following definitions in our tobago.css file which lay open the problem: {code} .tobago-page { border: 1px solid #EE; width: 90%; height: 99%; // ... } {code} Each of these lines alone causes some amount of popup movement. Removing all of them makes the problem disappear. I also was able to isolate the JavaScript code where the actual repositioning happens: tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js Tobago.Utils.keepElementInVisibleArea line 98f (SVN trunk): {code} /** * fix position, when the element it is outside of the current page * @param elements is an jQuery Array of elements to be fixed. */ Tobago.Utils.keepElementInVisibleArea = function(elements) { elements.each(function() { var element = jQuery(this); var page = jQuery(.tobago-page-content:first); var left = element.offset().left; var top = element.offset().top; // fix menu position, when it is outside of the current page left = Math.max(0, Math.min(left, page.outerWidth() - element.outerWidth())); top = Math.max(0, Math.min(top, page.outerHeight() - element.outerHeight())); element.css('left', left); element.css('top', top); }); }; {code} The left and top variables are not changed by the max/min assignment, but because of (both!) the border and the changed width of the tobago-page class, element.offset().left and element.offset().top seem to return a different value than actually needed. Even the following code causes the same behavior: {code} Tobago.Utils.keepElementInVisibleArea = function(elements) { elements.each(function() { var element = jQuery(this); element.css('left', element.offset().left); element.css('top', element.offset().top); }); }; {code} -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TOBAGO-1372) tc:sheet with rowSpan in auto row gets 0 height
[ https://issues.apache.org/jira/browse/TOBAGO-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13930459#comment-13930459 ] Bernhard Stadler commented on TOBAGO-1372: -- {quote} Not illegal, but it has to be at least one component in that row with rowSpan=1 (default) {quote} So putting an empty panel with rowSpan=1 should make the sheet display correctly? Or did you mean that only components with rowSpan=1 contribute to the row's height? tc:sheet with rowSpan in auto row gets 0 height - Key: TOBAGO-1372 URL: https://issues.apache.org/jira/browse/TOBAGO-1372 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-alpha-3 Environment: JSF 2.0.1.1 / Servlet 3.0.1 / Jetty Reporter: Bernhard Stadler Attachments: Sheet in panel with rowSpan=2.jpg, Sheet with rowSpan=2.jpg, tobago-sheet-panel-rowSpan-bug.xhtml, tobago-sheet-rowSpan-bug.xhtml Original Estimate: 2h Remaining Estimate: 2h I have a tobago page having a grid layout with auto rows and * columns. When I put a tc:sheet with a rowSpan = 2 on it, the table doesn't get rendered. Without rowSpan, this works nicely. When I try removing the rowSpan from tc:sheet and putting the sheet inside a panel with rowSpan = 2, the sheet does get rendered, but subsequent elements overlap the table as if it had height = 0px. The only workaround I found is giving the sheet rowSpan=1 (instead of n = 2) and adding a panel with rowSpan=n-1. (However, this doesn't work too well for my use case). I'll attach examples for both cases. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TOBAGO-1372) tc:sheet with rowSpan in auto row gets 0 height
[ https://issues.apache.org/jira/browse/TOBAGO-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13924096#comment-13924096 ] Bernhard Stadler commented on TOBAGO-1372: -- Hi Udo, Thanks for the change. {quote} Why do you use the rowSpan=2? In the exemple it is not needed. But I assume, your real application is more complex. {quote} This is because the XHTML files are generated from a large legacy application (so manually adjusting the XHTML is not an option). I have to make sure that the space originally taken by the table is reflected correctly in the grid. As I wrote in the report, I can work around this (in a not-so-beautiful way) by putting an empty panel that occupies these grid cells into the row below. {quote} I think the problem is, that the height of the 2 (or n) rows can't be computed. {quote} So does this mean that using rowSpan = 2 for 'auto' rows is always illegal? Otherwise putting the sheet inside a tc:panel (like in the attached tobago-sheet-panel-rowSpan-bug.xhtml) should work because the sheet has rowSpan = 1. To me it would make sense to allow rowSpan = 2 for 'auto' rows - it would only mean that the height of all spanned rows together has to be = the height of the element. I.e. as far as the rows aren't already high enough because of other widgets in other columns of the spanned rows, each of the spanned auto row's height has to be increased by the missing amount divided by the number of spanned auto rows. This would even make sense when different kinds of rows are being spanned, including '*' or constant height rows. tc:sheet with rowSpan in auto row gets 0 height - Key: TOBAGO-1372 URL: https://issues.apache.org/jira/browse/TOBAGO-1372 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-alpha-3 Environment: JSF 2.0.1.1 / Servlet 3.0.1 / Jetty Reporter: Bernhard Stadler Attachments: Sheet in panel with rowSpan=2.jpg, Sheet with rowSpan=2.jpg, tobago-sheet-panel-rowSpan-bug.xhtml, tobago-sheet-rowSpan-bug.xhtml Original Estimate: 2h Remaining Estimate: 2h I have a tobago page having a grid layout with auto rows and * columns. When I put a tc:sheet with a rowSpan = 2 on it, the table doesn't get rendered. Without rowSpan, this works nicely. When I try removing the rowSpan from tc:sheet and putting the sheet inside a panel with rowSpan = 2, the sheet does get rendered, but subsequent elements overlap the table as if it had height = 0px. The only workaround I found is giving the sheet rowSpan=1 (instead of n = 2) and adding a panel with rowSpan=n-1. (However, this doesn't work too well for my use case). I'll attach examples for both cases. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (TOBAGO-1372) tc:sheet with rowSpan in auto row gets 0 height
Bernhard Stadler created TOBAGO-1372: Summary: tc:sheet with rowSpan in auto row gets 0 height Key: TOBAGO-1372 URL: https://issues.apache.org/jira/browse/TOBAGO-1372 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-1 Environment: JSF 2.0.1.1 / Servlet 3.0.1 / Jetty Reporter: Bernhard Stadler I have a tobago page having a grid layout with auto rows and * columns. When I put a tc:sheet with a rowSpan = 2 on it, the table doesn't get rendered. Without rowSpan, this works nicely. When I try removing the rowSpan from tc:sheet and putting the sheet inside a panel with rowSpan = 2, the sheet does get rendered, but subsequent elements overlap the table as if it had height = 0px. The only workaround I found is giving the sheet rowSpan=1 (instead of n = 2) and adding a panel with rowSpan=n-1. (However, this doesn't work too well for my use case). I'll attach examples for both cases. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Comment Edited] (TOBAGO-1372) tc:sheet with rowSpan in auto row gets 0 height
[ https://issues.apache.org/jira/browse/TOBAGO-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13912644#comment-13912644 ] Bernhard Stadler edited comment on TOBAGO-1372 at 2/26/14 8:39 AM: --- Attached screenshot of tobago-sheet-rowSpan-bug.xhtml was (Author: bstadler): Rendering of tobago-sheet-rowSpan-bug.xhtml tc:sheet with rowSpan in auto row gets 0 height - Key: TOBAGO-1372 URL: https://issues.apache.org/jira/browse/TOBAGO-1372 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-1 Environment: JSF 2.0.1.1 / Servlet 3.0.1 / Jetty Reporter: Bernhard Stadler Attachments: Sheet in panel with rowSpan=2.jpg, Sheet with rowSpan=2.jpg, tobago-sheet-panel-rowSpan-bug.xhtml, tobago-sheet-rowSpan-bug.xhtml Original Estimate: 2h Remaining Estimate: 2h I have a tobago page having a grid layout with auto rows and * columns. When I put a tc:sheet with a rowSpan = 2 on it, the table doesn't get rendered. Without rowSpan, this works nicely. When I try removing the rowSpan from tc:sheet and putting the sheet inside a panel with rowSpan = 2, the sheet does get rendered, but subsequent elements overlap the table as if it had height = 0px. The only workaround I found is giving the sheet rowSpan=1 (instead of n = 2) and adding a panel with rowSpan=n-1. (However, this doesn't work too well for my use case). I'll attach examples for both cases. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Comment Edited] (TOBAGO-1372) tc:sheet with rowSpan in auto row gets 0 height
[ https://issues.apache.org/jira/browse/TOBAGO-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13912645#comment-13912645 ] Bernhard Stadler edited comment on TOBAGO-1372 at 2/26/14 8:39 AM: --- Attached screenshot of tobago-sheet-panel-rowSpan-bug.xhtml was (Author: bstadler): Rendering of tobago-sheet-panel-rowSpan-bug.xhtml tc:sheet with rowSpan in auto row gets 0 height - Key: TOBAGO-1372 URL: https://issues.apache.org/jira/browse/TOBAGO-1372 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-1 Environment: JSF 2.0.1.1 / Servlet 3.0.1 / Jetty Reporter: Bernhard Stadler Attachments: Sheet in panel with rowSpan=2.jpg, Sheet with rowSpan=2.jpg, tobago-sheet-panel-rowSpan-bug.xhtml, tobago-sheet-rowSpan-bug.xhtml Original Estimate: 2h Remaining Estimate: 2h I have a tobago page having a grid layout with auto rows and * columns. When I put a tc:sheet with a rowSpan = 2 on it, the table doesn't get rendered. Without rowSpan, this works nicely. When I try removing the rowSpan from tc:sheet and putting the sheet inside a panel with rowSpan = 2, the sheet does get rendered, but subsequent elements overlap the table as if it had height = 0px. The only workaround I found is giving the sheet rowSpan=1 (instead of n = 2) and adding a panel with rowSpan=n-1. (However, this doesn't work too well for my use case). I'll attach examples for both cases. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Comment Edited] (TOBAGO-1372) tc:sheet with rowSpan in auto row gets 0 height
[ https://issues.apache.org/jira/browse/TOBAGO-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13912632#comment-13912632 ] Bernhard Stadler edited comment on TOBAGO-1372 at 2/26/14 8:39 AM: --- tobago-sheet-rowSpan-bug.xhtml: Sheet with rowSpan auto row tobago-sheet-panel-rowSpan-bug.xhtml: Attempted workaround with panel. was (Author: bstadler): Sheet with rowSpan auto row resp. attempted workaround with panel. tc:sheet with rowSpan in auto row gets 0 height - Key: TOBAGO-1372 URL: https://issues.apache.org/jira/browse/TOBAGO-1372 Project: MyFaces Tobago Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-1 Environment: JSF 2.0.1.1 / Servlet 3.0.1 / Jetty Reporter: Bernhard Stadler Attachments: Sheet in panel with rowSpan=2.jpg, Sheet with rowSpan=2.jpg, tobago-sheet-panel-rowSpan-bug.xhtml, tobago-sheet-rowSpan-bug.xhtml Original Estimate: 2h Remaining Estimate: 2h I have a tobago page having a grid layout with auto rows and * columns. When I put a tc:sheet with a rowSpan = 2 on it, the table doesn't get rendered. Without rowSpan, this works nicely. When I try removing the rowSpan from tc:sheet and putting the sheet inside a panel with rowSpan = 2, the sheet does get rendered, but subsequent elements overlap the table as if it had height = 0px. The only workaround I found is giving the sheet rowSpan=1 (instead of n = 2) and adding a panel with rowSpan=n-1. (However, this doesn't work too well for my use case). I'll attach examples for both cases. -- This message was sent by Atlassian JIRA (v6.1.5#6160)