Re: Component specific JavaScript

2012-02-19 Thread Jorge Rodrigez
Hi,

I think you just need:

class MyComponent extends SomeWicketComponent {

  @Override public void renderHead(IHeaderResponse response) {
response.renderOnDomReadyJavascript(someJSToExecute());
  }
}

someJSToExecute() will be executed every time an instance of MyComponent is
rendered. Both Ajax and normal requests.

On Sat, Feb 18, 2012 at 5:46 PM, Jürgen Lind juergen.l...@iteratec.dewrote:

 Hi Christoph,

 thank you for your reply, I did not know that such a method exists (does
 it for 1.4
 or is this already Wicket 1.5). An secondly: are these handlers fired on a
 ajax
 update of an existing DOM Element or only when it is added?

 And where would I put the Javascript that registers the handler? In the
 Markup-Page of
 the Component? How do I make sure, the handler is added only once?


 J.


 On 18.02.2012 17:39, Christoph Leiter wrote:

 Hello Juergen,

 you can register a function that gets called when wicket creates a new
 element in the DOM:

 Wicket.Event.subscribe('/dom/**node/added', function(element) {
  // do stuff
 });

 You can also use the '/dom/node/removing' channel.

 Hope this helps.


 Christoph




 Jürgen Lind (2012-02-18 16:55):

 Hi,

 I was wondering if there is any kind of best practice to add specific
 javascript
 to a component. I often have the case, where a piece of javascript needs
 to run
 when the component is rendered as part of full-page request, and then
 subsequently
 as part of a self-triggered Ajax-Request or as part of an Ajax-Request
 triggered
 by another component.

 I would like to have one place where I can put the Javascript and be
 shure, it is
 run every time...

 Cheers,

 J.


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



 Mit freundlichen Grüßen,

 Jürgen Lind


 --
 Dr. Jürgen Lind
 iteratec GmbHFon: +49 (0)89 614551-44
 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
 82008 Unterhaching   Web: www.iteratec.de

 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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




Re: Component specific JavaScript

2012-02-19 Thread Jürgen Lind

Hi Jorge,

thanks for the hint, unfortunately, this method is only available in Wicket 1.5 
-
in this projekt, I am still using Wicket 1.4. Maybe I should stop looking for
a general solution for this project and in the future use the solution you 
suggested...

J.


On 19.02.2012 10:30, Jorge Rodrigez wrote:

Hi,

I think you just need:

class MyComponent extends SomeWicketComponent {

   @Override public void renderHead(IHeaderResponse response) {
 response.renderOnDomReadyJavascript(someJSToExecute());
   }
}

someJSToExecute() will be executed every time an instance of MyComponent is
rendered. Both Ajax and normal requests.

On Sat, Feb 18, 2012 at 5:46 PM, Jürgen Lindjuergen.l...@iteratec.dewrote:


Hi Christoph,

thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on a
ajax
update of an existing DOM Element or only when it is added?

And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


J.


On 18.02.2012 17:39, Christoph Leiter wrote:


Hello Juergen,

you can register a function that gets called when wicket creates a new
element in the DOM:

Wicket.Event.subscribe('/dom/**node/added', function(element) {
  // do stuff
});

You can also use the '/dom/node/removing' channel.

Hope this helps.


Christoph




Jürgen Lind (2012-02-18 16:55):


Hi,

I was wondering if there is any kind of best practice to add specific
javascript
to a component. I often have the case, where a piece of javascript needs
to run
when the component is rendered as part of full-page request, and then
subsequently
as part of a self-triggered Ajax-Request or as part of an Ajax-Request
triggered
by another component.

I would like to have one place where I can put the Javascript and be
shure, it is
run every time...

Cheers,

J.



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




Mit freundlichen Grüßen,

Jürgen Lind


--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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





Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



Re: Component specific JavaScript

2012-02-19 Thread Martin Grigorov
Hi Juergen,

