Re: Stateless link usage

2008-05-08 Thread Igor Vaynberg
there are two ways to do it:

a) use a bookmarkablepagelink to go to the cart page and pass in the
itemid+quantity to be added. this means that the cart page is
responsible for adding the item to the cart.

b) use a stateless link to add the item to cart, then
setResponsePage(CartPage.class) == to a class not an instance to
maintain a clean url with a redirect.

-igor


On Wed, May 7, 2008 at 10:49 PM, Ritz123 [EMAIL PROTECTED] wrote:

  Add To Cart links are on the product list page. I want the links to take the
  users to view cart page where they can see the cart content.





  igor.vaynberg wrote:
  
   so you want it to add something to cart, and then go where? to the
   same page? to the cart page?
  
   -igor
  
  
   On Wed, May 7, 2008 at 9:11 AM, Ritz123 [EMAIL PROTECTED] wrote:
  
Actually I want to add the product to the cart and not go to the
   detail
page. They both are similar operation in a way, but there is one major
difference. View Product has dedicated functionality of just viewing the
product and nothing more, but View Cart page will be overloaded with
   add
to cart functionality if I am understanding your point correctly.
  
This actually brings up interesting design question with Wicket, what
   would
be the best way to handle these kind of scenarios? In struts world, I
   had
CartAction - which took care of all the operations (Add, View, Update
   and
Delete) for Cart, what would be the equivalent design in Wicket?
  
All the books and available material covers more of syntactic part of
Wicket - but none covers the design - that I have found. I may be
   missing
something and will appreciate any pointers.
  
  
  
  
  
  
igor.vaynberg wrote:

 that's what stateless kinks do. If you want to go t a detail page use
 a bookmarkable link, not a stateles one.

 -igor


 On 5/6/08, Ritz123 [EMAIL PROTECTED] wrote:

 Hi,

 I have a page containing bunch of products and addToCart link next to
 each
 product. On clicking the add to cart link, would like to add product
   to
 cart. I had Link and onClick() to do this - but recently encountered
   page
 expired message which is expected since the page becomes stateful due
   to
 the
 Link.

 Obviously this page is supposed to be stateless and hence I changed
   Link
 to
 StatelessLink using final product id inside the onclick. Now on
 application
 reload(due to hotdeploy) to simulate session expiry, dont get session
 expired message but link behaves weird in the sense, it seems to be
 reloading the contained page instead of going to the setResponsePage.

 Seems like I may be missing something. Is this the right approach in
 terms
 of making the page stateless?
 --
 View this message in context:
 http://www.nabble.com/Stateless-link-usage-tp17093682p17093682.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/Stateless-link-usage-tp17093682p17108713.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/Stateless-link-usage-tp17093682p17120171.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]



Re: Wicket javascripts - reloading every one hour

2008-05-08 Thread Johan Compagner
But is it then really downloaded?
Because the brower makes first a head request to it and that will say
not changed

On 5/8/08, Stefan Simik [EMAIL PROTECTED] wrote:

 Hi boys,

 I think, there is one problem with wicket ajax javascripts - there are
 reloading by browser every
 hour, because the Expire header is hardcoded to 3600 seconds in
 WebResource#setHeaders() method.

 It is really needed to repeatedly once an hour download these wicket
 javascripts ?
 These are static wicket javascripts, they are not subject of changes, so
 why could they not be cached for longer time, for example - 1 week, or
 longer.

 It would be better, if caching time should be configurable from some
 application settings.
 Could I create requet for improvement, or it is all ok ?

 thx
 Stefan Simik

 //
 I have consulted this before, but without result. So now, I am trying to
 show
 the problem in a simpler situation.


 --
 View this message in context:
 http://www.nabble.com/Wicket-javascripts---reloading-every-one-hour-tp17117009p17117009.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]



Re: behavior for onComponentTagBody

2008-05-08 Thread Johan Compagner
Or use a converter? Because it seems that is what you are doing?

On 5/7/08, Eyal Golan [EMAIL PROTECTED] wrote:
 Hi all,
 I have this in several components:
 @Override
 protected void onComponentTagBody(MarkupStream markupStream,
 ComponentTag openTag) {
 String value;
 if (getModel() != null) {
 value = getModelValue();
 } else {
 value = ;
 }
 replaceComponentTagBody(markupStream, openTag,
 Consts.getTableBody(getMarkupId(),
 value));
 }

 I want to put it in one location such as in an AbstractBehavior.
 Unfortunately, this behavior doesn't have this (or something like this)
 method.

 Is there a way for creating a behavior for the onComponentTagBody or
 replaceComponentTagBody?

 thanks

 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/


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



Re: A question about partial form updates with AJAX

2008-05-08 Thread Maurice Marrink
Can you show us some code?
This should work as long as the component models are updated.

Maurice

On Thu, May 8, 2008 at 1:22 AM, nate roe [EMAIL PROTECTED] wrote:
 I have a form with several items.  About half of the form is wrapped in a
 named div attached to a WebMarkupContainer.  When a drop-down value changes,
 the div is updated via AJAX, re-rendering that part of the form.  However,
 the components in that part of the form are not updated and so this
 re-rendering causes their values to revert to the initial value.

 I've used an AjaxFormComponentUpdatingBehavior to accomplish the AJAX
 update.  Is there a more appropriate behavior that I should use?  When I use
 no AJAX, then the form maintains its values rather than resetting (but the
 whole page is refreshed.)

 How can I prevent a form reset?

 Thanks,
 Nate Roe


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



Re: behavior for onComponentTagBody

2008-05-08 Thread Eelco Hillenius
On Wed, May 7, 2008 at 8:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 doesnt Label do this already?

Yeah, I think just using getModelValueAsString would give the same results.

Also, Label is the only (or one of the few at most) class(es) where
overriding onComponentTagBody makes sense. Why not do your thing in a
base class Eyal?

Or... make model wrappers, where the sole purpose of your wrapping
models is to format the output of your wrapped models.

Or... do this using converters.

Creating a base class makes sense if you do this with the same kind of
components all the time (labels I pressume?). If your components are
very different, any of the other options are fine.

Eelco

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



Form doesn't fire onsubmit when nested in a wizard

2008-05-08 Thread Piller Sébastien

Hello guys,

I have a problem with the wizard component in Wicket 1.3.1. I have a 
user form panel, containing a form with several fields. I put it in a 
wizard, and have the following problem:


FormUser

public class FormPerson extends Panel {
   // ...
   public FormPerson(String formid) {
   super(formid);


   name = new RequiredTextField(name);
   firstname = new RequiredTextField(firstname);
   address = new RequiredTextField(address);
   zip = new RequiredTextField(zip);
   city = new RequiredTextField(city);
   

   form = new Form(formperson, new CompoundPropertyModel(xxx)) {

   @Override
   protected void onError() {
   super.onError();
   updateFieldsCssClasses();
   System.out.println(ON ERROR);
   }

   @Override
   public void onSubmit() {
   super.onSubmit();
   System.out.println(on submit :  + src.getFirstname());
   }
   };
   add(form);


Now I put it in a Wizard component
 - When there are errors on that form and I click the next button, 
the method onError get correctly called
 - When there are no errors and I click next, the method onSubmit get 
not called


Have you any idea on what's going wrong?

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



Re: behavior for onComponentTagBody

2008-05-08 Thread Martijn Dashorst
I think we miss one call into Eyan's code:

Consts.getTableBody(getMarkupId(), value)

 seems to be the crux.

Martijn
On 5/8/08, Eelco Hillenius [EMAIL PROTECTED] wrote:
 On Wed, May 7, 2008 at 8:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   doesnt Label do this already?


 Yeah, I think just using getModelValueAsString would give the same results.

  Also, Label is the only (or one of the few at most) class(es) where
  overriding onComponentTagBody makes sense. Why not do your thing in a
  base class Eyal?

  Or... make model wrappers, where the sole purpose of your wrapping
  models is to format the output of your wrapped models.

  Or... do this using converters.

  Creating a base class makes sense if you do this with the same kind of
  components all the time (labels I pressume?). If your components are
  very different, any of the other options are fine.


  Eelco


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

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



Re: Ajax and Loop

2008-05-08 Thread Stefan Lindner
Thank you! The ListView did the trick! 

-Ursprüngliche Nachricht-
Von: Eelco Hillenius [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 8. Mai 2008 00:35
An: users@wicket.apache.org; [EMAIL PROTECTED]
Betreff: Re: Ajax and Loop

 Have you tried using a ListView in combination with a model (rather than 
 passing a List to the constructor of ListView)?

That won't trigger a re-population of the child components (ListItem and 
everything you add to it). For that, you need to call setReuseItems(false). 
Note that this can cause problems in forms (particularly with updating 
feedback), so when using forms, things like RefreshingView are often preferable.

Eelco

-
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]



Re: A question about partial form updates with AJAX

2008-05-08 Thread Johan Compagner
are you sure that all the form elements that are in that div that you
replace have the AjaxFormComponentUpdatingBehavior attached?

On Thu, May 8, 2008 at 1:22 AM, nate roe [EMAIL PROTECTED] wrote:

 I have a form with several items.  About half of the form is wrapped in a
 named div attached to a WebMarkupContainer.  When a drop-down value
 changes,
 the div is updated via AJAX, re-rendering that part of the form.  However,
 the components in that part of the form are not updated and so this
 re-rendering causes their values to revert to the initial value.

 I've used an AjaxFormComponentUpdatingBehavior to accomplish the AJAX
 update.  Is there a more appropriate behavior that I should use?  When I
 use
 no AJAX, then the form maintains its values rather than resetting (but the
 whole page is refreshed.)

 How can I prevent a form reset?

 Thanks,
 Nate Roe



Problem with MultiFileUploadField and keeping rest of fields in model

2008-05-08 Thread Java Programmer
Hello,
I have use MultiFileUploadField for uploading pictures, everything
works fine but when I use e.g. setMaxSize(Bytes.kilobytes(1024)) on
the form and try to upload larger picture or pictures than limit, I
got only one message about hitting limit size, and other fildes are
not checked this time (e.g. required text fields). There is also
problem with backuping fields from model after such sending, some
fields are set up, and some remains empty. I have read about Notice
that this component clears its model at the end of the request, so the
uploaded files MUST be processed within the request they were
uploaded., but I don't think it's the problem. I try to use 2 models
one CompoundPropertyModel for texts on form, and one for new
MultiFileUploadField(UPLOADS, new Model(new ArrayListFileUpload()),
MAX_PICTURES_TO_UPLOAD); (earlier I had everything in
CompoundPropertyModel).

Anybody knows what could be wrong?

Best regards,
Adr

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



Re: Problem with MultiFileUploadField and keeping rest of fields in model

2008-05-08 Thread Gerolf Seitz
when the file size exceeds the size limit,
the request processing is kind of aborted and the other
request params are not processed (no conversion, validation, ...).
when the page is then rendered again, the formcomponents
don't have an input value set, and that's why the fields
are cleared and no error messages are displayed.

there's already a jira issue for that, but actually there's not much
that we can do, except some hacks that would temporarily allow
an unlimited file size to be able to read the normal request parameters,
and just discard the uploaded files.
but then a (wicke[dt]) user can upload gigabytes of files and keeping
your server, connection, ... busy. so that's not really a solution either.

creative input on how to handle this is very much appreciated ;)

Cheers,
  Gerolf

