Re: Which github branch

2012-10-20 Thread Carl-Eric Menzel

 Wicket github has both a 'master'  'trunk'. Which one should I
 choose? (or is there something else for 'latest 1.6.x code'?)

It's currently still in master.

Carl-Eric

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



Re: IAjaxCallDecorator deprecated by no suggested replacement in Migration to 6.x

2012-10-20 Thread vineet semwal
iajaxcalldecoration is replaced with iajaxcalllistener and yes it's
specified in migration

https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax

On Sat, Oct 20, 2012 at 1:03 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 It looks like IAjaxCallDecorator is no longer available in 6.x

 I found this nabble reference:

 My question is: should we try to translate IAjaxCallDecorator to
 IAjaxCallListener or we should drop IACD completely ?
 The migration page will describe to do the translation in any
 case!

 Seems like IACD has been dropped completely but the Wicket 6.x migration
 page doesn't have any reference explaining how to replace it.




-- 
regards,

Vineet Semwal

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



Re: PaletteButton#onComponentTag(ComponentTag) does not call super

2012-10-20 Thread Sven Meier

That was probably overlooked, please create an issue in Jira.

Thanks
Sven

On 10/20/2012 12:36 AM, Sebastien wrote:

Dear all,

Just a simple (I guess) question: Is there any particular reason why
o.a.w.extensions.markup.html.form.palette.Palette.PaletteButton.onComponentTag(ComponentTag
tag)
does not call: super.onComponentTag(tag) ?

I do not really figure out what may break this call, but I see what it does
not do...
For instance, I am not able to override Palette#newAddComponent like
return super.newAddComponent().setOutputMarkupId(true);

Thanks in advance,
Sebastien.




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



RE: IAjaxCallDecorator deprecated by no suggested replacement in Migration to 6.x

2012-10-20 Thread Chris Colman
iajaxcalldecoration is replaced with iajaxcalllistener and yes it's
specified in migration

https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax

Whoah! That's a much better migration page than the one I was using.

Perhaps this old one should be changed to reference the migration page
you provided because the one I was using comes up first when I google

wicket migration 6

https://cwiki.apache.org/WICKET/migration-to-wicket-60.html - old one?



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



RE: IAjaxCallDecorator deprecated by no suggested replacement in Migration to 6.x

2012-10-20 Thread Chris Colman
iajaxcalldecoration is replaced with iajaxcalllistener and yes it's
specified in migration

https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax

Whoah! That's a much better migration page than the one I was using.

Perhaps this old one should be changed to reference the migration page
you provided because the one I was using comes up first when I google

wicket migration 6

https://cwiki.apache.org/WICKET/migration-to-wicket-60.html - old one?

On closer inspection it seems we need to use both of these Migration 6
pages for full coverage of all migration 6 issues.

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



Re: IAjaxCallDecorator deprecated by no suggested replacement in Migration to 6.x

2012-10-20 Thread vineet semwal
On Sat, Oct 20, 2012 at 1:34 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
iajaxcalldecoration is replaced with iajaxcalllistener and yes it's
specified in migration

https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax
   wicket ajax related migration^^

Whoah! That's a much better migration page than the one I was using.

Perhaps this old one should be changed to reference the migration page
you provided because the one I was using comes up first when I google

wicket migration 6

https://cwiki.apache.org/WICKET/migration-to-wicket-60.html - old one?
complete wicket migration ^^ ,url for wicket ajax related migration is
 provided here ;)

 On closer inspection it seems we need to use both of these Migration 6
 pages for full coverage of all migration 6 issues.

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




-- 
regards,

Vineet Semwal

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



Re: PaletteButton#onComponentTag(ComponentTag) does not call super

2012-10-20 Thread Sebastien
Hi Sven,

Done: https://issues.apache.org/jira/browse/WICKET-4826

Thanks,
Sebastien.

