Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.6DR#4
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Win XP / Tomcat 5.5.17 / Liferay 4.3.0 (pre-release)
Description
In the attached sample portlet, the following code in View.jspx:
<ice:inputFile
id="inputFile1" actionListener="#{ResumeUploader.actionListener}"
binding="#{ResumeUploader.inputFile}" buttonClass="portlet-form-button" file="#{JobApplication.file}"
label="#{JobApplicationMsgs.uploadResume}"
progressListener="#{ResumeUploader.progressListener}" styleClass="portlet-form-input-field"/>
Is causing the class attribute of the <input type="file"/> element within the IFRAME to be rendered like this:
class="iceFileUploadText portlet-form-input-fieldText"/>
Note that the word "Text" should not be at the end of "portlet-form-input-fieldText"
<ice:inputFile
id="inputFile1" actionListener="#{ResumeUploader.actionListener}"
binding="#{ResumeUploader.inputFile}" buttonClass="portlet-form-button" file="#{JobApplication.file}"
label="#{JobApplicationMsgs.uploadResume}"
progressListener="#{ResumeUploader.progressListener}" styleClass="portlet-form-input-field"/>
Is causing the class attribute of the <input type="file"/> element within the IFRAME to be rendered like this:
class="iceFileUploadText portlet-form-input-fieldText"/>
Note that the word "Text" should not be at the end of "portlet-form-input-fieldText"
Issue Links
- depends on
-
ICE-1644 Custom components are not using uniform strategy for styling
- Closed
Activity
Neil Griffin
created issue -
Neil Griffin
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | sample-jsf-icefaces-sun-portlet.zip [ 10421 ] |
Ken Fyten
made changes -
Assignee | Adnan Durrani [ adnan.durrani ] |
Adnan Durrani
made changes -
Ken Fyten
made changes -
Fix Version/s | 1.6 [ 10031 ] |
Ken Fyten
made changes -
Assignee Priority | P2 |
Adnan Durrani
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Won't Fix [ 2 ] |
Ken Fyten
made changes -
Fix Version/s | 1.6DR#6 [ 10090 ] | |
Fix Version/s | 1.6 [ 10031 ] |
Ken Fyten
made changes -
Fix Version/s | 1.6 [ 10031 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P2 | |
Assignee | Adnan Durrani [ adnan.durrani ] |
Hi Neil,
This is part of the ICEfaces theme mechanism. As all of the custom components renders more then one html elements. So the developer might want to style more then one element on the component, in order to accomplish that a JSF component need to be defined number of styleClass attributes which makes the TLD bigger.
Let say inputFile component renders the following html:
<iframe>
<form>
<input type="file"/>
<input type="submit"/>
</form>
</iframe>
As we can see above, there are 3 important elements that can be styled:
1- iframe
Allow to set style on the root element (e.g.)height, width, bgcolor, padding etc
2- input(file)
Allow to set style on text field of file upload (e.g.) color, font, gbcolor etc
3- input(button).
Allow to set style for the upload button
As we already discussed that one way to style every element is to, have number of styleClass attributes on the component. However ICEfaces strategy is to use styleClass attribute to get the base class and generate rest of the classes using the base.
All ICEfaces extended and custom components have a default/base styleClass. For example the default class of inputFile is "iceFileUpload", We render the base class on the root element of the component and suffix the base class for other elements accordingly( e.g.)
.Jsp
//the style class has not defined, so the default will be used
<ice:inputFile />
Rendered Html
//the default class is "iceFileUpload"
<iframe class="iceFileUpload">
<form>
//we suffixed the base class with "Text"
<input type="file" class="iceFileUploadText"/>
//we suffixed the base class with "Button"
<input type="submit" class=""iceFileUploadButton"/>
</form>
</iframe>
As css allows to extend style classes, so it nice to get the benefit of overriding a style class. So the developer do not need to write style class from scratch. Suppose if I want to change the background color of the inputText only and keep the other default style intact. I can do the following:
*.jsp
<ice:inputFile styleClass="portletForm"/>
*.css
{ background-color:red; }//I just need to define one class
.portletFormText
//We always render out the default classes so the user defined style class can extend it.
<iframe class="iceFileUpload portletForm">
<form>
<input type="file" class="iceFileUploadText portletFormText"/>
<input type="submit" class=""iceFileUploadButton portletFormButton"/>
</form>
</iframe>