Re: Re: Model is not created

2012-07-03 Thread wicket
Hello,

thanks for the answers. At the moment I am not able to access my code but let
me explain the code in detail and give you some additional examples. I think
the idea with the stateful behavior could be right but I do not understand the 
reason.

In detail.

- I have a starting page where a Link is constructed that depending on the 
available
PageParameters links to the second page with or without PageParameters:

p.. PageParameters

setResponsePage(MyPage2.class, p) or setResponsePage(MyPage2.class) or 

- After clicking the link on the starting page, the MyPage2 will be opened and 
the constructor adds the elements to the page. A Form will be added and gets 
a Model that is created in the constructor:

MyModel model = new MyModel();

The MyModel has two fields. 
class MyModel {
  private String text;
  private ListString classes;
  public void setText ..
  public void setClasses...
  public String getText ...
  public ListString getClasses...
}

The classes field is pre-filled with 3 entries in the MyModel class.

Before the end of the constructor, my Form is added with:
add(new MyForm(id, new CompoundPropertyModel(model)));

When I submit the form, the MyPage3 is opened and the values from
the MyForm are used.

When I click back to my starting page and click on the link to MyPage2,
the selected values from the first click to this page are filled in the
MyModel. I printed the values of MyModel directly after the line:
MyModel model = new MyModel()
Normally, the pre-filled values should be in the classes variable. BUT ... 
I have the selected values from the first call of the MyPage2.
That's my miracle :)

Thanks for any additional help
Andre

- Original Message -
From: mgrigo...@apache.org
To: users@wicket.apache.org
Date: 03.07.2012 07:44:54
Subject: Re: Model is not created


 On Mon, Jul 2, 2012 at 11:45 PM, Andre Schütz wic...@faustas.de wrote:
 Hello,
 
 I have a problem with the creation of a model in one of my pages.
 It works as follows:
 
 I have a link that uses setResponsePage(new MyPage(parameters)) on the click
 
 I'd recommend to use setResponsePage(MyPage.class, parameters) instead
 in this case. This way you will have a nice looking url and the page
 may stay stateless if there are no stateful components/behaviors in
 it.
 If you know the parameters earlier then you can even use
 BookmarkablePageLink(id, MyPage.class, parameters) - this will save
 you a http redirect.
 
 with parameters as PageParameters.
 At the MyPage site, the constructor creates a:
 IModelMyModel model = new IModelMyModel() {
   public void setObject ..
   public MyModel getObject..
 }
 
 This variable is used to create a CompoundPropertyModel for a Form.
 
 The first time when I click on my link to the MyPage site, everything
 is fine. At the second time, the MyModel variable is not empty. The
 variable is filled with the selected values from the first time when
 I clicked on the link to the MyPage site.
 
 I do not understand this behavior. Normally, the MyModel variable
 should be empty and not filled with the last selection.
 
 Has someone an idea?
 
 Thanks,
 Andre
 
 --
 Andre Schütz wic...@faustas.de
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


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



Wicketopia

2012-07-03 Thread Vit Rozkovec

Hi,
is it still possible to use Wicketopia with wicket 1.4.x?
What is the status of the project? It has not been updated for six 
months, does it need still some work?


Thanks.

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



Re: setResponsePage swallows my session feedback messages

2012-07-03 Thread Martin Grigorov
Hi Bertrand,

On Mon, Jul 2, 2012 at 11:21 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi Martin,

 Thanks for your answer and code. Indeed, in my case, option 2 is most
 desirable because the session message is set in a completely different place
 than where the redirect is done.

 NonResettingRestartException works great when thrown from a page
 constructor. However, when thrown from a link or form handler, a list
 concurrent modification exception occurs.

 This email is rather long so I divided it in 2 parts.

 Part 1 - NonResettingRestartException problem
 =

 The list is the actions list of the BufferedWebResponse with the following
 stack trace:
 BufferedWebResponse.addCookie(Cookie) line: 421
 HeaderBufferingWebResponse.addCookie(Cookie) line: 72
 BufferedWebResponse$AddCookieAction.invoke(WebResponse) line: 240
 BufferedWebResponse.writeMetaData(WebResponse) line: 75
 HeaderBufferingWebResponse.writeMetaData(WebResponse) line: 205
 NonResettingRestartException.init(ClassPage, PageParameters,
 RequestCycle) line: 28
 LinkPage$4.onClick() line: 38

 Analysis:
 1) HeaderBufferingWebResponse delegates #writeMetaData() to its
 bufferedResponse (a BufferedWebResponse instance).
 2) BufferedWebResponse iterates its action list with the single
 AddCookieAction and invoke()s it
 3) BufferedWebResponse$AddCookieAction.invoke does
 response.addCookie(cookie)
 4) The addCookie is executed with this==BufferedWebResponse from 2) which
 modifies the action list illegally

 I created a set of test pages to test the different ways to redirect to a
 page from a page constructor, a link handler and a form submit handler. They
 all set a cookie and a session message to validate the behaviors. I will
 gladly share this if desired.