On Sat, Oct 20, 2012 at 9:53 AM, Sven Meier s...@meiers.net wrote:

 That was probably overlooked, please create an issue in Jira.

 Thanks
 Sven


 On 10/20/2012 12:36 AM, Sebastien wrote:

 Dear all,

 Just a simple (I guess) question: Is there any particular reason why
 o.a.w.extensions.markup.html.**form.palette.Palette.**
 PaletteButton.onComponentTag(**ComponentTag
 tag)
 does not call: super.onComponentTag(tag) ?

 I do not really figure out what may break this call, but I see what it
 does
 not do...
 For instance, I am not able to override Palette#newAddComponent like
 return super.newAddComponent().**setOutputMarkupId(true);

 Thanks in advance,
 Sebastien.



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




Re: Upgrade Advice

2012-10-20 Thread Bill Speirs
I would say no only because going from 1.5 - 6 was super easy. I
changed a few ints to longs, added a bunch of type parameters for
sorting and then it all just worked.

Bill-

On Fri, Oct 19, 2012 at 4:30 PM, Jered Myers
jer...@maplewoodsoftware.com wrote:
 I am working on migrating a large application from Wicket 1.4.18 to Wicket
 6.x.  Is it better to convert to 1.5 first and then to 6.x or to just go
 straight to 6.x?  Thanks.  Also, an early thanks to everybody who took the
 time to write the migration guides!

 Jered


 -
 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: Upgrade Advice

2012-10-20 Thread Chris Colman
I would say no only because going from 1.5 - 6 was super easy. I
changed a few ints to longs, added a bunch of type parameters for
sorting and then it all just worked.

While I found 1.5 - 6 a lot easier than 1.4 - 1.5 if you like
incremental development and want to have some intermediate compilable
and runnable code then I suggest you target 1.5 first.

1.4 has quite a few methods/classes that are deprecated in 1.5 - this
means that even though they are shunned upon they are still present
and working - which makes your 1.4 - 1.5 efforts easier because you can
avoid doing quite a lot code changes which means less effort before you
get a working system again.

Version 6, on the other hand, removes many of the deprecations of 1.5
which means you will have to replace these before you can a successful
compile.

It depends on your style but I like to do things in shorter increments
with many small successes rather than a big huge effort with no success
for possibly many days, depending on the size of your code, and then one
big success at the end (but you'll probably still have some runtime only
errors to tackle).


Bill-

On Fri, Oct 19, 2012 at 4:30 PM, Jered Myers
jer...@maplewoodsoftware.com wrote:
 I am working on migrating a large application from Wicket 1.4.18 to
Wicket
 6.x.  Is it better to convert to 1.5 first and then to 6.x or to just
go
 straight to 6.x?  Thanks.  Also, an early thanks to everybody who
took
the
 time to write the migration guides!

 Jered


 -
 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


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



Re: Upgrade Advice

2012-10-20 Thread Sebastien
+1, perfectly explained IMHO. Migrating from 1.4 to 6 directly is much more
complicated than performing the migration in 2 steps and much more error
prone.

On Sat, Oct 20, 2012 at 2:55 PM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 I would say no only because going from 1.5 - 6 was super easy. I
 changed a few ints to longs, added a bunch of type parameters for
 sorting and then it all just worked.

 While I found 1.5 - 6 a lot easier than 1.4 - 1.5 if you like
 incremental development and want to have some intermediate compilable
 and runnable code then I suggest you target 1.5 first.

 1.4 has quite a few methods/classes that are deprecated in 1.5 - this
 means that even though they are shunned upon they are still present
 and working - which makes your 1.4 - 1.5 efforts easier because you can
 avoid doing quite a lot code changes which means less effort before you
 get a working system again.

 Version 6, on the other hand, removes many of the deprecations of 1.5
 which means you will have to replace these before you can a successful
 compile.

 It depends on your style but I like to do things in shorter increments
 with many small successes rather than a big huge effort with no success
 for possibly many days, depending on the size of your code, and then one
 big success at the end (but you'll probably still have some runtime only
 errors to tackle).

 
 Bill-
 
 On Fri, Oct 19, 2012 at 4:30 PM, Jered Myers
 jer...@maplewoodsoftware.com wrote:
  I am working on migrating a large application from Wicket 1.4.18 to
 Wicket
  6.x.  Is it better to convert to 1.5 first and then to 6.x or to just
 go
  straight to 6.x?  Thanks.  Also, an early thanks to everybody who
 took
 the
  time to write the migration guides!
 
  Jered
 
 
  -
  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


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