On Thu, May 8, 2008 at 10:13 AM, Java Programmer [EMAIL PROTECTED]
wrote:

 Hello,
 I have use MultiFileUploadField for uploading pictures, everything
 works fine but when I use e.g. setMaxSize(Bytes.kilobytes(1024)) on
 the form and try to upload larger picture or pictures than limit, I
 got only one message about hitting limit size, and other fildes are
 not checked this time (e.g. required text fields). There is also
 problem with backuping fields from model after such sending, some
 fields are set up, and some remains empty. I have read about Notice
 that this component clears its model at the end of the request, so the
 uploaded files MUST be processed within the request they were
 uploaded., but I don't think it's the problem. I try to use 2 models
 one CompoundPropertyModel for texts on form, and one for new
 MultiFileUploadField(UPLOADS, new Model(new ArrayListFileUpload()),
 MAX_PICTURES_TO_UPLOAD); (earlier I had everything in
 CompoundPropertyModel).

 Anybody knows what could be wrong?

 Best regards,
 Adr

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




Re: forcing cookies to expire

2008-05-08 Thread Johan Compagner
i have no idea then what goes wrong
especially if it is just one request not a redirect one.

you could try to clean the cookes by directly using the httpresponseobject
yes.
Just that that one from the WebResponse

johan


On Wed, May 7, 2008 at 5:00 PM, Andrew Broderick 
[EMAIL PROTECTED] wrote:

 Tried that, and it didn't make any difference
 (getRequestCycle().setRedirect(false)).

 The page is called via a BookmarkablePageLink. Debugging reveals that the
 constructor, below, is called every time the link is clicked, so it isn't an
 issue of the code not being called. I also tried calling it via a
 wicket:link as well - no dice.

 Earlier, someone mentioned something about pushing to the
 HttpServletResponse object. What does this mean, exactly?

 Thanks

 -Original Message-
 From: Johan Compagner [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 07, 2008 2:24 AM
 To: users@wicket.apache.org
 Subject: Re: forcing cookies to expire

 how is that page called/created?

 if you do this:

   public SignOut()
   {
   clearCookie(Register.REMEMBER_ME_COOKIE);
   getSession().invalidate();
   getRequestCycle().setRedirct(false)
}

 what then

 On Tue, May 6, 2008 at 4:16 PM, Andrew Broderick 
 [EMAIL PROTECTED] wrote:

  Hi,
 
  clearCookie() is called in the constructor of a page called SignOut. The
  entire constructor is:
 
 public SignOut()
 {
 clearCookie(Register.REMEMBER_ME_COOKIE);
 getSession().invalidate();
 }
 
  As I mentioned the cookie is never cleared. Is there something else I
 need
  to do?
 
  Thanks
 
  -Original Message-
  From: Johan Compagner [mailto:[EMAIL PROTECTED]
  Sent: Monday, May 05, 2008 5:58 PM
  To: users@wicket.apache.org
  Subject: Re: forcing cookies to expire
 
  When is that clear cookie called?
  Can you follow that call a bit more, is it pushed to the
  httpservletresponse object?
 
  On 5/5/08, Andrew Broderick [EMAIL PROTECTED] wrote:
   Hi,
  
   I am trying to manage cookies in Wicket. I can create them and read
 them
  no
   problem, but forcing expiry by setting maxAge=0 does not seem to be
  working.
   Here is the code:
  
   Set cookie:
  
 public void setRememberMeCookie(String username)
 {
   Cookie cookie = new Cookie(REMEMBER_ME_COOKIE, username);
   cookie.setMaxAge(-1);
   cookie.setPath(/);
   getWebRequestCycle().getWebResponse().addCookie(cookie);
 }
  
   Clear cookie:
  
 private void clearCookie(String name)
 {
   Cookie cookie =
   getWebRequestCycle().getWebRequest().getCookie(name);
   cookie.setMaxAge(0);
   getWebRequestCycle().getWebResponse().addCookie(cookie);
 }
  
   The code is definitely called. However, the cookie remains. What am I
  doing
   wrong?
  
   Thanks
  
   ___
  
   The  information in this email or in any file attached
   hereto is intended only for the personal and confiden-
   tial  use  of  the individual or entity to which it is
   addressed and may contain information that is  propri-
   etary  and  confidential.  If you are not the intended
   recipient of this message you are hereby notified that
   any  review, dissemination, distribution or copying of
   this message is strictly prohibited.  This  communica-
   tion  is  for information purposes only and should not
   be regarded as an offer to sell or as  a  solicitation
   of an offer to buy any financial product. Email trans-
   mission cannot be guaranteed to be  secure  or  error-
   free. P6070214
  
 
  -
  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]




RE: South African Wicket Users?

2008-05-08 Thread Arje Cahn
Hi Izak, 

 Plenty of such companies around in the Netherlands it seems. 
 Search through the list archives for ideas :-) Topicus, Xebia, 
 Servoy, Hippo, Finalist to name a few. Good knowledge of 
 Dutch is probably required, especially if you want to work outside of 'de 
 randstad'.

Hi there from the Hippo department :). I'd be more than happy to talk to you 
about a Wicket job.
Our headquarters are in Amsterdam (which indeed is within the Randstad), and we 
have an office in San Francisco where we do mainly Portal development. English 
is the primary language for our developers - although most of them are Dutch.

We use Wicket for Hippo CMS v7, our flagship content management system, and 
Hippo Portal, our portal engine. Your help would be very much appreciated as we 
expect to rely more and more on Wicket.

Take a look at http://www.onehippo.com/en/about_us/jobs,senior-developer.html 
for some more inspiration.



Kind regards,

Arjé Cahn

Hippo  

[EMAIL PROTECTED] / [EMAIL PROTECTED]

Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466  
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-3329 +1 
(707) 773-4646

www.onehippo.com [EMAIL PROTECTED]

--
 Hippo CMS community   http://www.hippocms.org
 My weblog http://blogs.hippo.nl/arje
--

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



Re: CometServlet and WicketFilter

2008-05-08 Thread Johan Compagner
it seems that jetty 6 really uses servlet api 2.5 yes (this is by the way
very hard to find... they really should have a list just as tomcat has)

so somehow you have another servlet.jar there

On Thu, May 8, 2008 at 3:32 AM, freak182 [EMAIL PROTECTED] wrote:


 Hello Johan,
 I think im running on servlet 2.5 container because in the wicket-push
 example it uses the embeded jetty server 6.1.1 and in our project we are
 using embeded jetty server 6.1.4..i guess higher version make a difference
 or i might be wrong,pls advise?...Thanks a lot...Cheers..


 Johan Compagner wrote:
 
  you can upgrade your compile servlet api just fine
  But are you also running in a container that uses 2.5???
 
  johan
 
 
  On Wed, May 7, 2008 at 11:45 AM, freak182 [EMAIL PROTECTED]
 wrote:
 
 
  Hello,
  my problem im having problem integrating the wicket-push example to our
  project using wicketfilter and since the wicket-push examples using
  wicketservlet..how can i configure this changes?i already ported to
  servlet-api 2.5.
 
  i change from...
  ServletContext servletContext =
  ((WebApplication)Application.get()).getServletContext();
 
  to
 ServletContext servletContext =
 
 
 ((WebApplication)Application.get()).getWicketFilter().getFilterConfig().getServletContext();
 
  but still error...
 
  java.lang.NoSuchMethodError:
  javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
 at
 
 
 org.wicketstuff.push.cometd.CometdAbstractBehavior.getCometdServletPath(CometdAbstractBehavior.java:221)
 at
 
 
 org.wicketstuff.push.cometd.CometdAbstractBehavior.clinit(CometdAbstractBehavior.java:25)
 
  ...any idea how to do this thing???
 
  Thanks a lot...Cheers
  --
  View this message in context:
 
 http://www.nabble.com/CometServlet-and-WicketFilter-tp17101068p17101068.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]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/CometServlet-and-WicketFilter-tp17101068p17117634.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]




Re: South African Wicket Users?

2008-05-08 Thread Erik van Oosten
Actually, since I changed jobs, Finalist no longer uses Wicket but now
JTeam (www.jteam.nl) does :)

Regards,
Erik.

 Plenty of such companies around in the Netherlands it seems. 
 Search through the list archives for ideas :-) Topicus, Xebia, 
 Servoy, Hippo, Finalist to name a few. Good knowledge of 
 Dutch is probably required, especially if you want to work outside of 'de 
 randstad'.
 
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: South African Wicket Users?

2008-05-08 Thread Johan Compagner
WHY?

On Thu, May 8, 2008 at 1:34 PM, Erik van Oosten [EMAIL PROTECTED]
wrote:

 Actually, since I changed jobs, Finalist no longer uses Wicket but now
 JTeam (www.jteam.nl) does :)

 Regards,
Erik.

  Plenty of such companies around in the Netherlands it seems.
  Search through the list archives for ideas :-) Topicus, Xebia,
  Servoy, Hippo, Finalist to name a few. Good knowledge of
  Dutch is probably required, especially if you want to work outside of
 'de randstad'.
 
 --
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/



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




Re: Wicket javascripts - reloading every one hour

2008-05-08 Thread Stefan Simik

I looked at it in detail, and it works as following:

1. You are right, when caching is too low - then browser makes request, with
header
   If-Modified-Since. Response is 304 - that it was not modified. So the
whole resource 
   is not really downloaded, it is requested only, with short 304 response.

2. When caching time is longer, then:
 if resource is in caching time interval, then it is immediately taken
from browser cache,
 without sending a request with If-Modified-Since. So the request is not
performed, until
 caching time expires.

So the overhead is not so big. Some complex applications
may use many css and javascript files, and it is wasting of time for
requesting these never 
changing files every hour again and again. 

Also, solution is very simple, elegant and breaks no API. And the resulting
performance will 
be slightly better.
It would be good, to have a possibility to cache these never changing static
resources for 
a specified time, to prevent these needless requests.

The only thing, that is needed to do for it, is to change
WebResource#setHeaders() to take
the caching time from some settings, so it is not hardcoded and can be
configured by developer.

What do you think about it - should I create a RFE, or it is ok ?

Stefan Simik










Johan Compagner wrote:
 
 But is it then really downloaded?
 Because the brower makes first a head request to it and that will say
 not changed
 
 On 5/8/08, Stefan Simik [EMAIL PROTECTED] wrote:

 Hi boys,

 I think, there is one problem with wicket ajax javascripts - there are
 reloading by browser every
 hour, because the Expire header is hardcoded to 3600 seconds in
 WebResource#setHeaders() method.

 It is really needed to repeatedly once an hour download these wicket
 javascripts ?
 These are static wicket javascripts, they are not subject of changes, so
 why could they not be cached for longer time, for example - 1 week, or
 longer.

 It would be better, if caching time should be configurable from some
 application settings.
 Could I create requet for improvement, or it is all ok ?

 thx
 Stefan Simik

 //
 I have consulted this before, but without result. So now, I am trying to
 show
 the problem in a simpler situation.


 --
 View this message in context:
 http://www.nabble.com/Wicket-javascripts---reloading-every-one-hour-tp17117009p17117009.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-javascripts---reloading-every-one-hour-tp17117009p17125087.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]



Re: Label to Uppercase

2008-05-08 Thread ak

Brilliant suggestions ... Thanks Eelco and Jeremy.
In our proj we attach a behavior to TextField/TextArea like this, but tied
to a specifc event as onblur. 

public class ToUpperCaseBehavior extends AbstractBehavior {

public void onComponentTag(Component component, ComponentTag tag){
tag.put(getJsEvent(),this.value = this.value.toUpperCase(););
}

protected String getJsEvent(){
return onblur;
}

}

Thanks for your pointers and hope other fellow wicketers find it useful.
Cheers,
Andy

