RE: how to reuse a label in the same page?

2008-12-12 Thread Bruno Cesar Borges
lol... 

Alright, I agree with you, but think about. There are some cases where creating 
a fragment or a panel to reuse, wouldn't address the main advantage. We could 
save a *lot* of memory usage this way, and I think it would be a cool feature. 
Even with Ajax wouldn't be a problem.

-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
Sent: Friday, December 12, 2008 10:33 AM
To: users@wicket.apache.org
Subject: Re: how to reuse a label in the same page?


The fact that you want to bind a component in two places and complain
that you can't, is a code smell: you should extract that component to
a panel or fragment and reuse the panel (/fragment).

Martijn

On Fri, Dec 12, 2008 at 1:32 PM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 ieuw

 On Fri, Dec 12, 2008 at 1:30 PM, Bruno Cesar Borges
 brunobor...@cetip.com.br wrote:
 Martijn, it is possible to create nodes inside a DOM tree refering to 
 another DOM node. What if it was possible to do the same with Wicket?

 div wicket:id=myPanel
  span wicket:id=foolabel/span
  span wicket:ref=fooagain/span
 /div

 span wicket:ref=myPanel.fooagain but outside panel!/span

 Regards,
 Bruno

 -Original Message-
 From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
 Sent: Friday, December 12, 2008 5:18 AM
 To: users@wicket.apache.org
 Subject: Re: how to reuse a label in the same page?


 Nope, wicket:id is a 1-1 mapping at the same dom tree level. You can
 reuse id's at different levels or in different branches of the dom
 tree, but not as siblings.

 a href=# wicket:id=foospan wicket:id=foo/span/a works
 but another
 a href=# wicket:id=foo/a will fail (and rightfully so)

 Martijn

 On Fri, Dec 12, 2008 at 6:20 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 I'm pretty sure that you can just add it once in Java and multiple times in
 the HTML, although I've never pondered the (potential) side-effects of
 this.  Give it a shot and let us know how it works for you.  With something
 as stateless / simple as a BookmarkablePageLink, there probably couldn't be
 much in the way of side-effects, although with very complex, stateful
 components, I could see that maybe there would be an issue... (maybe??)
 --
 Jeremy Thomerson
 http://www.wickettraining.com


 On Thu, Dec 11, 2008 at 3:29 PM, novotny novo...@gridsphere.org wrote:



 Basically I need two of the same links on the page, and it looks like I
 have
 to do this which just seems kinda lame...

 add(new BookmarkablePageLinkString(personaldetails,
 PersonalDetailsPage.class));
 add(new BookmarkablePageLinkString(personaldetails2,
 PersonalDetailsPage.class));

 

 Click Here
 Profile page







 jWeekend wrote:
 
  Jason,
 
  What are you trying to achieve?
 
  Here are some ideas that may give the desired effect, depending on what
  that is ...
 
  1 - Make a model for your data and give that to all the Label instances
 as
  required, (but each with their unique id and separate markup).
  2 - Use a repeater (like a ListView) to render several labels (no
  repetition of Java code or markup).
  3 - Write a method that takes a model (or just a String) and an id, that
  returns an appropriately configured Label instance  (saves on repeating
  Java code - still need markup per component and your own unique ids).
 
  Regards - Cemal
   http://www.jWeekend.co.uk http://www.jweekend.co.uk/ jWeekend
 
 
 
  novotny wrote:
 
 
  I have a simple label hello and I want to display it twice in the same
  page, but wicket complains the wicket:id needs to be unique in my
  page what do I need to do, is there an alias or something?
 
  Thanks, Jason
 
 
 

 --
 View this message in context:
 http://www.nabble.com/how-to-reuse-a-label-in-the-same-page--tp20964351p20964551.html
  Sent from the Wicket - User 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






 --
 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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s) 
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu 
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação, 
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do

RE: how to reuse a label in the same page?

2008-12-12 Thread Bruno Cesar Borges
Sorry. What I did want to say was that There are some cases where creating a 
fragment or a panel to be reused is just... too cumbersome. 

-Original Message-
From: Bruno Cesar Borges [mailto:brunobor...@cetip.com.br]
Sent: Friday, December 12, 2008 10:37 AM
To: users@wicket.apache.org
Subject: RE: how to reuse a label in the same page?


lol... 

Alright, I agree with you, but think about. There are some cases where creating 
a fragment or a panel to reuse, wouldn't address the main advantage. We could 
save a *lot* of memory usage this way, and I think it would be a cool feature. 
Even with Ajax wouldn't be a problem.

-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
Sent: Friday, December 12, 2008 10:33 AM
To: users@wicket.apache.org
Subject: Re: how to reuse a label in the same page?


The fact that you want to bind a component in two places and complain
that you can't, is a code smell: you should extract that component to
a panel or fragment and reuse the panel (/fragment).

Martijn

On Fri, Dec 12, 2008 at 1:32 PM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 ieuw

 On Fri, Dec 12, 2008 at 1:30 PM, Bruno Cesar Borges
 brunobor...@cetip.com.br wrote:
 Martijn, it is possible to create nodes inside a DOM tree refering to 
 another DOM node. What if it was possible to do the same with Wicket?

 div wicket:id=myPanel
  span wicket:id=foolabel/span
  span wicket:ref=fooagain/span
 /div

 span wicket:ref=myPanel.fooagain but outside panel!/span

 Regards,
 Bruno

 -Original Message-
 From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
 Sent: Friday, December 12, 2008 5:18 AM
 To: users@wicket.apache.org
 Subject: Re: how to reuse a label in the same page?


 Nope, wicket:id is a 1-1 mapping at the same dom tree level. You can
 reuse id's at different levels or in different branches of the dom
 tree, but not as siblings.

 a href=# wicket:id=foospan wicket:id=foo/span/a works
 but another
 a href=# wicket:id=foo/a will fail (and rightfully so)

 Martijn

 On Fri, Dec 12, 2008 at 6:20 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 I'm pretty sure that you can just add it once in Java and multiple times in
 the HTML, although I've never pondered the (potential) side-effects of
 this.  Give it a shot and let us know how it works for you.  With something
 as stateless / simple as a BookmarkablePageLink, there probably couldn't be
 much in the way of side-effects, although with very complex, stateful
 components, I could see that maybe there would be an issue... (maybe??)
 --
 Jeremy Thomerson
 http://www.wickettraining.com


 On Thu, Dec 11, 2008 at 3:29 PM, novotny novo...@gridsphere.org wrote:



 Basically I need two of the same links on the page, and it looks like I
 have
 to do this which just seems kinda lame...

 add(new BookmarkablePageLinkString(personaldetails,
 PersonalDetailsPage.class));
 add(new BookmarkablePageLinkString(personaldetails2,
 PersonalDetailsPage.class));

 

 Click Here
 Profile page







 jWeekend wrote:
 
  Jason,
 
  What are you trying to achieve?
 
  Here are some ideas that may give the desired effect, depending on what
  that is ...
 
  1 - Make a model for your data and give that to all the Label instances
 as
  required, (but each with their unique id and separate markup).
  2 - Use a repeater (like a ListView) to render several labels (no
  repetition of Java code or markup).
  3 - Write a method that takes a model (or just a String) and an id, that
  returns an appropriately configured Label instance  (saves on repeating
  Java code - still need markup per component and your own unique ids).
 
  Regards - Cemal
   http://www.jWeekend.co.uk http://www.jweekend.co.uk/ jWeekend
 
 
 
  novotny wrote:
 
 
  I have a simple label hello and I want to display it twice in the same
  page, but wicket complains the wicket:id needs to be unique in my
  page what do I need to do, is there an alias or something?
 
  Thanks, Jason
 
 
 

 --
 View this message in context:
 http://www.nabble.com/how-to-reuse-a-label-in-the-same-page--tp20964351p20964551.html
  Sent from the Wicket - User 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






 --
 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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s) 
 destinatários(s) acima identificado(s),
 podendo

RE: how to reuse a label in the same page?

2008-12-12 Thread Bruno Cesar Borges
Really, if we think about the DOM tree and XMLs, we'll see that it is possible 
to put some information in different places, but that information is declared 
only once.

Wicket works with XHTML (XML over HTML). So why not support this? If one 
decides to refer to a component declared in another piece of the html, and 
duplicate that (html) code, it is possible to do it anyway, with Javascript. 

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
Sent: Friday, December 12, 2008 3:35 PM
To: users@wicket.apache.org
Subject: Re: how to reuse a label in the same page?


Oops - you are right there - the component use check was turned off in this
app (I just threw the example into an existing app to test it).

While I don't typically use this, or have this use case, I'm not clear on
what is fundamentally wrong with this - you have a component you want two
places in a page or panel, etc...  So, why mustyou create two duplicate
components?  That seems more wrong than the former.

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