JSON response in wicket = 6.0.0

2012-10-20 Thread Gonzalo Aguilar Delgado
Hello, 

I was looking to some code and googling around but cannot find a
suitable solution for my problem. 


I have an AbstractDefaultAjaxBehavior that I'm implemented the function
respond(AjaxRequestTarget target) like this

---
@Override
protected void respond(AjaxRequestTarget target) {



JsonChoiceRendererT jsonRenderer = new
JsonChoiceRendererT(getChoices());

target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
getRenderer()));

}

---

But this is not a JSON response when it is called from javascript. I
want to respond with an application/json response.

I saw something like:

  RequestCycle requestCycle = RequestCycle.get();
  requestCycle.getResponse().setCharacterEncoding(UTF-8);
requestCycle.getResponse().setContentType(application/json;);

But it means that I have to override the final void onRequest() of the
AbstractAjaxBehavior class, but this is final so I cannot. 


What's the best way to do it with newer versions of wicket?


Thank you a lot in advance.


Re: JSON response in wicket = 6.0.0

2012-10-20 Thread Ernesto Reinaldo Barreiro
Try the following

TextRequestHandler textRequestHandler = new
TextRequestHandler(application/json, UTF-8, Your JSON HERE);
RequestCycle.get().scheduleRequestHandlerAfterCurrent(textRequestHandler);

On Sat, Oct 20, 2012 at 4:00 PM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Hello,

 I was looking to some code and googling around but cannot find a
 suitable solution for my problem.


 I have an AbstractDefaultAjaxBehavior that I'm implemented the function
 respond(AjaxRequestTarget target) like this

 ---
 @Override
 protected void respond(AjaxRequestTarget target) {



 JsonChoiceRendererT jsonRenderer = new
 JsonChoiceRendererT(getChoices());

 target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
 getRenderer()));

 }

 ---

 But this is not a JSON response when it is called from javascript. I
 want to respond with an application/json response.

 I saw something like:

   RequestCycle requestCycle = RequestCycle.get();
   requestCycle.getResponse().setCharacterEncoding(UTF-8);
 requestCycle.getResponse().setContentType(application/json;);

 But it means that I have to override the final void onRequest() of the
 AbstractAjaxBehavior class, but this is final so I cannot.


 What's the best way to do it with newer versions of wicket?


 Thank you a lot in advance.




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com


Re: JSON response in wicket = 6.0.0

2012-10-20 Thread Ernesto Reinaldo Barreiro
on the respond method of your AbstractDefaultAjaxBehavior

On Sat, Oct 20, 2012 at 4:07 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Try the following

 TextRequestHandler textRequestHandler = new
 TextRequestHandler(application/json, UTF-8, Your JSON HERE);
 RequestCycle.get().scheduleRequestHandlerAfterCurrent(textRequestHandler);

 On Sat, Oct 20, 2012 at 4:00 PM, Gonzalo Aguilar Delgado 
 gagui...@aguilardelgado.com wrote:

 Hello,

 I was looking to some code and googling around but cannot find a
 suitable solution for my problem.


 I have an AbstractDefaultAjaxBehavior that I'm implemented the function
 respond(AjaxRequestTarget target) like this

 ---
 @Override
 protected void respond(AjaxRequestTarget target) {



 JsonChoiceRendererT jsonRenderer = new
 JsonChoiceRendererT(getChoices());

 target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
 getRenderer()));

 }

 ---

 But this is not a JSON response when it is called from javascript. I
 want to respond with an application/json response.

 I saw something like:

   RequestCycle requestCycle = RequestCycle.get();
   requestCycle.getResponse().setCharacterEncoding(UTF-8);
 requestCycle.getResponse().setContentType(application/json;);

 But it means that I have to override the final void onRequest() of the
 AbstractAjaxBehavior class, but this is final so I cannot.


 What's the best way to do it with newer versions of wicket?


 Thank you a lot in advance.




 --
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com


