Re: Simple javascript from wicket

2010-03-22 Thread marioosh.net
2010/3/18 Jeremy Thomerson :
> Wicket is "just java, just html".  Just add the JS to your HTML file.  Don't
> add an AjaxEventBehavior in java - because you don't want Ajax, and you
> don't need to do it in the java.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

Thanks...
I did that in that way:

WebMarkupContainer container = new 
WebMarkupContainer("container"){
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);

// prototype'owo hide and show
tag.put("onmouseover", "$('"+ 
buttons.getMarkupId() +"').show()");
tag.put("onmouseout", "$('"+ 
buttons.getMarkupId() +"').hide()");
}   
};

-- 
Greetings,
marioosh

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Simple javascript from wicket

2010-03-17 Thread Jeremy Thomerson
Wicket is "just java, just html".  Just add the JS to your HTML file.  Don't
add an AjaxEventBehavior in java - because you don't want Ajax, and you
don't need to do it in the java.

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Mar 17, 2010 at 4:05 AM, marioosh.net wrote:

> I have container and buttons element in my template:
>
>
>
>...
>
>
>E
>D
>
>
>
> and java:
>container.add(new AjaxEventBehavior("onmouseover") {
>protected void onEvent(AjaxRequestTarget target) {
>buttons.add(new
> SimpleAttributeModifier("style", "display: ;"));
>target.addComponent(buttons);
>}
>});
>
> On mouseover container i show buttons, but i think it sends request to
> server in that way.
> Is possible to change style in js only (but programming in wicket),
> not sending request to server ?
> How in wicket do some js work, but not interacting with server ?
>
> --
> Greetings,
> marioosh
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Simple javascript from wicket

2010-03-17 Thread marioosh.net
I have container and buttons element in my template:



...


E
D



and java:
container.add(new AjaxEventBehavior("onmouseover") {
protected void onEvent(AjaxRequestTarget target) {
buttons.add(new 
SimpleAttributeModifier("style", "display: ;"));
target.addComponent(buttons);
}
});

On mouseover container i show buttons, but i think it sends request to
server in that way.
Is possible to change style in js only (but programming in wicket),
not sending request to server ?
How in wicket do some js work, but not interacting with server ?

-- 
Greetings,
marioosh

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org