Re: Server and client side validation

2013-05-07 Thread Cedric Gatay
Hi Gabriel,
the spin-off from Martin's blog post is available on Maven Central (via
Sonatype OSS services). It depends on JSR303 though.

Regards,

__
Cedric Gatay (@Cedric_Gatay http://twitter.com/Cedric_Gatay)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr


On Tue, May 7, 2013 at 2:37 AM, Gabriel Landon glan...@piti.pf wrote:

 Martin,

 I've create a ParsleyRangeValidator and a ParsleyLengthValidator very
 easily
 thanks to your code.
 I've also create ParsleyForm that initializes Parsley in the RenderHead and
 a ParsleyAjaxButton that validates Parsley on submit.

 I only have one problem with forms in a ModalWindow. As the form tag is
 replace with a div tag, Parsley doesn't seems to work in this case.
 Do you have an idea on how to fix that?

 Regards,

 Gabriel.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Server-and-client-side-validation-tp4658242p4658602.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 6] Modal unable to see page's properties anymore ?

2013-05-07 Thread Martin Grigorov
Hi,

You should not keep references to other page instances.
Instead pass IPageReference: page.getPageReference().
Later you can do:
MyPage page = (MyPage) pageRef.getPage();
page.setXyz();


But in your case I think you should use the Session. If the login is
successful then bind a session and set the flag. Then redirect to LoginPage
and in its constructor check whether there is a session, and whether the
flag is set and  redirect to the post-login page.



On Tue, May 7, 2013 at 4:03 AM, smallufo small...@gmail.com wrote:

 I have a LoginModal which binds a LoginPage .

 In LoginModal.setWindowClosedCallback() method , I use
 LoginPage.isSuccessful() to judge if the user login successful.
 If login successful , I refresh the page , or do nothing.

 LoginModal code : http://pastebin.com/nLU2akzV
 LoginPage code : http://pastebin.com/PqfLwsNg

 It works in wicket 1.4 , but failed in wicket 6

 In LoginPage , I can see user correctly login , and the successful = true
 is set.
 But LoginModal can only see the old successful value (which is FALSE).
 No matter I read the property (isSuccessful() ) or through reflection
 PropertyModel :
 boolean successful = (new PropertyModelBoolean(loginPage, successful)).
 getObject().booleanValue();

 It just returns FALSE.

 I notice it may be page serialization problem introduced in wicket 1.5 .
 My page has an integer attached , such as /app/?1 , no matter how I refresh
 the page , I just see the LoginPage's isSuccessful is FALSE.
 But if I manually browse /app/ (no trailing integer) , the user is logged
 in. (I set something in the httpSession in LoginPage)

 I searched the maillist , try to override *isVersioned() and return false*,
 but everything is the same

 How to solve the problem , making LoginModal able to see LoginPage's latest
 property ?

 Thanks !




-- 
Martin Grigorov
Wicket Training  Consulting
http://jWeekend.com http://jweekend.com/


Re: How to preserve current url in error page

2013-05-07 Thread Martin Grigorov
Hi,

Use:
Class errorPage =
application.getApplicationSettings().getInternalErrorPage();
throw new RestartResponseException(new PageProvider(errorPage),
RedirectPolicy.NEVER_REDIRECT)


On Mon, May 6, 2013 at 6:23 PM, infiniter infini...@gmail.com wrote:

 I've got a listener that does the error handling in Wicket 6.6.0 and I want
 to keep the current url instead of replacing it with the url of the error
 page. Anyone
 Help is appreciated.

 Carlos.




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-preserve-current-url-in-error-page-tp4658595.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
Wicket Training  Consulting
http://jWeekend.com http://jweekend.com/


Re: Dynamic Session.style

2013-05-07 Thread Илья Нарыжный
Hi,

We use different approach than styles and variations.
We have GenericPage with following definition:
public abstract class GenericPageK extends Serializable extends
EntityPageK implements IMarkupResourceStreamProvider,
IMarkupCacheKeyProvider