Regression when using wicket:enclosure with non wicket namespace in 6.0

2012-10-20 Thread Chris Colman
We have a panel with an enclosure that worked fine in 1.5 but now fails
in 6.0
 
The page uses a non wicket namespace: i.e. instead of using wicket: ...
 everywhere it uses, for example mynamespace: ... 
and adds xmlns:mynamespace to the html tag to declare the non standard
namespace.
 
If we remove the namespace declaration from the html tag and rename all
the mynamespace: tags to wicket: then the enclosure works fine.
 
I remember a similar problem happened earlier in 1.5 that was caused by
some Wicket code hardcoding the namespace to be 'wicket' instead of
checking the namespace declared for each individual markup file. This
problem was eventually fixed in 1.5. Here is a link to that issue:
 
https://issues.apache.org/jira/browse/WICKET-4330
 


Re: JSON response in wicket = 6.0.0

2012-10-20 Thread Gonzalo Aguilar Delgado
Hello Ernesto, 

Yes!!! It did the trick! Great!

Let me understand, you schedule a request handler just after the
current, like in the onRequest...
AjaxRequestTarget target =
app.newAjaxRequestTarget(getComponent().getPage());

RequestCycle requestCycle = RequestCycle.get();
requestCycle.scheduleRequestHandlerAfterCurrent(target);


So what happens with the current one. It returns nothing? Does it
changes something in the request?

Thank you a lot!



El sáb, 20-10-2012 a las 16:08 +0200, Ernesto Reinaldo Barreiro
escribió:

 on the respond method of your AbstractDefaultAjaxBehavior
 
 On Sat, Oct 20, 2012 at 4:07 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:
 
  Try the following
 
  TextRequestHandler textRequestHandler = new
  TextRequestHandler(application/json, UTF-8, Your JSON HERE);
  RequestCycle.get().scheduleRequestHandlerAfterCurrent(textRequestHandler);
 
  On Sat, Oct 20, 2012 at 4:00 PM, Gonzalo Aguilar Delgado 
  gagui...@aguilardelgado.com wrote:
 
  Hello,
 
  I was looking to some code and googling around but cannot find a
  suitable solution for my problem.
 
 
  I have an AbstractDefaultAjaxBehavior that I'm implemented the function
  respond(AjaxRequestTarget target) like this
 
  ---
  @Override
  protected void respond(AjaxRequestTarget target) {
 
 
 
  JsonChoiceRendererT jsonRenderer = new
  JsonChoiceRendererT(getChoices());
 
  target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
  getRenderer()));
 
  }
 
  ---
 
  But this is not a JSON response when it is called from javascript. I
  want to respond with an application/json response.
 
  I saw something like:
 
RequestCycle requestCycle = RequestCycle.get();
requestCycle.getResponse().setCharacterEncoding(UTF-8);
  requestCycle.getResponse().setContentType(application/json;);
 
  But it means that I have to override the final void onRequest() of the
  AbstractAjaxBehavior class, but this is final so I cannot.
 
 
  What's the best way to do it with newer versions of wicket?
 
 
  Thank you a lot in advance.
 
 
 
 
  --
  Regards - Ernesto Reinaldo Barreiro
  Antilia Soft
  http://antiliasoft.com
 
 
 
 


Re: JSON response in wicket = 6.0.0

2012-10-20 Thread Gonzalo Aguilar Delgado
Hello again, 

Sorry. I was thinking about extending AbstractAjaxBehavior directly. It
seems to have cleaner code but I loss some functionality. 

Could it be right? 