-- 
View this message in context: 
http://www.nabble.com/Label-to-Uppercase-tp17114635p17126031.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]



Re: Wicket javascripts - reloading every one hour

2008-05-08 Thread Johan Compagner
file RFE

On Thu, May 8, 2008 at 3:07 PM, Stefan Simik [EMAIL PROTECTED] wrote:


 I looked at it in detail, and it works as following:

 1. You are right, when caching is too low - then browser makes request,
 with
 header
   If-Modified-Since. Response is 304 - that it was not modified. So the
 whole resource
   is not really downloaded, it is requested only, with short 304 response.

 2. When caching time is longer, then:
 if resource is in caching time interval, then it is immediately taken
 from browser cache,
 without sending a request with If-Modified-Since. So the request is not
 performed, until
 caching time expires.

 So the overhead is not so big. Some complex applications
 may use many css and javascript files, and it is wasting of time for
 requesting these never
 changing files every hour again and again.

 Also, solution is very simple, elegant and breaks no API. And the resulting
 performance will
 be slightly better.
 It would be good, to have a possibility to cache these never changing
 static
 resources for
 a specified time, to prevent these needless requests.

 The only thing, that is needed to do for it, is to change
 WebResource#setHeaders() to take
 the caching time from some settings, so it is not hardcoded and can be
 configured by developer.

 What do you think about it - should I create a RFE, or it is ok ?

 Stefan Simik










 Johan Compagner wrote:
 
  But is it then really downloaded?
  Because the brower makes first a head request to it and that will say
  not changed
 
  On 5/8/08, Stefan Simik [EMAIL PROTECTED] wrote:
 
  Hi boys,
 
  I think, there is one problem with wicket ajax javascripts - there are
  reloading by browser every
  hour, because the Expire header is hardcoded to 3600 seconds in
  WebResource#setHeaders() method.
 
  It is really needed to repeatedly once an hour download these wicket
  javascripts ?
  These are static wicket javascripts, they are not subject of changes, so
  why could they not be cached for longer time, for example - 1 week, or
  longer.
 
  It would be better, if caching time should be configurable from some
  application settings.
  Could I create requet for improvement, or it is all ok ?
 
  thx
  Stefan Simik
 
  //
  I have consulted this before, but without result. So now, I am trying to
  show
  the problem in a simpler situation.
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Wicket-javascripts---reloading-every-one-hour-tp17117009p17117009.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-javascripts---reloading-every-one-hour-tp17117009p17125087.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]




IActivePageBehaviorListener exception

2008-05-08 Thread richardwilko

Hi,

I have wicket running clustered and occasionally see this exception:

WicketMessage: Attempt to access unknown request listener interface
IActivePageBehaviorListener

Root cause:

org.apache.wicket.WicketRuntimeException: Attempt to access unknown request
listener interface IActivePageBehaviorListener
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:397)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)

I happens when I start up my wicket instances, go to a page and start typing
in an autocomplete text box.  I only see it if I haven't done anything else
in the session, ie all I have done is open the page.

Im using wicket 1.3.3, jetty 6 and wadi to cluster my jetty sessions.

I presume that I get this error because the session state hasnt been
propagated yet when i open my first page.  Has anyone had a similar error or
seen this problem before?

Any help would be great,

Richard


-- 
View this message in context: 
http://www.nabble.com/IActivePageBehaviorListener-exception-tp17127279p17127279.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]



Re: Stateless link usage

2008-05-08 Thread Ritz123

a) is what I am doing now.

b) is where the problem was, which is what the original question was about.
Please see my opening post.


igor.vaynberg wrote:
 
 there are two ways to do it:
 
 a) use a bookmarkablepagelink to go to the cart page and pass in the
 itemid+quantity to be added. this means that the cart page is
 responsible for adding the item to the cart.
 
 b) use a stateless link to add the item to cart, then
 setResponsePage(CartPage.class) == to a class not an instance to
 maintain a clean url with a redirect.
 
 -igor
 
 
 On Wed, May 7, 2008 at 10:49 PM, Ritz123 [EMAIL PROTECTED] wrote:

  Add To Cart links are on the product list page. I want the links to take
 the
  users to view cart page where they can see the cart content.





  igor.vaynberg wrote:
  
   so you want it to add something to cart, and then go where? to the
   same page? to the cart page?
  
   -igor
  
  
   On Wed, May 7, 2008 at 9:11 AM, Ritz123 [EMAIL PROTECTED]
 wrote:
  
Actually I want to add the product to the cart and not go to the
   detail
page. They both are similar operation in a way, but there is one
 major
difference. View Product has dedicated functionality of just viewing
 the
product and nothing more, but View Cart page will be overloaded
 with
   add
to cart functionality if I am understanding your point correctly.
  
This actually brings up interesting design question with Wicket,
 what
   would
be the best way to handle these kind of scenarios? In struts world,
 I
   had
CartAction - which took care of all the operations (Add, View,
 Update
   and
Delete) for Cart, what would be the equivalent design in Wicket?
  
All the books and available material covers more of syntactic part
 of
Wicket - but none covers the design - that I have found. I may be
   missing
something and will appreciate any pointers.
  
  
  
  
  
  
igor.vaynberg wrote:

 that's what stateless kinks do. If you want to go t a detail page
 use
 a bookmarkable link, not a stateles one.

 -igor


 On 5/6/08, Ritz123 [EMAIL PROTECTED] wrote:

 Hi,

 I have a page containing bunch of products and addToCart link
 next to
 each
 product. On clicking the add to cart link, would like to add
 product
   to
 cart. I had Link and onClick() to do this - but recently
 encountered
   page
 expired message which is expected since the page becomes stateful
 due
   to
 the
 Link.

 Obviously this page is supposed to be stateless and hence I
 changed
   Link
 to
 StatelessLink using final product id inside the onclick. Now on
 application
 reload(due to hotdeploy) to simulate session expiry, dont get
 session
 expired message but link behaves weird in the sense, it seems to
 be
 reloading the contained page instead of going to the
 setResponsePage.

 Seems like I may be missing something. Is this the right approach
 in
 terms
 of making the page stateless?
 --
 View this message in context:

 http://www.nabble.com/Stateless-link-usage-tp17093682p17093682.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/Stateless-link-usage-tp17093682p17108713.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/Stateless-link-usage-tp17093682p17120171.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/Stateless-link-usage-tp17093682p17127282.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Re: CheckGroup and back Button problem

2008-05-08 Thread Thomas Mäder
We seem to have a similar problem with a wizard page. We came across the
following code in Check.onComponentTag(..)