Both Component#renderHead(IHeaderResponse) 
IHeaderResponse#renderOnDomReadyJavascript() methods are available in 1.4.x.
What exactly you think is not available there ?



 From: Jürgen Lind juergen.l...@iteratec.de
To: users@wicket.apache.org users@wicket.apache.org 
Sent: Sunday, 19 February 2012, 12:08
Subject: Re: Component specific JavaScript
 
Hi Jorge,

thanks for the hint, unfortunately, this method is only available in Wicket 1.5 
-
in this projekt, I am still using Wicket 1.4. Maybe I should stop looking for
a general solution for this project and in the future use the solution you 
suggested...

J.


On 19.02.2012 10:30, Jorge Rodrigez wrote:
 Hi,

 I think you just need:

 class MyComponent extends SomeWicketComponent {

    @Override public void renderHead(IHeaderResponse response) {
      response.renderOnDomReadyJavascript(someJSToExecute());
    }
 }

 someJSToExecute() will be executed every time an instance of MyComponent is
 rendered. Both Ajax and normal requests.

 On Sat, Feb 18, 2012 at 5:46 PM, Jürgen Lindjuergen.l...@iteratec.dewrote:

 Hi Christoph,

 thank you for your reply, I did not know that such a method exists (does
 it for 1.4
 or is this already Wicket 1.5). An secondly: are these handlers fired on a
 ajax
 update of an existing DOM Element or only when it is added?

 And where would I put the Javascript that registers the handler? In the
 Markup-Page of
 the Component? How do I make sure, the handler is added only once?


 J.


 On 18.02.2012 17:39, Christoph Leiter wrote:

 Hello Juergen,

 you can register a function that gets called when wicket creates a new
 element in the DOM:

 Wicket.Event.subscribe('/dom/**node/added', function(element) {
       // do stuff
 });

 You can also use the '/dom/node/removing' channel.

 Hope this helps.


 Christoph




 Jürgen Lind (2012-02-18 16:55):

 Hi,

 I was wondering if there is any kind of best practice to add specific
 javascript
 to a component. I often have the case, where a piece of javascript needs
 to run
 when the component is rendered as part of full-page request, and then
 subsequently
 as part of a self-triggered Ajax-Request or as part of an Ajax-Request
 triggered
 by another component.

 I would like to have one place where I can put the Javascript and be
 shure, it is
 run every time...

 Cheers,

 J.


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



 Mit freundlichen Grüßen,

 Jürgen Lind


 --
 Dr. Jürgen Lind
 iteratec GmbH                Fon: +49 (0)89 614551-44
 Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
 82008 Unterhaching           Web: www.iteratec.de

 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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




Mit freundlichen Grüßen,

Jürgen Lind

-- 
Dr. Jürgen Lind
iteratec GmbH                Fon: +49 (0)89 614551-44
Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
82008 Unterhaching           Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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

Re: Component specific JavaScript

2012-02-19 Thread Jürgen Lind


Strange, I am using 1.4.12 and neither is present there. The javadoc at
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html also does
not show the method with this signature...

J.


On 19.02.2012 12:23, Martin Grigorov wrote:

Hi Juergen,

Both Component#renderHead(IHeaderResponse) 
IHeaderResponse#renderOnDomReadyJavascript() methods are available in 1.4.x.
What exactly you think is not available there ?



  From: Jürgen Lindjuergen.l...@iteratec.de
To: users@wicket.apache.orgusers@wicket.apache.org
Sent: Sunday, 19 February 2012, 12:08
Subject: Re: Component specific JavaScript

Hi Jorge,

thanks for the hint, unfortunately, this method is only available in Wicket 1.5 
-
in this projekt, I am still using Wicket 1.4. Maybe I should stop looking for
a general solution for this project and in the future use the solution you 
suggested...

J.


On 19.02.2012 10:30, Jorge Rodrigez wrote:

Hi,

I think you just need:

class MyComponent extends SomeWicketComponent {

 @Override public void renderHead(IHeaderResponse response) {
   response.renderOnDomReadyJavascript(someJSToExecute());
 }
}

