You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by walnutmon <ju...@gmail.com> on 2008/12/23 15:54:03 UTC
Applying Styles Through Java
I have found very little in my wicket books, and on this forum in terms of
adding styles to components through java. Is this because it's outside of
the scope of wicket?
As an example. If I have a panel, and I want all of those panels to have a
style class "someComponentClass", is it better to keep that information in
the HTML? Or can I assign that behavior through the .java code?
Also, as an aside, where can I find wicket jars for the 1.3.5 release with
javadocs contained so that I can see the javadocs from netbeans? I have had
a heck of a time without them.
best,
justin
--
View this message in context: http://www.nabble.com/Applying-Styles-Through-Java-tp21145758p21145758.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Applying Styles Through Java
Posted by dtoffe <dt...@yahoo.com.ar>.
walnutmon wrote:
>
> Also, as an aside, where can I find wicket jars for the 1.3.5 release with
> javadocs contained so that I can see the javadocs from netbeans? I have
> had a heck of a time without them.
>
>
http://repo2.maven.org/maven2/org/apache/wicket/wicket/
At the moment I believe you will not find the release with the javadocs
included.
In this list it is often suggested to get the javadocs jar via Maven,
but if you use Netbeans and your projects are not Maven based, you can
download the wicket release, add the javadoc jar downloaded from this maven
repo, and then configure as a Library, setting jars, sources and javadocs
path with the Library Manager.
hth,
Daniel
--
View this message in context: http://www.nabble.com/Applying-Styles-Through-Java-tp21145758p21146945.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Applying Styles Through Java
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
I think this might depend on your use case:
1-If your are creating a component and you want it to tune to "look"
different on different "parts" of your pages it might be useful to have
something like:
component.add(new SimpleAttributeModifier("class", getMyStyleClassName());
So that you can change it at Java code.
2- If the style is going to be the same everywhere why bother in
parameterizing it at Java level?
Best
Ernesto
On Tue, Dec 23, 2008 at 3:54 PM, walnutmon <ju...@gmail.com>wrote:
>
> I have found very little in my wicket books, and on this forum in terms of
> adding styles to components through java. Is this because it's outside of
> the scope of wicket?
>
> As an example. If I have a panel, and I want all of those panels to have a
> style class "someComponentClass", is it better to keep that information in
> the HTML? Or can I assign that behavior through the .java code?
>
> Also, as an aside, where can I find wicket jars for the 1.3.5 release with
> javadocs contained so that I can see the javadocs from netbeans? I have
> had
> a heck of a time without them.
>
> best,
> justin
> --
> View this message in context:
> http://www.nabble.com/Applying-Styles-Through-Java-tp21145758p21145758.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
RE: Applying Styles Through Java
Posted by Stefan Lindner <li...@visionet.de>.
It depends :-) You may control the attributes of an element (e.g. attribute "class") with
Component.add(new simpleAttributeModifier("class", " someComponentClass");
Stefan
-----Ursprüngliche Nachricht-----
Von: walnutmon [mailto:justin.m.boyd82@gmail.com]
Gesendet: Dienstag, 23. Dezember 2008 15:54
An: users@wicket.apache.org
Betreff: Applying Styles Through Java
I have found very little in my wicket books, and on this forum in terms of
adding styles to components through java. Is this because it's outside of
the scope of wicket?
As an example. If I have a panel, and I want all of those panels to have a
style class "someComponentClass", is it better to keep that information in
the HTML? Or can I assign that behavior through the .java code?
Also, as an aside, where can I find wicket jars for the 1.3.5 release with
javadocs contained so that I can see the javadocs from netbeans? I have had
a heck of a time without them.
best,
justin
--
View this message in context: http://www.nabble.com/Applying-Styles-Through-Java-tp21145758p21145758.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Applying Styles Through Java
Posted by Steve Swinsburg <s....@lancaster.ac.uk>.
You can do it in either but since its best to separate the display
from the logic, keep it in the HTML. Exception is if you need to
dynamically change the class etc.
HTML:
<div class="someCSS" wicket:id="someComponent">
stuff
</div>
Java:
look at AttributeAppender
AttributeModifier that appends the given value, rather than replace
it. This is especially useful for adding CSS classes to markup
elements, or adding JavaScript snippets to existing element handlers.
<a href="#" wicket:id="foo" class="link"
onmouseover="doSomething()">
can be modified with these AttributeAppenders:
link.add(new AttributeAppender("class", new Model("hot"), " "));
link.add(new AttributeAppender("onmouseover", new
Model("foo();return false;"), ";"));
this will result in the following markup:
<a href="#" wicket:id="foo" class="link hot"
onmouseover="doSomething();foo();return false;">
cheers,
Steve
On 23 Dec 2008, at 14:54, walnutmon wrote:
>
> I have found very little in my wicket books, and on this forum in
> terms of
> adding styles to components through java. Is this because it's
> outside of
> the scope of wicket?
>
> As an example. If I have a panel, and I want all of those panels to
> have a
> style class "someComponentClass", is it better to keep that
> information in
> the HTML? Or can I assign that behavior through the .java code?
>
> Also, as an aside, where can I find wicket jars for the 1.3.5
> release with
> javadocs contained so that I can see the javadocs from netbeans? I
> have had
> a heck of a time without them.
>
> best,
> justin
> --
> View this message in context: http://www.nabble.com/Applying-Styles-Through-Java-tp21145758p21145758.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>