Then in public IResourceStream getMarkupResourceStream(final
MarkupContainer container, java.lang.Class? containerClass) we can
substite any required design of the page dynamically, for example we
have: XXXWebApplication.get().getDesignSupplier().getDesign()

Also, all our pages are inherited from GenericPage. By the way that's give
us interesting feature: we can have pages for viewing/editing common
entities like User/Page/MenuItem/Category and etc. But later simply
include that pages into design of new site by returning in getDesign()
required design for this particular site. So we have generic JAR with all
core related things: entities/view and edit page and etc: and we don't need
to introduce changes for common pages in any particular project which use
this generic JAR.

Thanks,

Ilia




2013/5/6 Martin Grigorov mgrigo...@apache.org

 Hi,

 You can use variations instead.
 Each special page can override #getVariation().


 On Fri, May 3, 2013 at 7:27 PM, Allen Gilbert allen.gilb...@doane.edu
 wrote:

  If locale and/or style are determined by a user-configurable setting,
  then yes, I agree that all pages should be affected by it. However,
  we're trying to differentiate styles between pages viewed within the
  same session. I'm guessing that Session.style was designed to be set
  once, not dynamically...
 
  On Fri, May 3, 2013 at 11:55 AM, Paul Bors p...@bors.ws wrote:
   But isn't that normal behavior?
  
   Consider localization alone and setting the user's language in a
 session.
   If the user logs in and uses English and then opens a new tab (same
  session)
   and choose Spanish, going back to the first tab and refreshing the page
   should be in Spanish.
  
   Same for you. What you need to do is create a new session for the
 second
  tab
   in order to treat them separate.
  
   ~ Thank you,
 Paul Bors
  
   -Original Message-
   From: Allen Gilbert [mailto:allen.gilb...@doane.edu]
   Sent: Friday, May 03, 2013 12:48 PM
   To: users
   Subject: Dynamic Session.style
  
   We are adding some new pages to our application that we'd like to style
   differently from existing ones. We also want to reuse Panels we've
  built, so
   we're employing the Style mechanism outlined in
  
 
 https://cwiki.apache.org/confluence/display/WICKET/Localization+and+Skinning
   +of+Applications.
  
   We have two different base pages for the separate styles, and in each
  base
   page constructor, we set the proper Session.style. This works fine, but
   doesn't seem like the best approach, and now we've discovered a problem
  with
   it.
  
   Say a user lands on page A with style A (the default style), then opens
  page
   B with style B in a new tab. After looking at page B for a bit, the
 user
   goes back to the tab with page A. The user clicks an AjaxLink that
 should
   display an InfoPanel. InfoPanel can be used with both styles, so it has
  two
   markup files: InfoPanel.html, and InfoPanel_B.html. Unfortunately,
  because
   page B was the last page to set Session.style, InfoPanel_B.html is
  loaded,
   even though the user is on page A.
  
   Any suggestions on how to solve this problem? The first thing that came
  to
   my mind was to create an AbstractRequestCycleListener subclass that
 could
   properly set Session.style for each request, but I'm not sure if
 that's a
   good idea.
  
   Thanks for your help!
  
   -Allen
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Localized urls

2013-05-07 Thread Martin Grigorov
Hi,

I think you will need to write custom IRequestMapper.
I think the Wicket default ones do not support this out of the box.


On Fri, May 3, 2013 at 4:29 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca
 wrote:

 Has no one ever done this? Any guidelines as to how to implement it?


 On 01/05/2013 10:29 AM, Bertrand Guay-Paquet wrote:

 Hello,

 I'd like to localize the urls generated by my app like so:
 /en/account/settings   - AccountSettingsPage, locale EN
 /fr/compte/parametres   - AccountSettingsPage, locale FR

 I already have urls prefixed with the locale base on the
 LocaleFirstMapper from Wicket examples, but they are all mapped the same
 way after the locale segment, like this:
 /en/account/settings
 /fr/account/settings

 I could think of 2 potential approached to this, but neither seem easy to
 implement...

 1- In my LocaleFirstMapper, have one set of localized mappers for each
 locale. I would need to duplicate the built-in mappers (link listeners,
 forms, etc.) manually for the extra sets of mappers.

 2-Create a new RequestMapper class based on MountedMapper which allows
 custom dynamic parts in urls, somewhat like the page parameter placeholders
 make a url dynamic.

 Any ideas or comments? Has anybody done this before?

 Thanks!
 Bertrand

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



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