if (group.hasRawInput())
{
final String[] input = group.getInputAsArray();

if (input != null)
{
for (int i = 0; i  input.length; i++)
{
if (uuid.equals(input[i]))
{
tag.put(checked, checked);


It looks like the Check component is checking for the existence of raw
input, but then using the input from the current request (via
getInputAsArray()) to render. Sounds fishy! I figure this could be related?

Thomas

On Wed, May 7, 2008 at 5:27 PM, Steen Larsen [EMAIL PROTECTED] wrote:

 Hi,

 I have made a CheckGroup vith a ListView of Check's than works fine, except
 that when it is submitted and I'm on the next page and want to go back
 through a Wicket Button (not the browsers back button), all the checks are
 empty even thouch the model behind still contains the selected obejcts.
 Here
 is the example code of the first page:

 public HomePage() {
Order order = ((WicketSession) (Session.get())).getOrder();
if (order.getDigitalPackets() == null)
order.setDigitalPackets(new ArrayListProduct());
System.err.println(LIST1 =  + order.getDigitalPackets());
Form form = new DigitalOrderForm(digitalOrderForm);
form.setModel(new CompoundPropertyModel(order));
add(form);
ListProduct allProducts = new ArrayListProduct();
for (int i = 0; i  10; i++) {
Product p = new Product();
p.setProductKey(i + );
p.setTotalPrice(new BigDecimal(100 + i));
p.setProductName(Product + i);
allProducts.add(p);
}
CheckGroup group = new CheckGroup(digitalPackets);
form.add(group);
ListView products = new ListView(products, allProducts) {
protected void populateItem(ListItem item) {
  item.add(new Check(check,
 item.getModel()).setEscapeModelStrings(false));
  item.add(new Label(productName, new
 PropertyModel(item.getModel(), productName)));
  item.add(new Label(totalPrice, new
 PropertyModel(item.getModel(), totalPrice)));
}
};
group.add(products.setReuseItems(true));
}

class DigitalOrderForm extends Form {
DigitalOrderForm(String s) {
super(s);
}

protected void onSubmit() {
Order order = (Order) getModelObject();
System.err.println(LIST2 =  +
 order.getDigitalPackets());
setResponsePage(PageTwo.class);
}
}

 The second page is just a back button like this:

 public PageTwo() {
add(new Button(back) {
public void onSubmit() {
setResponsePage(HomePage.class);
}
});
}

 Anybody knows how to get the selected objects shown when you go back like
 that ?

 /Steen



Re: CheckGroup and back Button problem

2008-05-08 Thread Steen Larsen
If I instead of item.getModel() for the Check, uses some PropertyModel that
evaluates to a String identifier it works fine, but then only the identifier
is saved, and not the object, which as I understand it should be the
purpose. I haven't looked at the code, but I wander what uuid is exactly as
the equals apparently fail on non basic types. Will have a look when I get
the time. Thanks for the hint.

/Steen

2008/5/8 Thomas Mäder [EMAIL PROTECTED]:

 We seem to have a similar problem with a wizard page. We came across the
 following code in Check.onComponentTag(..)

if (group.hasRawInput())
{
final String[] input = group.getInputAsArray();

if (input != null)
{
for (int i = 0; i  input.length; i++)
{
if (uuid.equals(input[i]))
{
tag.put(checked, checked);


 It looks like the Check component is checking for the existence of raw
 input, but then using the input from the current request (via
 getInputAsArray()) to render. Sounds fishy! I figure this could be related?

 Thomas

 On Wed, May 7, 2008 at 5:27 PM, Steen Larsen [EMAIL PROTECTED] wrote:

  Hi,
 
  I have made a CheckGroup vith a ListView of Check's than works fine,
 except
  that when it is submitted and I'm on the next page and want to go back
  through a Wicket Button (not the browsers back button), all the checks
 are
  empty even thouch the model behind still contains the selected obejcts.
  Here
  is the example code of the first page:
 
  public HomePage() {
 Order order = ((WicketSession) (Session.get())).getOrder();
 if (order.getDigitalPackets() == null)
 order.setDigitalPackets(new ArrayListProduct());
 System.err.println(LIST1 =  + order.getDigitalPackets());
 Form form = new DigitalOrderForm(digitalOrderForm);
 form.setModel(new CompoundPropertyModel(order));
 add(form);
 ListProduct allProducts = new ArrayListProduct();
 for (int i = 0; i  10; i++) {
 Product p = new Product();
 p.setProductKey(i + );
 p.setTotalPrice(new BigDecimal(100 + i));
 p.setProductName(Product + i);
 allProducts.add(p);
 }
 CheckGroup group = new CheckGroup(digitalPackets);
 form.add(group);
 ListView products = new ListView(products, allProducts) {
 protected void populateItem(ListItem item) {
   item.add(new Check(check,
  item.getModel()).setEscapeModelStrings(false));
   item.add(new Label(productName, new
  PropertyModel(item.getModel(), productName)));
   item.add(new Label(totalPrice, new
  PropertyModel(item.getModel(), totalPrice)));
 }
 };
 group.add(products.setReuseItems(true));
 }
 
 class DigitalOrderForm extends Form {
 DigitalOrderForm(String s) {
 super(s);
 }
 
 protected void onSubmit() {
 Order order = (Order) getModelObject();
 System.err.println(LIST2 =  +
  order.getDigitalPackets());
 setResponsePage(PageTwo.class);
 }
 }
 
  The second page is just a back button like this:
 
  public PageTwo() {
 add(new Button(back) {
 public void onSubmit() {
 setResponsePage(HomePage.class);
 }
 });
 }
 
  Anybody knows how to get the selected objects shown when you go back like
  that ?
 
  /Steen
 



RE: DropDownChoice.onSelectionChanged() and model updating

2008-05-08 Thread Andrew Broderick
Thanks for the reply. Calling clearInput() on the form components works. It has 
to be done on each individual component though, it seems. Is there a way to do 
it on the entire form, or a way to group fields on the form and do it on the 
group?

Thanks

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2008 10:28 PM
To: users@wicket.apache.org
Subject: Re: DropDownChoice.onSelectionChanged() and model updating

when you submit a form the fields remember their raw values. if in
onselectionchanged() of the ddc you change something that will change
values of these other form components and you want that reflected you
need to call clearInput() or modelUpdated() on those form components.

-igor


On Wed, May 7, 2008 at 1:46 PM, Andrew Broderick
[EMAIL PROTECTED] wrote:
 Hi,

  I have a form that I want to repopulate when a drop down list is changed. If 
 I change the underlying domain object in the onSelectionChanged(), the form 
 fields are not updated to reflect the changes (yes, they do use a dynamic 
 model). However, if I have a button next to the drop down list and the user 
 clicks it, the exact same processing happens, and the form is updated. Why is 
 this, and how can I get onSelectionChanged() to behave the same way?

  Thanks



  ___

  The  information in this email or in any file attached
  hereto is intended only for the personal and confiden-
  tial  use  of  the individual or entity to which it is
  addressed and may contain information that is  propri-
  etary  and  confidential.  If you are not the intended
  recipient of this message you are hereby notified that
  any  review, dissemination, distribution or copying of
  this message is strictly prohibited.  This  communica-
  tion  is  for information purposes only and should not
  be regarded as an offer to sell or as  a  solicitation
  of an offer to buy any financial product. Email trans-
  mission cannot be guaranteed to be  secure  or  error-
  free. P6070214


-
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]



Re: Stateless link usage

2008-05-08 Thread Igor Vaynberg
yes i read it, but you are not being very clear.

a stateless link points to the page its on, just like Link does. the
trick here is like i said to call setresponsepage(class);
requestcycle.setredirect(true);

this way your link points to ?wicket:interface=blahblah

when you hit that the onclick is processed, and then a new response
page is set with a redirect, so  the browser redirects to a
bookmarkable url and the ?wicket:interface url is replaced with a
bookmarkable one. this way the user never has the ?wicket:interface
url left in the url bar.

-igor


On Thu, May 8, 2008 at 7:46 AM, Ritz123 [EMAIL PROTECTED] wrote:

  a) is what I am doing now.

  b) is where the problem was, which is what the original question was about.
  Please see my opening post.




  igor.vaynberg wrote:
  
   there are two ways to do it:
  
   a) use a bookmarkablepagelink to go to the cart page and pass in the
   itemid+quantity to be added. this means that the cart page is
   responsible for adding the item to the cart.
  
   b) use a stateless link to add the item to cart, then
   setResponsePage(CartPage.class) == to a class not an instance to
   maintain a clean url with a redirect.
  
   -igor
  
  
   On Wed, May 7, 2008 at 10:49 PM, Ritz123 [EMAIL PROTECTED] wrote:
  
Add To Cart links are on the product list page. I want the links to take
   the
users to view cart page where they can see the cart content.
  
  
  
  
  
igor.vaynberg wrote:

 so you want it to add something to cart, and then go where? to the
 same page? to the cart page?

 -igor


 On Wed, May 7, 2008 at 9:11 AM, Ritz123 [EMAIL PROTECTED]
   wrote:

  Actually I want to add the product to the cart and not go to the
 detail
  page. They both are similar operation in a way, but there is one
   major
  difference. View Product has dedicated functionality of just viewing
   the
  product and nothing more, but View Cart page will be overloaded
   with
 add
  to cart functionality if I am understanding your point correctly.

  This actually brings up interesting design question with Wicket,
   what
 would
  be the best way to handle these kind of scenarios? In struts world,
   I
 had
  CartAction - which took care of all the operations (Add, View,
   Update
 and
  Delete) for Cart, what would be the equivalent design in Wicket?

  All the books and available material covers more of syntactic part
   of
  Wicket - but none covers the design - that I have found. I may be
 missing
  something and will appreciate any pointers.






  igor.vaynberg wrote:
  
   that's what stateless kinks do. If you want to go t a detail page
   use
   a bookmarkable link, not a stateles one.
  
   -igor
  
  
   On 5/6/08, Ritz123 [EMAIL PROTECTED] wrote:
  
   Hi,
  
   I have a page containing bunch of products and addToCart link
   next to
   each
   product. On clicking the add to cart link, would like to add
   product
 to
   cart. I had Link and onClick() to do this - but recently
   encountered
 page
   expired message which is expected since the page becomes stateful
   due
 to
   the
   Link.
  
   Obviously this page is supposed to be stateless and hence I
   changed
 Link
   to
   StatelessLink using final product id inside the onclick. Now on
   application
   reload(due to hotdeploy) to simulate session expiry, dont get
   session
   expired message but link behaves weird in the sense, it seems to
   be
   reloading the contained page instead of going to the
   setResponsePage.
  
   Seems like I may be missing something. Is this the right approach
   in
   terms
   of making the page stateless?
   --
   View this message in context:
  
   http://www.nabble.com/Stateless-link-usage-tp17093682p17093682.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/Stateless-link-usage-tp17093682p17108713.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]



 

Re: DropDownChoice.onSelectionChanged() and model updating

2008-05-08 Thread Igor Vaynberg
form.visitchildren(..)

-igor


On Thu, May 8, 2008 at 8:26 AM, Andrew Broderick
[EMAIL PROTECTED] wrote:
 Thanks for the reply. Calling clearInput() on the form components works. It 
 has to be done on each individual component though, it seems. Is there a way 
 to do it on the entire form, or a way to group fields on the form and do it 
 on the group?

  Thanks



  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, May 07, 2008 10:28 PM
  To: users@wicket.apache.org
  Subject: Re: DropDownChoice.onSelectionChanged() and model updating

  when you submit a form the fields remember their raw values. if in
  onselectionchanged() of the ddc you change something that will change
  values of these other form components and you want that reflected you
  need to call clearInput() or modelUpdated() on those form components.

  -igor


  On Wed, May 7, 2008 at 1:46 PM, Andrew Broderick
  [EMAIL PROTECTED] wrote:
   Hi,
  
I have a form that I want to repopulate when a drop down list is changed. 
 If I change the underlying domain object in the onSelectionChanged(), the 
 form fields are not updated to reflect the changes (yes, they do use a 
 dynamic model). However, if I have a button next to the drop down list and 
 the user clicks it, the exact same processing happens, and the form is 
 updated. Why is this, and how can I get onSelectionChanged() to behave the 
 same way?
  
Thanks
  
  
  
___
  
The  information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial  use  of  the individual or entity to which it is
addressed and may contain information that is  propri-
etary  and  confidential.  If you are not the intended
recipient of this message you are hereby notified that
any  review, dissemination, distribution or copying of
this message is strictly prohibited.  This  communica-
tion  is  for information purposes only and should not
be regarded as an offer to sell or as  a  solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be  secure  or  error-
free. P6070214
  

  -
  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]



Re: South African Wicket Users?

2008-05-08 Thread Eelco Hillenius
 Actually, since I changed jobs, Finalist no longer uses Wicket but now
 JTeam (www.jteam.nl) does :)

Now it's all up to Remco then :-)

Good luck with your new job though.

Eelco

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



unmount sub url

2008-05-08 Thread Sebastiaan van Erk

Hi,

I've got a page mounted on /path1.

I've got some files in a directory in my webapp root on /path1/dir

How can I tell Wicket to give control back to the servlet container for 
dir? Currently (even using QueryStringUrlCodingStrategy) the mount eats 
/path1/dir and doesn't let me access the files there...


Regards,
Sebastiaan


smime.p7s
Description: S/MIME Cryptographic Signature


Bug introduced somewhere after 1.2.2 is still in 1.3.3

2008-05-08 Thread Frank Silbermann
I wrote earlier about my problems going from Wicket 1.2.2 to Wicket
1.2.6.  This has to do with a RadioGroup component that I built;
whenever I used it on more than one page, clicking on one RadioGroup
caused the marker to disapper from all the other RadioGroups on the
page.

I wasn't given much help because Wicket 1.2 is end-of-life.  Today I
tried the example on Wicked 1.3.3.  I downloaded the QuickStart
application for Wicket 1.3.3, installed an upgraded version of my
RadioGroup component, modified the home page to show my RadioGroup panel
twice, and the bad behavior is still there.  

By the way, the only change in the generated HTML that I could see was
that in Wicket 1.2.2 the buttons were defined: 

input value=radios:2:radio  ...etc.

-- with the numbers starting over again for each RadioGroup, whereas in
Wicket 1.2.6 and Wicket 1.3.3 it was more like: 

input value=radio7  ...etc. 

with the numbers _not_ starting over for each RadioGroup.  Clicking on
one radio group causes the marker to disappear from the other radio
group -- as if part of Wicket were treating the buttons as though they
all belonged to the same radio group.

I'd like the Wicket 1.3 developers either to fix the bug in a future
release (after which I'll upgrade my entire application to 1.3), or tell
me what I'm doing wrong.  How do I get the process started? 

/Frank

-Original Message-
From: Johan Compagner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 29, 2008 12:31 PM
To: users@wicket.apache.org
Subject: Re: Change to API between Wicket 1.2 releases?

I dont know what this is, but 1.2 is pretty much end of life, so you
should try to debug what it is and patch your version Or just use a 1.2
version that works for you

On 4/29/08, Frank Silbermann [EMAIL PROTECTED] wrote:
 I'm not sure what you mean by what part it really is?  Are you 
 asking me to find a simpler example exhibiting the problem?  I mean, 
 the panel class follows the RadioGroup component example quite
closely:

 http://wicketstuff.org/wicket13/compref/;jsessionid=C6F7701B6426601795
 63 
 84008732211C?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.com
 pr
 ef.RadioGroupPage

 The only significant difference is that instead of using a submit 
 button I override wantOnSelectionChangedNotification() to return true.

  public class MyPanel extends Panel {

  public MyPanel( String id,
  String caption,
  PropertyModel groupModel,
  ChoiceOption[] options ) {

   super(id, groupModel);

   add( new Label(caption, caption) );

   final RadioGroup group = new RadioGroup(group, groupModel)
{
  //THIS IS THE ONLY PART THAT CHANGED FROM THE
 COMPONENT EXAMPLE
  protected boolean 
 wantOnSelectionChangedNotifications()
 {
  return true;
  }
  //IT POSTS BACK ON ANY SELECTION
   };
   add(group);

   ListChoiceOption optionList = Arrays.asList( options );

   ListView radios = new ListView(radios, optionList) {
protected void populateItem(ListItem listItem) {
  listItem.add( new Radio(radio,
new PropertyModel( 
 listItem.getModel(),
   value)
)
  );
  listItem.add( new Label(option,
new PropertyModel( 
 listItem.getModel(), label )
 )
  );
}
   };

   group.add(radios);
  }

 Did I do something wrong, or is that feature of RadioGroup indeed 
 broken in current releases of Wicket 1.2?

 I really don't know enough about the Wicket internals to debug Wicket.
 Can you suggest anything simpler that I could try to narrow down the 
 location of the problem?  Would it work in Wicket 1.3?


 -Original Message-
 From: Johan Compagner [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 29, 2008 3:54 AM
 To: users@wicket.apache.org
 Subject: Re: Change to API between Wicket 1.2 releases?

 1.2 is a long time ago
 I have no idea what change did break yours (and what did it fix) If 
 you could figure out what part it really is?

 johan


 On Tue, Apr 29, 2008 at 12:09 AM, Frank Silbermann  
 [EMAIL PROTECTED] wrote:

  I completed a Wicket 1.2 project a couple of years ago, and I've 
  been maintaining it since then. I've been using Version 1.2.2 
  successfully,

  and figured I might as well use the lastest release of that version 
  (1.2.7). Well, I'm trying to figure out why Wicket 1.2.7 broke my
 code.
  (I scrounged up a Wicket 1.2.6 release, and that also breaks it.)
 
  Am I using the Wicket 1.2 API incorrectly?  When it works in Wicket 
  1.2.2, am I 

Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3

2008-05-08 Thread Igor Vaynberg
On Thu, May 8, 2008 at 10:06 AM, Frank Silbermann
[EMAIL PROTECTED] wrote:
 I wrote earlier about my problems going from Wicket 1.2.2 to Wicket
  1.2.6.  This has to do with a RadioGroup component that I built;
  whenever I used it on more than one page, clicking on one RadioGroup
  caused the marker to disapper from all the other RadioGroups on the
  page.

  I wasn't given much help because Wicket 1.2 is end-of-life.  Today I
  tried the example on Wicked 1.3.3.  I downloaded the QuickStart
  application for Wicket 1.3.3, installed an upgraded version of my
  RadioGroup component, modified the home page to show my RadioGroup panel
  twice, and the bad behavior is still there.

  By the way, the only change in the generated HTML that I could see was
  that in Wicket 1.2.2 the buttons were defined:

 input value=radios:2:radio  ...etc.

  -- with the numbers starting over again for each RadioGroup, whereas in
  Wicket 1.2.6 and Wicket 1.3.3 it was more like:

 input value=radio7  ...etc.

  with the numbers _not_ starting over for each RadioGroup.  Clicking on
  one radio group causes the marker to disappear from the other radio
  group -- as if part of Wicket were treating the buttons as though they
  all belonged to the same radio group.

  I'd like the Wicket 1.3 developers either to fix the bug in a future
  release (after which I'll upgrade my entire application to 1.3), or tell
  me what I'm doing wrong.  How do I get the process started?

the usual way, create a jira issue and attach a quickstart project
that demonstrates the problem. than post the jira url back into this
thread. it is not very helpful when you post huge fragments of code
and markup into an email.

-igor



  /Frank

  -Original Message-
  From: Johan Compagner [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, April 29, 2008 12:31 PM
  To: users@wicket.apache.org
  Subject: Re: Change to API between Wicket 1.2 releases?

  I dont know what this is, but 1.2 is pretty much end of life, so you
  should try to debug what it is and patch your version Or just use a 1.2
  version that works for you

  On 4/29/08, Frank Silbermann [EMAIL PROTECTED] wrote:
   I'm not sure what you mean by what part it really is?  Are you
   asking me to find a simpler example exhibiting the problem?  I mean,
   the panel class follows the RadioGroup component example quite
  closely:
  
   http://wicketstuff.org/wicket13/compref/;jsessionid=C6F7701B6426601795
   63
   84008732211C?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.com
   pr
   ef.RadioGroupPage
  
   The only significant difference is that instead of using a submit
   button I override wantOnSelectionChangedNotification() to return true.
  
public class MyPanel extends Panel {
  
public MyPanel( String id,
String caption,
PropertyModel groupModel,
ChoiceOption[] options ) {
  
 super(id, groupModel);
  
 add( new Label(caption, caption) );
  
 final RadioGroup group = new RadioGroup(group, groupModel)
  {
//THIS IS THE ONLY PART THAT CHANGED FROM THE
   COMPONENT EXAMPLE
protected boolean
   wantOnSelectionChangedNotifications()
   {
return true;
}
//IT POSTS BACK ON ANY SELECTION
 };
 add(group);
  
 ListChoiceOption optionList = Arrays.asList( options );
  
 ListView radios = new ListView(radios, optionList) {
  protected void populateItem(ListItem listItem) {
listItem.add( new Radio(radio,
  new PropertyModel(
   listItem.getModel(),
 value)
  )
);
listItem.add( new Label(option,
  new PropertyModel(
   listItem.getModel(), label )
   )
);
  }
 };
  
 group.add(radios);
}
  
   Did I do something wrong, or is that feature of RadioGroup indeed
   broken in current releases of Wicket 1.2?
  
   I really don't know enough about the Wicket internals to debug Wicket.
   Can you suggest anything simpler that I could try to narrow down the
   location of the problem?  Would it work in Wicket 1.3?
  
  
   -Original Message-
   From: Johan Compagner [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, April 29, 2008 3:54 AM
   To: users@wicket.apache.org
   Subject: Re: Change to API between Wicket 1.2 releases?
  
   1.2 is a long time ago
   I have no idea what change did break yours (and what did it fix) If
   you could figure out what part it really is?
  
   johan
  
  
   On Tue, 

Re: A question about partial form updates with AJAX

2008-05-08 Thread nate roe
Hrm.  I've only added the AjaxFormComponentUpdatingBehavior to the
components that cause the visibility of other components to change.  The
idea -- and I'm new to Wicket so it may not have been a very good one -- was
to limit server round-trips until a rendering change is required.

I'll add the behavior to all of the elements and see how that goes.

On Thu, May 8, 2008 at 1:09 AM, Johan Compagner [EMAIL PROTECTED]
wrote:

 are you sure that all the form elements that are in that div that you
 replace have the AjaxFormComponentUpdatingBehavior attached?

 On Thu, May 8, 2008 at 1:22 AM, nate roe [EMAIL PROTECTED] wrote:

  I have a form with several items.  About half of the form is wrapped in a
  named div attached to a WebMarkupContainer.  When a drop-down value
  changes,
  the div is updated via AJAX, re-rendering that part of the form.
  However,
  the components in that part of the form are not updated and so this
  re-rendering causes their values to revert to the initial value.
 
  I've used an AjaxFormComponentUpdatingBehavior to accomplish the AJAX
  update.  Is there a more appropriate behavior that I should use?  When I
  use
  no AJAX, then the form maintains its values rather than resetting (but
 the
  whole page is refreshed.)
 
  How can I prevent a form reset?
 
  Thanks,
  Nate Roe
 



Re: Form doesn't fire onsubmit when nested in a wizard

2008-05-08 Thread Per Newgro
Hello Piller Sébastien:

do you first generate some errors, press next (errors), fix them and then 
press next again?

Maybe error messages will not be reset.

Cheers
Per

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



RE: Bug introduced somewhere after 1.2.2 is still in 1.3.3

2008-05-08 Thread Frank Silbermann
Well, then, as I am a beginner who hasn't worked much with open source,
could you please point me to a reference that explains what a jira issue
is and how to create one?  (I'm guessing that it's an entry into some
sort of bug tracking database.)

Also, by attaching a quickstart Project do you mean simply a zipped
archive of a project directory that was created by installing the
quickstart project and minimally modifying it to create a web
application that exhibits the bug?

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 12:13 PM
To: users@wicket.apache.org
Subject: Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3

On Thu, May 8, 2008 at 10:06 AM, Frank Silbermann
[EMAIL PROTECTED] wrote:
 I wrote earlier about my problems going from Wicket 1.2.2 to Wicket  
 1.2.6.  This has to do with a RadioGroup component that I built;  
 whenever I used it on more than one page, clicking on one RadioGroup  
 caused the marker to disapper from all the other RadioGroups on the  
 page.

  I wasn't given much help because Wicket 1.2 is end-of-life.  Today I

 tried the example on Wicked 1.3.3.  I downloaded the QuickStart  
 application for Wicket 1.3.3, installed an upgraded version of my  
 RadioGroup component, modified the home page to show my RadioGroup 
 panel  twice, and the bad behavior is still there.

  By the way, the only change in the generated HTML that I could see 
 was  that in Wicket 1.2.2 the buttons were defined:

 input value=radios:2:radio  ...etc.

  -- with the numbers starting over again for each RadioGroup, whereas 
 in  Wicket 1.2.6 and Wicket 1.3.3 it was more like:

 input value=radio7  ...etc.

  with the numbers _not_ starting over for each RadioGroup.  Clicking 
 on  one radio group causes the marker to disappear from the other 
 radio  group -- as if part of Wicket were treating the buttons as 
 though they  all belonged to the same radio group.

  I'd like the Wicket 1.3 developers either to fix the bug in a future

 release (after which I'll upgrade my entire application to 1.3), or 
 tell  me what I'm doing wrong.  How do I get the process started?

the usual way, create a jira issue and attach a quickstart project that
demonstrates the problem. than post the jira url back into this thread.
it is not very helpful when you post huge fragments of code and markup
into an email.

-igor



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



Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3

2008-05-08 Thread Per Newgro
Hello Frank Silbermann:
 Well, then, as I am a beginner who hasn't worked much with open source,
 could you please point me to a reference that explains what a jira issue
 is and how to create one?  (I'm guessing that it's an entry into some
 sort of bug tracking database.)
Sure you can. You could use the mailing list search at nabble.com because the 
question was asked and answered once a month :-)

Use http://issues.apache.org/jira/browse/ - goto wicket - login (you have to 
get an account) - press new issue and follow instructions.
Its realy easy and helps alot to stay in touch with the open issues. 


 Also, by attaching a quickstart Project do you mean simply a zipped
 archive of a project directory that was created by installing the
 quickstart project and minimally modifying it to create a web
 application that exhibits the bug?
Yes.

Cheers
Per

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



Re: AutoCompleteTextField type mismatch in line 227

2008-05-08 Thread taygolf

Yes I am just starting to try and get the autocompletetextfield working on my
app and I am using wicket 1.3. as well and it is doing the same thing. It is
throwing a js type mismatch error. Works fine in firefox but not in IE.

Did you figure out the problem?

T


Niels Bo wrote:
 
 Hi
 
 I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript error
 type mismatch in line 227,
 wich is this line in wicket-autocomplete.js:
 
 menu.style.zIndex=index==auto?index:Number(index)+1;
 
 Only in IE (6.0) - firefox works fine.
 Does anyone else see this problem?
 
 Niels
 

-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-line-227-tp16560166p17135623.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]



Re: AutoCompleteTextField type mismatch in line 227

2008-05-08 Thread Gerolf Seitz
it's fixed in the upcoming 1.3.4 and the already release 1.4-M1

  Gerolf

On Thu, May 8, 2008 at 10:20 PM, taygolf [EMAIL PROTECTED] wrote:


 Yes I am just starting to try and get the autocompletetextfield working on
 my
 app and I am using wicket 1.3. as well and it is doing the same thing. It
 is
 throwing a js type mismatch error. Works fine in firefox but not in IE.

 Did you figure out the problem?

 T


 Niels Bo wrote:
 
  Hi
 
  I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript
 error
  type mismatch in line 227,
  wich is this line in wicket-autocomplete.js:
 
  menu.style.zIndex=index==auto?index:Number(index)+1;
 
  Only in IE (6.0) - firefox works fine.
  Does anyone else see this problem?
 
  Niels
 

 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-line-227-tp16560166p17135623.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]




Default choice

2008-05-08 Thread Mathias P.W Nilsson

Hi!

I'm using the getDefaultChoice to have --- choose brand  in my drop box.

@Override
protected java.lang.CharSequence getDefaultChoice(final Object selected){
   return option value=\\+
getLocalizer().getString(category.select.edit, CategoryPage.this ) 
+/option; 
}

This is rather teedious to have this in every drop list. I it possible to
have a default choice without using this? I know I can set setNullValid(
true ) but I can't handle the localization default choice.
-- 
View this message in context: 
http://www.nabble.com/Default-choice-tp17135706p17135706.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]



RE: Bug introduced somewhere after 1.2.2 is still in 1.3.3

2008-05-08 Thread Frank Silbermann
Here's the URL of my jira issue.  

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

The issue has attached a quickstart project and a screen print. 

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 12:13 PM
To: users@wicket.apache.org
Subject: Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3

On Thu, May 8, 2008 at 10:06 AM, Frank Silbermann
[EMAIL PROTECTED] wrote:
 I wrote earlier about my problems going from Wicket 1.2.2 to Wicket  
 1.2.6.  This has to do with a RadioGroup component that I built;  
 whenever I used it on more than one page, clicking on one RadioGroup  
 caused the marker to disapper from all the other RadioGroups on the  
 page.

  I wasn't given much help because Wicket 1.2 is end-of-life.  Today I

 tried the example on Wicked 1.3.3.  I downloaded the QuickStart  
 application for Wicket 1.3.3, installed an upgraded version of my  
 RadioGroup component, modified the home page to show my RadioGroup 
 panel  twice, and the bad behavior is still there.

  By the way, the only change in the generated HTML that I could see 
 was  that in Wicket 1.2.2 the buttons were defined:

 input value=radios:2:radio  ...etc.

  -- with the numbers starting over again for each RadioGroup, whereas 
 in  Wicket 1.2.6 and Wicket 1.3.3 it was more like:

 input value=radio7  ...etc.

  with the numbers _not_ starting over for each RadioGroup.  Clicking 
 on  one radio group causes the marker to disappear from the other 
 radio  group -- as if part of Wicket were treating the buttons as 
 though they  all belonged to the same radio group.

  I'd like the Wicket 1.3 developers either to fix the bug in a future

 release (after which I'll upgrade my entire application to 1.3), or 
 tell  me what I'm doing wrong.  How do I get the process started?

the usual way, create a jira issue and attach a quickstart project that
demonstrates the problem. than post the jira url back into this thread.
it is not very helpful when you post huge fragments of code and markup
into an email.

-igor


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



Detached models

2008-05-08 Thread Mathias P.W Nilsson

I have some questions on detached models for Wicket

Let's say I create a detached model like this

IModel detachedModel = new LoadableDetachableModel(){
   protected Object load(){
  return . spring injected hibernate dao lets say Categories
   }
};

So now I'll have a detached model.

now I'll use a ListView to populate data from the detachedModel

add( new ListView( myId , detachedModel   ){
   public void populateItem( ListItem item) {
   final Category category = (Category) item.getModelObject();

  item.add( new Link( link ){
  public void onClick(){
setResponsePage( new CategoryPage( category ) );
  }
  } );
   }
});

I hope this is right. This is obviously from the top of my head. My question
is.
When In my CategoryPage after a user has clicked the link in the list item
is the Category that I got
from a detached model detached? Or is it a hibernate proxy? If so, how can I
get it detached all the way?


Igor wrote something about a detached DataProvider. Do I need to use
DataProvider to get detached hibernate pojos? I would really want to know
how to do this. Right now, I'm in spagetti code with DAOS that throws
LazyLoading exceptions and Wicket pages that does the same.


-- 
View this message in context: 
http://www.nabble.com/Detached-models-tp17136199p17136199.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]



Re: Detached models

2008-05-08 Thread James Carman
Why do you need it detached all the way?

On Thu, May 8, 2008 at 4:56 PM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:

 I have some questions on detached models for Wicket

 Let's say I create a detached model like this

 IModel detachedModel = new LoadableDetachableModel(){
   protected Object load(){
  return . spring injected hibernate dao lets say Categories
   }
 };

 So now I'll have a detached model.

 now I'll use a ListView to populate data from the detachedModel

 add( new ListView( myId , detachedModel   ){
   public void populateItem( ListItem item) {
   final Category category = (Category) item.getModelObject();

  item.add( new Link( link ){
  public void onClick(){
setResponsePage( new CategoryPage( category ) );
  }
  } );
   }
 });

 I hope this is right. This is obviously from the top of my head. My question
 is.
 When In my CategoryPage after a user has clicked the link in the list item
 is the Category that I got
 from a detached model detached? Or is it a hibernate proxy? If so, how can I
 get it detached all the way?


 Igor wrote something about a detached DataProvider. Do I need to use
 DataProvider to get detached hibernate pojos? I would really want to know
 how to do this. Right now, I'm in spagetti code with DAOS that throws
 LazyLoading exceptions and Wicket pages that does the same.


 --
 View this message in context: 
 http://www.nabble.com/Detached-models-tp17136199p17136199.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]



Re: Detached models

2008-05-08 Thread Igor Vaynberg
On Thu, May 8, 2008 at 1:56 PM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:


  add( new ListView( myId , detachedModel   ){
public void populateItem( ListItem item) {
final Category category = (Category) item.getModelObject();

   item.add( new Link( link ){
   public void onClick(){
 setResponsePage( new CategoryPage( category ) );

^-- this is bad. now your anonymous link component is
holding onto a detached category object, so if in categorypage's
constructor you try to access a lazy collection you will get an
exception. the proper thing to do here is to:

final Category category = (Category) item.getModelObject();
final IModel cat=new HibernateEntityModel(category);
item.add(new Link(link, cat){ setResponsePage(new CategoryPage(getModel()); }

the idea is to pass a lookup(a model) rather then the entity itself.
this way you are never holding onto the entity outside of a hibernate
session.

-igor


   }
   } );
}
  });

  I hope this is right. This is obviously from the top of my head. My question
  is.
  When In my CategoryPage after a user has clicked the link in the list item
  is the Category that I got
  from a detached model detached? Or is it a hibernate proxy? If so, how can I
  get it detached all the way?


  Igor wrote something about a detached DataProvider. Do I need to use
  DataProvider to get detached hibernate pojos? I would really want to know
  how to do this. Right now, I'm in spagetti code with DAOS that throws
  LazyLoading exceptions and Wicket pages that does the same.


  --
  View this message in context: 
 http://www.nabble.com/Detached-models-tp17136199p17136199.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]



Re: Detached models

2008-05-08 Thread Igor Vaynberg
if you want nicer code then use a dataview with a dataprovider, that
really is geared much better towards database data then listview, and
dataprovider.model() is a great place to wrap the entity with model,
so your code can look like this:

  public void populateItem( tem item) {
 item.add( new Link( link , item.getModel()) {
setResponsePage(new CategoryPage(getModel());}

-igor

On Thu, May 8, 2008 at 2:02 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 On Thu, May 8, 2008 at 1:56 PM, Mathias P.W Nilsson
  [EMAIL PROTECTED] wrote:
  
  

   add( new ListView( myId , detachedModel   ){
  public void populateItem( ListItem item) {
  final Category category = (Category) item.getModelObject();
  
 item.add( new Link( link ){
 public void onClick(){
   setResponsePage( new CategoryPage( category ) );

  ^-- this is bad. now your anonymous link component is
  holding onto a detached category object, so if in categorypage's
  constructor you try to access a lazy collection you will get an
  exception. the proper thing to do here is to:


  final Category category = (Category) item.getModelObject();
  final IModel cat=new HibernateEntityModel(category);
  item.add(new Link(link, cat){ setResponsePage(new 
 CategoryPage(getModel()); }

  the idea is to pass a lookup(a model) rather then the entity itself.
  this way you are never holding onto the entity outside of a hibernate
  session.

  -igor




 }
 } );
  }
});
  
I hope this is right. This is obviously from the top of my head. My 
 question
is.
When In my CategoryPage after a user has clicked the link in the list item
is the Category that I got
from a detached model detached? Or is it a hibernate proxy? If so, how 
 can I
get it detached all the way?
  
  
Igor wrote something about a detached DataProvider. Do I need to use
DataProvider to get detached hibernate pojos? I would really want to know
how to do this. Right now, I'm in spagetti code with DAOS that throws
LazyLoading exceptions and Wicket pages that does the same.
  
  
--
View this message in context: 
 http://www.nabble.com/Detached-models-tp17136199p17136199.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]



Re: Detached models

2008-05-08 Thread Mathias P.W Nilsson

Thanks Igor!

So if I use the sample code you gave me and, when getting the Object from
the constructor
on the response page I will have a detached object. 

Do I have to load the object from database here? When looking at the Phone
book example I see you pass id instead of object. Is this more lightweight
or is it better practice to just pass the id and not the whole object?


-- 
View this message in context: 
http://www.nabble.com/Detached-models-tp17136199p17137533.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]



Re: unmount sub url

2008-05-08 Thread Sebastiaan van Erk

 Hi,

 I've got a page mounted on /path1.

 I've got some files in a directory in my webapp root on /path1/dir

 How can I tell Wicket to give control back to the servlet container for
 dir? Currently (even using QueryStringUrlCodingStrategy) the mount eats
 /path1/dir and doesn't let me access the files there...

 Regards,
 Sebastiaan

I looked at the wicket filter code, and it does not seem that this is 
possible at the moment (though I might be missing something). I see at 
least two possible ways to add this feature:


1) using a special exception (I did not think about the name):

if (isWicketRequest(relativePath))
{
try
{
...
}
catch (NotWicketAfterAllException e) {
// Pass down the filter chain.
chain.doFilter(request, response);
}
finally
{
// always unset the application thread local
Application.unset();
RequestContext.unset();
}
}

2) using a special RequestCodingStrategy, i.e. 
UnmountedRequestCodingStrategy and tweaking isWicketRequest to return 
false if it detects this request coding strategy...


The first solution is more powerful (it allows you to pass the request 
down the filter chain from pretty much anywhere), but it might be a bit 
dangerous (what if you already read from the request/response, etc), and 
it requires your own request strategy implementation to check if it 
happens to be an url that you want to pass down the filter chain which 
usually ends up being ugly string compares)...


The second solution is cleaner in my opinion and it would allow you to 
unmount or mount as a pass through specific urls...


What do you guys think?

Regards,
Sebastiaan

Sebastiaan van Erk wrote:



smime.p7s
Description: S/MIME Cryptographic Signature


Re: South African Wicket Users?

2008-05-08 Thread Thies Edeling


Plenty of such companies around in the Netherlands it seems. 
Search through the list archives for ideas :-) Topicus, Xebia, 
Servoy, Hippo, Finalist to name a few. Good knowledge of 
Dutch is probably required, especially if you want to work outside of 'de randstad'.



Hi there from the Hippo department :). I'd be more than happy to talk to you 
about a Wicket job.
Our headquarters are in Amsterdam (which indeed is within the Randstad), and we 
have an office in San Francisco where we do mainly Portal development. English 
is the primary language for our developers - although most of them are Dutch.

We use Wicket for Hippo CMS v7, our flagship content management system, and 
Hippo Portal, our portal engine. Your help would be very much appreciated as we 
expect to rely more and more on Wicket.

Take a look at http://www.onehippo.com/en/about_us/jobs,senior-developer.html 
for some more inspiration.
  

Interesting, do you also work with freelancers? :)

gr
Thies

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



Re: Wicket javascripts - reloading every one hour

2008-05-08 Thread Stefan Simik

OK, thx
https://issues.apache.org/jira/browse/WICKET-1602

Stefan Simik


Johan Compagner wrote:
 
 file RFE
 

-- 
View this message in context: 
http://www.nabble.com/Wicket-javascripts---reloading-every-one-hour-tp17117009p17137997.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]



Re: unmount sub url

2008-05-08 Thread Eelco Hillenius
On Thu, May 8, 2008 at 3:15 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Hi,

 I've got a page mounted on /path1.

 I've got some files in a directory in my webapp root on /path1/dir

 How can I tell Wicket to give control back to the servlet container for
 dir? Currently (even using QueryStringUrlCodingStrategy) the mount eats
 /path1/dir and doesn't let me access the files there...

 Regards,
 Sebastiaan

 I looked at the wicket filter code, and it does not seem that this is
 possible at the moment (though I might be missing something). I see at least
 two possible ways to add this feature:

 1) using a special exception (I did not think about the name):
 ...
 2) using a special RequestCodingStrategy, i.e.
 UnmountedRequestCodingStrategy and tweaking isWicketRequest to return false
 if it detects this request coding strategy...

 What do you guys think?

Well, my first impulse is to say that mounting was never meant to
serve complex cases, and that instead of mounting you'd do best with a
custom request coding strategy instead.

That said though, I'm not against something like 2 if we have a nice
construct for it.

Eelco

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



Javascript adding input

2008-05-08 Thread Dan Kaplan
Let's say that hypothetically I used javascript to add an input to a
form in its onload method.  How can I get wicket to become aware of that
input so I can do things like validate it, etc.?  



Re: unmount sub url

2008-05-08 Thread Sebastiaan van Erk

Eelco Hillenius wrote:

On Thu, May 8, 2008 at 3:15 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

2) using a special RequestCodingStrategy, i.e.
UnmountedRequestCodingStrategy and tweaking isWicketRequest to return false
if it detects this request coding strategy...

What do you guys think?


Well, my first impulse is to say that mounting was never meant to
serve complex cases, and that instead of mounting you'd do best with a
custom request coding strategy instead.

That said though, I'm not against something like 2 if we have a nice
construct for it.

Eelco


I made a proof of concept which works, though I have some questions 
about it (I'm not really into the whole request coding strategy API). 
Basically what I did was:


1) Add PassThroughUrlCodingStrategy:

public class PassThroughUrlCodingStrategy extends 
AbstractRequestTargetUrlCodingStrategy

{
public PassThroughUrlCodingStrategy(final String mountPath) {
super(mountPath);
}

public IRequestTarget decode(RequestParameters requestParameters) {
return null;
}

public CharSequence encode(IRequestTarget requestTarget) {
return null;
}

public boolean matches(IRequestTarget requestTarget) {
return false;
}
}

That's the one I have questions about: I'm not quite sure how to 
implement these methods properly.


2) Modify wicket filter isWicketRequest

// Mounted page
IRequestTargetUrlCodingStrategy urlCodingStrategy = 
webApplication.getRequestCycleProcessor()

.getRequestCodingStrategy()
.urlCodingStrategyForPath(relativePath);

// Mounted and not pass through?
return urlCodingStrategy != null 
!(urlCodingStrategy instanceof PassThroughUrlCodingStrategy);

3) Mount my PassThroughUrlCodingStrategy in my Application.init() method:

mount(new QueryStringUrlCodingStrategy(/path1, MyPage.class));
mount(new PassThroughUrlCodingStrategy(/path1/dir));

4) Fired up tomcat and tested it. :-) It works...