On Fri, Dec 12, 2008 at 11:23 AM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Now run your application in virgin development mode. The fact that we
 disable the component use check in production mode doesn't make it
 less evil.

 Martijn

 On Fri, Dec 12, 2008 at 5:56 PM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
  Martijn,
  Actually, what I described does work - try this on any page:
 
  JAVA (added only once - since you couldn't add two with the same ID
 anyway):
  add(new Label(test, this is a test));
 
  HTML:
  span wicket:id=test[]/spanbr /
  span wicket:id=test[]/spanbr /
 
  OUTPUT:
  span wicket:id=testthis is a test/spanbr /
  span wicket:id=testthis is a test/spanbr /
  Right or wrong, it currently works that way.  (1.4-SNAPSHOT - and I know
  I've used it in past versions as well)
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 12, 2008 at 1:17 AM, Martijn Dashorst 
  martijn.dasho...@gmail.com wrote:
 
  Nope, wicket:id is a 1-1 mapping at the same dom tree level. You can
  reuse id's at different levels or in different branches of the dom
  tree, but not as siblings.
 
  a href=# wicket:id=foospan wicket:id=foo/span/a works
  but another
  a href=# wicket:id=foo/a will fail (and rightfully so)
 
  Martijn
 
  On Fri, Dec 12, 2008 at 6:20 AM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
   I'm pretty sure that you can just add it once in Java and multiple
 times
  in
   the HTML, although I've never pondered the (potential) side-effects of
   this.  Give it a shot and let us know how it works for you.  With
  something
   as stateless / simple as a BookmarkablePageLink, there probably
 couldn't
  be
   much in the way of side-effects, although with very complex, stateful
   components, I could see that maybe there would be an issue...
 (maybe??)
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
   On Thu, Dec 11, 2008 at 3:29 PM, novotny novo...@gridsphere.org
 wrote:
  
  
  
   Basically I need two of the same links on the page, and it looks like
 I
   have
   to do this which just seems kinda lame...
  
   add(new BookmarkablePageLinkString(personaldetails,
   PersonalDetailsPage.class));
   add(new BookmarkablePageLinkString(personaldetails2,
   PersonalDetailsPage.class));
  
   
  
   Click Here
   Profile page
  
  
  
  
  
  
  
   jWeekend wrote:
   
Jason,
   
What are you trying to achieve?
   
Here are some ideas that may give the desired effect, depending on
  what
that is ...
   
1 - Make a model for your data and give that to all the Label
  instances
   as
required, (but each with their unique id and separate markup).
2 - Use a repeater (like a ListView) to render several labels (no
repetition of Java code or markup).
3 - Write a method that takes a model (or just a String) and an id,
  that
returns an appropriately configured Label instance  (saves on
  repeating
Java code - still need markup per component and your own unique
 ids).
   
Regards - Cemal
 http://www.jWeekend.co.uk http://www.jweekend.co.uk/ 
 http://www.jweekend.co.uk/ 
  http://www.jweekend.co.uk/ jWeekend
   
   
   
novotny wrote:
   
   
I have a simple label hello and I want to display it twice in
 the
  same
page, but wicket complains the wicket:id needs to be unique in my
page what do I need to do, is there an alias or something?
   
Thanks, Jason
   
   
   
  
   --
   View this message in context:
  
 
 http://www.nabble.com/how-to-reuse-a-label-in-the-same-page--tp20964351p20964551.html
Sent from the Wicket - User 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
  
  
  
 
 
 
  --
  Become a Wicket 

RE: how to reuse a label in the same page?

2008-12-12 Thread Bruno Cesar Borges
It could continue to return foo. But when processing ajax responses, 
wicket:ref will register, through Javascript, the references to foo, somehow. 
So this approach wouldn't break any code.

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Friday, December 12, 2008 4:35 PM
To: users@wicket.apache.org
Subject: Re: how to reuse a label in the same page?


what do we return from getmarkupid() because that is what the code
uses to output that markupid for the javascript that needs to
manipulate the dom nodes.

-igor

On Fri, Dec 12, 2008 at 10:28 AM, Bruno Cesar Borges
brunobor...@cetip.com.br wrote:
 I'm pretty sure it is possible to register all markup IDs generated to 
 referenced nodes.

 new Label(foo, Foo);

 div wicket:id=fooddd/div
 div wicket:ref=fooagain/div

 outputs:
 div id=foo0Foo/div
 div id=foo1Foo/div

 Then it would be possible to do, for instance, an Ajax update over all nodes.



 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, December 12, 2008 4:11 PM
 To: users@wicket.apache.org
 Subject: Re: how to reuse a label in the same page?


 what happens once you add a behavior that uses markup id? or even call
 setoutputmarkupid(true) on that component?

 -igor

 On Fri, Dec 12, 2008 at 9:35 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 Oops - you are right there - the component use check was turned off in this
 app (I just threw the example into an existing app to test it).

 While I don't typically use this, or have this use case, I'm not clear on
 what is fundamentally wrong with this - you have a component you want two
 places in a page or panel, etc...  So, why mustyou create two duplicate
 components?  That seems more wrong than the former.

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


 On Fri, Dec 12, 2008 at 11:23 AM, Martijn Dashorst 
 martijn.dasho...@gmail.com wrote:

 Now run your application in virgin development mode. The fact that we
 disable the component use check in production mode doesn't make it
 less evil.

 Martijn

 On Fri, Dec 12, 2008 at 5:56 PM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
  Martijn,
  Actually, what I described does work - try this on any page:
 
  JAVA (added only once - since you couldn't add two with the same ID
 anyway):
  add(new Label(test, this is a test));
 
  HTML:
  span wicket:id=test[]/spanbr /
  span wicket:id=test[]/spanbr /
 
  OUTPUT:
  span wicket:id=testthis is a test/spanbr /
  span wicket:id=testthis is a test/spanbr /
  Right or wrong, it currently works that way.  (1.4-SNAPSHOT - and I know
  I've used it in past versions as well)
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 12, 2008 at 1:17 AM, Martijn Dashorst 
  martijn.dasho...@gmail.com wrote:
 
  Nope, wicket:id is a 1-1 mapping at the same dom tree level. You can
  reuse id's at different levels or in different branches of the dom
  tree, but not as siblings.
 
  a href=# wicket:id=foospan wicket:id=foo/span/a works
  but another
  a href=# wicket:id=foo/a will fail (and rightfully so)
 
  Martijn
 
  On Fri, Dec 12, 2008 at 6:20 AM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
   I'm pretty sure that you can just add it once in Java and multiple
 times
  in
   the HTML, although I've never pondered the (potential) side-effects of
   this.  Give it a shot and let us know how it works for you.  With
  something
   as stateless / simple as a BookmarkablePageLink, there probably
 couldn't
  be
   much in the way of side-effects, although with very complex, stateful
   components, I could see that maybe there would be an issue...
 (maybe??)
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
   On Thu, Dec 11, 2008 at 3:29 PM, novotny novo...@gridsphere.org
 wrote:
  
  
  
   Basically I need two of the same links on the page, and it looks like
 I
   have
   to do this which just seems kinda lame...
  
   add(new BookmarkablePageLinkString(personaldetails,
   PersonalDetailsPage.class));
   add(new BookmarkablePageLinkString(personaldetails2,
   PersonalDetailsPage.class));
  
   
  
   Click Here
   Profile page
  
  
  
  
  
  
  
   jWeekend wrote:
   
Jason,
   
What are you trying to achieve?
   
Here are some ideas that may give the desired effect, depending on
  what
that is ...
   
1 - Make a model for your data and give that to all the Label
  instances
   as
required, (but each with their unique id and separate markup).
2 - Use a repeater (like a ListView) to render several labels (no
repetition of Java code or markup).
3 - Write a method that takes a model (or just a String) and an id,
  that
returns an appropriately configured Label instance  (saves on
  repeating
Java code - still need markup per component and your own unique
 ids).
   
Regards - Cemal
 http://www.jWeekend.co.uk http://www.jweekend.co.uk/ 
 http://www.jweekend.co.uk/ 
  http

RE: how to reuse a label in the same page?

2008-12-12 Thread Bruno Cesar Borges
One more thing: the Server-side will not know about foo1 (references to 
'foo'). Instead, this would be controled from the javascript, client-side.

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Friday, December 12, 2008 4:35 PM
To: users@wicket.apache.org
Subject: Re: how to reuse a label in the same page?


what do we return from getmarkupid() because that is what the code
uses to output that markupid for the javascript that needs to
manipulate the dom nodes.

-igor

On Fri, Dec 12, 2008 at 10:28 AM, Bruno Cesar Borges
brunobor...@cetip.com.br wrote:
 I'm pretty sure it is possible to register all markup IDs generated to 
 referenced nodes.

 new Label(foo, Foo);

 div wicket:id=fooddd/div
 div wicket:ref=fooagain/div

 outputs:
 div id=foo0Foo/div
 div id=foo1Foo/div

 Then it would be possible to do, for instance, an Ajax update over all nodes.



 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, December 12, 2008 4:11 PM
 To: users@wicket.apache.org
 Subject: Re: how to reuse a label in the same page?


 what happens once you add a behavior that uses markup id? or even call
 setoutputmarkupid(true) on that component?

 -igor

 On Fri, Dec 12, 2008 at 9:35 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 Oops - you are right there - the component use check was turned off in this
 app (I just threw the example into an existing app to test it).

 While I don't typically use this, or have this use case, I'm not clear on
 what is fundamentally wrong with this - you have a component you want two
 places in a page or panel, etc...  So, why mustyou create two duplicate
 components?  That seems more wrong than the former.

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


 On Fri, Dec 12, 2008 at 11:23 AM, Martijn Dashorst 
 martijn.dasho...@gmail.com wrote:

 Now run your application in virgin development mode. The fact that we
 disable the component use check in production mode doesn't make it
 less evil.

 Martijn

 On Fri, Dec 12, 2008 at 5:56 PM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
  Martijn,
  Actually, what I described does work - try this on any page:
 
  JAVA (added only once - since you couldn't add two with the same ID
 anyway):
  add(new Label(test, this is a test));
 
  HTML:
  span wicket:id=test[]/spanbr /
  span wicket:id=test[]/spanbr /
 
  OUTPUT:
  span wicket:id=testthis is a test/spanbr /
  span wicket:id=testthis is a test/spanbr /
  Right or wrong, it currently works that way.  (1.4-SNAPSHOT - and I know
  I've used it in past versions as well)
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 12, 2008 at 1:17 AM, Martijn Dashorst 
  martijn.dasho...@gmail.com wrote:
 
  Nope, wicket:id is a 1-1 mapping at the same dom tree level. You can
  reuse id's at different levels or in different branches of the dom
  tree, but not as siblings.
 
  a href=# wicket:id=foospan wicket:id=foo/span/a works
  but another
  a href=# wicket:id=foo/a will fail (and rightfully so)
 
  Martijn
 
  On Fri, Dec 12, 2008 at 6:20 AM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
   I'm pretty sure that you can just add it once in Java and multiple
 times
  in
   the HTML, although I've never pondered the (potential) side-effects of
   this.  Give it a shot and let us know how it works for you.  With
  something
   as stateless / simple as a BookmarkablePageLink, there probably
 couldn't
  be
   much in the way of side-effects, although with very complex, stateful
   components, I could see that maybe there would be an issue...
 (maybe??)
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
   On Thu, Dec 11, 2008 at 3:29 PM, novotny novo...@gridsphere.org
 wrote:
  
  
  
   Basically I need two of the same links on the page, and it looks like
 I
   have
   to do this which just seems kinda lame...
  
   add(new BookmarkablePageLinkString(personaldetails,
   PersonalDetailsPage.class));
   add(new BookmarkablePageLinkString(personaldetails2,
   PersonalDetailsPage.class));
  
   
  
   Click Here
   Profile page
  
  
  
  
  
  
  
   jWeekend wrote:
   
Jason,
   
What are you trying to achieve?
   
Here are some ideas that may give the desired effect, depending on
  what
that is ...
   
1 - Make a model for your data and give that to all the Label
  instances
   as
required, (but each with their unique id and separate markup).
2 - Use a repeater (like a ListView) to render several labels (no
repetition of Java code or markup).
3 - Write a method that takes a model (or just a String) and an id,
  that
returns an appropriately configured Label instance  (saves on
  repeating
Java code - still need markup per component and your own unique
 ids).
   
Regards - Cemal
 http://www.jWeekend.co.uk http://www.jweekend.co.uk/ 
 http://www.jweekend.co.uk/ 
  http://www.jweekend.co.uk/ jWeekend

RE: how to reuse a label in the same page?

2008-12-12 Thread Bruno Cesar Borges
Javascript could get all child references to that component (markupId), and 
apply that code to them as well.

In this case you submitted, the problem would be only with reaaally hacked 
code, like doing weird stuff with 'response' instead of using Behaviours. 

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Friday, December 12, 2008 4:41 PM
To: users@wicket.apache.org
Subject: Re: how to reuse a label in the same page?


huh? so if i have a behavior that does:

response.write(getElementById('+getMarkupId()+').style.display='none';);

how does that work???

-igor

On Fri, Dec 12, 2008 at 10:38 AM, Bruno Cesar Borges
brunobor...@cetip.com.br wrote:
 It could continue to return foo. But when processing ajax responses, 
 wicket:ref will register, through Javascript, the references to foo, 
 somehow. So this approach wouldn't break any code.

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, December 12, 2008 4:35 PM
 To: users@wicket.apache.org
 Subject: Re: how to reuse a label in the same page?


 what do we return from getmarkupid() because that is what the code
 uses to output that markupid for the javascript that needs to
 manipulate the dom nodes.

 -igor

 On Fri, Dec 12, 2008 at 10:28 AM, Bruno Cesar Borges
 brunobor...@cetip.com.br wrote:
 I'm pretty sure it is possible to register all markup IDs generated to 
 referenced nodes.

 new Label(foo, Foo);

 div wicket:id=fooddd/div
 div wicket:ref=fooagain/div

 outputs:
 div id=foo0Foo/div
 div id=foo1Foo/div

 Then it would be possible to do, for instance, an Ajax update over all nodes.



 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, December 12, 2008 4:11 PM
 To: users@wicket.apache.org
 Subject: Re: how to reuse a label in the same page?


 what happens once you add a behavior that uses markup id? or even call
 setoutputmarkupid(true) on that component?

 -igor

 On Fri, Dec 12, 2008 at 9:35 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 Oops - you are right there - the component use check was turned off in this
 app (I just threw the example into an existing app to test it).

 While I don't typically use this, or have this use case, I'm not clear on
 what is fundamentally wrong with this - you have a component you want two
 places in a page or panel, etc...  So, why mustyou create two duplicate
 components?  That seems more wrong than the former.

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


 On Fri, Dec 12, 2008 at 11:23 AM, Martijn Dashorst 
 martijn.dasho...@gmail.com wrote:

 Now run your application in virgin development mode. The fact that we
 disable the component use check in production mode doesn't make it
 less evil.

 Martijn

 On Fri, Dec 12, 2008 at 5:56 PM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
  Martijn,
  Actually, what I described does work - try this on any page:
 
  JAVA (added only once - since you couldn't add two with the same ID
 anyway):
  add(new Label(test, this is a test));
 
  HTML:
  span wicket:id=test[]/spanbr /
  span wicket:id=test[]/spanbr /
 
  OUTPUT:
  span wicket:id=testthis is a test/spanbr /
  span wicket:id=testthis is a test/spanbr /
  Right or wrong, it currently works that way.  (1.4-SNAPSHOT - and I know
  I've used it in past versions as well)
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 12, 2008 at 1:17 AM, Martijn Dashorst 
  martijn.dasho...@gmail.com wrote:
 
  Nope, wicket:id is a 1-1 mapping at the same dom tree level. You can
  reuse id's at different levels or in different branches of the dom
  tree, but not as siblings.
 
  a href=# wicket:id=foospan wicket:id=foo/span/a works
  but another
  a href=# wicket:id=foo/a will fail (and rightfully so)
 
  Martijn
 
  On Fri, Dec 12, 2008 at 6:20 AM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
   I'm pretty sure that you can just add it once in Java and multiple
 times
  in
   the HTML, although I've never pondered the (potential) side-effects of
   this.  Give it a shot and let us know how it works for you.  With
  something
   as stateless / simple as a BookmarkablePageLink, there probably
 couldn't
  be
   much in the way of side-effects, although with very complex, stateful
   components, I could see that maybe there would be an issue...
 (maybe??)
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
   On Thu, Dec 11, 2008 at 3:29 PM, novotny novo...@gridsphere.org
 wrote:
  
  
  
   Basically I need two of the same links on the page, and it looks like
 I
   have
   to do this which just seems kinda lame...
  
   add(new BookmarkablePageLinkString(personaldetails,
   PersonalDetailsPage.class));
   add(new BookmarkablePageLinkString(personaldetails2,
   PersonalDetailsPage.class));
  
   
  
   Click Here
   Profile page
  
  
  
  
  
  
  
   jWeekend wrote:
   
Jason,
   
What are you trying to achieve

RE: NPE when wicket:link embedding input type=image src...

2008-12-11 Thread Bruno Cesar Borges
Please, submit a JIRA issue. Looks like a simple bug while parsing the content.

PS: should now be the time to reconsider the idea of dropping wicket:link? :-)

-Original Message-
From: danielt [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2008 11:34 AM
To: users@wicket.apache.org
Subject: NPE when wicket:link embedding input type=image src...



hi at all..

works: 
wicket:link
   lt;img src=resources/prev.png
/wicket:link

doesn't work:
wicket:link
   input type=image src=resources/prev.png /
/wicket:link

ErrorLog:

WicketMessage: Exception in rendering component: [MarkupContainer [Component
id = _link5]]

Root cause:

java.lang.NullPointerException
at
org.apache.wicket.markup.resolver.AutoLinkResolver$PathInfo.init(AutoLinkResolver.java:249)
at
org.apache.wicket.markup.resolver.AutoLinkResolver.resolveAutomaticLink(AutoLinkResolver.java:812)
at
org.apache.wicket.markup.resolver.AutoLinkResolver.resolve(AutoLinkResolver.java:747)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1324)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1476)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1401)
at org.apache.wicket.Component.renderComponent(Component.java:2480)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:223)
at
org.apache.wicket.markup.resolver.WicketLinkResolver.resolve(WicketLinkResolver.java:73)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1324)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1427)
at org.apache.wicket.Page.onRender(Page.java:1470)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.Page.renderPage(Page.java:904)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1181)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1252)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:200)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