-- 
Martin Grigorov
Wicket Training  Consulting
http://jWeekend.com http://jweekend.com/


Scheme-less URLs vs. UrlRenderer

2013-05-07 Thread Jan Riehn

Hello,

I would like to introduce a similar pattern as  fifty-five's SimpleCDN ( 
http://blog.55minutes.com/2012/01/simplecdn-and-the-newly-released-fiftyfive-wicket-32/). 
Thereby I stumbled across the same obstacle as mbrictson:


Wicket does not understand scheme-less URLs that start with //. 
Fixing this would require enhancements to Wicket'sUrl, UrlRenderer, and 
perhaps other classes. You can find a closer description here: 
https://github.com/55minutes/fiftyfive-wicket/issues/35


Is there any advice in how to handle such relatives URLs using wicket-1.5.x?

Regards,

Jan


Re: Scheme-less URLs vs. UrlRenderer

2013-05-07 Thread Martin Grigorov
Hi Jan,

This has been improved in 6.7.0 -
https://issues.apache.org/jira/browse/WICKET-5065
https://github.com/apache/wicket/blob/master/wicket-core/src/test/java/org/apache/wicket/request/cycle/UrlRendererTest.java?source=c#L510-L538
Time to upgrade ;-)


On Tue, May 7, 2013 at 11:23 AM, Jan Riehn jan.ri...@1und1.de wrote:

 Hello,

 I would like to introduce a similar pattern as  fifty-five's SimpleCDN (
 http://blog.55minutes.com/**2012/01/simplecdn-and-the-**
 newly-released-fiftyfive-**wicket-32/http://blog.55minutes.com/2012/01/simplecdn-and-the-newly-released-fiftyfive-wicket-32/).
 Thereby I stumbled across the same obstacle as mbrictson:

 Wicket does not understand scheme-less URLs that start with //. Fixing
 this would require enhancements to Wicket'sUrl, UrlRenderer, and perhaps
 other classes. You can find a closer description here:
 https://github.com/55minutes/**fiftyfive-wicket/issues/35https://github.com/55minutes/fiftyfive-wicket/issues/35

 Is there any advice in how to handle such relatives URLs using
 wicket-1.5.x?

 Regards,

 Jan




-- 
Martin Grigorov
Wicket Training  Consulting
http://jWeekend.com http://jweekend.com/


Re: CheckGroup, CheckGroupSelection and Check behavior

2013-05-07 Thread David Beer

Hi Sven

Thanks for replying the table is inside a form. Here is the html snippet.

form wicket:id=form
span wicket:id=group
table style=border: 2px dotted #fc0; width: 400px; 
padding: 5px;

tr
td valign=topSelect persons/td
td

table wicket:id=persons cellspacing=0 
cellpadding=2

tr wicket:remove
tdbSelect/b/td
tdbName/b/td
tdbEmail/b/td
tdbPhone/b/td
/tr
tr wicket:remove
tdinput type=checkbox//td
tdspan[this is where name will 
be]/span/td
tdspan[this is where email will 
be]/span/td
tdspan[this is where phone will 
be]/span/td

/tr
/table
  span valign=top
  /span
/td
/tr
tr
td colspan=2 align=center
button wicket:id=submit-button 
type=submitSubmit/button

/td
/tr
/table
/span
/form

The full src can be downloaded from here 
https://dl.dropboxusercontent.com/u/1979126/Wicket-Bootstrap-DataTable.zip


Appreciate the help on this.

Thanks

David