That leaves me with the questions about the decode, encode and 
matches... How should I implement them properly? :-)


Regards,
Sebastiaan



smime.p7s
Description: S/MIME Cryptographic Signature


Form onSubmit called after Page components created

2008-05-08 Thread Joel Halbert
Hi,

I've noticed that when submitting a (stateless) Form page the onSubmit()  
method of the form is only called once all the Page components have all been 
created, and likewise any model objects relating to the form are only populated 
once the page components have been rendered. 

This means that it is hard to create dynamic content in the page that is 
dependent on the contents of the submitted form without reloading the page 
using 
setResponsePage(MyPage.class, pageParams) at the end of the onSubmit() call of 
the form.

Has anyone else noticed this and is there a way around it? i.e. can the models 
be populated before the page components are created?

Rgs
Joel



RE: AutoCompleteTextField type mismatch in line 227

2008-05-08 Thread Hoover, William
Although, it still has some issues when dealing with mouseover and
keyboard events combo ;o) 

-Original Message-
From: Gerolf Seitz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 4:23 PM
To: users@wicket.apache.org
Subject: Re: AutoCompleteTextField type mismatch in line 227

it's fixed in the upcoming 1.3.4 and the already release 1.4-M1

  Gerolf

On Thu, May 8, 2008 at 10:20 PM, taygolf [EMAIL PROTECTED]
wrote:


 Yes I am just starting to try and get the autocompletetextfield 
 working on my app and I am using wicket 1.3. as well and it is doing 
 the same thing. It is throwing a js type mismatch error. Works fine in

 firefox but not in IE.

 Did you figure out the problem?

 T


 Niels Bo wrote:
 
  Hi
 
  I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript
 error
  type mismatch in line 227,
  wich is this line in wicket-autocomplete.js:
 
  menu.style.zIndex=index==auto?index:Number(index)+1;
 
  Only in IE (6.0) - firefox works fine.
  Does anyone else see this problem?
 
  Niels
 

 --
 View this message in context:
 http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-lin
 e-227-tp16560166p17135623.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]