And doing like you said. The getRequestHandler(); returns your
TextRequestHandler. Do I need the stuff inside
AbstractDefaultAjaxBehavior?

Functions like updateAjaxAttributes, renderAjaxAttributes,
appendListenerHandler, getCallbackFunction and so on, does not seem
useful for me now. 


public final void onRequest()
{
//  WebApplication app =
(WebApplication)getComponent().getApplication();
//  AjaxRequestTarget target =
app.newAjaxRequestTarget(getComponent().getPage());
//
//  RequestCycle requestCycle = RequestCycle.get();
//  requestCycle.scheduleRequestHandlerAfterCurrent(target);
//
//  respond(target);

IRequestHandler handler = getRequestHandler();

if(handler!=null)
RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
}


El sáb, 20-10-2012 a las 16:08 +0200, Ernesto Reinaldo Barreiro
escribió:

 on the respond method of your AbstractDefaultAjaxBehavior
 
 On Sat, Oct 20, 2012 at 4:07 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:
 
  Try the following
 
  TextRequestHandler textRequestHandler = new
  TextRequestHandler(application/json, UTF-8, Your JSON HERE);
  RequestCycle.get().scheduleRequestHandlerAfterCurrent(textRequestHandler);
 
  On Sat, Oct 20, 2012 at 4:00 PM, Gonzalo Aguilar Delgado 
  gagui...@aguilardelgado.com wrote:
 
  Hello,
 
  I was looking to some code and googling around but cannot find a
  suitable solution for my problem.
 
 
  I have an AbstractDefaultAjaxBehavior that I'm implemented the function
  respond(AjaxRequestTarget target) like this
 
  ---
  @Override
  protected void respond(AjaxRequestTarget target) {
 
 
 
  JsonChoiceRendererT jsonRenderer = new
  JsonChoiceRendererT(getChoices());
 
  target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
  getRenderer()));
 
  }
 
  ---
 
  But this is not a JSON response when it is called from javascript. I
  want to respond with an application/json response.
 
  I saw something like:
 
RequestCycle requestCycle = RequestCycle.get();
requestCycle.getResponse().setCharacterEncoding(UTF-8);
  requestCycle.getResponse().setContentType(application/json;);
 
  But it means that I have to override the final void onRequest() of the
  AbstractAjaxBehavior class, but this is final so I cannot.
 
 
  What's the best way to do it with newer versions of wicket?
 
 
  Thank you a lot in advance.
 
 
 
 
  --
  Regards - Ernesto Reinaldo Barreiro
  Antilia Soft
  http://antiliasoft.com
 
 
 
 


Re: JSON response in wicket = 6.0.0

2012-10-20 Thread Ernesto Reinaldo Barreiro
Gonzalo,

You want to use AbstractDefaultAjaxBehavior as context to serve some JSON?
Then what you do is

add(behavior = new AbstractDefaultAjaxBehavior() {
 @Override
protected void respond(AjaxRequestTarget target) {
TextRequestHandler handler = new TextRequestHandler(...);
RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
}
});

then use use behavior.getCallbackUrl() to generate the URL you need to use
on client side to retrieve that JSON.