bug or feature? 

thanks a lot and best regards, 
Tee

-- 
View this message in context: 
http://www.nabble.com/NPE-when-%3Cwicket%3Alink%3E-embedding-%3Cinput-type%3D%22image%22-src%22...%22%3E-tp20955539p20955539.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the 

RE: Include a jsp in my wicket-page - PageExpired

2008-12-11 Thread Bruno Cesar Borges
You can accomplish this somehow, but all of your wicket pages will have to deal 
with PageParameters... And I really recommend you to put your wicket pages 
inside an Iframe. It will be bether this way.

-Original Message-
From: alexander.elsholz [mailto:alexander.elsh...@widas.de]
Sent: Thursday, December 11, 2008 1:10 PM
To: users@wicket.apache.org
Subject: RE: Include a jsp in my wicket-page - PageExpired



Hi,

i have an existing jsp-application which i have to includ in a
new wicket application. iframe looks fine, but i have to display this
application
in different tabs, so i need a possibility to display the Iframe in a panel
- and i think it's
not possible.

I need JSP's in the same application like wicket, because i have to control
parts of this application 
by url. that works fine, but i have a problem with the http-post-method - i
think wicket tries
to answer this request, but it shoukd delegate it to the existing
web-applicatoion-servlet.

hope that displays my dilemma.

i need a possibility to display and control  the jsp-app in a wicket panel -
like @include in jsp.

thanks alex



Bruno Cesar Borges wrote:
 
 Looks like you want to process a JSP Form to a Wicket page. I hardly think
 this is possible.
 
 What you could try to do is using an IFrame to load a Wicket page
 containing that form. But I rather ask you, why do you want to use JSPs
 within the same application that uses Wicket?
 
 -Original Message-
 From: alexander.elsholz [mailto:alexander.elsh...@widas.de]
 Sent: Thursday, December 11, 2008 10:55 AM
 To: users@wicket.apache.org
 Subject: Include a jsp in my wicket-page - PageExpired
 
 
 
 hi,
 
 in my tabbedpane i want include different jsps. 
 
 i use the wicket include component.
 
 that works fine without userinteraction.
 
 but in one jsp-page is a form, which submit the data with a submit butzton
 and the http-post method. when i click this one i get a page-expired -
 without any logfile-failures.
 
 thanks alex
 -- 
 View this message in context:
 http://www.nabble.com/Include-a-jsp-in-my-wicket-page--%3E-PageExpired-tp20954898p20954898.html
 Sent from the Wicket - User 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
 
 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e
 seu sigilo é protegido por 
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem 
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente, 
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.
 
 
 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly 
 containing information and or privileged/confidential documents whose
 content is protected by law. 
 In case you have mistakenly received it, please notify the sender and
 delete it from your system. 
 Be noticed that the law forbids the retention, dissemination,
 distribution, copy or use without 
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect 
 CETIP's point of view, which is only divulged by authorized personnel.
 ***
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/RE%3A-Include-a-jsp-in-my-wicket-page--%3E-PageExpired-tp20955015p20957234.html
Sent from the Wicket - User 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

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é

Re: [OT] wicket users around the world

2008-12-11 Thread Bruno Cesar Borges
Rio de Janeiro, Brazil

For those brazilians out there, check this out:
http://blog.brunoborges.com.br/search/label/Wicket
And this:
http://groups.google.com/group/wicket-ptbr

Thanks,
Bruno

-Original Message-
From: Cristiano Kliemann [mailto:cristia...@gmail.com]
Sent: Thursday, December 11, 2008 6:16 PM
To: users@wicket.apache.org
Subject: Re: [OT] wicket users around the world


Brasilia, Brazil

On Thu, Dec 11, 2008 at 4:57 PM, francisco treacy 
francisco.tre...@gmail.com wrote:

 to know a little bit more of our great (and vast) community, i was
 just wondering if you're keen on sharing where you come from and/or
 where you work with wicket...

 for instance, here argentinian/belgian working with wicket in antibes,
 france

 francisco

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


***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


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



RE: Integrating Scheduler into Web Application

2008-12-11 Thread Bruno Cesar Borges
You should setUp/tearDown Quartz's Scheduler using context listener in your web 
application and attach it to your Application Context.



-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
Sent: Thursday, December 11, 2008 6:41 PM
To: users@wicket.apache.org
Subject: Re: Integrating Scheduler into Web Application


Hi Will,

Maybe this is more question for the quartz mailing list

Probably you would want to have only one scheduler per application, so
you should follow a singleton pattern. E.g.

public class SchedulerLocator {

   private static Scheduler scheduler;

   public static Scheduler getScheduler() {
   if(scheduler == null) {
 scheduler = .all the factory thing.
   }
  return scheduler;
   }

}

So everywhere you could do  SchedulerLocator.getScheduler() (e.g on you
pages). I would create this singleton when the  application object is
created or initialized.

init() {
   SchedulerLocator.getScheduler();
}

If you want your jobs/triggers to persist after application restarts you
will need to create a persistent scheduler and consequently create the
associated tables and instruct quartz to deal with them...

Ernesto
 
wfroud wrote:
 Hi,

 I am trying to integrate a scheduler into my web application. I believe my
 question is probably very trivial but I am missing some vital Java
 knowledge. Please let me explain… 
 My web application currently allows users to choose, customise and run
 reports.
 I now need to add a detailed scheduler so that users can choose when to run
 the reports and how often etc.

 I'm using Spring for the db access, and I was going to use Quartz for
 scheduling.

 A basic Quartz schedule looks something like the following:
 public class SimpleExample {
 
 public void run() throws Exception {
  
 // First we must get a reference to a scheduler
 // This schedule info is  stored in a db, defined in the
 quartz.properties file.
 SchedulerFactory sf = new StdSchedulerFactory();
 Scheduler sched = sf.getScheduler();
  
 // Add jobs and triggers to schedule.
  
 // Start up the scheduler (nothing can actually run until the 
 // scheduler has been started)
 sched.start();
  
 // Wait for a short period of time so scheduler has chance to run
 jobs.
  
  sched.shutdown();
 }
  
 public static void main(String[] args) throws Exception {
  
 SimpleExample example = new SimpleExample();
 example.run();
  
 }
  
 }

 More details about a really basic example can be found here:
 http://wiki.opensymphony.com/display/QRTZ1/TutorialLesson1

 I can run this fine as a standalone test.

 The basics of my web application are as follows:

 MyApp which extends WebApplication.
 Loads of classes which extend WebPage
 A MySession class which extends WebSession

 What I'm not sure about is where I should be instantiating the
 SchedulerFactory within my application so that all users can update any
 schedule (i.e. so there is kind-of-like global access to the scheduler
 object) and so that the SchedulerFactory is only instantiated the once.

 I can't instantiate it in a web page as this will be user specific.
 I could instantiate it in the MyApp class but then I don't have access to it
 from the web pages.

 Any help whatsoever, just to point me in the right direction, would be much
 appreciated.

 Thanks

 Will 


   


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

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.

RE: Newbie question

2008-12-09 Thread Bruno Cesar Borges
Oh, yeah... size() is a method from MarkupContainer.

/**
 * Get the number of children in this container.
 * 
 * @return Number of children in this container
 */
public final int size()
{
return children_size();
}

I don't know if for Repeaters would make sense to return how many items they 
contain. Probably not.