Re: AutoCompleteTextField type mismatch in line 227

2008-05-08 Thread Gerolf Seitz
in case you mean [0], that's going to be dealt with probably
tomorrow ;)

[0] https://issues.apache.org/jira/browse/WICKET-1595


On Fri, May 9, 2008 at 1:52 AM, Hoover, William [EMAIL PROTECTED] wrote:

 Although, it still has some issues when dealing with mouseover and
 keyboard events combo ;o)

 -Original Message-
 From: Gerolf Seitz [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 08, 2008 4:23 PM
 To: users@wicket.apache.org
 Subject: Re: AutoCompleteTextField type mismatch in line 227

 it's fixed in the upcoming 1.3.4 and the already release 1.4-M1

  Gerolf

 On Thu, May 8, 2008 at 10:20 PM, taygolf [EMAIL PROTECTED]
 wrote:

 
  Yes I am just starting to try and get the autocompletetextfield
  working on my app and I am using wicket 1.3. as well and it is doing
  the same thing. It is throwing a js type mismatch error. Works fine in

  firefox but not in IE.
 
  Did you figure out the problem?
 
  T
 
 
  Niels Bo wrote:
  
   Hi
  
   I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript
  error
   type mismatch in line 227,
   wich is this line in wicket-autocomplete.js:
  
   menu.style.zIndex=index==auto?index:Number(index)+1;
  
   Only in IE (6.0) - firefox works fine.
   Does anyone else see this problem?
  
   Niels
  
 
  --
  View this message in context:
  http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-lin
  e-227-tp16560166p17135623.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]




