You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ak <an...@yahoo.com> on 2008/08/12 20:51:22 UTC

onComponentTag tag.append() javascript events ?

Hello,

I stumbled upon this scenario wherein I have 'onclick=doSomething()'
associated with a button on the html page. Then there is a behaviour that
sets onclick event from java code for button component as:
public void onComponentTag(Component component, ComponentTag tag){
      tag.put(getJsEvent(),"doChoosenBehaviour();");
}
protected String getJsEvent(){
    return "onclick";
}

In this scenario, my html event was overridden by the onComponentTag()
method. I am wondering can the ComponentTag have a tag.append() method that
will prevent the loss of similar events described through html page. I am
not sure if that is possible, but will like to know your thoughts.

Thanks and Regards,
Andy
-- 
View this message in context: http://www.nabble.com/onComponentTag-tag.append%28%29-javascript-events---tp18949963p18949963.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: onComponentTag tag.append() javascript events ?

Posted by Martijn Dashorst <ma...@gmail.com>.
also, take a look at AttributeAppender

Martijn

On Tue, Aug 12, 2008 at 9:18 PM, Martijn Dashorst
<ma...@gmail.com> wrote:
> if you already know you want to append, then you can do this:
>
> tag.put(getJsEvent(), "doChoosenBehaviour();" + tag.get(getJsEvent())));
>
> Martijn
>
> On Tue, Aug 12, 2008 at 8:51 PM, ak <an...@yahoo.com> wrote:
>>
>> Hello,
>>
>> I stumbled upon this scenario wherein I have 'onclick=doSomething()'
>> associated with a button on the html page. Then there is a behaviour that
>> sets onclick event from java code for button component as:
>> public void onComponentTag(Component component, ComponentTag tag){
>>      tag.put(getJsEvent(),"doChoosenBehaviour();");
>> }
>> protected String getJsEvent(){
>>    return "onclick";
>> }
>>
>> In this scenario, my html event was overridden by the onComponentTag()
>> method. I am wondering can the ComponentTag have a tag.append() method that
>> will prevent the loss of similar events described through html page. I am
>> not sure if that is possible, but will like to know your thoughts.
>>
>> Thanks and Regards,
>> Andy
>> --
>> View this message in context: http://www.nabble.com/onComponentTag-tag.append%28%29-javascript-events---tp18949963p18949963.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
>>
>>
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
> Apache Wicket 1.3.4 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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


Re: onComponentTag tag.append() javascript events ?

Posted by Martijn Dashorst <ma...@gmail.com>.
if you already know you want to append, then you can do this:

tag.put(getJsEvent(), "doChoosenBehaviour();" + tag.get(getJsEvent())));

Martijn

On Tue, Aug 12, 2008 at 8:51 PM, ak <an...@yahoo.com> wrote:
>
> Hello,
>
> I stumbled upon this scenario wherein I have 'onclick=doSomething()'
> associated with a button on the html page. Then there is a behaviour that
> sets onclick event from java code for button component as:
> public void onComponentTag(Component component, ComponentTag tag){
>      tag.put(getJsEvent(),"doChoosenBehaviour();");
> }
> protected String getJsEvent(){
>    return "onclick";
> }
>
> In this scenario, my html event was overridden by the onComponentTag()
> method. I am wondering can the ComponentTag have a tag.append() method that
> will prevent the loss of similar events described through html page. I am
> not sure if that is possible, but will like to know your thoughts.
>
> Thanks and Regards,
> Andy
> --
> View this message in context: http://www.nabble.com/onComponentTag-tag.append%28%29-javascript-events---tp18949963p18949963.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
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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