someJSToExecute() will be executed every time an instance of MyComponent is
rendered. Both Ajax and normal requests.

On Sat, Feb 18, 2012 at 5:46 PM, Jürgen Lindjuergen.l...@iteratec.dewrote:


Hi Christoph,

thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on a
ajax
update of an existing DOM Element or only when it is added?

And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


J.


On 18.02.2012 17:39, Christoph Leiter wrote:


Hello Juergen,

you can register a function that gets called when wicket creates a new
element in the DOM:

Wicket.Event.subscribe('/dom/**node/added', function(element) {
// do stuff
});

You can also use the '/dom/node/removing' channel.

Hope this helps.


Christoph




Jürgen Lind (2012-02-18 16:55):


Hi,

I was wondering if there is any kind of best practice to add specific
javascript
to a component. I often have the case, where a piece of javascript needs
to run
when the component is rendered as part of full-page request, and then
subsequently
as part of a self-triggered Ajax-Request or as part of an Ajax-Request
triggered
by another component.

I would like to have one place where I can put the Javascript and be
shure, it is
run every time...

Cheers,

J.



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




Mit freundlichen Grüßen,

Jürgen Lind


--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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





Mit freundlichen Grüßen,

Jürgen Lind




Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



Re: Component specific JavaScript

2012-02-19 Thread Martin Grigorov
Well, I haven't used 1.4.x for almost two years now ...
It seems you need to add implements IHeaderContributor to your component.



 From: Jürgen Lind juergen.l...@iteratec.de
To: users@wicket.apache.org users@wicket.apache.org; Martin Grigorov 
martingrigo...@yahoo.com 
Sent: Sunday, 19 February 2012, 12:37
Subject: Re: Component specific JavaScript
 

Strange, I am using 1.4.12 and neither is present there. The javadoc at
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html also does
not show the method with this signature...

J.


On 19.02.2012 12:23, Martin Grigorov wrote:
 Hi Juergen,

 Both Component#renderHead(IHeaderResponse) 
 IHeaderResponse#renderOnDomReadyJavascript() methods are available in 1.4.x.
 What exactly you think is not available there ?


 
   From: Jürgen Lindjuergen.l...@iteratec.de
 To: users@wicket.apache.orgusers@wicket.apache.org
 Sent: Sunday, 19 February 2012, 12:08
 Subject: Re: Component specific JavaScript

 Hi Jorge,

 thanks for the hint, unfortunately, this method is only available in Wicket 
 1.5 -
 in this projekt, I am still using Wicket 1.4. Maybe I should stop looking for
 a general solution for this project and in the future use the solution you 
 suggested...

 J.


 On 19.02.2012 10:30, Jorge Rodrigez wrote:
 Hi,

 I think you just need:

 class MyComponent extends SomeWicketComponent {

      @Override public void renderHead(IHeaderResponse response) {
        response.renderOnDomReadyJavascript(someJSToExecute());
      }
 }

 someJSToExecute() will be executed every time an instance of MyComponent is
 rendered. Both Ajax and normal requests.

 On Sat, Feb 18, 2012 at 5:46 PM, Jürgen Lindjuergen.l...@iteratec.dewrote:

 Hi Christoph,

 thank you for your reply, I did not know that such a method exists (does
 it for 1.4
 or is this already Wicket 1.5). An secondly: are these handlers fired on a
 ajax
 update of an existing DOM Element or only when it is added?

 And where would I put the Javascript that registers the handler? In the
 Markup-Page of
 the Component? How do I make sure, the handler is added only once?


 J.


 On 18.02.2012 17:39, Christoph Leiter wrote:

 Hello Juergen,

 you can register a function that gets called when wicket creates a new
 element in the DOM:

 Wicket.Event.subscribe('/dom/**node/added', function(element) {
         // do stuff
 });

 You can also use the '/dom/node/removing' channel.

 Hope this helps.


 Christoph




 Jürgen Lind (2012-02-18 16:55):

 Hi,

 I was wondering if there is any kind of best practice to add specific
 javascript
 to a component. I often have the case, where a piece of javascript needs
 to run
 when the component is rendered as part of full-page request, and then
 subsequently
 as part of a self-triggered Ajax-Request or as part of an Ajax-Request
 triggered
 by another component.

 I would like to have one place where I can put the Javascript and be
 shure, it is
 run every time...

 Cheers,

 J.


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



 Mit freundlichen Grüßen,

 Jürgen Lind


 --
 Dr. Jürgen Lind
 iteratec GmbH                Fon: +49 (0)89 614551-44
 Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
 82008 Unterhaching           Web: www.iteratec.de

 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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




 Mit freundlichen Grüßen,

 Jürgen Lind