Good wicket patterns

2008-05-08 Thread gurgel2

After some 6 months of wicket ive come accross some wierd scenarios

Go'ol request/response

1. Sub FormComponent hierarchies that needed to be manually visited to have
thier vaidate and updateModel called. It was a criteria/search panel that
supplied a form with data. Just a bit awkward to create those visitors in
the middle of the code. Should I have done that with a nested Form? 

2. Where should you keep your models? Should a big Component hierarcy have
one big model with its parts extracted and passed on to child components?
Analogy - repeaters (lists of object renditions/Label(...,obj.toString) take
lists-of-objects.  Or, is more advisable to keep a component's model
contained within itself? I have yet to find a good practice here.

Ajax

3. Now im working with more Ajax. What is a good inter component
communication scheme? Swing has its listeners, but in wicket i tend to call
methods on dependent components from ajax event handlers. Is this a good
approach - (it atleast dont feel so good)? 


-- 
View this message in context: 
http://www.nabble.com/Good-wicket-patterns-tp17139005p17139005.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]



RE: AutoCompleteTextField type mismatch in line 227

2008-05-08 Thread Hoover, William
that is it :o)

i'm assuming the same issue also causes the selection to be lost on
occasion

-Original Message-
From: Gerolf Seitz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 7:57 PM
To: users@wicket.apache.org
Subject: Re: AutoCompleteTextField type mismatch in line 227

in case you mean [0], that's going to be dealt with probably tomorrow ;)

[0] https://issues.apache.org/jira/browse/WICKET-1595


On Fri, May 9, 2008 at 1:52 AM, Hoover, William [EMAIL PROTECTED]
wrote:

 Although, it still has some issues when dealing with mouseover and 
 keyboard events combo ;o)

 -Original Message-
 From: Gerolf Seitz [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 08, 2008 4:23 PM
 To: users@wicket.apache.org
 Subject: Re: AutoCompleteTextField type mismatch in line 227

 it's fixed in the upcoming 1.3.4 and the already release 1.4-M1

  Gerolf

 On Thu, May 8, 2008 at 10:20 PM, taygolf [EMAIL PROTECTED]
 wrote:

 
  Yes I am just starting to try and get the autocompletetextfield 
  working on my app and I am using wicket 1.3. as well and it is doing

  the same thing. It is throwing a js type mismatch error. Works fine 
  in

  firefox but not in IE.
 
  Did you figure out the problem?
 
  T
 
 
  Niels Bo wrote:
  
   Hi
  
   I just swithed from 1.3.2 to 1.3.3 and that resultet in a 
   javascript
  error
   type mismatch in line 227,
   wich is this line in wicket-autocomplete.js:
  
   menu.style.zIndex=index==auto?index:Number(index)+1;
  
   Only in IE (6.0) - firefox works fine.
   Does anyone else see this problem?
  
   Niels
  
 
  --
  View this message in context:
  http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-l
  in e-227-tp16560166p17135623.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]



Re: Detached models

2008-05-08 Thread James Carman
I typically don't like to have my UI code directly interact with the
ORM implementation (hibernate in this case).  For my applications, I
pass a Repository (think DAO) object and the object's id into the
LoadableDetachableModel.

On Thu, May 8, 2008 at 6:33 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 you can pass in the id if you want, i prefer to work with objects...so

  class entitymodel extends ldm {
   private final String cn;
   private final Serialializable id;

   public entitymodel(class cl, serializable id) { cn=cl.getName(); 
 this.id=id; }
   public entitymodel(identifiable entity) {
  cn=hibernateutils.unproxy(entity).getclass().getname();
  id=entity.getid(); }
   public object load() { session.get(class.forname(cn), id); }
  }

  this is just more convinient, obviously identifiable is an interface
  we use here internally.

  -igor




  On Thu, May 8, 2008 at 3:10 PM, Mathias P.W Nilsson
  [EMAIL PROTECTED] wrote:
  
Thanks Igor!
  
So if I use the sample code you gave me and, when getting the Object from
the constructor
on the response page I will have a detached object.
  
Do I have to load the object from database here? When looking at the Phone
book example I see you pass id instead of object. Is this more lightweight
or is it better practice to just pass the id and not the whole object?
  
  
--
View this message in context: 
 http://www.nabble.com/Detached-models-tp17136199p17137533.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]