On Sat, Oct 20, 2012 at 5:57 PM, Gonzalo Aguilar Delgado 
gagui...@aguilardelgado.com wrote:

 Hello again,

 Sorry. I was thinking about extending AbstractAjaxBehavior directly. It
 seems to have cleaner code but I loss some functionality.

 Could it be right?


 And doing like you said. The getRequestHandler(); returns your
 TextRequestHandler. Do I need the stuff inside
 AbstractDefaultAjaxBehavior?

 Functions like updateAjaxAttributes, renderAjaxAttributes,
 appendListenerHandler, getCallbackFunction and so on, does not seem
 useful for me now.


 public final void onRequest()
 {
 //  WebApplication app =
 (WebApplication)getComponent().getApplication();
 //  AjaxRequestTarget target =
 app.newAjaxRequestTarget(getComponent().getPage());
 //
 //  RequestCycle requestCycle = RequestCycle.get();
 //  requestCycle.scheduleRequestHandlerAfterCurrent(target);
 //
 //  respond(target);

 IRequestHandler handler = getRequestHandler();

 if(handler!=null)

 RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
 }


 El sáb, 20-10-2012 a las 16:08 +0200, Ernesto Reinaldo Barreiro
 escribió:

  on the respond method of your AbstractDefaultAjaxBehavior
 
  On Sat, Oct 20, 2012 at 4:07 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   Try the following
  
   TextRequestHandler textRequestHandler = new
   TextRequestHandler(application/json, UTF-8, Your JSON HERE);
  
 RequestCycle.get().scheduleRequestHandlerAfterCurrent(textRequestHandler);
  
   On Sat, Oct 20, 2012 at 4:00 PM, Gonzalo Aguilar Delgado 
   gagui...@aguilardelgado.com wrote:
  
   Hello,
  
   I was looking to some code and googling around but cannot find a
   suitable solution for my problem.
  
  
   I have an AbstractDefaultAjaxBehavior that I'm implemented the
 function
   respond(AjaxRequestTarget target) like this
  
   ---
   @Override
   protected void respond(AjaxRequestTarget target) {
  
  
  
   JsonChoiceRendererT jsonRenderer = new
   JsonChoiceRendererT(getChoices());
  
   target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
   getRenderer()));
  
   }
  
   ---
  
   But this is not a JSON response when it is called from javascript. I
   want to respond with an application/json response.
  
   I saw something like:
  
 RequestCycle requestCycle = RequestCycle.get();
 requestCycle.getResponse().setCharacterEncoding(UTF-8);
  
 requestCycle.getResponse().setContentType(application/json;);
  
   But it means that I have to override the final void onRequest() of the
   AbstractAjaxBehavior class, but this is final so I cannot.
  
  
   What's the best way to do it with newer versions of wicket?
  
  
   Thank you a lot in advance.
  
  
  
  
   --
   Regards - Ernesto Reinaldo Barreiro
   Antilia Soft
   http://antiliasoft.com
  
  
 
 




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com


Re: JSON response in wicket = 6.0.0

2012-10-20 Thread Ernesto Reinaldo Barreiro
or your question is why this works?