Mit freundlichen Grüßen,

Jürgen Lind

-- 
Dr. Jürgen Lind
iteratec GmbH                Fon: +49 (0)89 614551-44
Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
82008 Unterhaching           Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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

Re: Component specific JavaScript

2012-02-19 Thread Christoph Leiter

On 18.02.2012 17:46, Jürgen Lind wrote:

thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on
a ajax
update of an existing DOM Element or only when it is added?


This is also available in 1.4. The events are fired when you add 
something to the ajax request via target.add(Component)



And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


I use jQuery and register the handler globally in my main.js for every 
page within $(document).ready().


This approach works very well if you don't want to create subclasses of 
components but rather execute some specific JS if e.g. a css class is 
present. I use it to add a hint image to every autocomplete textfield 
via jQuery.


If it's more component specific then the renderHead() solution seems better.


Christoph

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



Re: Component specific JavaScript

2012-02-19 Thread Jürgen Lind

Christoph,

I have use yout approach (jQuery + css-class) for some time now as well. 
However, I
have found that if the DOM tree grows rather large, a full scan puts 
significant load
on the browser. That's why I want to be more specific and limit the scanning + 
updating
to the relevant parts of the page.

J.

On 19.02.2012 13:02, Christoph Leiter wrote:

On 18.02.2012 17:46, Jürgen Lind wrote:

thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on
a ajax
update of an existing DOM Element or only when it is added?


This is also available in 1.4. The events are fired when you add
something to the ajax request via target.add(Component)


And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


I use jQuery and register the handler globally in my main.js for every
page within $(document).ready().

This approach works very well if you don't want to create subclasses of
components but rather execute some specific JS if e.g. a css class is
present. I use it to add a hint image to every autocomplete textfield
via jQuery.

If it's more component specific then the renderHead() solution seems better.


Christoph

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




--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



Re: Component specific JavaScript

2012-02-19 Thread Christoph Leiter

Hi Juergen,

there's actually no need to scan the full DOM with this method. :) The 
first argument of the event handler is the added element. You can simply 
use it as is or pass it to $() to do jQuery magic just for the relevant 
part.



Christoph


On 19.02.2012 13:18, Jürgen Lind wrote:

Christoph,

I have use yout approach (jQuery + css-class) for some time now as well.
However, I
have found that if the DOM tree grows rather large, a full scan puts
significant load
on the browser. That's why I want to be more specific and limit the
scanning + updating
to the relevant parts of the page.

J.

On 19.02.2012 13:02, Christoph Leiter wrote:

On 18.02.2012 17:46, Jürgen Lind wrote:

thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on
a ajax
update of an existing DOM Element or only when it is added?


This is also available in 1.4. The events are fired when you add
something to the ajax request via target.add(Component)


And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


I use jQuery and register the handler globally in my main.js for every
page within $(document).ready().

This approach works very well if you don't want to create subclasses of
components but rather execute some specific JS if e.g. a css class is
present. I use it to add a hint image to every autocomplete textfield
via jQuery.

If it's more component specific then the renderHead() solution seems
better.


Christoph

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






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



Re: Component specific JavaScript

2012-02-19 Thread Jürgen Lind

I'm not sure if I get you right on this one: the first argument of which event
handler is the added element? Could you probably add some code to illustrate 
this?

J.

