Allow CSS class for ViewOrEdit Label

Skip to first unread message

chapp007

unread,
Apr 25, 2011, 2:24:24 PM4/25/11
to visural-wicket
Hi,

I just completed a task at my company using your ViewOrEdit component
and it works like a charm. One thing that I needed that it didn't
provide is the ability to add a css class to the label component. We
have a grey background on our form panels so when the form was
disabled it was black text on a grey background so to make it easier
to read we needed to add some css styles to give it a white background
and other things to make it more readable.

My first try was to override the onBeforeRender and add an
AttributeAppender there but I couldn't access the private Label
variable. For now I just created a CustomViewOrEdit component that is
just a copy of ViewOrEdit and hard codes our specific class in the
html.

You could add another constructor that takes the css class or just
make the label protected or have a protected getLabel().

I think it is a great component. I just thought I would offer this
suggestion to you.

Thanks,

Josh
Reply all
Reply to author
Forward
0 new messages