On Sat, Oct 20, 2012 at 6:18 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Gonzalo,

 You want to use AbstractDefaultAjaxBehavior as context to serve some
 JSON? Then what you do is

 add(behavior = new AbstractDefaultAjaxBehavior() {
  @Override
 protected void respond(AjaxRequestTarget target) {
 TextRequestHandler handler = new TextRequestHandler(...);
  RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
 }
 });

 then use use behavior.getCallbackUrl() to generate the URL you need to use
 on client side to retrieve that JSON.


 On Sat, Oct 20, 2012 at 5:57 PM, Gonzalo Aguilar Delgado 
 gagui...@aguilardelgado.com wrote:

 Hello again,

 Sorry. I was thinking about extending AbstractAjaxBehavior directly. It
 seems to have cleaner code but I loss some functionality.

 Could it be right?


 And doing like you said. The getRequestHandler(); returns your
 TextRequestHandler. Do I need the stuff inside
 AbstractDefaultAjaxBehavior?

 Functions like updateAjaxAttributes, renderAjaxAttributes,
 appendListenerHandler, getCallbackFunction and so on, does not seem
 useful for me now.


 public final void onRequest()
 {
 //  WebApplication app =
 (WebApplication)getComponent().getApplication();
 //  AjaxRequestTarget target =
 app.newAjaxRequestTarget(getComponent().getPage());
 //
 //  RequestCycle requestCycle = RequestCycle.get();
 //  requestCycle.scheduleRequestHandlerAfterCurrent(target);
 //
 //  respond(target);

 IRequestHandler handler = getRequestHandler();

 if(handler!=null)

 RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
 }


 El sáb, 20-10-2012 a las 16:08 +0200, Ernesto Reinaldo Barreiro
 escribió:

  on the respond method of your AbstractDefaultAjaxBehavior
 
  On Sat, Oct 20, 2012 at 4:07 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   Try the following
  
   TextRequestHandler textRequestHandler = new
   TextRequestHandler(application/json, UTF-8, Your JSON HERE);
  
 RequestCycle.get().scheduleRequestHandlerAfterCurrent(textRequestHandler);
  
   On Sat, Oct 20, 2012 at 4:00 PM, Gonzalo Aguilar Delgado 
   gagui...@aguilardelgado.com wrote:
  
   Hello,
  
   I was looking to some code and googling around but cannot find a
   suitable solution for my problem.
  
  
   I have an AbstractDefaultAjaxBehavior that I'm implemented the
 function
   respond(AjaxRequestTarget target) like this
  
   ---
   @Override
   protected void respond(AjaxRequestTarget target) {
  
  
  
   JsonChoiceRendererT jsonRenderer = new
   JsonChoiceRendererT(getChoices());
  
   target.appendJavaScript(jsonRenderer.renderJsonArray(getComponent(),
   getRenderer()));
  
   }
  
   ---
  
   But this is not a JSON response when it is called from javascript. I
   want to respond with an application/json response.
  
   I saw something like:
  
 RequestCycle requestCycle = RequestCycle.get();
 requestCycle.getResponse().setCharacterEncoding(UTF-8);
  
 requestCycle.getResponse().setContentType(application/json;);
  
   But it means that I have to override the final void onRequest() of
 the
   AbstractAjaxBehavior class, but this is final so I cannot.
  
  
   What's the best way to do it with newer versions of wicket?
  
  
   Thank you a lot in advance.
  
  
  
  
   --
   Regards - Ernesto Reinaldo Barreiro
   Antilia Soft
   http://antiliasoft.com
  
  
 
 




 --
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com


wicket-6 User friendly form validation with Wicket (stuq)

2012-10-20 Thread Rafał Krupiński

Hi all!
There is old article on putting validation messages near the input 
fields at 
http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket


Is there a wicket-native method of doing this in wicket 6 or should I 
follow the article?


Rafał

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



Re: wicket-tree with two Hibernate entities

2012-10-20 Thread Sandor Feher
Thanks. All work fine.

s



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-with-two-Hibernate-entities-tp4653122p4653163.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: wicket-tree with two Hibernate entities

2012-10-20 Thread Sven Meier

That's good to hear :).

Sven

On 10/20/2012 09:41 PM, Sandor Feher wrote:

Thanks. All work fine.

s



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-with-two-Hibernate-entities-tp4653122p4653163.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




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



Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Alec Swan
Hello,

This Wiki page explains how to add custom CSS styles to Feedback
messages in 1.4+:
https://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html

Basically, it suggests that you override
FeedbackPanel#newMessageDisplayComponent(..) method and add the custom
CSS class to the component before returning it.

However, this approach does not work in 1.5 because
FeedbackPanel.MessageListView#populateItem calls
FeedbackPanel#newMessageDisplayComponent(..) and then immediately adds
an AttributeModifier that replaces CSS class that was set inside
newMessageDisplayComponent().

Is this a bug or Wiki is wrong?
Is there any workaround without creating a custom FeedbackPanel?

Thanks,

Alec

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



Re: Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Alec Swan
Note that I need to set CSS styles on the label (span) and not the
list item (li) and hence cannot override getCSSClass() because it is
applied to both.

On Sat, Oct 20, 2012 at 2:58 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 This Wiki page explains how to add custom CSS styles to Feedback
 messages in 1.4+:
 https://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html

 Basically, it suggests that you override
 FeedbackPanel#newMessageDisplayComponent(..) method and add the custom
 CSS class to the component before returning it.

 However, this approach does not work in 1.5 because
 FeedbackPanel.MessageListView#populateItem calls
 FeedbackPanel#newMessageDisplayComponent(..) and then immediately adds
 an AttributeModifier that replaces CSS class that was set inside
 newMessageDisplayComponent().

 Is this a bug or Wiki is wrong?
 Is there any workaround without creating a custom FeedbackPanel?

 Thanks,

 Alec

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



