This content has been marked as final.
Show 7 replies
-
1. Re: s:fileUpload styleClass (2.0.2.SP1)
blabno Feb 11, 2010 1:06 PM (in response to mikebgx)How about selectors ?
#fileUploadId input[type="button"] { ... }
-
2. Re: s:fileUpload styleClass (2.0.2.SP1)
mikebgx Feb 11, 2010 7:07 PM (in response to mikebgx)Thanks for the suggestion.
But that doesn't change the style, maybe I'm doing something wrong? -
3. Re: s:fileUpload styleClass (2.0.2.SP1)
mikebgx Feb 11, 2010 7:26 PM (in response to mikebgx)[ sorry for earlier partial reply ]
Thanks for the suggestion.
But that doesn't change the style (of any part of the fileUpload). Or maybe I'm doing something wrong?
As a simple test I tried to shift it to the left, which works when I do this in the fileUpload's style=
In my template2.xhtml's <head> I have:
<style type="text/css">
#fileUploadId input[type="button"] {
margin-left: -126px;
}
</style>
</head>
And in my page I have
<ui:composition ... template="layout/template2.xhtml">
...
<s:fileUpload id="fileUploadId" accept="application/excel" data="#{importXlBean.fileData}" />
I've tried adding a '*' before the '#', same bad.
Can you see what I'm doing wrong please?
Rgds, Mike -
4. Re: s:fileUpload styleClass (2.0.2.SP1)
blabno Feb 11, 2010 10:29 PM (in response to mikebgx)Well, JSF appends formId to your fileUploadId, so maybe better add styleClass and use it in stead of id in your selector.
-
5. Re: s:fileUpload styleClass (2.0.2.SP1)
mikebgx Feb 12, 2010 9:42 AM (in response to mikebgx)Thanks.
From "view source" I noticed the full JSF-augmented id:
So I changed to:
<style type="text/css">
#j_id17:fileDecor:fileUploadId input[type="button"] {
... same bad.
When you say use styleClass do you mean as follows?
In the <head>:
<style type="text/css">
testStyle {
margin-left: -126px;
}
Then in the page:
<s:fileUpload id="fileUploadId" accept="application/excel" data="#{importXlBean.fileData}" styleClass="testStyle" />
...which is what I had in the first place,
Or did you mean something different, that only affects the style of the button? -
6. Re: s:fileUpload styleClass (2.0.2.SP1)
blabno Feb 12, 2010 10:09 AM (in response to mikebgx)#j_id17:fileDecor:fileUploadId input[type="button"]
It is bad because form id may change.
Try this :
.testStyle input[type="button"]
-
7. Re: s:fileUpload styleClass (2.0.2.SP1)
mikebgx Feb 12, 2010 10:20 AM (in response to mikebgx).testStyle input[type="button"] does not change the style at all.
has it worked for you?