On 06/05/13 15:53, Sven Meier wrote:
You have to wrap you whole table in a form, otherwise only the value 
of the single check is sent to the server.


Sven

On 05/06/2013 03:34 PM, David Beer wrote:

Hi All

I am trying to add Checkgroup selection behaviour to my table, this 
all works fins so far. I can use the select all and individual check 
boxes to select items. What I am trying to get is get notified when a 
selection occurs so that I can enable and or disable buttons 
depending on how many selected.


When I overide the 'protected boolean 
wantOnSelectionChangedNotifications' method the page fefreshses to a 
new version and only selects one item. Is this a known problem and 
what is the best way to find out if an item is selected so that I can 
enable the correct button?


Thanks

David

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




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




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



Re: CheckGroup, CheckGroupSelection and Check behavior

2013-05-07 Thread Sven Meier

Hi David,

the CheckGroupSelector fails to select all checks, because the first 
changed check already submits the form and then re-renders the page :(.


You can use an AjaxFormChoiceComponentUpdatingBehavior instead of 
#wantOnSelectionChangedNotifications(true).


Regards
Sven


On 05/07/2013 12:30 PM, David Beer wrote:

Hi Sven

Thanks for replying the table is inside a form. Here is the html snippet.

form wicket:id=form
span wicket:id=group
table style=border: 2px dotted #fc0; width: 400px; 
padding: 5px;

tr
td valign=topSelect persons/td
td

table wicket:id=persons cellspacing=0 
cellpadding=2

tr wicket:remove
tdbSelect/b/td
tdbName/b/td
tdbEmail/b/td
tdbPhone/b/td
/tr
tr wicket:remove
tdinput type=checkbox//td
tdspan[this is where name will 
be]/span/td
tdspan[this is where email will 
be]/span/td
tdspan[this is where phone will 
be]/span/td

/tr
/table
  span valign=top
  /span
/td
/tr
tr
td colspan=2 align=center
button wicket:id=submit-button 
type=submitSubmit/button

/td
/tr
/table
/span
/form

The full src can be downloaded from here 
https://dl.dropboxusercontent.com/u/1979126/Wicket-Bootstrap-DataTable.zip


Appreciate the help on this.

Thanks

David

On 06/05/13 15:53, Sven Meier wrote:
You have to wrap you whole table in a form, otherwise only the value 
of the single check is sent to the server.


Sven

On 05/06/2013 03:34 PM, David Beer wrote:

Hi All

I am trying to add Checkgroup selection behaviour to my table, this 
all works fins so far. I can use the select all and individual check 
boxes to select items. What I am trying to get is get notified when 
a selection occurs so that I can enable and or disable buttons 
depending on how many selected.


When I overide the 'protected boolean 
wantOnSelectionChangedNotifications' method the page fefreshses to a 
new version and only selects one item. Is this a known problem and 
what is the best way to find out if an item is selected so that I 
can enable the correct button?


Thanks

David

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




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




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




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



Re: CheckGroup, CheckGroupSelection and Check behavior

2013-05-07 Thread David Beer

Hi Sven

I understand now why the page re-renders thanks for that. This worked 
well and allows me to enable disable the buttons as needed.


Thanks

David

On 07/05/13 12:26, Sven Meier wrote:

Hi David,

the CheckGroupSelector fails to select all checks, because the first 
changed check already submits the form and then re-renders the page :(.


You can use an AjaxFormChoiceComponentUpdatingBehavior instead of 
#wantOnSelectionChangedNotifications(true).


Regards
Sven


On 05/07/2013 12:30 PM, David Beer wrote:

Hi Sven

Thanks for replying the table is inside a form. Here is the html 
snippet.


form wicket:id=form
span wicket:id=group
table style=border: 2px dotted #fc0; width: 400px; 
padding: 5px;

tr
td valign=topSelect persons/td
td

table wicket:id=persons cellspacing=0 
cellpadding=2

tr wicket:remove
tdbSelect/b/td
tdbName/b/td
tdbEmail/b/td
tdbPhone/b/td
/tr
tr wicket:remove
tdinput type=checkbox//td
tdspan[this is where name will 
be]/span/td
tdspan[this is where email will 
be]/span/td
tdspan[this is where phone will 
be]/span/td

/tr
/table
  span valign=top
  /span
/td
/tr
tr
td colspan=2 align=center
button wicket:id=submit-button 
type=submitSubmit/button

/td
/tr
/table
/span
/form

The full src can be downloaded from here 
https://dl.dropboxusercontent.com/u/1979126/Wicket-Bootstrap-DataTable.zip


Appreciate the help on this.

Thanks

David

On 06/05/13 15:53, Sven Meier wrote:
You have to wrap you whole table in a form, otherwise only the value 
of the single check is sent to the server.


Sven

On 05/06/2013 03:34 PM, David Beer wrote:

Hi All

I am trying to add Checkgroup selection behaviour to my table, this 
all works fins so far. I can use the select all and individual 
check boxes to select items. What I am trying to get is get 
notified when a selection occurs so that I can enable and or 
disable buttons depending on how many selected.


When I overide the 'protected boolean 
wantOnSelectionChangedNotifications' method the page fefreshses to 
a new version and only selects one item. Is this a known problem 
and what is the best way to find out if an item is selected so that 
I can enable the correct button?


Thanks

David

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




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




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




-
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: [wicket 6] Modal unable to see page's properties anymore ?

2013-05-07 Thread smallufo
Hi , I found no IPageReference class .
If you mean PageReference , I finally found the solution:
http://pastebin.com/bes3H9w3

Though the solution seems not so intuitional compared to wicket 1.4




2013/5/7 Martin Grigorov mgrigo...@apache.org

 Hi,

 You should not keep references to other page instances.
 Instead pass IPageReference: page.getPageReference().
 Later you can do:
 MyPage page = (MyPage) pageRef.getPage();
 page.setXyz();


 But in your case I think you should use the Session. If the login is
 successful then bind a session and set the flag. Then redirect to LoginPage
 and in its constructor check whether there is a session, and whether the
 flag is set and  redirect to the post-login page.



 On Tue, May 7, 2013 at 4:03 AM, smallufo small...@gmail.com wrote:

  I have a LoginModal which binds a LoginPage .
 
  In LoginModal.setWindowClosedCallback() method , I use
  LoginPage.isSuccessful() to judge if the user login successful.
  If login successful , I refresh the page , or do nothing.
 
  LoginModal code : http://pastebin.com/nLU2akzV
  LoginPage code : http://pastebin.com/PqfLwsNg
 
  It works in wicket 1.4 , but failed in wicket 6
 
  In LoginPage , I can see user correctly login , and the successful =
 true
  is set.
  But LoginModal can only see the old successful value (which is FALSE).
  No matter I read the property (isSuccessful() ) or through reflection
  PropertyModel :
  boolean successful = (new PropertyModelBoolean(loginPage,
 successful)).
  getObject().booleanValue();
 
  It just returns FALSE.
 
  I notice it may be page serialization problem introduced in wicket 1.5 .
  My page has an integer attached , such as /app/?1 , no matter how I
 refresh
  the page , I just see the LoginPage's isSuccessful is FALSE.
  But if I manually browse /app/ (no trailing integer) , the user is logged
  in. (I set something in the httpSession in LoginPage)
 
  I searched the maillist , try to override *isVersioned() and return
 false*,
  but everything is the same
 
  How to solve the problem , making LoginModal able to see LoginPage's
 latest
  property ?
 
  Thanks !
 



 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Migrating WebRequestCycleProcessor from 1.4.x to 6.5.0

2013-05-07 Thread Igor Vaynberg
all these things can be accomplished from inside IRequestCycleListener

-igor

On Mon, May 6, 2013 at 10:26 PM, iamrakesh iamrakes...@rediffmail.com wrote:
 Hi,

 In resolve() method we're trying to catch  handle InvalidUrlException to
 prevent exception due to multiple clicks on a button.
 In respond() method we're logging the request target
 [RequestCycle#getRequestTarget() value] and if it is of type
 AjaxRequestTarget we're trying to add components to request target which
 needs to updated on the page, this must be done just before the actual
 response is rendered.
 And in newRequestCodingStrategy() method, we're returning a custom
 implementation of
 org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy
 class. This custom implementation overrides the encodeURL() method.

 Regards,
 Rakesh.A



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Migrating-WebRequestCycleProcessor-from-1-4-x-to-6-5-0-tp4658605p4658607.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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



Re: Change signature of AbstractTree or Model.ofSet

2013-05-07 Thread Igor Vaynberg
jira ticket please. can only be fixed in 7.0

-igor

On Sun, May 5, 2013 at 5:30 AM, Илья Нарыжный phan...@ydn.ru wrote:
 Hello,

 I have following problem in wicket 6 with trees:
 Constructor of
 class org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree
 have following signature:
 protected AbstractTree(String id, ITreeProviderT provider, IModelSetT
 state)
 The problem is in IModelSetT state argument and fact that Model.ofSet
 return IModelSet? extends C, so it's not possible directly pass
 IModelSet? extends C to constructor. It seems that either Model.ofSet
 should be changed or AbstractTree.

 What do you think?

 Regards,

 Ilia

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



How to unit test AttributeModifier

2013-05-07 Thread Dmitriy Neretin
Hello,

Is it possible to unit test an AttributeModifier?

I have a simple component:

WebMarkupContainer container = new WebMarkupContainer(containerId);
container.add(new AttributeModifier(name, anyDynamicValue));

In the unit test:

WebMarkupContainer container = (WebMarkupContainer)
tester.getComponentFromLastRenderedPage(containerId);

Is it possible to get the modifier above? I can see it in the object state
(while debugging) but I have no idea how to get it to test an
anyDynamicValue...

Any ideas?

Regards,

Dmitriy


Re: How to unit test AttributeModifier

2013-05-07 Thread Igor Vaynberg
attribute modifiers are behaviors, so use
component.getbehavior(AttributeModifier.class) to get it.

-igor

On Tue, May 7, 2013 at 8:24 AM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Hello,

 Is it possible to unit test an AttributeModifier?

 I have a simple component:

 WebMarkupContainer container = new WebMarkupContainer(containerId);
 container.add(new AttributeModifier(name, anyDynamicValue));

 In the unit test:

 WebMarkupContainer container = (WebMarkupContainer)
 tester.getComponentFromLastRenderedPage(containerId);

 Is it possible to get the modifier above? I can see it in the object state
 (while debugging) but I have no idea how to get it to test an
 anyDynamicValue...

 Any ideas?

 Regards,

 Dmitriy

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



Wicket RepeatingView refresh / rerender ? Possibilities? [List items missing]

2013-05-07 Thread DaWicketUser
Hi Community,

i got a little problem with my wicket application.

The problem is on a page called OverviewPage, here are some panels like the
ListPanel, in which my RepeatingView is.

This RepeatingView (List) got some items with a button for each item, if i
press the button, i will be redirected to another page (RegistationPage) and
some changes to the RepeatingView (list) are done.

If i now navigate back to the OverviePage with the RepeatingView (list), the
list is exactly the same like before. I did changes to the list items but
they are not visible. (I did not press the browser back button, i clicked a
link of my navigation)

I know instances of wicket pages last over the session... can i tell wicket
to rerender this page / list again? what possibilities are there? can anyone
help oder give advices?

Thanks

DaWicketUser 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-RepeatingView-refresh-rerender-Possibilities-List-items-missing-tp4658623.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 RepeatingView refresh / rerender ? Possibilities? [List items missing]

2013-05-07 Thread Igor Vaynberg
repeatingviews are manual repeaters - meaning they do not get updated
once they are built.

you should most likely use a RefreshingView, or navigate back to the
page in such a way that a new instance is created which will rebuild
the repeatingview.

-igor

On Tue, May 7, 2013 at 5:59 AM, DaWicketUser d3nny...@web.de wrote:
 Hi Community,

 i got a little problem with my wicket application.

 The problem is on a page called OverviewPage, here are some panels like the
 ListPanel, in which my RepeatingView is.

 This RepeatingView (List) got some items with a button for each item, if i
 press the button, i will be redirected to another page (RegistationPage) and
 some changes to the RepeatingView (list) are done.

 If i now navigate back to the OverviePage with the RepeatingView (list), the
 list is exactly the same like before. I did changes to the list items but
 they are not visible. (I did not press the browser back button, i clicked a
 link of my navigation)

 I know instances of wicket pages last over the session... can i tell wicket
 to rerender this page / list again? what possibilities are there? can anyone
 help oder give advices?

 Thanks

 DaWicketUser



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-RepeatingView-refresh-rerender-Possibilities-List-items-missing-tp4658623.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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



custom button in tinymce

2013-05-07 Thread fachhoch
I am using wicket tinymce .I want to  add a  custom button to tinymce which I
can do using tinymce init script , i also want to  know if user clicked on
this button when the form is submitted  at the server side any suggestion on
how to ?




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/custom-button-in-tinymce-tp4658630.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: Server and client side validation

2013-05-07 Thread Gabriel Landon
Hi Cedric,

Yes I've seen what you have done.
Did you manage to make it works with forms in ModalWindow?

Regards,

Gabriel.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Server-and-client-side-validation-tp4658242p4658631.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: Introducing wicket-continuous-calendar

2013-05-07 Thread Paul Bors
I migrated my project to Wicket 6.x and as a result a new module to support
the newer version of Wicket was added for the integration of
jQuery-Continuous-Calendar with Wicket 6.x. 

Feel free to use it if you need it:
http://Wicket-Continuous-Calendar.GoogleCode.com



-
~ Thank you,
p...@bors.ws
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Introducing-wicket-continuous-calendar-tp4655896p4658632.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: Performance replace panel with AjaxLink.

2013-05-07 Thread Raul
Hello, in this project we are not using unit tests, and I can not add a
breakpoint, but I managed to narrow down the error. The call to the
constructor of the page disappears, commenting javascript call panel markup.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Performance-replace-panel-with-AjaxLink-tp4658473p4658634.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



Error in the semantics of names. AjaxLazyLoadPanel.java

2013-05-07 Thread Raul

Error in the semantics of names. AjaxLazyLoadPanel.java
I saw a little mistake semantic,:, Class AjaxLazyLoadPanel, Wicket 6.7.0
/ **
* Called When the placeholder component is Replaced with the lazy loaded
one.
*
* @ Param target
* The Ajax request handler
* @ Param component
* The lazy loaded component.
* /
protected void onComponentLoaded (Component *target*, AjaxRequestTarget
*component*)
{
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-the-semantics-of-names-AjaxLazyLoadPanel-java-tp4658635.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



[wicket 6] javascript confirmation via onPrecondition failed.

2013-05-07 Thread smallufo
I want to add a warning dialog when user clicks an ajax deleteLink
I saw the following solution:

LinkVoid deleteLink = new AjaxFallbackLinkVoid(deleteLink)
{
  @Override
  public void onClick(AjaxRequestTarget target)
  {
commentService.deleteComment(user, comment, ip);
setResponsePage(CommentsPage.class , pps);
  }

  @Override
  protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
  {
super.updateAjaxAttributes(attributes);

AjaxCallListener ajaxCallListener = new AjaxCallListener();
ajaxCallListener.onPrecondition(return confirm('Are you sure?'););
attributes.getAjaxCallListeners().add(ajaxCallListener);
  }
};
add(deleteLink);

It did popup a warning box , display Are you sure?
But no matter user clicks OK or Cancel
The comment get deleted !

What's wrong here ?

Thanks.

(wicket 6.7)