Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.4, 1.6DR#3
-
Component/s: Framework
-
Labels:None
-
Environment:All
-
Affects:Compatibility/Configuration
-
Workaround Exists:Yes
-
Workaround Description:Manually adjust the theme stylesheet.
Description
-
- xp.css
- 47 kB
- Deryk Sinotte
-
- xp-portlet.css
- 51 kB
- Neil Griffin
-
- screenshot-1.jpg
- 248 kB
Issue Links
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
In addition to the xp-portlet.css that I just attached, I recommend adding the following entries as well:
.iceDatTbl
{ margin: 0px; }.iceOutConStat
{ margin: 0px; }.iceSelOneMnu
{ padding: 1px 1px 1px 1px; }.iceInpTxt
{ margin: 0px; }.iceOutLbl
{ padding: 1px 4px 1px 0px; }.icePnlTbSet
{ background: transparent; }The attached file is easily diff'able with today's trunk. I deleted some hard coded font colors and some other items that shouldn't be present it portlets.
Screenshot showing alternating table row classes and background images after applying the suggested fix.
Adnan,
Found one more issue today...
In TableRenderer.java, the PORTLET_SECTION_BODY class is being applied to the <tbody> element, and the PORTLET_SECTION_ALTERNATE class is being applied to the "odd" <tr> elements.
This can cause a rendering problem under IE, which in this case actually obeys CSS a little better than FireFox. Basically, the styles applied to <tbody> are supposed to override the styles applied to <tr>. So by putting the PORTLET_SECTION_BODY class name on the <tbody> element, it makes it impossible to do things like render a background image in the alternate table rows. Instead, the PORTLET_SECTION_BODY class should be applied to "even" rows, just as PORTLET_SECTION_ALTERNATE applies to "odd" rows.
So in order to fix this, the folowing code needs to be removed from TableRenderer.encodeChildren()...
/*
if (CoreUtils.getPortletStyleClass(PORTLET_CSS_DEFAULT.
PORTLET_SECTION_BODY).length() > 1)
*/
And the getPortletAlternateRowClass() code should look like this:
String getPortletAlternateRowClass(String selectedClass, int rowIndex) {
String rowClass = PORTLET_CSS_DEFAULT.PORTLET_SECTION_ALTERNATE;
if ((rowIndex % 2) == 0)
if(selectedClass.indexOf(' ')> 1)
{ return selectedClass.replaceFirst(" ", CoreUtils.getPortletStyleClass(" "+ rowClass + " ")); }else
{ return selectedClass += CoreUtils.getPortletStyleClass(""+ rowClass); }}
Thanks!!!
Neil
Hey thanks Adnan!!!
Hi Neil,
The outputText component doesn't render the portlet styleClass anymore and the ice:dataTable is rendering the following style classes:
PORTLET_SECTION_HEADER
PORTLET_SECTION_BODY
PORTLET_SECTION_ALTERNATE
PORTLET_SECTION_FOOTER
revision : 14925
Adnan,
The PORTLET_CSS_DEFAULT.PORTLET_SECTION_BODY and PORTLET_CSS_DEFAULT.PORTLET_SECTION_ALTERNATE styles are not getting appended to rows in ice:dataTable.
Thanks,
Neil
Adnan,
I'm working with the trunk and noticed that the <ice:outputText/> component is rendering like this:
<span class="portlet-form-label">
This class should only be rendered on <ice:outputLabel /> and needs to be removed from the rendering of <ice:outputText />
Thanks,
Neil
The changes has been made, so the ICEfaces extended components can spit out the portlet specific style classes only when in portlet environment and the following context parameter being set to true in the web.xml "com.icesoft.faces.portlet.renderStyles". The default value of this parameter is true. To disabling it the following param need to be set to false exclusively.
<context-param>
<param-name>com.icesoft.faces.portlet.renderStyles</param-name>
<param-value>false</param-value>
</context-param>
According to the spec, all approperate components has been modifed, except dataTable and selectOneRadio and selectManyCheckbox.
The JSF with non-porlet environment, renders styleClasses on the container of the both selectOneRadio and selectManyCheckbox, and according to the portlet classes need to be render on each instance of the input element.
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlCommandButton.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlInputSecret.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlInputText.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlInputTextarea.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlOutputLabel.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlOutputText.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectBooleanCheckbox.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectManyListbox.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectManyMenu.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectOneListbox.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectOneMenu.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\taglib\Util.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menubar\MenuBarRenderer.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menubar\MenuItemRenderer.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java
Modified: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\util\CoreUtils.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menubar\MenuBarRenderer.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\util\CoreUtils.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectOneListbox.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectBooleanCheckbox.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectManyMenu.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\taglib\Util.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlInputTextarea.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlOutputLabel.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\core\src\com\icesoft\faces\renderkit\dom_html_basic\DomBasicRenderer.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlInputText.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlOutputText.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlInputSecret.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectOneMenu.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlSelectManyListbox.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlCommandButton.java
Sending content: D:\work\development\current\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\menubar\MenuItemRenderer.java
Completed: At revision: 14844
The work that needs to be done is to:
1) Examine the portlet spec and review the specified styles names outlined in PLT.C CSS Style Definitions.
2) Resolve those against our existing components.
3) Implement a mechanism were the standard portlet class names are rendered out when appropriate.
I think many of these changes got put into the xp-portet-styles.css file in the DR#5 release.
On a related note, there is a Liferay customer who is interested in seeing stuff like
style="portlet-form-input-field" added to <ice:inputText/> automatically when running inside a portal, so that the portal's theme will get picked up automatically. This would apply to <ice:commandButton/> and other controls too.
(Part of the wholistic thing Deryk was talking about)
I'm attaching the customer's adjustments to our xp.css file as well as pasting in a diff from our current stylesheet in the repository trunk. The only adjustment I made was to remove the customer's name and email address to protect their privacy.
Index: xp.css
===================================================================
— xp.css (revision 13465)
+++ xp.css (working copy)
@@ -41,34 +41,45 @@
/* set the attributes for the font family, size and color for ALL elements on the page */
/* make the fonts inside tables and forms == the default size of the page */
+
+/* This is incompatible with portal themes, so commenting it out...
body, table
+*/
/* now set the size and other attributes of the fonts for any of the form elements for non-ICE form elements. (note this will also affect any ICE components that render out any of the following HTML tags */
+/* This is incompatible with portal themes, so commenting it out...
input, textarea, select {
}
+*/
/*
=================== HTML Form Element Appearence ==============
*/
/* set the style elements for any of the textarea form elements */
+/* This is incompatible with portal themes, so commenting it out...
textarea {
}
+*/
/* set the style elements for any of the select form elements */
+/* This is incompatible with portal themes, so commenting it out...
select {
}
+*/
/* set the style elements for any of the input form elements */
+/* This is incompatible with portal themes, so commenting it out...
input {
}
+*/
/*
=================== Style class definitions for ICE Standard Extended Component Appearance ==============
@@ -80,10 +91,6 @@
padding: 2px;
}
-.iceCheckbox
{ - white-space: nowrap; -}-
.iceCheckbox input, .iceRadioBtn input, .iceBooleanCheckbox
-.iceDtdPgrScrBtn {
/* the cells behind the scroll buttons */
+/* This is incompatible with portal themes, so commenting it out...
+/*
+.iceDtdPgrScrBtn
+*/
.iceDtdPgrTbl
{ /* the container for the pagination*/ @@ -341,9 +351,9 @@ background-color: #FFFFFF; color: #666666; display: block; + border: 1px solid #FFFFFF; padding-left: 5px; padding-right: 5px; - border: 1px solid #FFFFFF; }- html .iceDtdPgrCol a { @@ -437,6 +447,7 @@ border: none; }
+ /* ADDED Navy Blue font color, since it always appears on a white background. In one case, the portal theme had a portlet-font, which would not render on this always-white background in the ICEfaces XP theme */
.iceTabSetTabOn .MiddleMiddle
.iceTabSetTabOn .MiddleMiddle a
{ @@ -534,6 +546,7 @@ border: none; }+ /* ADDED Navy Blue font color, since it always appears on a white background. In one case, the portal theme had a portlet-font, which would not render on this always-white background in the ICEfaces XP theme */
.iceTabSetTabOff .MiddleMiddle
.iceTabSetTabOff .MiddleMiddle a {
@@ -691,6 +705,8 @@
/* tabPanel */
+
+/* background-color: #FFFFFF; Background color within .iceTabSet is incompatible with portal themes, so commenting it out... */
.iceTabSet
/* TABS ON BOTTOM STYLE CLASSES */
@@ -1217,7 +1232,6 @@
/*
----------- FileUpload Component classes
*/
-.iceFileUpload {}
.iceFileUploadText {
border: 1px solid #ABABAB;
background-color: #FFFFFF;
@@ -1550,8 +1564,8 @@
Classes for the connection status indicator
*/
+/* margin: 10px; This is incompatible with portal themes, so commenting it out... */
.iceOutConStat
-/* submenu disabled style classes */
-.iceSubMenuRowLabel-dis
-
-.iceSubMenuRow-dis
-
-.iceSubMenuRow-dis a
-
-.iceSubMenuRow-dis a:hover
-
-
/* panel tabs disabled style classes */
.iceTabSetTabOff {
I do not t see any problems with it.