-Original Message-
From: Mark Daniel [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2008 6:35 PM
To: users@wicket.apache.org
Subject: Re: Newbie question


Hi,

Basically,  getCart().getCheeses().size() != cartListView.size()


On Wed, Dec 10, 2008 at 12:31 AM, Bruno Cesar Borges 
[EMAIL PROTECTED] wrote:

 I think you are talking about the 'viewSize' property of ListView.

 This indicates how many viewable items will be displayed within a
 ListView.



 -Original Message-
 From: Mark Daniel [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 09, 2008 6:23 PM
 To: users@wicket.apache.org
 Subject: Newbie question


 Hello all,

 I'm following the wicket in action book. I'm trying the cheese store in
 chapter 3. I was following along the code by reading a bit and coding a bit
 on my own. The code defining the ListView for the cheese cart is
 originally:

 add(new ListView(cart, new PropertyModel(this, cart.cheeses)) { ... }

 The way I ended up coding it was:

 add(new ListView(cart, getCart().getCheeses())) { ... }

 Which seems to be working fine, but If I click repeatedly fast on the 'add
 to cart' link, the ArrayList in session gets its size changed correctly
 when
 adding elements, but the ListView element size doesnt change accordingly.
 Basically, the list size keeps growing on each click,  but the number of
 items in the ListView doesnt grow anymore.

 Any ideas whats wrong?

 Thanks.

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente,
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.


 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly
 containing information and or privileged/confidential documents whose
 content is protected by law.
 In case you have mistakenly received it, please notify the sender and
 delete it from your system.
 Be noticed that the law forbids the retention, dissemination, distribution,
 copy or use without
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect
 CETIP's point of view, which is only divulged by authorized personnel.

 ***


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LoadableDetachableModel in Listview

2008-12-08 Thread Bruno Cesar Borges
Put your object into user's session, just like a shopping chart. :-)

-Original Message-
From: Benjamin Ernst [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 10:06 AM
To: users@wicket.apache.org
Subject: LoadableDetachableModel in Listview


Hi everybody,

I have a little Problem with LDMs:

I have a page with a ListView and for each item in the ListView the user can
open a modalWindow to edit the item.

My Problem is, that I don't want to persist the item to the DB from the
modalWindow. Only after the User confirms the changes in the page with the
ListView, all these changes for all items from the ListView should be
persisted. Or the User presses abort and nothing is persisted.

When I use LDMs changes that are made in the modalWindow are never shown in
the ListView, because the models are detached.

I could use normal Models or the actual Objects for this, but then I might
run into lazy-initialization-problems.

Has anybody a solution for this problem, or is this simply not possible in
this way?

Thanks in advance,

Benjamin

---

My Code looks like this:

ListViewAccount accountListView = new ListViewAccount(accountList,
accountList)
{
@Override
protected void populateItem(ListItemAccount item) {
DetachableEntityModelAccount account = new
DetachableEntityModelAccount(item.getModelObject());

item.add(new Label(accountName, new
PropertyModelString(account, name)));
item.add(new Label(accountNumber, new
PropertyModelString(account, number)));

item.add(new AjaxLinkAccount(edit, account)
{
@Override
public void onClick(AjaxRequestTarget target) {
modalWindow.showPage(target, new
AccountEditPage(modalWindow, this.getModel()));
}
});
}
};
cont.add(accountListView);

AjaxLink save = new AjaxLink(saveAccounts)
{
@Override
public void onClick(AjaxRequestTarget target) {
User user = userModel.getObject();
user.getAccounts().clear();
user.getAccounts().addAll(accountList);

ServiceLocator.instance().getUserService().saveUser(user);
}
};
***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Bruno Cesar Borges
Put that code into some .js file and add it to your panel as a 
HeaderContributor. Then you are ready to go.

-Original Message-
From: Graeme Knight [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 11:48 AM
To: users@wicket.apache.org
Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.



Hey Bruno,

Perhaps my ramblings with myself didn't make myself clear.

I am simply wanting to populate the innerHTML with content. I have it
working wonderfully with Tapestry but not with Wicket as I'm not sure of the
correct way of doing it.

Essentially my component will be a wysiwyg editor. I don't want to use
standard ones because I have written my own AND I will be doing some fancy
stuff with the content at a later date.

So perhaps here's the correct question:

What's the best way to set innerHTML on an iframe?

I have a javascript function that I would like to call, which is something
like the following:

IFrameArea.populateContent = function( isEditable, allowDocumentTags,
content )
{
var iFrame = document.getElementById( IFrameArea.FRAME_NAME );

if( iFrame.contentWindow != null )
{
if( iFrame.contentWindow.document != null )
{
var iFrameDocument = 
iFrame.contentWindow.document;

iFrameDocument.open();

if( allowDocumentTags == true )
{
iFrameDocument.write('htmlhead');

iFrameDocument.write( 'link 
rel=stylesheet type=text/css
href=styles/IFrameStyle.css' );


iFrameDocument.write('/headbody');
}

iFrameDocument.write( content );


if( allowDocumentTags == true )
{
iFrameDocument.write('/body/html');
}

iFrameDocument.close(); 

if( isEditable == true )
{   
IFrameArea.designModeOn();
}
}
}
};

isEditable indicates whether the iframe is editable or not,
allowDocumentTags indicates whether the iframe should contain basic html
tags and CSS, and the content is ... the content (created by the server) -
this is my Tapestry-esq implementation, so of course it is open to change.

The magic question: How do I get this in the HTML for the 'context' panel?


Bruno Borges wrote:
 
 I've just read your thread and looks like what you want to do is quite...
 invalid. Iframes are just like normal frames, or even, a separate
 window/tab. If you think that way, you will notice that what you want to
 do
 is not possible. From a Javascript developer's perspective, of course.
 This
 has nothing to do with Wicket.
 
 If you want to set the innerHTML property of some DOM object, that object
 *has* to have that property. Check these URLs:
 
 http://www.htmlite.com/lite021.php
 http://msdn.microsoft.com/en-us/library/ms535258(VS.85).aspx#
 
 So, stop talking with yourself about something impossible to accomplish
 and
 go get some sleep buddy... ;-)
 
 Cheers,
 Bruno Borges
 blog.brunoborges.com.br
 +55 21 76727099
 
 The glory of great men should always be
 measured by the means they have used to
 acquire it.
 - Francois de La Rochefoucauld
 
 
 On Mon, Dec 8, 2008 at 1:07 AM, Graeme Knight [EMAIL PROTECTED]
 wrote:
 

 Bruno!

 I absolutely would love to write a wiki page on this if I can make it
 work
 -
 and you are right - conversation with myself *might* help others who
 perhaps
 have a similar problem.

 I'm not quite there yet :-( - perhaps tomorrow!

 Cheers, Graeme.


 Bruno Borges wrote:
 
  With all that conversation with yourself, how about writing a Wiki page
  after you succeed ?! :-D
 
  Cheers,
  Bruno Borges
  blog.brunoborges.com.br
  +55 21 76727099
 
  The glory of great men should always be
  measured by the means they have used to
  acquire it.
  - Francois de La Rochefoucauld
 
 
  On Sun, Dec 7, 2008 at 11:51 PM, Graeme Knight [EMAIL PROTECTED]
  wrote:
 
 
  Hi.
 
  I'm making some progress by using an IPageLink to a page that might
  contain
  (if I can) the rendered content... HHmm...
 
  Cheers, Graeme.
 
 
  Graeme Knight 

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Bruno Cesar Borges
Did you try to add a Label with CSS hidden attribute that executes your script? 
Something like this:

div style=display:none;
  scriptmyJavascriptMethod();/script
/div

I'm really not sure if this actually works, but you could also check this Wiki 
page (yeah, it exists)

http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html

cheers,
Bruno

-Original Message-
From: Graeme Knight [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 12:12 PM
To: users@wicket.apache.org
Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.



Hi Bruno,

Right, that far I DID get. I have a Javascript file that contains the
required Javascript for my editor. 

(Sorry, I don't have the code now):

When the user hits the tab and the panel goes into another context I create
the panel, add a HeaderContributor that adds the Javascript file. 

This panel is not created via a page refresh - it is replaced as per the
code above (i.e. currentPanel = new  ). Will the HeaderContributor
actually be utilized at this point or is a full page refresh required?

My BIG problem (this is the crux) is HOW to call that Javascript function -
the call to 'popupateContent' effectively has to be AFTER the iframe is
initialized (so an innerHTML exists). This can't be part of a
HeaderContributor - it has to be further down the chain of execution. My
confusion is how to make this happen.

Almost there! What are the guidelines for the Wiki when I get this working?
Perhaps I can submit to the Wicket people for verification?

REALLY appreciate your discussion on this.

Cheers, Graeme.


Bruno Cesar Borges wrote:
 
 Put that code into some .js file and add it to your panel as a
 HeaderContributor. Then you are ready to go.
 
 -Original Message-
 From: Graeme Knight [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2008 11:48 AM
 To: users@wicket.apache.org
 Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
 
 
 
 Hey Bruno,
 
 Perhaps my ramblings with myself didn't make myself clear.
 
 I am simply wanting to populate the innerHTML with content. I have it
 working wonderfully with Tapestry but not with Wicket as I'm not sure of
 the
 correct way of doing it.
 
 Essentially my component will be a wysiwyg editor. I don't want to use
 standard ones because I have written my own AND I will be doing some fancy
 stuff with the content at a later date.
 
 So perhaps here's the correct question:
 
 What's the best way to set innerHTML on an iframe?
 
 I have a javascript function that I would like to call, which is something
 like the following:
 
   IFrameArea.populateContent = function( isEditable, allowDocumentTags,
 content )
   {
   var iFrame = document.getElementById( IFrameArea.FRAME_NAME );
   
   if( iFrame.contentWindow != null )
   {
   if( iFrame.contentWindow.document != null )
   {
   var iFrameDocument = 
 iFrame.contentWindow.document;
   
   iFrameDocument.open();
   
   if( allowDocumentTags == true )
   {
   iFrameDocument.write('htmlhead');
   
   iFrameDocument.write( 'link 
 rel=stylesheet type=text/css
 href=styles/IFrameStyle.css' );
   
 
   iFrameDocument.write('/headbody');
   }
   
   iFrameDocument.write( content );
 
   
   if( allowDocumentTags == true )
   {
   iFrameDocument.write('/body/html');
   }
   
   iFrameDocument.close(); 
   
   if( isEditable == true )
   {   
   IFrameArea.designModeOn();
   }
   }
   }
   };
 
 isEditable indicates whether the iframe is editable or not,
 allowDocumentTags indicates whether the iframe should contain basic html
 tags and CSS, and the content is ... the content (created by the server) -
 this is my Tapestry-esq implementation, so of course it is open to change.
 
 The magic question: How do I get this in the HTML for the 'context' panel?
 
 
 Bruno Borges wrote:
 
 I've just read your thread and looks like what you want to do is quite...
 invalid. Iframes are just like normal frames, or even

RE: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Bruno Cesar Borges
Try the setTimeout('myfunction()', 100); function. The second argument is the 
timeout (in miliseconds) to wait before evaluating the first argument.

There's also a way to execute your javascript function only after body is fully 
loaded. Google for that. Maybe that's your answer.

cheers,
Bruno (becoming a JS developer rather Wicket)

-Original Message-
From: Graeme Knight [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 2:31 PM
To: users@wicket.apache.org
Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.



Not sure about this solution. The content of the iframe is visible then
disappears... Hhm.


Graeme Knight wrote:
 
 Hi guys,
 
 I'm making some progress. wicketGlobalPostCallHandler doesn't seem to be
 working for me, but I can do something like this after the iframe:
 
 StringBuilder buffer = new StringBuilder( script );
 buffer.append( IFrameArea.populateContent( false, true, 'hello
 world' ); );
 buffer.append( /script );
 
 Label scriptLabel = new Label( scriptLabel, buffer.toString() );
 
 scriptLabel.setRenderBodyOnly( true );
 scriptLabel.setEscapeModelStrings( false );
 
 add( scriptLabel );
 
 This will add a nice bit of Javascript into the whole lot that will call
 the populateContent function (hurray).
 
 Now the thing is, the text (hello world) flashes on the screen - then
 disappears.
 
 If I hit the 'refresh' button on the browser then the innerHTML 'hello
 world' sticks. If I can solve this tricky problem then I think I'm good to
 go.
 
 Is it REALLY this simple? Why does Wicket have to be so cool?
 
 Cheers, Graeme. 
 
 
 Graeme Knight wrote:
 
 Hi Ernesto,
 
 No - I didn't solve this problem as yet. However, this is part of the
 process of parsing the HTML prior to insertion on the innerHTML. If I can
 get that bit working I'm going to get back to our thread on the CIDs very
 soon!
 
 Cheers, Graeme.
 
 
 Graeme Knight wrote:
 
 Hi Bruno,
 
 No I didn't try this the Label idea... I'll give it a go!
 
 Thanks for the link I'll let you know how it works out ... watch this
 space!
 
 
 
 Bruno Cesar Borges wrote:
 
 Did you try to add a Label with CSS hidden attribute that executes your
 script? Something like this:
 
 div style=display:none;
   scriptmyJavascriptMethod();/script
 /div
 
 I'm really not sure if this actually works, but you could also check
 this Wiki page (yeah, it exists)
 
 http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
 
 cheers,
 Bruno
 
 -Original Message-
 From: Graeme Knight [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2008 12:12 PM
 To: users@wicket.apache.org
 Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
 
 
 
 Hi Bruno,
 
 Right, that far I DID get. I have a Javascript file that contains the
 required Javascript for my editor. 
 
 (Sorry, I don't have the code now):
 
 When the user hits the tab and the panel goes into another context I
 create
 the panel, add a HeaderContributor that adds the Javascript file. 
 
 This panel is not created via a page refresh - it is replaced as per
 the
 code above (i.e. currentPanel = new  ). Will the HeaderContributor
 actually be utilized at this point or is a full page refresh required?
 
 My BIG problem (this is the crux) is HOW to call that Javascript
 function -
 the call to 'popupateContent' effectively has to be AFTER the iframe is
 initialized (so an innerHTML exists). This can't be part of a
 HeaderContributor - it has to be further down the chain of execution.
 My
 confusion is how to make this happen.
 
 Almost there! What are the guidelines for the Wiki when I get this
 working?
 Perhaps I can submit to the Wicket people for verification?
 
 REALLY appreciate your discussion on this.
 
 Cheers, Graeme.
 
 
 Bruno Cesar Borges wrote:
 
 Put that code into some .js file and add it to your panel as a
 HeaderContributor. Then you are ready to go.
 
 -Original Message-
 From: Graeme Knight [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2008 11:48 AM
 To: users@wicket.apache.org
 Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
 
 
 
 Hey Bruno,
 
 Perhaps my ramblings with myself didn't make myself clear.
 
 I am simply wanting to populate the innerHTML with content. I have it
 working wonderfully with Tapestry but not with Wicket as I'm not sure
 of
 the
 correct way of doing it.
 
 Essentially my component will be a wysiwyg editor. I don't want to use
 standard ones because I have written my own AND I will be doing some
 fancy
 stuff with the content at a later date.
 
 So perhaps here's the correct question:
 
 What's the best way to set innerHTML on an iframe?
 
 
 I have a javascript function that I would like to call, which is
 something
 like the following:
 
   IFrameArea.populateContent = function( isEditable, allowDocumentTags,
 content )
   {
   var iFrame = document.getElementById

Re: Populate IFRAME innerHTML on AJAX load of panel.

2008-12-08 Thread Bruno Cesar Borges
Well done Graeme!

=)

Now, please create a Wiki page with all this information, for God's sake! 

cheers,
bruno

-Original Message-
From: Graeme Knight [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 3:46 PM
To: users@wicket.apache.org
Subject: RE: Populate IFRAME innerHTML on AJAX load of panel.



Yahhhyahhh!

The answer appears to be a HeaderContributor with a call to
renderOnLoadJavascript.

Bruno - you're a star!

I will respond with a more sensible sentence than above as soon as I have
proven it (so far it works).

Rgds, Graeme.


Bruno Cesar Borges wrote:
 
 Try the setTimeout('myfunction()', 100); function. The second argument is
 the timeout (in miliseconds) to wait before evaluating the first argument.
 
 There's also a way to execute your javascript function only after body is
 fully loaded. Google for that. Maybe that's your answer.
 
 cheers,
 Bruno (becoming a JS developer rather Wicket)
 
 -Original Message-
 From: Graeme Knight [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2008 2:31 PM
 To: users@wicket.apache.org
 Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
 
 
 
 Not sure about this solution. The content of the iframe is visible then
 disappears... Hhm.
 
 
 Graeme Knight wrote:
 
 Hi guys,
 
 I'm making some progress. wicketGlobalPostCallHandler doesn't seem to be
 working for me, but I can do something like this after the iframe:
 
 StringBuilder buffer = new StringBuilder( script );
 buffer.append( IFrameArea.populateContent( false, true, 'hello
 world' ); );
 buffer.append( /script );
 
 Label scriptLabel = new Label( scriptLabel, buffer.toString()
 );
 
 scriptLabel.setRenderBodyOnly( true );
 scriptLabel.setEscapeModelStrings( false );
 
 add( scriptLabel );
 
 This will add a nice bit of Javascript into the whole lot that will call
 the populateContent function (hurray).
 
 Now the thing is, the text (hello world) flashes on the screen - then
 disappears.
 
 If I hit the 'refresh' button on the browser then the innerHTML 'hello
 world' sticks. If I can solve this tricky problem then I think I'm good
 to
 go.
 
 Is it REALLY this simple? Why does Wicket have to be so cool?
 
 Cheers, Graeme. 
 
 
 Graeme Knight wrote:
 
 Hi Ernesto,
 
 No - I didn't solve this problem as yet. However, this is part of the
 process of parsing the HTML prior to insertion on the innerHTML. If I
 can
 get that bit working I'm going to get back to our thread on the CIDs
 very
 soon!
 
 Cheers, Graeme.
 
 
 Graeme Knight wrote:
 
 Hi Bruno,
 
 No I didn't try this the Label idea... I'll give it a go!
 
 Thanks for the link I'll let you know how it works out ... watch this
 space!
 
 
 
 Bruno Cesar Borges wrote:
 
 Did you try to add a Label with CSS hidden attribute that executes
 your
 script? Something like this:
 
 div style=display:none;
   scriptmyJavascriptMethod();/script
 /div
 
 I'm really not sure if this actually works, but you could also check
 this Wiki page (yeah, it exists)
 
 http://cwiki.apache.org/WICKET/howto-do-javscript-call-after-each-wicket-ajax-update.html
 
 cheers,
 Bruno
 
 -Original Message-
 From: Graeme Knight [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2008 12:12 PM
 To: users@wicket.apache.org
 Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
 
 
 
 Hi Bruno,
 
 Right, that far I DID get. I have a Javascript file that contains the
 required Javascript for my editor. 
 
 (Sorry, I don't have the code now):
 
 When the user hits the tab and the panel goes into another context I
 create
 the panel, add a HeaderContributor that adds the Javascript file. 
 
 This panel is not created via a page refresh - it is replaced as per
 the
 code above (i.e. currentPanel = new  ). Will the HeaderContributor
 actually be utilized at this point or is a full page refresh required?
 
 My BIG problem (this is the crux) is HOW to call that Javascript
 function -
 the call to 'popupateContent' effectively has to be AFTER the iframe
 is
 initialized (so an innerHTML exists). This can't be part of a
 HeaderContributor - it has to be further down the chain of execution.
 My
 confusion is how to make this happen.
 
 Almost there! What are the guidelines for the Wiki when I get this
 working?
 Perhaps I can submit to the Wicket people for verification?
 
 REALLY appreciate your discussion on this.
 
 Cheers, Graeme.
 
 
 Bruno Cesar Borges wrote:
 
 Put that code into some .js file and add it to your panel as a
 HeaderContributor. Then you are ready to go.
 
 -Original Message-
 From: Graeme Knight [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2008 11:48 AM
 To: users@wicket.apache.org
 Subject: Re: Populate IFRAME innerHTML on AJAX load of panel.
 
 
 
 Hey Bruno,
 
 Perhaps my ramblings with myself didn't make myself clear.
 
 I am simply wanting to populate the innerHTML with content. I have it
 working wonderfully

RE: Clustering Problems / java.lang.StackOverflowError

2008-12-08 Thread Bruno Cesar Borges
Jeremy, could you please try to debug and see which class Wicket is trying to 
resolve at class IObjectStreamFactory, line 70?

org.apache.wicket.util.io.IObjectStreamFactory$1.resolveClass(IObjectStreamFactory.java:70)

Thanks,
Bruno

-Original Message-
From: Jeremy Levy [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2008 4:02 PM
To: users@wicket.apache.org
Subject: Clustering Problems / java.lang.StackOverflowError


We have recently moved our application over to using clustering, we are
running JBoss 4.2.3 with Tomcat 6 bundled using two nodes.  After a few
seconds with both nodes active and receiving traffic we start to see
StackOverFlow exceptions.  They don't originate from within our code and I'm
a bit at a loss of how to troubleshoot this.   Any help is appreciated.

java.lang.StackOverflowError
at
EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.hash(ConcurrentReaderHashMap.java:299)
at
EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(ConcurrentReaderHashMap.java:411)
at
org.jboss.mx.loading.UnifiedLoaderRepository3.getCachedClass(UnifiedLoaderRepository3.java:222)
at
org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:403)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
at
org.apache.wicket.util.io.IObjectStreamFactory$1.resolveClass(IObjectStreamFactory.java:70)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.convertToPage(DiskPageStore.java:1230)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.getLastPage(SecondLevelCacheSessionStore.java:228)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:296)
at org.apache.wicket.Session.getPage(Session.java:751)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore$PageHolder.readResolve(AbstractPageStore.java:363)
at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at

RE: Thread.sleep() for only one session

2008-12-05 Thread Bruno Cesar Borges
I'm totally against captcha. It's annoying for users and just one more obstacle 
for criminals - they will always find a way to break it. What I really suggest 
is: 

1) use HTTPS (obviously)
2) require your users a strong password
3) if your user tries login in more than X times, disable his/her account and 
redirect them to some Forgot your password? page. And they will have to 
answer some question related to their profile to get an email with a link to 
reset their password.

This is how I usually code websites with user/password support. The reason I 
don't like captcha is that I want to let power users to use browser's password 
remembering feature, and most of them hate having to type again some silly word 
drawed on some silly image. And I also don't want to annoy non-power users, but 
still protect them.

:-)

-Original Message-
From: Maarten Bosteels [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2008 3:37 PM
To: users@wicket.apache.org
Subject: Re: Thread.sleep() for only one session


If you're trying to defend against a brute-force password guessing attack,
you could add a captcha to your logon form after x failed login attempts
from one IP address.

Maarten

On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
[EMAIL PROTECTED]wrote:

 You definitely do NOT want to intentionally sleep a thread - that halts the
 request, and uses up your thread pool.  You instead want the request to
 complete, but you don't want to allow them to continue trying.  So, that
 being said, you could:

 1 - add a value to their session like private long blockedFromSignInUntil
 and when they've exceeded your threshold, set that for ten minutes future.
 This isn't bulletproof since they could start a new session by using a new
 window / browser / blowing away cookies.
 2 - if it's on a per-username (rather than a per-session) basis, add a
 similar value to the user - not allowed signin until  This is probably
 better anyway, because if I'm nefarious guy and I'm trying to sign in to
 mr nice guy account, you lock mr nice guy account because you are in
 fact detecting an identity theft attempt.
 3 - you could do a combo of the above so that I, nefarious guy when I get
 blocked from mr nice guy account, can't move on to mr unsuspecting
 account.

 Then, just have your sign in form be aware of that value in session or user
 and not allow a sign in to that account or from that session until the
 timeout is expired.

 But as a general rule of thumb, never use Thread.sleep in a web app -
 especially somewhere in the request cycle.  It'll be shooting yourself in
 the foot.

 Hope this helps,

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


 On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
 [EMAIL PROTECTED] wrote:

  Hello all Wicket users.
 
  One more question today.
  I need to implement appearence of sleep if user (session, IP
  address) tries incorrect login many times.
  Thread.sleep() seems to stop all sessions at once. Any ideas?
 
  Thank you!
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


RE: Thread.sleep() for only one session

2008-12-05 Thread Bruno Cesar Borges
Indeed.


-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2008 3:52 PM
To: users@wicket.apache.org
Subject: Re: Thread.sleep() for only one session


But, if you only show the captcha after so many failed logins, wouldn't that
be okay?  You let them try a few times and if they are still failing, you
initiate the captcha.

On Fri, Dec 5, 2008 at 12:48 PM, Bruno Cesar Borges 
[EMAIL PROTECTED] wrote:

 I'm totally against captcha. It's annoying for users and just one more
 obstacle for criminals - they will always find a way to break it. What I
 really suggest is:

 1) use HTTPS (obviously)
 2) require your users a strong password
 3) if your user tries login in more than X times, disable his/her account
 and redirect them to some Forgot your password? page. And they will have
 to answer some question related to their profile to get an email with a link
 to reset their password.

 This is how I usually code websites with user/password support. The reason
 I don't like captcha is that I want to let power users to use browser's
 password remembering feature, and most of them hate having to type again
 some silly word drawed on some silly image. And I also don't want to annoy
 non-power users, but still protect them.

 :-)

 -Original Message-
 From: Maarten Bosteels [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 05, 2008 3:37 PM
 To: users@wicket.apache.org
 Subject: Re: Thread.sleep() for only one session


 If you're trying to defend against a brute-force password guessing attack,
 you could add a captcha to your logon form after x failed login attempts
 from one IP address.

 Maarten

 On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
 [EMAIL PROTECTED]wrote:

  You definitely do NOT want to intentionally sleep a thread - that halts
 the
  request, and uses up your thread pool.  You instead want the request to
  complete, but you don't want to allow them to continue trying.  So, that
  being said, you could:
 
  1 - add a value to their session like private long
 blockedFromSignInUntil
  and when they've exceeded your threshold, set that for ten minutes
 future.
  This isn't bulletproof since they could start a new session by using a
 new
  window / browser / blowing away cookies.
  2 - if it's on a per-username (rather than a per-session) basis, add a
  similar value to the user - not allowed signin until  This is
 probably
  better anyway, because if I'm nefarious guy and I'm trying to sign in
 to
  mr nice guy account, you lock mr nice guy account because you are in
  fact detecting an identity theft attempt.
  3 - you could do a combo of the above so that I, nefarious guy when I
 get
  blocked from mr nice guy account, can't move on to mr unsuspecting
  account.
 
  Then, just have your sign in form be aware of that value in session or
 user
  and not allow a sign in to that account or from that session until the
  timeout is expired.
 
  But as a general rule of thumb, never use Thread.sleep in a web app -
  especially somewhere in the request cycle.  It'll be shooting yourself in
  the foot.
 
  Hope this helps,
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
  [EMAIL PROTECTED] wrote:
 
   Hello all Wicket users.
  
   One more question today.
   I need to implement appearence of sleep if user (session, IP
   address) tries incorrect login many times.
   Thread.sleep() seems to stop all sessions at once. Any ideas?
  
   Thank you!
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente,
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.


 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly
 containing information and or privileged/confidential documents whose
 content is protected by law.
 In case you have mistakenly received it, please notify the sender and
 delete it from your system.
 Be noticed that the law forbids the retention, dissemination, distribution,
 copy or use without
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect
 CETIP's point of view, which is only divulged by authorized personnel

RES: make invisible if model object is null

2008-12-01 Thread Bruno Cesar Borges
Use a border

-Mensagem original-
De: kan [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 1 de dezembro de 2008 09:03
Para: users@wicket.apache.org
Assunto: make invisible if model object is null


I use the next construction very often:

[markup]
wicket:enclosure child=something
pSomething here, description, comments etc: span
wicket:id=somethinig/span/p
/wicket:enclosure

[java]
add(new Label(something)
{
@Override
public boolean isVisible() {
return super.isVisible()  getDefaultModelObject() != null;
}
});

And there are a lot different components which should be hidden with
some arounding text if they have null value of model object.
How to make this more elegant?
First obvious way - inherit from Label, and make something
LabelInvisibleNull, but it is very bad, because a lot different
components (not only Label, but Image, WebMarkupContainer, some my
custom components, etc) require this behavior.
Second - more meaningful - make a IBehavior. But it doesn't work. In
bind is to early to check model, but in beforeRender is too late
to change visibility.
Is there any other option?


-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


Re: make invisible if model object is null

2008-12-01 Thread Bruno Cesar Borges
Alright, this is my last try replying with MS Outlook. =) And I will also add 
more info to help with this thread.

You can use borders to acomplish what you want. Here's an example:

#JAVA
public abstract class ConditionalHiddenBorder extends Border {

   public ConditionalHiddenBorder(String id) {
  super(id);
   }

   public abstract boolean isVisible();

}

#HTML
   html
   body
 wicket:border
   wicket:body/
 /wicket:border
   /body
   /html

#EXAMPLE (Wicket's Quickstart)
   public HomePage() {
  final Label label = new Label(message, If you see this message wicket 
is properly configured and running);
  ConditionalHiddenBorder chb = new ConditionalHiddenBorder(border) {

 public boolean isVisible() {
return label.getDefaultModelObject() != null;
 }
  };
  chb.add(label);
  add(chb);
   }

#HTML Example
div wicket:id=border
span wicket:id=messagemessage will be here/span
/div

Hope this reply works!

cheers,
Bruno

-Original Message-
From: kan [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2008 9:03 AM
To: users@wicket.apache.org
Subject: make invisible if model object is null


I use the next construction very often:

[markup]
wicket:enclosure child=something
pSomething here, description, comments etc: span
wicket:id=somethinig/span/p
/wicket:enclosure

[java]
add(new Label(something)
{
@Override
public boolean isVisible() {
return super.isVisible()  getDefaultModelObject() != null;
}
});

And there are a lot different components which should be hidden with
some arounding text if they have null value of model object.
How to make this more elegant?
First obvious way - inherit from Label, and make something
LabelInvisibleNull, but it is very bad, because a lot different
components (not only Label, but Image, WebMarkupContainer, some my
custom components, etc) require this behavior.
Second - more meaningful - make a IBehavior. But it doesn't work. In
bind is to early to check model, but in beforeRender is too late
to change visibility.
Is there any other option?


-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


Re make invisible if model object is null

2008-12-01 Thread Bruno Cesar Borges
Use a border

PS: I hate Microsoft Outlook

-Mensagem original-
De: kan [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 1 de dezembro de 2008 09:03
Para: users@wicket.apache.org
Assunto: make invisible if model object is null


I use the next construction very often:

[markup]
wicket:enclosure child=something
pSomething here, description, comments etc: span
wicket:id=somethinig/span/p
/wicket:enclosure

[java]
add(new Label(something)
{
@Override
public boolean isVisible() {
return super.isVisible()  getDefaultModelObject() != null;
}
});

And there are a lot different components which should be hidden with
some arounding text if they have null value of model object.
How to make this more elegant?
First obvious way - inherit from Label, and make something
LabelInvisibleNull, but it is very bad, because a lot different
components (not only Label, but Image, WebMarkupContainer, some my
custom components, etc) require this behavior.
Second - more meaningful - make a IBehavior. But it doesn't work. In
bind is to early to check model, but in beforeRender is too late
to change visibility.
Is there any other option?


-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


Re: How to get all the children of a MarkupContainer?

2008-11-28 Thread Bruno Cesar Borges
https://issues.apache.org/jira/browse/WICKET

-Mensagem original-
De: Valentine2008 [mailto:[EMAIL PROTECTED]
Enviada em: sexta-feira, 28 de novembro de 2008 18:12
Para: users@wicket.apache.org
Assunto: Re: How to get all the children of a MarkupContainer?



Where to open a jira issue?


igor.vaynberg wrote:
 
 open a jira issue and that way we can confirm.
 
 -igor
 
 On Fri, Nov 28, 2008 at 10:32 AM, Valentine2008
 [EMAIL PROTECTED] wrote:

 Hi Igor,

 I find it out!

 The reason I couldn't get a child using a string component path is
 because
 of the outdated JavaDoc sentences in MarkupContainer (Wicket 1.3.4):

 Children can be added by calling the add() method, and they can be
 looked
 up using a dotted path. For example, if a container called a held a
 nested
 container b which
 held a nested component c, then a.get(b.c) would return the Component
 with id c. .

 It said about *dotted* path with a clear example.  And I used the dotted
 path.

 Now I find that the Component.PATH_SEPARATOR is used, which is :.
 We have to use a.get(b:c) in the example.

 Can we confirm that the JavaDoc is updated in the next coming release of
 Wicket?

 Thanks,
 Valentine



 igor.vaynberg wrote:

 no. why would it do that? visibility is a render-time condition, it
 has nothing to do with component hierarchy.

 -igor

 On Thu, Nov 27, 2008 at 12:01 PM, Valentine2008
 [EMAIL PROTECTED] wrote:

 But Component.get(pathString) will check the visibility and will return
 null
 if the child is invisible. Right?

 Thanks,
 Valentine




 igor.vaynberg wrote:

 iterator() does not check visibility.

 -igor

 On Thu, Nov 27, 2008 at 11:24 AM, Valentine2008
 [EMAIL PROTECTED] wrote:

 Can we get even the invisible children?

 Seems we cannot:-(

 igor.vaynberg wrote:

 iterator()

 -igor

 On Thu, Nov 27, 2008 at 10:42 AM, Valentine2008
 [EMAIL PROTECTED] wrote:

 Use iterator(Comparator)?

 Or other ways?

 Thanks,
 Valentine
 --
 View this message in context:
 http://www.nabble.com/How-to-get-all-the-children-of-a-MarkupContainer--tp20723938p20723938.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context:
 http://www.nabble.com/How-to-get-all-the-children-of-a-MarkupContainer--tp20723938p20724471.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context:
 http://www.nabble.com/How-to-get-all-the-children-of-a-MarkupContainer--tp20723938p20724656.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context:
 http://www.nabble.com/How-to-get-all-the-children-of-a-MarkupContainer--tp20723938p20738180.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-all-the-children-of-a-MarkupContainer--tp20723938p20739977.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa 

RES: Set format date inline

2008-11-27 Thread Bruno Cesar Borges
@Override
public IConverter getConverter(Class? type)
{
return MyConverter();
}

-Mensagem original-
De: kan [mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de novembro de 2008 14:57
Para: users@wicket.apache.org
Assunto: Set format date inline


I have a MyPojo with property java.util.Date someDate
I use CompoundPropertyModelMyPojo
Now I add components on my page, like add(new Label(someDate)) and
it automagically uses IConvertor to convert from Date to string.
But in some places of web-site I need print only 27/11/2008, in some
places better will be 2 days ago, in some places 27/11/2008
16:53:34 UTC and so on.
What is an elegant way to specify a format in particular piece of code?

-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


RES: How can I instance home page myself

2008-11-27 Thread Bruno Cesar Borges
What kind of dependencies you want to pass on?

If you want URL parameters, just put a PageParameters argument to the Page's 
constructor. Wicket will inject that automatically.

If you want to inject objects from the Application instance, you can just get 
those from Page's constructor itself.

public MyPage() {
  Foo foo = getApplication().getFoo();
}

Cheers,
Bruno

-Mensagem original-
De: Kamil Hark [mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de novembro de 2008 16:22
Para: users@wicket.apache.org
Assunto: How can I instance home page myself



an Application class (and WebApplication) has method Class getHomePage()

 Why this method returns class instead of Page object?
 Now I'm limited to use non-argument constructor, I connot pass any
dependiences and so on. 

Are there any posibilities to instance and return Page object?
 
 
regards
 
Kamil
-- 
View this message in context: 
http://www.nabble.com/How-can-I-instance-home-page-myself-tp20723688p20723688.html
Sent from the Wicket - User mailing list archive at Nabble.com.
***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: RES: How can I instance home page myself

2008-11-27 Thread Bruno Cesar Borges
You can always code your page in such way that makes it easy to be tested, like 
this:

public MyPage() {
   setFoo(getApplication().getFoo());
}

protected MyPage(IFoo foo) {
   setFoo(foo);
}

-Mensagem original-
De: Kamil Hark [mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de novembro de 2008 16:39
Para: users@wicket.apache.org
Assunto: Re: RES: How can I instance home page myself



Yes I know that I can do it through Application but then it is very dificult
to test. If I could inject args into constructur like below then it would be
much better

new MyPage(Foo foo){...}
-- 
View this message in context: 
http://www.nabble.com/How-can-I-instance-home-page-myself-tp20723688p20723898.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: RES: How can I instance home page myself

2008-11-27 Thread Bruno Cesar Borges
By the way, you can implement an IPageFactory :-)

-Mensagem original-
De: Bruno Cesar Borges [mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de novembro de 2008 16:49
Para: users@wicket.apache.org
Assunto: RES: RES: How can I instance home page myself


You can always code your page in such way that makes it easy to be tested, like 
this:

public MyPage() {
   setFoo(getApplication().getFoo());
}

protected MyPage(IFoo foo) {
   setFoo(foo);
}

-Mensagem original-
De: Kamil Hark [mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de novembro de 2008 16:39
Para: users@wicket.apache.org
Assunto: Re: RES: How can I instance home page myself



Yes I know that I can do it through Application but then it is very dificult
to test. If I could inject args into constructur like below then it would be
much better

new MyPage(Foo foo){...}
-- 
View this message in context: 
http://www.nabble.com/How-can-I-instance-home-page-myself-tp20723688p20723898.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: Wicket Session grows too big real fast

2008-11-26 Thread Bruno Cesar Borges
Now that is a really good advice. :-)

-Mensagem original-
De: kan [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 26 de novembro de 2008 14:19
Para: users@wicket.apache.org
Assunto: Re: Wicket Session grows too big real fast


I am not sure if it always applicable, but usually I do not do
implements Serializable for domain objects (it works well with
Hibernated POJOs). In this case the Wicket cannot serialize a
component, and if it was a link to any such object - wicket just
reports about it into log, so you can see right away which component
has tried to steal a reference to an object (like in your situation
with inner class).

2008/11/26 jhp [EMAIL PROTECTED]:

 Removing references pointing to previous pages solved a lot, very good point.
 Also making sure that individual domain objects don't get stored to session
 makes  a difference. I have still a lot of code to go through to make sure
 that all unnecessary references don't get stored to session, but making a
 few changes in the most important pages makes already a big difference.

 I noticed that this is a problem that others have experienced too. I guess
 it is pretty easy unintentionally stuff the session with domain objects ,and
 if using modern day persistence framework, those domain objects can be quite
 large if they have collections etc.

 I think there is a need for small document outlining the common pitfalls and
 remedies for them. I haven't seen such. Wicket reference of course tells
 about LoadableDetachableModel, but this thread has info that I haven't found
 anywhere else. I might try compose such a document, if I just have the time
 and energy in the near future.

 Thanks to Martijn, Johan and John for your responses!

 BR,
 Jukka




 Martijn Dashorst wrote:

 With Wicket 1.3 only one page should be stored in session. You should
 check if you don't keep references between pages - that would result
 in 1+N pages (with N being the number of pages you reference in your
 page).

 Other than that: using LDM's and DataView/DataProvider instead of
 ListView will help considerably.

 Martijn


 --
 View this message in context: 
 http://www.nabble.com/Wicket-Session-grows-too-big-real-fast-tp20697077p20702093.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


RES: Wicket Session grows too big real fast

2008-11-26 Thread Bruno Cesar Borges
Maybe would be a good idea if Wicket could report memory usage for 
non-Wicket_Components (and non-standard Java objects, like String and 
Collections) in memory. I don't know if this could ever be possible.

-Mensagem original-
De: Ladislav Thon [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 26 de novembro de 2008 14:21
Para: users@wicket.apache.org
Assunto: Re: Wicket Session grows too big real fast


Agree. I was almost shocked :-) by Martijn's e-mail about keeping references
between pages. I believed it is a standard practice to keep reference to
previous page for the purpose of cancelling, and of course do it all the
time. It seems very natural to me. O-oops.

LT

2008/11/26 Piller Sébastien [EMAIL PROTECTED]

 I vote for such a document, too. I am now trying to reduce my session size
 too, and if I could find some hints somewhere (ie, be extremly carefull
 with anonymous subclasses, etc) it may be a big plus.

 jhp a écrit :

 Removing references pointing to previous pages solved a lot, very good
 point.
 Also making sure that individual domain objects don't get stored to
 session
 makes  a difference. I have still a lot of code to go through to make sure
 that all unnecessary references don't get stored to session, but making a
 few changes in the most important pages makes already a big difference.

 I noticed that this is a problem that others have experienced too. I guess
 it is pretty easy unintentionally stuff the session with domain objects
 ,and
 if using modern day persistence framework, those domain objects can be
 quite
 large if they have collections etc.

 I think there is a need for small document outlining the common pitfalls
 and
 remedies for them. I haven't seen such. Wicket reference of course tells
 about LoadableDetachableModel, but this thread has info that I haven't
 found
 anywhere else. I might try compose such a document, if I just have the
 time
 and energy in the near future.

 Thanks to Martijn, Johan and John for your responses!

 BR,
 Jukka




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: Is there any other way? DataProviders must hit the Db twice for (possible) large datasets

2008-11-26 Thread Bruno Cesar Borges
You have to consider some things

1) Is this table going to be huge?
2) Am I going to let users do a Full Table Scan? (letting them search without 
filters, for instance)
3) Is this table frequently updated? How often new data is added to it?
4) Any other question that may affect your scalability ...

Then you will know if is a good idea to just bring the whole data, or do a 
count(*) before.

But, from my experience I rather say: always do a count(*) before.

Regards,
Bruno

-Mensagem original-
De: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 26 de novembro de 2008 15:20
Para: users@wicket.apache.org
Assunto: Re: Is there any other way? DataProviders must hit the Db twice
for (possible) large datasets


On Wed, Nov 26, 2008 at 9:06 AM, Wayne Pope
[EMAIL PROTECTED] wrote:
 Hi Igor,

what? why would you ever load the whole dataset?
 just to avoid 2 calls on smallish datasets, especially when there are
 multiple joins and database isnt on the same box.

so you think pushing all that extra data over the network is actually
more efficient then doing another query wtf.

yeah. because select count() queries are the most expensive queries
you can run on the database. you are right, its totally going to kill
it. you know how all those sites on the internet that have a pager
above the pageable view that shows you the number of the last
available page...you know how those work without doing a select
count()?

 Ouch.
 I just want to limit calls if possible to the database as waiting for i/o's
 is never great for scalability. I'm not 'having a go' at wicket or DataViews
 or anything, just trying to understand it. I never claimed to be a guru -
 far from it.

i can only assume that you have actually profiled your app and that
one select count() call was what was taking a significant chunk of
processing time in the database server? to the point where eliminating
it will actually reduce enough load on the database to increase your
throughput?

-igor


 Wayne


 On Wed, Nov 26, 2008 at 5:58 PM, Igor Vaynberg [EMAIL PROTECTED]wrote:

 On Wed, Nov 26, 2008 at 7:32 AM, Wayne Pope
 [EMAIL PROTECTED] wrote:
  I'm sure I must be missing something still, as I can't beleive that we
 need
  to either a) load the whole data set

 what? why would you ever load the whole dataset?

 b) call count on the Db , then load in
  the iterator mehod. Thats going to kill the database in prod (or really
 not
  help.)

 yeah. because select count() queries are the most expensive queries
 you can run on the database. you are right, its totally going to kill
 it. you know how all those sites on the internet that have a pager
 above the pageable view that shows you the number of the last
 available page...you know how those work without doing a select
 count()?

 -igor






 
  On Wed, Nov 26, 2008 at 3:58 PM, Michael Sparer [EMAIL PROTECTED]
 wrote:
 
 
  have a look at https://issues.apache.org/jira/browse/WICKET-1784
 
 
  Wayne Pope-2 wrote:
  
   Ok,
  
   I was just having a bit of code clean up and I realized that in our
   IDataProviders we are loading all rows for a given dataset.
   So looking at the iterator method I see we can limit the result (and
 the
   offset). Great I thought - however I see that that the size() method
 is
   called as part of the getViewSize() in the AbstractPageableView. Thus
 I
   need
   to call the database here to figure out the size.
  
   Am I doing sonething wrong or have I got to hit the database twice for
   each
   DataProvider render.
  
   Obvously I don't want to hard code a size. Is there any other way ?
  
   Thanks
   Wayne
  
  
 
 
  -
  Michael Sparer
  http://talk-on-tech.blogspot.com
  --
  View this message in context:
 
 http://www.nabble.com/Is-there-any-other-way--DataProviders-must-hit-the-Db-twice-for-%28possible%29-large-datasets-tp20701684p20702476.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do 

RES: Is there any other way? DataProviders must hit the Db twice for (possible) large datasets

2008-11-26 Thread Bruno Cesar Borges
Here's what I've commented on this issue:

I think the purpose of Transfer Object Pattern , where it says it wants to 
reduce remote calls between tiers over the network is related to tiers like 
client / server architectures.

This means that:

i) A Swing client requests a query on a table for a remote EJB
ii) The EJB executes two calls on the database
ii.a) select count(*)
ii.b) select * ... limit x offset y / rownum between z and k // whatever DB 
paging technique is being used.
iii) Put all this information into one single Transfer Object
iv) Send the object back to the client application over the network

So, if your Web Application is running on the same server with your services 
(EJBs, Spring Services, whatever), this means that you are not going to 
transport data over the network between those tiers (Web and Model). And there 
will be an implicit Transfer Object to the real client (web browser).

Following this logic: -1 for this improvement.

Regards,
Bruno

-Mensagem original-
De: rgoodwin [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 26 de novembro de 2008 19:01
Para: users@wicket.apache.org
Assunto: RE: Is there any other way? DataProviders must hit the Db twice
for (possible) large datasets



Still is being disputed unfortunately :(

https://issues.apache.org/jira/browse/WICKET-1784

For those who believe in the 1-query approach, ergo the DTO pattern, writing
an alternative to the Wicket data provision using a DTO approach isn't a
terrible hardship ... just annoying to be sprung with on day one of using
Wicket. But pain is experienced later when encountering the Wicket data
provision and paging mechanism coupling. The paging mechanism is far less
joy to replace ...

IReallyHateDataProvider



Hoover, William wrote:
 
 I think the idea behind this is that size will be called first. If the
 size is zero there is no need to proceed with the call to get the items.
 I don't necessarily agree with this approach because a lot of service
 calls can capture the data in one call (even down to the database level-
 some support getting the size/results in one call), but the last time I
 brought this issue up it was disputed.
 

-- 
View this message in context: 
http://www.nabble.com/Is-there-any-other-way--DataProviders-must-hit-the-Db-twice-for-%28possible%29-large-datasets-tp20701684p20708929.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: Wicket and CoC

2008-11-26 Thread Bruno Cesar Borges
There you go. What about creating a project into Wicket Stuff, called ... 
WiCooCo?

Wicket Conventioned over Configurations =)



-Mensagem original-
De: Ricardo Mayerhofer [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 26 de novembro de 2008 19:57
Para: users@wicket.apache.org
Assunto: Re: Wicket and CoC



Perhaps the name could be userFeedBackPanel :) 
One Word per Concept (Clean Code, Bob Martin, p. 26)

I'm just talking about code duplication, add( new SubmitLink( submitLink )
) and similars many times in a code doenst makes a programmer happier.
OOP (object oriented programming) isn't always the best tools to solve code
duplication. So sometimes AOP (aspect oriented programming) comes to mind,
other times CoC (convention over configuration). (I hope Martijn is happy by
the acronyms explanations :)).

I'm not saying that it should be in wicket core (as you guys keep it thin as
you can) and I'm glad wicket core makes me able to extend it, in a way I can
implement this (thats a huge plus)

I'm just saying that this is not a bad idea, mainly when you care about
saving programming efforts and clean code. 


igor.vaynberg wrote:
 
 in our app components with id feedbackPanel are often used to present
 a user with a user-feedback panel they can use to submit
 suggestions...
 
 -igor
 
 On Wed, Nov 26, 2008 at 12:51 PM, Ricardo Mayerhofer
 [EMAIL PROTECTED] wrote:

 Hi Martijin,
 First of all thank you for your response.
 I guess automation != magic. Automation means that computers or
 frameworks
 helps humans accomplishing repetitive tasks, so developers can better
 focus
 on the problem being solved, rather than having to copy and paste same
 code
 over and over (boilerplate).
 If one add a markup named feedbackPanel, what is he intent, to make a
 combo
 box? Or he have to tell it again, in a different way? IMO it's better to
 tell one time what I'm willing to do rather than 2, 3, 5...


 Martijn Dashorst wrote:

 -1000,000,000,000

 First please don't assume someone understands your acronym du jour. I
 had to think really hard to understand that CoC means convention over
 configuration instead of the Dutch meaning gay rights group.

 Second this is not a task for wicket. You can  think up any CoCamania
 you want in your own addon framework and publish it on 'stuff or
 google code, but I won't be using it ever nor including it in core.

 The biggest plus point of wicket is that it doesn't perform magic. I
 don't need nor want to have to wave a dead chicken in front of my
 monitor and spend the bigger part of the day wondering which
 incantation I did wrong.

 Martijn
 On 11/26/08, Ricardo Mayerhofer [EMAIL PROTECTED] wrote:

 I started to use wicket some time ago, and I'm really enjoying it. Best
 framework ever.
 But I've some suggestions.
 I think wicket could be better if it had less boiler plate code. This
 could
 be reduced by using CoC.
 Take the FeedBackPanel for example, you always have to add the
 component
 on
 the web page, even if no special handling is requires (which is almost
 the
 case).
 Wicket could have some reserved ids, so if I add a markup with id
 feedbackPanel, a feedbackpanel component is automatically added to that
 page.
 Another example is SubmitLink component. No special handling required,
 but
 for wicket sake the developer must add it on the java the page.
 --
 View this message in context:
 http://www.nabble.com/Wicket-and-CoC-tp20706881p20706881.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context:
 http://www.nabble.com/Wicket-and-CoC-tp20706881p20708778.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Wicket-and-CoC-tp20706881p20709706.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem 

RES: [VOTE] Organizing Wicket Stuff / Regular Release Schedule?

2008-11-24 Thread Bruno Cesar Borges
[X] - YES - 
  SR on
and let be Igor the one controlling all releases. :-) 
  /Sarcastic Reply off

-Mensagem original-
De: Jeremy Thomerson [mailto:[EMAIL PROTECTED]
Enviada em: segunda-feira, 24 de novembro de 2008 16:13
Para: users@wicket.apache.org; Wicket Development
Assunto: [VOTE] Organizing Wicket Stuff / Regular Release Schedule?


Hello everyone,
  I would like to get your opinion on an idea regarding the Wicket Stuff
project(s).  As you are familiar with, Wicket Stuff is where anyone can
create anything related to Wicket, small or large.  One problem that new
users of Wicket (and us old users) come across is that there is a lot of
stuff in there, and not all of it is well maintained, and there aren't
specific releases of many of the projects.  So, you have to build it
yourself and figure out which version matches which Wicket version, etc...

  What I would like to know is if everyone thinks it would be good to have a
subset of WS projects that are structured in a way that they are always in
sync with the Wicket versions.  IOW, there would be two branches - 1.3.X and
1.4 (trunk), just like Wicket has.  There would be a parent module and all
of the modules that wanted to participate would be structured under it.
They would all release in sync with Wicket.  For instance, when Wicket
releases 1.4-RC2, we would cut a release of this wicket-stuff-structured
(bad name) and all of the projects under it at 1.4-RC2.  I haven't yet
figured out how interim releases would work (new features are added to a WS
project and it wants to cut a release between wicket releases) or if that
matters.

  This would not have to effect all WS projects - someone could continue to
add projects to WS just like they do today.  This would simply create a
sub-tree of projects that are in the structured / scheduled release area.
For those that don't want to be part of that structure, they could continue
operating as they do today.

So, here's the vote:

[ ] - NO!  We should leave Wicket Stuff like it is - a free-for-all with no
structure
[ ] - YES - I would like to see at least the most used Wicket Stuff projects
structured so that they mirror Wicket, and a release is produced for each
Wicket release.
[ ] - Maybe - I have a better idea (perfect!)

Also - please add the following:
1 - Would you be interested in helping to maintain such a thing. (If we had
two or three of the owners of the larger projects on board, I don't think it
would be too hard to keep the codebase of this in sync with Wicket core.)
2 - What projects do you own (and by your vote we'll see if you want those
projects to be included in this restructuring).

-- 
Jeremy Thomerson
http://www.wickettraining.com
***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: Set the HTML id programmatically

2008-11-21 Thread Bruno Cesar Borges
AttributeModifier does not work?

-Mensagem original-
De: Martin Letendre [mailto:[EMAIL PROTECTED]
Enviada em: sexta-feira, 21 de novembro de 2008 18:09
Para: users@wicket.apache.org
Assunto: Set the HTML id programmatically



I am usign this version of Wicket: 1.3.5

1- I would like to override an id for a TextArea programmatically

textarea   wicket:id=description 
id=toOverride
name=description
rows=10 
cols=50   /textarea
 

2- In my java code I tried this method

TextArea description =  new TextArea(description);
description.setMarkupId(myDescription);
form.add(description);


3- But it's not setting anything... Here is the generated HTML

textarea cols=50 rows=10 wicket:id=description name=description
id=toOverride/textarea

:confused:

Question: Is it possible to override the id programatically. Because it
would be usefull in my integration between YUI and Wicket...


-- 
View this message in context: 
http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: Model never called

2008-11-19 Thread Bruno Cesar Borges
I couldn't understand the part about the icon, but what I know is that 
'getObject()' will *never* be called until you set the Square object into 
itself as the model:

public Square() {
   setModel(this);
}

Regards,
Bruno

-Mensagem original-
De: Leucht, Axel [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 19 de novembro de 2008 09:28
Para: [EMAIL PROTECTED] Apache. Org (E-Mail)
Assunto: Model never called


Hi,

I do have a link class which should render different icons when clicked. 

So I decided to implement IModel and return different icons depending on the 
state of the object. But to my surprise getObject() never get called!

Does anyone give me a clue where to look next or give me a hint as to how to 
render the object with a different icon?

The object is used in a 10x10 board game where a player can shoot at 
different squares which are rendered as links in the output. The board is 
constructed as:
ListView listview = new ListView(rows, list) {
private static final long serialVersionUID = 1L;

protected void populateItem(ListItem item) {
Row row = (Row) item.getModelObject();
final Square[] squares = new Square[10];
for (int col=0; col10; col++) {
squares[col] = row.getCells(col);
}
Square square = row.getCells(0);
item.add(new Label(row,new 
Model(square.getRow(;
for (int col=0; col10; col++) {
final Square aSquare = 
row.getCells(col);
item.add(aSquare);
}
}
};
And the Square-Object is:
public class Square extends Link implements IModel {
@Override
public void onClick() {
System.out.println(Click: + ident);
}

@Override
public Object getObject() {
System.out.println(GetObject);
if (someState)
return icon1;
return icon2;

}
}

/Axel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RES: FileUploadField usage changed in 1.4 rc-1?

2008-11-19 Thread Bruno Cesar Borges
Yes, you need to set a Model object into FileUploadField. :-)

Bruno

-Mensagem original-
De: Martin Makundi [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 19 de novembro de 2008 14:33
Para: users@wicket.apache.org
Assunto: FileUploadField usage changed in 1.4 rc-1?


Hi!

My FileUploadField worked fine before:

  dataForm.add(fileUploadField = new FileUploadField(COMPANY_LOGO));

After upgrading to 1.4 rc-1 (from 1.4-m1) the upload crashes.

Am I doing something wrong or is there a bug in rc-1?

Caused by: java.lang.IllegalStateException: Attempt to set model
object on null model of component:
mainTabs:panel:innerTabs:panel:dataForm:company_logo
at 
org.apache.wicket.Component.setDefaultModelObject(Component.java:2933)
at 
org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1149)
at 
org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223)

ERROR - RequestCycle   - there was an error cleaning up target
java.lang.IllegalStateException: Attempt to set model object on null
model of component:
mainTabs:panel:innerTabs:panel:dataForm:company_logo
at 
org.apache.wicket.Component.setDefaultModelObject(Component.java:2933)
at 
org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1647)
at 
org.apache.wicket.markup.html.form.upload.FileUploadField.onDetach(FileUploadField.java:175)
at org.apache.wicket.Component.detach(Component.java:1119)

The 1.4-m-3 code avoided the nullpointer like this:
@Override
public void updateModel()
{
// Only update the model if one was passed in
if (hasExplicitModel)
{
setDefaultModelObject(getConvertedInput());
}
}

However, this hasExplicitModel is not there anymore in 1.4-rc1

No documentation seems to have changed..

**
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]