Yes, please attach the quickstart to a separate ticket.
NonResettingRestartException is not part of Wicket but it will be good
to have this functionality working in all cases.


 In conclusion, with Wicket 1.5.7, NonResettingRestartException works in a
 page constructor, but setResponsePage must be used in a link or form
 handler.

 So there is a workable alternative, but the difference in behavior depending
 on where the exception is thrown is not so good. And maybe other code paths
 are at risk of triggering this exception.

 Part 2 - Cookie problem with Jetty
 ==
 A heads up for anybody using redirects, cookies and Jetty 7.5.0, 7.5.4,
 7.6.4 or 8.1.4 (so I guess all versions essentially).

 Normally, throwing a RestartResponseException throws away anything added to
 the response before that point. This is not always the case for cookies when
 using Jetty! If a cookie is set before the exception is thrown AND it
 already exists on the client (with any value), Jetty will erroneously think
 the new value is set on the client.

 Here is what happens: when a cookie already exists, CookieUtils#save()
 updates its value instead of creating a new one. However, Jetty's
 CookieCutter class caches the client's parsed cookies across requests
 (server-side) so the cached copy is updated with the new value. Afterwards,
 Jetty does not check properly whether the cookies sent by the client match
 the cached values so the cookie is considered modified with the new phantom
 value until a new session is created.

 This bug had me scratching my head for a while when testing the different
 ways to redirect clients! This does not happen with Tomcat 7.0.27

 This definitely seems like a bug in Jetty but I don't have time to file it
 and follow up since I'm only using Jetty for quickstarts. I can give more
 info on request.



 On 01/07/2012 10:36 AM, Martin Grigorov wrote:

 Hi,

 Here is my later response.

 I see two ways to solve this:

 1) Use setResponsePage(pageInstance) as I described in my previous
 response:

 setMyCookie();
 PageB pageB = new PageB();
 pageB.info(some text);
 setResponsePage(pageB);

 This way the feedback is associated with a component (pageB) and wont
 be rendered when PageA is rendered.
 The drawback is that this way you will get a url like 'wicket/page?42'
 instead of the nice looking one (e.g. /customers/12)

 2) the second way is to use non-resetting RestartResponsePage
 I've rolled this out several months ago for our app:

 public class NonResettingRestartException extends ReplaceHandlerException
 {

  public NonResettingRestartException(final Class? extends Page?
 pageClass, final PageParameters params, final RequestCycle cycle) {
  super(createRequestHandler(pageClass, params), true);

  Response response = cycle.getResponse();
  if (response instanceof IMetaDataBufferingWebResponse) {
  IMetaDataBufferingWebResponse bufferingWebResponse =
 (IMetaDataBufferingWebResponse) response;
  bufferingWebResponse.writeMetaData((WebResponse)
 cycle.getOriginalResponse());
  }
  }

  private static IRequestHandler 

Re: Caching Imagages, CSS, JS in Wicket 1.5.3

2012-07-03 Thread sardo
I have a similar problem:

A css style sheet is added to the app like so:

 getSharedResources().add(css_table, new
ContextRelativeResource(css/table.css));

and this css file contains image references like so:

  div.tabpanel div.tab-row li {
float: left;
background: url(../images/tabs/left.png) no-repeat left top;
margin: 0;
padding: 0 0 0 9px;
  }

The problem is the images aren't displayed because Wicket is prefixing the
path with:

   myApp/wicket/resource/images/tabs/left.png (generates a 404)

instead of leaving it like this:

   myApp/images/tabs/left.png

Is there a way to solve this?  chris.schaefer did ask something similar
during the discussion above but I don't think it was answered...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Caching-Imagages-CSS-JS-in-Wicket-1-5-3-tp4121068p4650329.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Migration from wicket 1.4.x

2012-07-03 Thread Vit Rozkovec

Hi,
what is the best approach when migrating from wicket 1.4.x?
Wait for stable 6.0 version and then start migration or migrate to 1.5.x 
version?


All my projects now use 1.4.x with Hibernate via Databinder. I want to 
save myself the effort to do a double migration and would rather wait 
and stick with 1.4.x until 6.0 comes out, what do you recommend?


Thank you.

Vit

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



Re: Caching Imagages, CSS, JS in Wicket 1.5.3

2012-07-03 Thread Martin Grigorov
Hi,

Either don't use ContextRelativeResource for the css or use it for all
resources, i.e. the image should be delivered by
ContextRelativeResource too.

With the SharedResources you mount the .css at your own url and
deliver its content. But there is no such code for the images.

I'd remove the shared resources mounting and put the link to the
.css directly in MyPage.html.

On Tue, Jul 3, 2012 at 11:50 AM, sardo mark.willi...@power-oasis.com wrote:
 I have a similar problem:

 A css style sheet is added to the app like so:

  getSharedResources().add(css_table, new
 ContextRelativeResource(css/table.css));

 and this css file contains image references like so:

   div.tabpanel div.tab-row li {
 float: left;
 background: url(../images/tabs/left.png) no-repeat left top;
 margin: 0;
 padding: 0 0 0 9px;
   }

 The problem is the images aren't displayed because Wicket is prefixing the
 path with:

myApp/wicket/resource/images/tabs/left.png (generates a 404)

 instead of leaving it like this:

myApp/images/tabs/left.png

 Is there a way to solve this?  chris.schaefer did ask something similar
 during the discussion above but I don't think it was answered...

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Caching-Imagages-CSS-JS-in-Wicket-1-5-3-tp4121068p4650329.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Migration from wicket 1.4.x

2012-07-03 Thread Martin Grigorov
Hi,

Wicket 6 will be released soon (few weeks) but this wont save you the
changes you have to do which are required by Wicket 1.5.
There are no changes which are required by Wicket 1.5 and then
reverted for Wicket 6.0.
I'd migrate to 1.5.7 first and then to 6.0.0-beta2.

On Tue, Jul 3, 2012 at 1:14 PM, Vit Rozkovec rozkovec...@email.cz wrote:
 Hi,
 what is the best approach when migrating from wicket 1.4.x?
 Wait for stable 6.0 version and then start migration or migrate to 1.5.x
 version?

 All my projects now use 1.4.x with Hibernate via Databinder. I want to save
 myself the effort to do a double migration and would rather wait and stick
 with 1.4.x until 6.0 comes out, what do you recommend?

 Thank you.

 Vit

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Migration from wicket 1.4.x

2012-07-03 Thread Cedric Gatay
Hello,
I've done such a migration from 1.4.x to 1.5.7 in two days for roughly 100k
SLOC. Then migration to 6.0 is a breeze...
__
Cedric Gatay
http://www.bloggure.info | http://cedric.gatay.fr |
@Cedric_Gatayhttp://twitter.com/Cedric_Gatay

On Tue, Jul 3, 2012 at 1:18 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Wicket 6 will be released soon (few weeks) but this wont save you the
 changes you have to do which are required by Wicket 1.5.
 There are no changes which are required by Wicket 1.5 and then
 reverted for Wicket 6.0.
 I'd migrate to 1.5.7 first and then to 6.0.0-beta2.

 On Tue, Jul 3, 2012 at 1:14 PM, Vit Rozkovec rozkovec...@email.cz wrote:
  Hi,
  what is the best approach when migrating from wicket 1.4.x?
  Wait for stable 6.0 version and then start migration or migrate to 1.5.x
  version?
 
  All my projects now use 1.4.x with Hibernate via Databinder. I want to
 save
  myself the effort to do a double migration and would rather wait and
 stick
  with 1.4.x until 6.0 comes out, what do you recommend?
 
  Thank you.
 
  Vit
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: setResponsePage swallows my session feedback messages

2012-07-03 Thread Bertrand Guay-Paquet

Hi,

Issues WICKET-4636 and WICKET-4637 were created.

Bertrand

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



Wicket 1.4 newSession id

2012-07-03 Thread dpmihai
In my WebApplication is there possible to know the session id inside
newSession method?

public Session newSession(Request request, Response response) {
  Session session = super.newSession(request, response);
  ...
  String id = session.getId(); // returns null;
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-newSession-id-tp4650337.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket 1.4 newSession id

2012-07-03 Thread Martin Grigorov
Hi,

Because there is no active session yet.
You have to call session.bind() before that.

On Tue, Jul 3, 2012 at 4:56 PM, dpmihai dpmi...@yahoo.com wrote:
 In my WebApplication is there possible to know the session id inside
 newSession method?

 public Session newSession(Request request, Response response) {
   Session session = super.newSession(request, response);
   ...
   String id = session.getId(); // returns null;
 }



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-newSession-id-tp4650337.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Wicket 1.4 newSession id

2012-07-03 Thread dpmihai
Thanks a lot.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-newSession-id-tp4650337p4650339.html
Sent from the Users forum mailing list archive at Nabble.com.

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



chekbox - allow only 5 selected

2012-07-03 Thread Dan12321
Hi,

I have CheckGroupUser group = new CheckGroupUser(usersGroup, list);
and in repeater I add checkbox: item.add(new CheckUser(checkboxUser,
group));

I have got 20 checkboxes, but I want to allow only 5 checkboxes select. When
will be selected more than 5 checkboxes, it shows error (in feedback).
I want to check this when the checkbox is selected (not after submitting
form).
Could help me, how can I do it?

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/chekbox-allow-only-5-selected-tp4650340.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Model is not created

2012-07-03 Thread Andre Schütz
There is one important information that I had forgotten to
mention. The link on my start page is not a link. It is a button
from within a form.

Andre

On Tue,  3 Jul 2012 11:41:36 +0200 (CEST)
wic...@faustas.de wrote:

 Hello,
 
 thanks for the answers. At the moment I am not able to access my code but let
 me explain the code in detail and give you some additional examples. I think
 the idea with the stateful behavior could be right but I do not understand 
 the 
 reason.
 
 In detail.
 
 - I have a starting page where a Link is constructed that depending on the 
 available
 PageParameters links to the second page with or without PageParameters:
 
 p.. PageParameters
 
 setResponsePage(MyPage2.class, p) or setResponsePage(MyPage2.class) or 
 
 - After clicking the link on the starting page, the MyPage2 will be opened 
 and 
 the constructor adds the elements to the page. A Form will be added and gets 
 a Model that is created in the constructor:
 
 MyModel model = new MyModel();
 
 The MyModel has two fields. 
 class MyModel {
   private String text;
   private ListString classes;
   public void setText ..
   public void setClasses...
   public String getText ...
   public ListString getClasses...
 }
 
 The classes field is pre-filled with 3 entries in the MyModel class.
 
 Before the end of the constructor, my Form is added with:
 add(new MyForm(id, new CompoundPropertyModel(model)));
 
 When I submit the form, the MyPage3 is opened and the values from
 the MyForm are used.
 
 When I click back to my starting page and click on the link to MyPage2,
 the selected values from the first click to this page are filled in the
 MyModel. I printed the values of MyModel directly after the line:
 MyModel model = new MyModel()
 Normally, the pre-filled values should be in the classes variable. BUT ... 
 I have the selected values from the first call of the MyPage2.
 That's my miracle :)
 
 Thanks for any additional help
 Andre
 
 - Original Message -
 From: mgrigo...@apache.org
 To: users@wicket.apache.org
 Date: 03.07.2012 07:44:54
 Subject: Re: Model is not created
 
 
  On Mon, Jul 2, 2012 at 11:45 PM, Andre Schütz wic...@faustas.de wrote:
  Hello,
  
  I have a problem with the creation of a model in one of my pages.
  It works as follows:
  
  I have a link that uses setResponsePage(new MyPage(parameters)) on the 
  click
  
  I'd recommend to use setResponsePage(MyPage.class, parameters) instead
  in this case. This way you will have a nice looking url and the page
  may stay stateless if there are no stateful components/behaviors in
  it.
  If you know the parameters earlier then you can even use
  BookmarkablePageLink(id, MyPage.class, parameters) - this will save
  you a http redirect.
  
  with parameters as PageParameters.
  At the MyPage site, the constructor creates a:
  IModelMyModel model = new IModelMyModel() {
public void setObject ..
public MyModel getObject..
  }
  
  This variable is used to create a CompoundPropertyModel for a Form.
  
  The first time when I click on my link to the MyPage site, everything
  is fine. At the second time, the MyModel variable is not empty. The
  variable is filled with the selected values from the first time when
  I clicked on the link to the MyPage site.
  
  I do not understand this behavior. Normally, the MyModel variable
  should be empty and not filled with the last selection.
  
  Has someone an idea?
  
  Thanks,
  Andre
  
  --
  Andre Schütz wic...@faustas.de
  
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
  
  -- 
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com
  
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


-- 
Andre Schütz wic...@faustas.de

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



Re: chekbox - allow only 5 selected

2012-07-03 Thread Jeremy Thomerson
On Tue, Jul 3, 2012 at 12:09 PM, Dan12321 wee...@centrum.cz wrote:

 Hi,

 I have CheckGroupUser group = new CheckGroupUser(usersGroup, list);
 and in repeater I add checkbox: item.add(new CheckUser(checkboxUser,
 group));

 I have got 20 checkboxes, but I want to allow only 5 checkboxes select.
 When
 will be selected more than 5 checkboxes, it shows error (in feedback).
 I want to check this when the checkbox is selected (not after submitting
 form).



It will require JavaScript, so I'd just make it an entirely client-side
validation.  Of course, you'll still want the server-side validation to
mirror it for when the form is submitted - potentially with forced values
or JS disabled.


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: chekbox - allow only 5 selected

2012-07-03 Thread Martin Grigorov
You can assign AjaxFormChoiceComponentUpdatingBehavior to the group
and check its model object's size in #onUpdate()

But this will fire Ajax requests for each and every click on the checkboxes.

On Tue, Jul 3, 2012 at 7:09 PM, Dan12321 wee...@centrum.cz wrote:
 Hi,

 I have CheckGroupUser group = new CheckGroupUser(usersGroup, list);
 and in repeater I add checkbox: item.add(new CheckUser(checkboxUser,
 group));

 I have got 20 checkboxes, but I want to allow only 5 checkboxes select. When
 will be selected more than 5 checkboxes, it shows error (in feedback).
 I want to check this when the checkbox is selected (not after submitting
 form).
 Could help me, how can I do it?

 Thanks.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/chekbox-allow-only-5-selected-tp4650340.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: chekbox - allow only 5 selected

2012-07-03 Thread Alexander Cherednichenko
Hi!

As the first A in AJAX  stands for Asynchronous, you may hit weird results
with this solution, especially on slow internet connection. Which means
that no one guarantees that if user clicks checkbox1 and then checkbox2
answers would arrive in such a manner.

What I would do in this case - I would just write a very simple JQuery
callback which would listen to checkbox check/uncheck events and would
disable remaining checkboxes once 5 are selected, plus show warning. It is
synchronous, immediate, and the rule - max 5 - seems to be easy to employ
on the client side.

Surely we need to leave the check for 'max 5' in the onsubmit validator as
we want it to be independent of the javascript.

Regards,
Alex.

2012/7/3 Martin Grigorov mgrigo...@apache.org

 You can assign AjaxFormChoiceComponentUpdatingBehavior to the group
 and check its model object's size in #onUpdate()

 But this will fire Ajax requests for each and every click on the
 checkboxes.

 On Tue, Jul 3, 2012 at 7:09 PM, Dan12321 wee...@centrum.cz wrote:
  Hi,
 
  I have CheckGroupUser group = new CheckGroupUser(usersGroup, list);
  and in repeater I add checkbox: item.add(new CheckUser(checkboxUser,
  group));
 
  I have got 20 checkboxes, but I want to allow only 5 checkboxes select.
 When
  will be selected more than 5 checkboxes, it shows error (in feedback).
  I want to check this when the checkbox is selected (not after submitting
  form).
  Could help me, how can I do it?
 
  Thanks.
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/chekbox-allow-only-5-selected-tp4650340.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 
Alexander Cherednichenko

[ the only way out is the way up ]


Re: chekbox - allow only 5 selected

2012-07-03 Thread Martin Grigorov
On Tue, Jul 3, 2012 at 9:24 PM, Alexander Cherednichenko
lex...@gmail.com wrote:
 Hi!

 As the first A in AJAX  stands for Asynchronous, you may hit weird results
 with this solution, especially on slow internet connection. Which means
 that no one guarantees that if user clicks checkbox1 and then checkbox2
 answers would arrive in such a manner.

Wicket serializes the Ajax requests both at the client and at the
server side, so there is a guarantee that request1 is processed before
request2.
You can disable the client side queueing by overriding ajax behavior's
#getAjaxChannel() method though.


 What I would do in this case - I would just write a very simple JQuery
 callback which would listen to checkbox check/uncheck events and would
 disable remaining checkboxes once 5 are selected, plus show warning. It is
 synchronous, immediate, and the rule - max 5 - seems to be easy to employ
 on the client side.

 Surely we need to leave the check for 'max 5' in the onsubmit validator as
 we want it to be independent of the javascript.

I agree that client side checks will be much better for the user experience.


 Regards,
 Alex.

 2012/7/3 Martin Grigorov mgrigo...@apache.org

 You can assign AjaxFormChoiceComponentUpdatingBehavior to the group
 and check its model object's size in #onUpdate()

 But this will fire Ajax requests for each and every click on the
 checkboxes.

 On Tue, Jul 3, 2012 at 7:09 PM, Dan12321 wee...@centrum.cz wrote:
  Hi,
 
  I have CheckGroupUser group = new CheckGroupUser(usersGroup, list);
  and in repeater I add checkbox: item.add(new CheckUser(checkboxUser,
  group));
 
  I have got 20 checkboxes, but I want to allow only 5 checkboxes select.
 When
  will be selected more than 5 checkboxes, it shows error (in feedback).
  I want to check this when the checkbox is selected (not after submitting
  form).
  Could help me, how can I do it?
 
  Thanks.
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/chekbox-allow-only-5-selected-tp4650340.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 Alexander Cherednichenko

 [ the only way out is the way up ]



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



[Announce] WicketStuff 1.5.7 is released

2012-07-03 Thread Martin Grigorov
Hello,

With a bit of delay WicketStuff core projects have been released
against Wicket 1.5.7.
The previous release was 1.5.5 and there is no such for 1.5.6
Due to a missing Git tag for 1.5.5 I wasn't able to build a release
notes but this will be fixed for the next release!

The projects can be retrieved from Maven like this:

dependency
  groupIdorg.wicketstuff/groupId
  artifactIdwicketstuff-progressbar/artifactId
  version1.5.7/version
/dependency

The release tag is here:
https://github.com/wicketstuff/core/tree/wicketstuff-core-1.5.7

Issues can be reported here: https://github.com/wicketstuff/core/issues

The Project Wiki is available here: https://github.com/wicketstuff/core/wiki

The WicketStuff team!

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



Re: Model is not created

2012-07-03 Thread Andre Schütz
Hello,

here is an abstract code example of my problem with my application.


# StartPage

class StartPage extends WebPage {
  public StartPage(PageParameters parameters) {
add(new SearchForm(searchForm, parameters));
  }

  private class SearchForm extends StatelessForm {
public SearchForm(String id, final PageParameters params) {
  super(id);
  init();
}

private void init() {
  Button startButton = new Button(button_search) {
@Override
public void onSubmit() {
  PageParamerters p = new PageParameters();
  // some additional checks with the parameters
  
  setResponsePage(MyFormPage.class, p);
}
  }
}
  }
}

#
# MyFormPage
#
class MyFormPage extends WebPage {
  public MyFormPage(PageParameters parameters) {
super(parameters);
ModelMySearchModel model = new ModelMySearchModel() {
  MySearchModel msm = new MySearchModel();

  @Override
  public MySearchModel getObject() {
return msm;
  }
  
  @Override
  public void setObject(MySearchModel newModel) {
this.msm = newModel;
  }
}

CompundPropertyModelMySearchModel cpm = new 
CompoundPropertyModelMySearchModel(model);
add(new AdvancedSearchForm(asForm, cpm));
  }

  private class AdvancedSearchForm extends StatelessFormMySearchModel {
private String name = null;

public AdvancedSearchForm (String id, IModelMySearchModel model) {
  super(id, model);
  init(model);
}

private void init(IModelMySearchModel model) {
  IModelListString classes = new 
LoadableDetachableModelListString() {
@Override
public ListString load() {
  ListString classes = HelperClass.getClasses();
  Collections.sort(classes);
  return classes;
}
  }

  IChoiceRendererObject rendererClasses = new IChoiceRendererObject() {
public Object getDisplayValue(Object obj) {
  return obj;
}

public String getIdValue(Object obj, int index) {
  return obj.toString();
}
  };
  CheckBoxMultipleChoiceString classesChoice =
new CheckBoxMultipleChoiceString(classes,
classes,
rendererClasses);
  add(classesChoice);

  TextFieldString tf = new TextFieldString(name, new 
PropertyModelString(this, name));
  add(tf);

  add(new Button(searchbutton_search) {
@Override
public void onSubmit() {
  makeSubmit();
}
  });
}

/**
 * Do the submit and got to the response page
 */
private void makeSubmit() {
  MySession s = (MySession)getSession();
  MySearchModel modelObject = this.getModelObject();

  if (!s.mySearchModelExists(modelObject.hashCode())) {
s.setMySearchModel(modelObject);
  }

  PageParameters p = new PageParameters();
  // following method creates parameters from the model
  p = MyParameterHelper.preparePageParameters(p, modelObject);
  setResponsePage(MyFinalPage.class, p);
}
  }
}


# MySearchModel


public class SearchModel implements Serializable {
  private String name = null;
  private ListString classes = null;

  public void setName(String newName) {
name = newName;
  }

  public void setClasses(ListString newClasses) {
classes = newClasses;
  }

  public String getName() {
return name;
  }

  public ListString getClasses() {
return classes;
  }
}

The process:

(0) I open the Opera Browser.
(1) I click on the button of the StatelessForm (SearchForm) in the StartPage 
class.
(2) The MyFormPage site is displayed.
(3) I select some classes and click the button in the AdvancedSearchForm.
(4) The MyFinalPage site is displayed.
(5) I open the Firefox Browser.
(6) I see the StartPage and click the button in the SearchForm.
(7) The MyFormPage is displayed and the classes from step (3) are selected.
(8) Additionally, I added a System.out.println(model.toString) before the line:
CompundPropertyModelMySearchModel cpm = new 
CompoundPropertyModelMySearchModel(model);
and looked into the Catalino.out logs. You can see that this is directly after 
the
initilization of the: ModelMySearchModel model = new ModelMySearchModel()
- the logs tell me that the classes from step (3) are in the model
= You can see in the model above that the classes are initialized with null.

Puh.
This is my problem. I hope that this code example gives a good imagination
of my problem.
I do not know why the classes from step 3 are in the model after a new 
initialization.

I would be very thankful for a solution.

Thanks,
Andre





On Tue, 3 Jul 2012 20:16:13 +0200
Andre Schütz wic...@faustas.de wrote:

 There is one important information that I had forgotten to
 mention. The link on my start page is not a link. It is a 

Re: Caching Imagages, CSS, JS in Wicket 1.5.3

2012-07-03 Thread sardo
Thanks Martin, that helps. Forgive my naivety, but why do I have the option
of adding CSS via the Java code? Surely it's better to follow convention and
add it into the appropriate .war directory?

...and if I could do the Columbo, Just one more thing, thing. Why am I
getting two head tags in my app?  There's a title tag in a base page
which is linked to a Label component in the code, which when rendered in the
second head tag predictably throws an exception.  The full question is on
the link below in Stack Overflow. This code worked in Wicket 1.4 but not
after porting to 1.5:

http://stackoverflow.com/questions/11243714/wicket-head-tag-rendered-twice-for-pages-extending-a-base-page
http://stackoverflow.com/questions/11243714/wicket-head-tag-rendered-twice-for-pages-extending-a-base-page
 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Caching-Imagages-CSS-JS-in-Wicket-1-5-3-tp4121068p4650350.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Anybody is having problems with Wicket and Facebook Like button?

2012-07-03 Thread Alec Swan
Hello,

We started receiving complaints from users saying that Facebook Like
buttons don't work on our web site anymore. I don't know what happened
on the Facebook side but now we are seeing the following errors when
user clicks Like button, e.g. on
http://galecsy.com:88/lrm/ms/oid/74989:

The page at 
http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1FBAE4A7B21CA0FC7B8B10BB21EF1
could not be reached.

I read SEO - Search Engine Optimization and overwrote newWebResponse
to remove JSESSIONID, however it looks like JSESSIONID is still being
added somewhere, probably Tomcat.

I know this is not directly related to Wicket, but I am wondering how
other Wicket users handled interaction with Facebook Like button.

Thanks

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



Re: [Announce] WicketStuff 1.5.7 is released

2012-07-03 Thread Bertrand Guay-Paquet

Good stuff!

Is there a way to see which issues where fixed between 2 releases with 
github? In Jira it's straightforward, but I haven't been able to figure 
this out yet for github...


I found out how to compare the source tree between 2 tags, but not the 
list of issues.
For the source, it's 
https://github.com/wicketstuff/core/compare/wicketstuff-core-1.5.5...wicketstuff-core-1.5.7


On 03/07/2012 4:00 PM, Martin Grigorov wrote:

Hello,

With a bit of delay WicketStuff core projects have been released
against Wicket 1.5.7.
The previous release was 1.5.5 and there is no such for 1.5.6
Due to a missing Git tag for 1.5.5 I wasn't able to build a release
notes but this will be fixed for the next release!

The projects can be retrieved from Maven like this:

dependency
   groupIdorg.wicketstuff/groupId
   artifactIdwicketstuff-progressbar/artifactId
   version1.5.7/version
/dependency

The release tag is here:
https://github.com/wicketstuff/core/tree/wicketstuff-core-1.5.7

Issues can be reported here: https://github.com/wicketstuff/core/issues

The Project Wiki is available here: https://github.com/wicketstuff/core/wiki

The WicketStuff team!

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



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



Re: [Announce] WicketStuff 1.5.7 is released

2012-07-03 Thread Martin Grigorov
With some help from Michael O'Cleirigh I was able to generate the changelog:

Sven Meier (4):
  Merge pull request #119 from jesselong/core-1.5.x
  TabbedPanel is generic now
  fixed version test for latest jquery
  fixed local test for latest jquery

inaiat (3):
  [jqplot] jqplot4java 1.2.3 and more examples
  [jqplot] jqplot4java 1.2.3 and more examples
  [jqplot] area chart example

Georg Buschbeck (2):
  more jquery versions for wicketstuff jslibraries
  jquery files

Inaiat Henrique (2):
  [jqplot] fix series colors and serializable
  Merge branch 'core-1.5.x' of github.com:wicketstuff/core into core-1.5.x

Martin Grigorov (2):
  Merge pull request #125 from td-github/core-1.5.x
  Merge pull request #130 from minman/fix-129

Martin Tzvetanov Grigorov (2):
  Fix #79 - Tinymce icon images not showing on advanced Theme and
wicket deployment mode
  Release WicketStuff 1.5.7

Michael O'Cleirigh (2):
  [core] update scm url
  Merge pull request #106 from dsoneira/core-1.5.x

Daniel Soneira (1):
  fixed issue #89 (DataGrid selection indication is broken)

Jesse Long (1):
  Change test to match new URL behaviour in wicket 1.5.6 snapshots

mam (1):
  fix-129 NPE when redirected from ajax

seb (1):
  [wicketstuff-push-cometd] fixed #118 cometd.js not found

On Wed, Jul 4, 2012 at 4:14 AM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Good stuff!

 Is there a way to see which issues where fixed between 2 releases with
 github? In Jira it's straightforward, but I haven't been able to figure this
 out yet for github...

I have no idea about this.


 I found out how to compare the source tree between 2 tags, but not the list
 of issues.
 For the source, it's
 https://github.com/wicketstuff/core/compare/wicketstuff-core-1.5.5...wicketstuff-core-1.5.7


 On 03/07/2012 4:00 PM, Martin Grigorov wrote:

 Hello,

 With a bit of delay WicketStuff core projects have been released
 against Wicket 1.5.7.
 The previous release was 1.5.5 and there is no such for 1.5.6
 Due to a missing Git tag for 1.5.5 I wasn't able to build a release
 notes but this will be fixed for the next release!

 The projects can be retrieved from Maven like this:

 dependency
groupIdorg.wicketstuff/groupId
artifactIdwicketstuff-progressbar/artifactId
version1.5.7/version
 /dependency

 The release tag is here:
 https://github.com/wicketstuff/core/tree/wicketstuff-core-1.5.7

 Issues can be reported here: https://github.com/wicketstuff/core/issues

 The Project Wiki is available here:
 https://github.com/wicketstuff/core/wiki

 The WicketStuff team!

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


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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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