DropDownChoice throws IllegalArgumentException with Integer values

2008-05-08 Thread Michael Mehrle
This is the error I'm getting:

 

[DEBUG LoadAdDataInterceptor] Loaded
AdData:[EMAIL PROTECTED] 

[ERROR RequestCycle] Cannot format given Object as a Number 

java.lang.IllegalArgumentException: Cannot format given Object as a
Number

at java.text.DecimalFormat.format(DecimalFormat.java:480)

at java.text.Format.format(Format.java:133)

at
org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver
tToString(AbstractNumberConverter.java:109)

at
org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe
solverConverter.java:84)

 

I'm using ListSelectOption to populate the DropDownChoice, as per the
online example:

 

http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht
ml

 

The only change I made to SelectOption is to set the 'value' field to an
Integer (which I need for my model).

 

Anyone any ideas as to what's going on? I'm pretty sure I didn't swap
the label/value pairs as the labels show up properly.

 

Thanks,

 

Michael



Re: Good wicket patterns

2008-05-08 Thread Scott Swank
e.g.

public class AjaxEvent
{
private SetComponent listeners = new HashSetComponent();

public void register(Component listener)
{
listeners.add(listener);
}

public void fire(AjaxRequestTarget request)
{
for (Component listener : listeners)
request.addComponent(listener);
}
}

On Thu, May 8, 2008 at 6:07 PM, Scott Swank [EMAIL PROTECTED] wrote:
   Ajax
  
3. Now im working with more Ajax. What is a good inter component
communication scheme? Swing has its listeners, but in wicket i tend to 
 call
methods on dependent components from ajax event handlers. Is this a good
approach - (it atleast dont feel so good)?

  I try to have my components just be a view of their model.  Then it's
  just a matter of setting the model(s) appropriately and refreshing the
  components.

  Alternately, create a AjaxEvent class that you subclass to represent
  each of the actions in which you're interested.  Put a collection of
  those on your Page.  Then have allow each component to register itself
  as a listener of an event.  Then an ajax call would result in
  SomeAjaxEvent.fire(AjaxTargetRequest) and that would in turn call
  addComponent() for each registered listener component.

  - Scott


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



Re: CometServlet and WicketFilter

2008-05-08 Thread freak182

Hello Johan,
Thanks for the advice...i will try to look at for any servlet.jar...anyway
our project is big and i dont know want jars my teammate added-n-added...
:-)

Thanks a lot..Cheers


Johan Compagner wrote:
 
 it seems that jetty 6 really uses servlet api 2.5 yes (this is by the way
 very hard to find... they really should have a list just as tomcat has)
 
 so somehow you have another servlet.jar there
 
 On Thu, May 8, 2008 at 3:32 AM, freak182 [EMAIL PROTECTED] wrote:
 

 Hello Johan,
 I think im running on servlet 2.5 container because in the wicket-push
 example it uses the embeded jetty server 6.1.1 and in our project we are
 using embeded jetty server 6.1.4..i guess higher version make a
 difference
 or i might be wrong,pls advise?...Thanks a lot...Cheers..


 Johan Compagner wrote:
 
  you can upgrade your compile servlet api just fine
  But are you also running in a container that uses 2.5???
 
  johan
 
 
  On Wed, May 7, 2008 at 11:45 AM, freak182 [EMAIL PROTECTED]
 wrote:
 
 
  Hello,
  my problem im having problem integrating the wicket-push example to
 our
  project using wicketfilter and since the wicket-push examples using
  wicketservlet..how can i configure this changes?i already ported to
  servlet-api 2.5.
 
  i change from...
  ServletContext servletContext =
  ((WebApplication)Application.get()).getServletContext();
 
  to
 ServletContext servletContext =
 
 
 ((WebApplication)Application.get()).getWicketFilter().getFilterConfig().getServletContext();
 
  but still error...
 
  java.lang.NoSuchMethodError:
  javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
 at
 
 
 org.wicketstuff.push.cometd.CometdAbstractBehavior.getCometdServletPath(CometdAbstractBehavior.java:221)
 at
 
 
 org.wicketstuff.push.cometd.CometdAbstractBehavior.clinit(CometdAbstractBehavior.java:25)
 
  ...any idea how to do this thing???
 
  Thanks a lot...Cheers
  --
  View this message in context:
 
 http://www.nabble.com/CometServlet-and-WicketFilter-tp17101068p17101068.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]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/CometServlet-and-WicketFilter-tp17101068p17117634.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]


 
 

-- 
View this message in context: 
http://www.nabble.com/CometServlet-and-WicketFilter-tp17101068p17139611.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]



RE: DropDownChoice throws IllegalArgumentException with Integer values

2008-05-08 Thread Michael Mehrle
Okay, I just stepped through this and getting the feeling that 'somehow'
the label is being passed on to the model. Now, if the label is '1' it
works fine, but if it's '1 day', then I get that error.

The question here is: why is the label being passed back to the model?
Doesn't make any sense - I'm using a ChoiceRenderer as such:

new ChoiceRenderer(label, value)

Do I also need to add some kind of converter to properly assign the
model?

Any input would be appreciated.

Michael

-Original Message-
From: Michael Mehrle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 08, 2008 5:19 PM
To: users@wicket.apache.org
Subject: DropDownChoice throws IllegalArgumentException with Integer
values

This is the error I'm getting:

 

[DEBUG LoadAdDataInterceptor] Loaded
AdData:[EMAIL PROTECTED] 

[ERROR RequestCycle] Cannot format given Object as a Number 

java.lang.IllegalArgumentException: Cannot format given Object as a
Number

at java.text.DecimalFormat.format(DecimalFormat.java:480)

at java.text.Format.format(Format.java:133)

at
org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver
tToString(AbstractNumberConverter.java:109)

at
org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe
solverConverter.java:84)

 

I'm using ListSelectOption to populate the DropDownChoice, as per the
online example:

 

http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht
ml

 

The only change I made to SelectOption is to set the 'value' field to an
Integer (which I need for my model).

 

Anyone any ideas as to what's going on? I'm pretty sure I didn't swap
the label/value pairs as the labels show up properly.

 

Thanks,

 

Michael


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



Re: Form onSubmit called after Page components created

2008-05-08 Thread Igor Vaynberg
the stateless stuff has to recreate the component hierarchy first - eg
the form instance has to exist before you can call onsubmit on it :)

however, inside onsubmit you can do any component replacement you
want, just like in a non-stateless page.

-igor


On Thu, May 8, 2008 at 4:36 PM, Joel Halbert [EMAIL PROTECTED] wrote:
 Hi,

  I've noticed that when submitting a (stateless) Form page the onSubmit()  
 method of the form is only called once all the Page components have all been 
 created, and likewise any model objects relating to the form are only 
 populated once the page components have been rendered.

  This means that it is hard to create dynamic content in the page that is 
 dependent on the contents of the submitted form without reloading the page 
 using
  setResponsePage(MyPage.class, pageParams) at the end of the onSubmit() call 
 of the form.

  Has anyone else noticed this and is there a way around it? i.e. can the 
 models be populated before the page components are created?

  Rgs
  Joel



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



Re: Detached models

2008-05-08 Thread Igor Vaynberg
im not that religious about this. i dont like to pass daos around or
have to look them up, not when i am using a central persistence tech
like hibernate/jpa. so i think of my entitymodel as a repository for a
single object :) you can give it the object or the class and id and it
knows how to load it. the need to create a loadable detachable model
for a persistent object is way too common to neglect such a
convenience. entitymodel encapsulates the lookup so nothing leaks, but
thats just me :)

-igor


On Thu, May 8, 2008 at 5:14 PM, James Carman [EMAIL PROTECTED] wrote:
 I typically don't like to have my UI code directly interact with the
  ORM implementation (hibernate in this case).  For my applications, I
  pass a Repository (think DAO) object and the object's id into the
  LoadableDetachableModel.



  On Thu, May 8, 2008 at 6:33 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   you can pass in the id if you want, i prefer to work with objects...so
  
class entitymodel extends ldm {
 private final String cn;
 private final Serialializable id;
  
 public entitymodel(class cl, serializable id) { cn=cl.getName(); 
 this.id=id; }
 public entitymodel(identifiable entity) {
cn=hibernateutils.unproxy(entity).getclass().getname();
id=entity.getid(); }
 public object load() { session.get(class.forname(cn), id); }
}
  
this is just more convinient, obviously identifiable is an interface
we use here internally.
  
-igor
  
  
  
  
On Thu, May 8, 2008 at 3:10 PM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:

  Thanks Igor!

  So if I use the sample code you gave me and, when getting the Object 
 from
  the constructor
  on the response page I will have a detached object.

  Do I have to load the object from database here? When looking at the 
 Phone
  book example I see you pass id instead of object. Is this more 
 lightweight
  or is it better practice to just pass the id and not the whole object?


  --
  View this message in context: 
 http://www.nabble.com/Detached-models-tp17136199p17137533.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]



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



Re: Detached models

2008-05-08 Thread James Carman
Well, I have a similar class called DetachableEntityModel (Entity is
an interface we devised to mark something as a persistent entity):

public class DetachableEntityModelT extends Entity extends
LoadableDetachableModelT
{
  private RepositoryT repository;
  private String id;

  public DetachableEntityModel(RepositoryT repository, String id)
  {
this.repository = repository;
this.id = id;
  }

  public T load()
  {
return repository.getById(id);
  }
}

This way, my model isn't tied to the ORM implementation at all.  I
just code to the Repository interface which can be implemented using
any ORM technology you like (Hibernate, JPA, iBATIS, etc.).  I
understand that most folks aren't as religious as me about this, but
I have learned that when I go away from my best practices my code
becomes more difficult to unit test (I still stray from time to time,
though :).

On Thu, May 8, 2008 at 10:16 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 im not that religious about this. i dont like to pass daos around or
 have to look them up, not when i am using a central persistence tech
 like hibernate/jpa. so i think of my entitymodel as a repository for a
 single object :) you can give it the object or the class and id and it
 knows how to load it. the need to create a loadable detachable model
 for a persistent object is way too common to neglect such a
 convenience. entitymodel encapsulates the lookup so nothing leaks, but
 thats just me :)

 -igor


 On Thu, May 8, 2008 at 5:14 PM, James Carman [EMAIL PROTECTED] wrote:
 I typically don't like to have my UI code directly interact with the
  ORM implementation (hibernate in this case).  For my applications, I
  pass a Repository (think DAO) object and the object's id into the
  LoadableDetachableModel.



  On Thu, May 8, 2008 at 6:33 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   you can pass in the id if you want, i prefer to work with objects...so
  
class entitymodel extends ldm {
 private final String cn;
 private final Serialializable id;
  
 public entitymodel(class cl, serializable id) { cn=cl.getName(); 
 this.id=id; }
 public entitymodel(identifiable entity) {
cn=hibernateutils.unproxy(entity).getclass().getname();
id=entity.getid(); }
 public object load() { session.get(class.forname(cn), id); }
}
  
this is just more convinient, obviously identifiable is an interface
we use here internally.
  
-igor
  
  
  
  
On Thu, May 8, 2008 at 3:10 PM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:

  Thanks Igor!

  So if I use the sample code you gave me and, when getting the Object 
 from
  the constructor
  on the response page I will have a detached object.

  Do I have to load the object from database here? When looking at the 
 Phone
  book example I see you pass id instead of object. Is this more 
 lightweight
  or is it better practice to just pass the id and not the whole object?


  --
  View this message in context: 
 http://www.nabble.com/Detached-models-tp17136199p17137533.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]



 -
 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]