On 19.02.2012 13:28, Christoph Leiter wrote:

Hi Juergen,

there's actually no need to scan the full DOM with this method. :) The
first argument of the event handler is the added element. You can simply
use it as is or pass it to $() to do jQuery magic just for the relevant
part.


Christoph


On 19.02.2012 13:18, Jürgen Lind wrote:

Christoph,

I have use yout approach (jQuery + css-class) for some time now as well.
However, I
have found that if the DOM tree grows rather large, a full scan puts
significant load
on the browser. That's why I want to be more specific and limit the
scanning + updating
to the relevant parts of the page.

J.

On 19.02.2012 13:02, Christoph Leiter wrote:

On 18.02.2012 17:46, Jürgen Lind wrote:

thank you for your reply, I did not know that such a method exists (does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers fired on
a ajax
update of an existing DOM Element or only when it is added?


This is also available in 1.4. The events are fired when you add
something to the ajax request via target.add(Component)


And where would I put the Javascript that registers the handler? In the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


I use jQuery and register the handler globally in my main.js for every
page within $(document).ready().

This approach works very well if you don't want to create subclasses of
components but rather execute some specific JS if e.g. a css class is
present. I use it to add a hint image to every autocomplete textfield
via jQuery.

If it's more component specific then the renderHead() solution seems
better.


Christoph

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






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




Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



Re: AjaxLink.onClick() Not Triggered

2012-02-19 Thread Andrea Del Bene

Hi,

 at first glance I can't say what's wrong with your code, but you 
should try debugging wicketAjaxGet function with FireBug or some other 
dev tool. In this way you should find why there's no AJAX call.

I have an Ajax link in a drop down menu, created like this:

 final MenuChoice item = new MenuChoice(Delete) {
 private static final long serialVersionUID = 1L;

 @Override protected AbstractLink newLink(final
String id) {
 final AjaxLinkString  link = new
AjaxLinkString(id) {
 private static final long
serialVersionUID = 1L;
 @Override public void
 onClick(final AjaxRequestTarget
target) {
  confirmer.confirm(model.getTrack(), target);
 }
 };
 return link;
 }
 };

The generated HTML looks like this:

a href=# id=id28 onclick=var
wcall=wicketAjaxGet('?wicket:interface=:1:resultForm:track-list:gridViewportContainer:viewPortTable:dataGridBody:rows:2:cells:12:cell:smartMenu:menuItemRepeater:5:menuItem:labelContainer:menuLink:1:IBehaviorListener:0:',function()
{ }.bind(this),function() { }.bind(this), function() {return
Wicket.$('id28') != null;}.bind(this));return !wcall;Delete/a

However, when I click the link, the onClick() handler is not called. The
Wicket Ajax debug window shows no Ajax activity occurring.

Can anyone see what I'm doing wrong?

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**




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



Re: Component specific JavaScript

2012-02-19 Thread Christoph Leiter

Sure:

$(document).ready(function() {
Wicket.Event.subscribe('/dom/node/added', function(element) {
$(element).css('border', '1px solid red');
   });
});


On 19.02.2012 13:39, Jürgen Lind wrote:

I'm not sure if I get you right on this one: the first argument of which
event
handler is the added element? Could you probably add some code to
illustrate this?

J.

On 19.02.2012 13:28, Christoph Leiter wrote:

Hi Juergen,

there's actually no need to scan the full DOM with this method. :) The
first argument of the event handler is the added element. You can simply
use it as is or pass it to $() to do jQuery magic just for the relevant
part.


Christoph


On 19.02.2012 13:18, Jürgen Lind wrote:

Christoph,

I have use yout approach (jQuery + css-class) for some time now as well.
However, I
have found that if the DOM tree grows rather large, a full scan puts
significant load
on the browser. That's why I want to be more specific and limit the
scanning + updating
to the relevant parts of the page.

J.

On 19.02.2012 13:02, Christoph Leiter wrote:

On 18.02.2012 17:46, Jürgen Lind wrote:

thank you for your reply, I did not know that such a method exists
(does
it for 1.4
or is this already Wicket 1.5). An secondly: are these handlers
fired on
a ajax
update of an existing DOM Element or only when it is added?


This is also available in 1.4. The events are fired when you add
something to the ajax request via target.add(Component)


And where would I put the Javascript that registers the handler? In
the
Markup-Page of
the Component? How do I make sure, the handler is added only once?


I use jQuery and register the handler globally in my main.js for every
page within $(document).ready().

This approach works very well if you don't want to create subclasses of
components but rather execute some specific JS if e.g. a css class is
present. I use it to add a hint image to every autocomplete textfield
via jQuery.

If it's more component specific then the renderHead() solution seems
better.


Christoph

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






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




Mit freundlichen Grüßen,

Jürgen Lind



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



Re: objectautocomplete with first item selected

2012-02-19 Thread northar
Ok, now i researched some some more:
What i wan't to do: Have an autocompletetextbox with custom layout in the
dropdown. 
The default autocomplete fills the first criteria, but then i would like to
modify the html-output
thats created in the dropdown. The default output is final though and
outputs an list list this.

ulli textvalue=abcabc/lili textvalue=abdabd/li/ul

and default renderer for autocompletetextfield, method renderer is final.

public abstract class AbstractAutoCompleteRendererT implements
IAutoCompleteRendererT
{
private static final long serialVersionUID = 1L;

public final void render(final T object, final Response response, final
String criteria)
{
String textValue = getTextValue(object);
if (textValue == null)
{
throw new IllegalStateException(
A call to textValue(Object) returned an 
illegal value: null for object:
 +
object.toString());
}
textValue = textValue.replaceAll(\\\, quot;);

response.write(li textvalue=\quot;quot; + textValue +
quot;\quot;quot;);
final CharSequence handler = 
getOnSelectJavaScriptExpression(object);
if (handler != null)
{
response.write(quot; onselect=\quot;quot; + handler 
+ 'quot;');
}
response.write(quot;);
renderChoice(object, response, criteria);
response.write(/li);
}

public final void renderHeader(final Response response)
{
response.write(ul);
}

public final void renderFooter(final Response response, int count)
{
response.write(/ul);
}


What i would like to do, kind of:
ul class=a
  liCoffee/li
  liTea/li
  liCoca Cola/li
/ul
p NEXT IN LINE /p
ul class=b
  liCoffee and some other values/li
  liTea and adfd/li
  liCoca Cola/li
/ul


Are there any easy obvious ways to do this, that i'm missing?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/objectautocomplete-with-first-item-selected-tp3031312p4401863.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Component specific JavaScript

2012-02-19 Thread Jürgen Lind

Thanks a lot. One last stupid question: is this supposed to work for Wicket 1.4?

J.

On 19.02.2012 15:28, Christoph Leiter wrote:

$(document).ready(function() {
  Wicket.Event.subscribe('/dom/node/added', function(element) {
  $(element).css('border', '1px solid red');
 });
});



--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



wicket DropDownChoice and List box Issue

2012-02-19 Thread mukesh kumar
Hi,

Can any person help my this issue ?
Actually i am facing two issue in my all wicket application version
1.5.3.
First is, I have a dropdown choice. When the page is render first time,
in dropdownchoice , choose one shown. But when select any item from drop
down and click on save button, than choose one not shown. For this, i
defined choose one hard-coded in properties file. Than its work fine. But
issue again created , when dropdownchoice have a mandatory field. In this
case, its not shown blank field validation, because its think that choose
one is already a field in property file.  
And second issue is that, in ListChoice. When We click for submit a page
or save the page, for any issue, when page is not successfully submitted,
than choose one  shown in ListChoice By default. I try lot of code for these
two issue, but i am unable to solve it.
   So, please solve my this issue, and send with right code
ASAP.
   


Thanks to all of you. Please reply soon.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-DropDownChoice-and-List-box-Issue-tp4401946p4401946.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Howto go for editable grid with add/remove row in wicket 1.4?

2012-02-19 Thread Emmanouil Batsis (Manos)
Subject says it all... currently using inmethod from wicketstuff but 
there is no add/remove row in the 1.4.x versions.


Manos


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



Re: Integrating Wicket with Jquery Flexigrid

2012-02-19 Thread AGarhy
Check out Flexigrid for Wicket: http://code.google.com/p/flexigrid-for-wicket/

Verma Shalini (HCTM/ETA Shalini.Verma at us.bosch.com writes:

 
 Hi,
 
 I was trying to search if anybody has integrated the Jquery Felxigrid plugin 
with Wicket.As the tool is very powerful.
 
 Thanks
 Shalini
 
 




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



Re: Howto go for editable grid with add/remove row in wicket 1.4?

2012-02-19 Thread Jorge Rodrigez
You just need to add/remove an item to your data source.
Next time you rerender the grid it will show/hide the added/removed
item/row.

On Sun, Feb 19, 2012 at 6:46 PM, Emmanouil Batsis (Manos) ma...@abiss.grwrote:

 Subject says it all... currently using inmethod from wicketstuff but there
 is no add/remove row in the 1.4.x versions.

 Manos


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




Shrinking the session size, simply by zipping it. Saved my day.

2012-02-19 Thread Per
Hi all,

thought I'd share a really simple hack that we're using to reduce the Wicket
session size (on Wicket 1.4). 

Background: We deploy to Google App Engine, and there's a strict 1MB limit.
We've been using LDMs and all sorts of optimisations, but we were still
reaching the limits when a user viewed long lists, or used many tabs, and as
a result pages often got evicted while still needed, resulting in ugly page
expired errors.

Turns out, you can zip the session's attributes on the way out, e.g. on
the fly, with minimal latency introduced. In over a year of squeezing bytes
out of the object graph, this had never occurred to me. But now it's kind of
obvious, and really easy to code as well... Check out our blog if you ever
had this problem.

http://smallimprove.wordpress.com/2012/02/19/reducing-wicket-session-size-to-one-third


Cheers,
Per



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Shrinking-the-session-size-simply-by-zipping-it-Saved-my-day-tp4402980p4402980.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Howto go for editable grid with add/remove row in wicket 1.4?

2012-02-19 Thread Emmanouil Batsis (Manos)

On 02/19/2012 10:56 PM, Jorge Rodrigez wrote:

You just need to add/remove an item to your data source.
Next time you rerender the grid it will show/hide the added/removed


Any custom datasource examples out there? Essentially I'd like to bind 
the grid to a POJO collection member.


Manos

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



Re: Shrinking the session size, simply by zipping it. Saved my day.

2012-02-19 Thread robmcguinness
very nice thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Shrinking-the-session-size-simply-by-zipping-it-Saved-my-day-tp4402980p4403065.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: Component specific JavaScript

2012-02-19 Thread Wilhelmsen Tor Iver
 Thanks a lot. One last stupid question: is this supposed to work for Wicket 
 1.4?

Doubful, the event system was added in 1.5

- Tor Iver

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



Re: Shrinking the session size, simply by zipping it. Saved my day.

2012-02-19 Thread Josh Kamau
Thanks for the post.

I wish this could be integrated into the core.

Josh.

On Mon, Feb 20, 2012 at 5:32 AM, robmcguinness 
robert.mcguinness@gmail.com wrote:

 very nice thanks!

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Shrinking-the-session-size-simply-by-zipping-it-Saved-my-day-tp4402980p4403065.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Component specific JavaScript

2012-02-19 Thread Jürgen Lind

That's right, I just checked the sources... Anyways, although migration the 
project
now does not make sense, it is a good idea for the next project...

Thanks everybody,

J.

On 20.02.2012 08:31, Wilhelmsen Tor Iver wrote:

Thanks a lot. One last stupid question: is this supposed to work for Wicket 1.4?


Doubful, the event system was added in 1.5

- Tor Iver

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




Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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