Re: Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Sven Meier

I was just going to ask you why you don't overwrite #getCSSClass().

What harm does it if the CSS class is on the li too?

Sven

On 10/20/2012 11:01 PM, Alec Swan wrote:

Note that I need to set CSS styles on the label (span) and not the
list item (li) and hence cannot override getCSSClass() because it is
applied to both.

On Sat, Oct 20, 2012 at 2:58 PM, Alec Swan alecs...@gmail.com wrote:

Hello,

This Wiki page explains how to add custom CSS styles to Feedback
messages in 1.4+:
https://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html

Basically, it suggests that you override
FeedbackPanel#newMessageDisplayComponent(..) method and add the custom
CSS class to the component before returning it.

However, this approach does not work in 1.5 because
FeedbackPanel.MessageListView#populateItem calls
FeedbackPanel#newMessageDisplayComponent(..) and then immediately adds
an AttributeModifier that replaces CSS class that was set inside
newMessageDisplayComponent().

Is this a bug or Wiki is wrong?
Is there any workaround without creating a custom FeedbackPanel?

Thanks,

Alec

-
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: Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Sebastien
Hi,

I also suffer from this feature (having the same CSS class applied onto
both li and span) since a long time.
@Sven, this could be important to remove one or the other class attribute
in case the class return by getCSSClass() is not from your own CSS (you
want to apply jquery-ui style for instance)
The update to be done on FeedbackPanel is really straightforward and could
easily be backward compatible. However, I never found the 20 necessary
minutes to make a pull request...

Anyway, the following hack could be done on a extended FeedbackPanel to
remove the class on the span, you can adapt it to remove class on li tags
instead:

@Override
protected void onBeforeRender()
{
super.onBeforeRender();

// removes the 'errorLevel' class on span wicket:id=message.
ListView? messages = (ListView?)
this.get(feedbackul:messages);
IteratorComponent iterator = messages.iterator();

while (iterator.hasNext())
{
Component component = iterator.next().get(message);
//iterator.next() returns the ListItem

if (component != null)
{
component.add(AttributeModifier.remove(class));
}
}
}

Best regards,
Sebastien.


On Sat, Oct 20, 2012 at 11:05 PM, Sven Meier s...@meiers.net wrote:

 I was just going to ask you why you don't overwrite #getCSSClass().

 What harm does it if the CSS class is on the li too?

 Sven


 On 10/20/2012 11:01 PM, Alec Swan wrote:

 Note that I need to set CSS styles on the label (span) and not the
 list item (li) and hence cannot override getCSSClass() because it is
 applied to both.

 On Sat, Oct 20, 2012 at 2:58 PM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 This Wiki page explains how to add custom CSS styles to Feedback
 messages in 1.4+:
 https://cwiki.apache.org/**WICKET/css-enabled-feedback-**panel.htmlhttps://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html

 Basically, it suggests that you override
 FeedbackPanel#**newMessageDisplayComponent(..) method and add the custom
 CSS class to the component before returning it.

 However, this approach does not work in 1.5 because
 FeedbackPanel.MessageListView#**populateItem calls
 FeedbackPanel#**newMessageDisplayComponent(..) and then immediately adds
 an AttributeModifier that replaces CSS class that was set inside
 newMessageDisplayComponent().

 Is this a bug or Wiki is wrong?
 Is there any workaround without creating a custom FeedbackPanel?

 Thanks,

 Alec

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



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




Re: Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Sebastien
Sven,

If you agree to have two methods: getListCSSClass and getLabelCSSClass
(which apply respectively on li and span), and mark getCSSClass as
deprecated (until marked as private), then the path is ready for branch
wicket-1.5.x. I am waiting for your go-ahead to send the patch somewhere or
submit the pull request on github.

If you do not agree, please tell me what I can do.

Thanks  best regards,
Sebastien.