Re: Wicket 1.5 PageParameters vs IRequestParameters question.

2011-04-12 Thread Serban Balamaci
Hello Pedro,
In my mind IRequestParameters and PageParameters should have stemmed from a
common interface, extend some even generic one like(IKeyValues, IParams) but
I trust you guys see the bigger picture maybe IRequestParameters is a very
generic thing that doesn't have to mean a page's parameters.

By 
IRequestParameters interface has PageParameters correspondent API to access 
page parameters. Can be accessed like: 
RequestCycle.get().getRequest().getQueryParameters() you mean that
IRequestParameters has methods present in PageParameters? (yes I know, that
why I thought the methods could have been shared in a common interface).

If you want to recreate page parameters for some request, you can use the 
PageParametersEncoder. It seems that PageParametersEncoder handles how the
parameters are rendered in the url(declared somehow like mounting pages) and
I guess it does not have access to the original page parameters. And not all
the parameters must be cloned, some must get overwritten and reflect the new
state of the page.

What I had in the original code is that I would have a helper method:
public static PageParameters keepPageParameters(PageParameters pageParams,
String[] paramNamesToKeep) {
// iterate through pageParams and recreate those with matching names
}

and pass these parameters to bookmarkablepagelinks. I would use this method
from PageParameters coming both from super(PageParameters) and
RequestCycle.get().getPageParameters().

Now I must have two methods one that handles PageParameters and one that
handles , actually I have just  one method now
public static PageParameters keepRequestPageParameters(IRequestParameters
pageParams, String[] paramNamesToKeep) and always get my parameters from
RequestCycle.get().getRequest().getQueryParameters() not from 

but it would have been better in my opinion to have a 
public static PageParameters keepPageParameters(IParams pageParams, String[]
paramNamesToKeep) {
}

Btw does someone have a better way of keeping page parameters from one page
to another. I like the utility method that I see in the page I'm working on
what parameters I'm working with.

I have not looked upon the new request cycle, I plan to, as migration to 1.5
is triggered by the feeling that somehow stateless ajax behaviours would be
easier to implement in 1.5. My current approach to  was to have zero compile
errors and then understand what is changed internally.

Regards


-
http://balamaci.wordpress.com 
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-PageParameters-vs-IRequestParameters-question-tp3442239p3444058.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.5 PageParameters vs IRequestParameters question.

2011-04-12 Thread Martin Grigorov
Hi Serban,

Feel free to create a patch with your proposed changes (IParams) and we will
consider it.
About stateless - see https://github.com/martin-g/wicket-stateless and
https://github.com/robmcguinness/wicket-stateless
 https://github.com/robmcguinness/wicket-statelessThose are Jolira's
ported to 1.5.

To work they need a patch in o.a.wicket.Behaviors.java which looks like:
--- wicket-core/src/main/java/org/apache/wicket/Behaviors.java (revision
1091311)
+++ wicket-core/src/main/java/org/apache/wicket/Behaviors.java (working
copy)
@@ -56,6 +56,7 @@
  }

  internalAdd(behavior);
+  getBehaviorId(behavior);

but it breaks few test expectations and I haven't had time to see whether
this is harmful somehow.

On Tue, Apr 12, 2011 at 10:51 AM, Serban Balamaci serban.balam...@asf.rowrote:

 Hello Pedro,
 In my mind IRequestParameters and PageParameters should have stemmed from a
 common interface, extend some even generic one like(IKeyValues, IParams)
 but
 I trust you guys see the bigger picture maybe IRequestParameters is a very
 generic thing that doesn't have to mean a page's parameters.

 By
 IRequestParameters interface has PageParameters correspondent API to
 access
 page parameters. Can be accessed like:
 RequestCycle.get().getRequest().getQueryParameters() you mean that
 IRequestParameters has methods present in PageParameters? (yes I know, that
 why I thought the methods could have been shared in a common interface).

 If you want to recreate page parameters for some request, you can use the
 PageParametersEncoder. It seems that PageParametersEncoder handles how the
 parameters are rendered in the url(declared somehow like mounting pages)
 and
 I guess it does not have access to the original page parameters. And not
 all
 the parameters must be cloned, some must get overwritten and reflect the
 new
 state of the page.

 What I had in the original code is that I would have a helper method:
 public static PageParameters keepPageParameters(PageParameters pageParams,
 String[] paramNamesToKeep) {
 // iterate through pageParams and recreate those with matching names
 }

 and pass these parameters to bookmarkablepagelinks. I would use this method
 from PageParameters coming both from super(PageParameters) and
 RequestCycle.get().getPageParameters().

 Now I must have two methods one that handles PageParameters and one that
 handles , actually I have just  one method now
 public static PageParameters keepRequestPageParameters(IRequestParameters
 pageParams, String[] paramNamesToKeep) and always get my parameters from
 RequestCycle.get().getRequest().getQueryParameters() not from

 but it would have been better in my opinion to have a
 public static PageParameters keepPageParameters(IParams pageParams,
 String[]
 paramNamesToKeep) {
 }

 Btw does someone have a better way of keeping page parameters from one page
 to another. I like the utility method that I see in the page I'm working on
 what parameters I'm working with.

 I have not looked upon the new request cycle, I plan to, as migration to
 1.5
 is triggered by the feeling that somehow stateless ajax behaviours would be
 easier to implement in 1.5. My current approach to  was to have zero
 compile
 errors and then understand what is changed internally.

 Regards


 -
 http://balamaci.wordpress.com
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-PageParameters-vs-IRequestParameters-question-tp3442239p3444058.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 http://jweekend.com/


[1.5-RC3] AjaxLink: order of added behaviors in relation to AjaxEventBehavior

2011-04-12 Thread Gabriel Bucher
in wicket 1.4 I used an Behavior called OnClickConfirmBehavior to add a 
javascript confirm dialog:


AjaxLink link = ...
link.add( new OnClickConfirmBehavior(...) );


if I do the same in wicket 1.5-rc3, the javascript confirm dialog never 
appears.



this has to do with the order, who the behaviors are added to the link 
component:

in wicket 1.4: the AjaxEventBehavior is added in the constructor.
order of behaviors:
1) AjaxEventBehavior
2) OnClickConfirmBehavior

in wicket 1.5-rc3: the AjaxEventBehavior is added in the onInitialize 
methods... the above example results in the following order of behaviors:

1) OnClickConfirmBehavior
2) AjaxEventBehavior


is this a deliberate behavior for the AjaxLink in wicket 1.5-rc3? or 
should the AjaxEventBehavior be added in the constructor?



cheers gab





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



Re: [1.5-RC3] AjaxLink: order of added behaviors in relation to AjaxEventBehavior

2011-04-12 Thread Martin Grigorov
I moved the registration in #onInitialize() so that now it is possible to
customize the behavior if needed.
See 1.5-RC3 changelog for more details.

For your use case it is better to use AjaxLink#getAjaxCallDecorator()
instead.
override decorateScript(Component comp, String script) {
  return !confirm('Are you sure?') { + script + };
}

On Tue, Apr 12, 2011 at 11:29 AM, Gabriel Bucher
gabriel.buc...@gmail.comwrote:

 in wicket 1.4 I used an Behavior called OnClickConfirmBehavior to add a
 javascript confirm dialog:

 AjaxLink link = ...
 link.add( new OnClickConfirmBehavior(...) );


 if I do the same in wicket 1.5-rc3, the javascript confirm dialog never
 appears.


 this has to do with the order, who the behaviors are added to the link
 component:
 in wicket 1.4: the AjaxEventBehavior is added in the constructor.
 order of behaviors:
 1) AjaxEventBehavior
 2) OnClickConfirmBehavior

 in wicket 1.5-rc3: the AjaxEventBehavior is added in the onInitialize
 methods... the above example results in the following order of behaviors:
 1) OnClickConfirmBehavior
 2) AjaxEventBehavior


 is this a deliberate behavior for the AjaxLink in wicket 1.5-rc3? or should
 the AjaxEventBehavior be added in the constructor?


 cheers gab





 -
 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 http://jweekend.com/


Re: [1.5-RC3] AjaxLink: order of added behaviors in relation to AjaxEventBehavior

2011-04-12 Thread Gabriel Bucher

Hi Martin,

thanks for the hint... this way works for me too.

cheers gab


On 12/04/11 17:42, Martin Grigorov wrote:

I moved the registration in #onInitialize() so that now it is possible to
customize the behavior if needed.
See 1.5-RC3 changelog for more details.

For your use case it is better to use AjaxLink#getAjaxCallDecorator()
instead.
override decorateScript(Component comp, String script) {
   return !confirm('Are you sure?') { + script + };
}

On Tue, Apr 12, 2011 at 11:29 AM, Gabriel Bucher
gabriel.buc...@gmail.comwrote:


in wicket 1.4 I used an Behavior called OnClickConfirmBehavior to add a
javascript confirm dialog:

AjaxLink link = ...
link.add( new OnClickConfirmBehavior(...) );


if I do the same in wicket 1.5-rc3, the javascript confirm dialog never
appears.


this has to do with the order, who the behaviors are added to the link
component:
in wicket 1.4: the AjaxEventBehavior is added in the constructor.
order of behaviors:
1) AjaxEventBehavior
2) OnClickConfirmBehavior

in wicket 1.5-rc3: the AjaxEventBehavior is added in the onInitialize
methods... the above example results in the following order of behaviors:
1) OnClickConfirmBehavior
2) AjaxEventBehavior


is this a deliberate behavior for the AjaxLink in wicket 1.5-rc3? or should
the AjaxEventBehavior be added in the constructor?


cheers gab





-
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



Models in a bookmarkable page

2011-04-12 Thread Ian Marshall
I have two questions - a minor one then my main one.

Minor question
--
Am I correct that the calls

  PageParameters params = ...
  MyPage pgNext = new MyPage(PageParameters params);
  setResponsePage(pgNext);

result in the creation of a session-relative page, whereas the calls

  PageParameters params = ...
  setResponsePage(MyPage.class, params);

result in the creation of a bookmarkable page?


Main question
-
My WebPage has one Form, the model of which is wrapped in a
LoadableDetachableModel (LDM). This LDM nulls most, but not all, of its
data.

If this page is called into being in a bookmarkable way, would I be correct
to think that none of this page's LDM's data would be stored in the user's
session (in a PageMap or otherwise)?


Regards,

Ian Marshall

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Models-in-a-bookmarkable-page-tp3444176p3444176.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: Models in a bookmarkable page

2011-04-12 Thread Martin Grigorov
Hi,

See inline

On Tue, Apr 12, 2011 at 12:05 PM, Ian Marshall ianmarshall...@gmail.comwrote:

 I have two questions - a minor one then my main one.

 Minor question
 --
 Am I correct that the calls

  PageParameters params = ...
  MyPage pgNext = new MyPage(PageParameters params);
  setResponsePage(pgNext);

 result in the creation of a session-relative page, whereas the calls

Yes.


  PageParameters params = ...
  setResponsePage(MyPage.class, params);

 result in the creation of a bookmarkable page?

Yes



 Main question
 -
 My WebPage has one Form, the model of which is wrapped in a
 LoadableDetachableModel (LDM). This LDM nulls most, but not all, of its
 data.

 If this page is called into being in a bookmarkable way, would I be correct
 to think that none of this page's LDM's data would be stored in the user's
 session (in a PageMap or otherwise)?


Bookmarkable URL means that a *new* instance of the page will be loaded
every time
a request comes. I.e. completely new Form with new LDM will be created for
this new page. The old ones are not used at all.
You can transfer state only by using page parameters.



 Regards,

 Ian Marshall

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Models-in-a-bookmarkable-page-tp3444176p3444176.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 http://jweekend.com/


Custom head title on subpage

2011-04-12 Thread Tito
Hi I don't know the best way to make title of page depends on subpage.

I have a BasePage with a header, footer, etc. My concrete pages extends from
BasePage. Then I want to have different title on each page.

What do you recomend?

Thanks


Re: Custom head title on subpage

2011-04-12 Thread Michael O'Cleirigh

You can normally use wicket in the head or wicket:head sections.

I use this approach to set my page favicon (which is the link tag).

It should also work for the title tag.

e.g. put a wicket:id into the title tag in the head section of the base 
page:


html
head
title wicket:id=title/title
/head
body
wicket:child/
/body
/html

And then in your BasePage:

onInitialize() {

add (new Label(title, provideTitleModel());

}

/**
 * Let the concrete child classes provide the content for the title.
 */
protected abstract IModelStringprovideTitleModel();

Regards,

Mike

Hi I don't know the best way to make title of page depends on subpage.

I have a BasePage with a header, footer, etc. My concrete pages extends from
BasePage. Then I want to have different title on each page.

What do you recomend?

Thanks




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



Re: Custom head title on subpage

2011-04-12 Thread Tito
I like this Idea but, how do you solve language issue?
I mean, how can i do in concrete class to provide a different title
depending on language.

Now i'm working with a properties file with wicket:message key=page.title
/
Defining a properties file for every page it seems to work but it is not so
confortable.

Thanks for the answer!


2011/4/12 Michael O'Cleirigh michael.ocleir...@rivulet.ca

 You can normally use wicket in the head or wicket:head sections.

 I use this approach to set my page favicon (which is the link tag).

 It should also work for the title tag.

 e.g. put a wicket:id into the title tag in the head section of the base
 page:

 html
 head
 title wicket:id=title/title
 /head
 body
 wicket:child/
 /body
 /html

 And then in your BasePage:

 onInitialize() {

add (new Label(title, provideTitleModel());

 }

 /**
  * Let the concrete child classes provide the content for the title.
  */
 protected abstract IModelStringprovideTitleModel();

 Regards,

 Mike

  Hi I don't know the best way to make title of page depends on subpage.

 I have a BasePage with a header, footer, etc. My concrete pages extends
 from
 BasePage. Then I want to have different title on each page.

 What do you recomend?

 Thanks



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




Re: Custom head title on subpage

2011-04-12 Thread Martin Grigorov
Each sub page will do:

protected IModelStringprovideTitleModel() {
  return new ResourceModel(the.page.title.property.for.that,page)
}

On Tue, Apr 12, 2011 at 3:10 PM, Tito njyt...@gmail.com wrote:

 I like this Idea but, how do you solve language issue?
 I mean, how can i do in concrete class to provide a different title
 depending on language.

 Now i'm working with a properties file with wicket:message
 key=page.title
 /
 Defining a properties file for every page it seems to work but it is not so
 confortable.

 Thanks for the answer!


 2011/4/12 Michael O'Cleirigh michael.ocleir...@rivulet.ca

  You can normally use wicket in the head or wicket:head sections.
 
  I use this approach to set my page favicon (which is the link tag).
 
  It should also work for the title tag.
 
  e.g. put a wicket:id into the title tag in the head section of the base
  page:
 
  html
  head
  title wicket:id=title/title
  /head
  body
  wicket:child/
  /body
  /html
 
  And then in your BasePage:
 
  onInitialize() {
 
 add (new Label(title, provideTitleModel());
 
  }
 
  /**
   * Let the concrete child classes provide the content for the title.
   */
  protected abstract IModelStringprovideTitleModel();
 
  Regards,
 
  Mike
 
   Hi I don't know the best way to make title of page depends on subpage.
 
  I have a BasePage with a header, footer, etc. My concrete pages extends
  from
  BasePage. Then I want to have different title on each page.
 
  What do you recomend?
 
  Thanks
 
 
 
  -
  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 http://jweekend.com/


RE: Custom head title on subpage

2011-04-12 Thread Wilhelmsen Tor Iver
 I mean, how can i do in concrete class to provide a different title
 depending on language.

Your title model class could check Session.get().getLocale() to decide what 
text to return from getObject().

- Tor Iver

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



IE8 + No Page found for component

2011-04-12 Thread Tejash Tarun
Hi,

I am using tabs in my page.

When switching between the tabs I get this exception frequently (and not
every time).

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = link]]
at org.apache.wicket.Component.getPage(Component.java:1819)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:284)

...


Previously I faced the problem of difference of client-side state and
server-side state with chrome and got a fix implementing the solution at
this link:
http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/

But now I see the simple switching between the tabs in IE8 gives me the
problem.

OS used: Windows7
Browser: IE8

Seeking help.

Thanks in advance,
Tejash


Re: Models in a bookmarkable page

2011-04-12 Thread Ian Marshall
Thank you, Martin. That's just what I wanted to know.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Models-in-a-bookmarkable-page-tp3444176p3444612.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: Custom head title on subpage

2011-04-12 Thread sonxurxo
What about using Page#getString(String key) method? If you have your
.properties files with language suffixes (e.g. MyPage_en.properties,
MyPage_es.properties, MyPage_fr.properties) Wicket will automatically
retrieve the String resource from the properties file of the session
language.

-
http://blog.sonxurxo.com
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-head-title-on-subpage-tp381p3444664.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: IE8 + No Page found for component

2011-04-12 Thread Thierry Peng

On 04/12/2011 03:20 PM, Tejash Tarun wrote:

Hi,

I am using tabs in my page.

When switching between the tabs I get this exception frequently (and not
every time).

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = link]]
at org.apache.wicket.Component.getPage(Component.java:1819)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:284)

...


Previously I faced the problem of difference of client-side state and
server-side state with chrome and got a fix implementing the solution at
this link:
http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/

But now I see the simple switching between the tabs in IE8 gives me the
problem.

OS used: Windows7
Browser: IE8

Seeking help.

Thanks in advance,
Tejash


that's most probably a problem with the component hierarchy.

If you call getPage() on a component that is (not yet or not anymore) 
added to another component this exception happens.


A possible Condition can be:

someSubmitMethod(ajaxtarget target){
if(someLogicDecides())
{
this.addOrReplace(new OtherPanel())
target.addComponent(getPage()); //= this getPage() cannot succeed
}
}

this may be not your case but there are many similar conditions with 
replace mechanism where this may happen. Look for replace mechanism and 
check them.


greetings

thierry

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



Re: IE8 + No Page found for component

2011-04-12 Thread Thierry Peng

On 04/12/2011 04:36 PM, Thierry Peng wrote:

On 04/12/2011 03:20 PM, Tejash Tarun wrote:

Hi,

I am using tabs in my page.

When switching between the tabs I get this exception frequently (and not
every time).

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = link]]
at org.apache.wicket.Component.getPage(Component.java:1819)
at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:284) 



...


Previously I faced the problem of difference of client-side state and
server-side state with chrome and got a fix implementing the solution at
this link:
http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/ 



But now I see the simple switching between the tabs in IE8 gives me the
problem.

OS used: Windows7
Browser: IE8

Seeking help.

Thanks in advance,
Tejash


that's most probably a problem with the component hierarchy.

If you call getPage() on a component that is (not yet or not anymore) 
added to another component this exception happens.


A possible Condition can be:

someSubmitMethod(ajaxtarget target){
if(someLogicDecides())
{
this.addOrReplace(new OtherPanel())
target.addComponent(getPage()); //= this getPage() cannot succeed
}
}

this may be not your case but there are many similar conditions with 
replace mechanism where this may happen. Look for replace mechanism 
and check them.


greetings

thierry

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


correction:

someSubmitMethod(ajaxtarget target){
if(someLogicDecides())
{
this.replaceWith(new OtherPanel())
target.addComponent(getPage()); //= this getPage() cannot succeed
}
}

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



Re: Custom head title on subpage

2011-04-12 Thread Tito
Thank you everybody.

I think it could be solve with .properties hierarchy in that case. I don't
have to use java code and just redifining page.title property for every page
it should work.

I thought perhaps wicket had something like a page template that i could
override in html concrete page.

Tito

2011/4/12 sonxurxo sonxu...@gmail.com

 What about using Page#getString(String key) method? If you have your
 .properties files with language suffixes (e.g. MyPage_en.properties,
 MyPage_es.properties, MyPage_fr.properties) Wicket will automatically
 retrieve the String resource from the properties file of the session
 language.

 -
 http://blog.sonxurxo.com
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Custom-head-title-on-subpage-tp381p3444664.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: [1.5-RC3] AjaxLink: order of added behaviors in relation to AjaxEventBehavior

2011-04-12 Thread Igor Vaynberg
we should probably make the ajax behavior append to the attribute
instead of overriding it...

-igor

On Tue, Apr 12, 2011 at 2:42 AM, Martin Grigorov mgrigo...@apache.org wrote:
 I moved the registration in #onInitialize() so that now it is possible to
 customize the behavior if needed.
 See 1.5-RC3 changelog for more details.

 For your use case it is better to use AjaxLink#getAjaxCallDecorator()
 instead.
 override decorateScript(Component comp, String script) {
  return !confirm('Are you sure?') { + script + };
 }

 On Tue, Apr 12, 2011 at 11:29 AM, Gabriel Bucher
 gabriel.buc...@gmail.comwrote:

 in wicket 1.4 I used an Behavior called OnClickConfirmBehavior to add a
 javascript confirm dialog:

 AjaxLink link = ...
 link.add( new OnClickConfirmBehavior(...) );


 if I do the same in wicket 1.5-rc3, the javascript confirm dialog never
 appears.


 this has to do with the order, who the behaviors are added to the link
 component:
 in wicket 1.4: the AjaxEventBehavior is added in the constructor.
 order of behaviors:
 1) AjaxEventBehavior
 2) OnClickConfirmBehavior

 in wicket 1.5-rc3: the AjaxEventBehavior is added in the onInitialize
 methods... the above example results in the following order of behaviors:
 1) OnClickConfirmBehavior
 2) AjaxEventBehavior


 is this a deliberate behavior for the AjaxLink in wicket 1.5-rc3? or should
 the AjaxEventBehavior be added in the constructor?


 cheers gab





 -
 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 http://jweekend.com/


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



Re: IE8 + No Page found for component

2011-04-12 Thread Igor Vaynberg
check your log for serialization errors.

-igor


On Tue, Apr 12, 2011 at 6:20 AM, Tejash Tarun ttej...@educator.eu wrote:
 Hi,

 I am using tabs in my page.

 When switching between the tabs I get this exception frequently (and not
 every time).

 java.lang.IllegalStateException: No Page found for component
 [MarkupContainer [Component id = link]]
 at org.apache.wicket.Component.getPage(Component.java:1819)
 at
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:284)

 ...


 Previously I faced the problem of difference of client-side state and
 server-side state with chrome and got a fix implementing the solution at
 this link:
 http://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/

 But now I see the simple switching between the tabs in IE8 gives me the
 problem.

 OS used: Windows7
 Browser: IE8

 Seeking help.

 Thanks in advance,
 Tejash


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



Re: Custom head title on subpage

2011-04-12 Thread Igor Vaynberg
My book had a recipe for a flexible solution for managing the page
title, and as luck would have it its in the chapter that was made
available for free:
http://www.packtpub.com/sites/default/files/downloads/1605_Chapter12.pdf

-igor


On Tue, Apr 12, 2011 at 7:40 AM, Tito njyt...@gmail.com wrote:
 Thank you everybody.

 I think it could be solve with .properties hierarchy in that case. I don't
 have to use java code and just redifining page.title property for every page
 it should work.

 I thought perhaps wicket had something like a page template that i could
 override in html concrete page.

 Tito

 2011/4/12 sonxurxo sonxu...@gmail.com

 What about using Page#getString(String key) method? If you have your
 .properties files with language suffixes (e.g. MyPage_en.properties,
 MyPage_es.properties, MyPage_fr.properties) Wicket will automatically
 retrieve the String resource from the properties file of the session
 language.

 -
 http://blog.sonxurxo.com
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Custom-head-title-on-subpage-tp381p3444664.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: Custom head title on subpage

2011-04-12 Thread Tito
Thank you Igor, I'm reading this now.

Tito

2011/4/12 Igor Vaynberg igor.vaynb...@gmail.com

 My book had a recipe for a flexible solution for managing the page
 title, and as luck would have it its in the chapter that was made
 available for free:
 http://www.packtpub.com/sites/default/files/downloads/1605_Chapter12.pdf

 -igor


 On Tue, Apr 12, 2011 at 7:40 AM, Tito njyt...@gmail.com wrote:
  Thank you everybody.
 
  I think it could be solve with .properties hierarchy in that case. I
 don't
  have to use java code and just redifining page.title property for every
 page
  it should work.
 
  I thought perhaps wicket had something like a page template that i could
  override in html concrete page.
 
  Tito
 
  2011/4/12 sonxurxo sonxu...@gmail.com
 
  What about using Page#getString(String key) method? If you have your
  .properties files with language suffixes (e.g. MyPage_en.properties,
  MyPage_es.properties, MyPage_fr.properties) Wicket will automatically
  retrieve the String resource from the properties file of the session
  language.
 
  -
  http://blog.sonxurxo.com
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Custom-head-title-on-subpage-tp381p3444664.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: link within modal window should reload parent page

2011-04-12 Thread MZemeck
The only thing that comes to mind is storing a flag in session.  Or 
perhaps if you are updating you datastore when the link is clicked you 
could check there.  Not the best solution in my mind, if you find 
something else let me know...




From:   hrbaer herber.m...@gmail.com
To: users@wicket.apache.org
Date:   04/11/2011 05:03 PM
Subject:Re: link within modal window should reload parent page



ok - I just realised that the WindowCloseCallback method gets triggered if 
a
user clicks on the link but also if he wants to close the popup. That's 
not
that good :(
Is there a chance to differ whether the user uses the link or just click 
on
the x button to close the popup?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/link-within-modal-window-should-reload-parent-page-tp3437508p3443126.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






Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Re: Apache Wicket Cookbook Published!

2011-04-12 Thread Marco Springer
Just a general question about packthub...

I've ordered the printed version on the 26th of March, from the
Netherlands, but I haven't received it yet.

Did someone else also order the printed version? If so, did you
receive it yet or should I be worried now ;-)

Cheers,

Marco

On 2 April 2011 03:24, shetc sh...@bellsouth.net wrote:
 Yippee! My book has arrived.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3421473.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: Apache Wicket Cookbook Published!

2011-04-12 Thread Don Ferguson
It seemed to take forever (a few weeks) to get mine.  The PDF came right away 
tho.

On Apr 12, 2011, at 12:01 PM, Marco Springer wrote:

 Just a general question about packthub...
 
 I've ordered the printed version on the 26th of March, from the
 Netherlands, but I haven't received it yet.
 
 Did someone else also order the printed version? If so, did you
 receive it yet or should I be worried now ;-)
 
 Cheers,
 
 Marco
 
 On 2 April 2011 03:24, shetc sh...@bellsouth.net wrote:
 Yippee! My book has arrived.
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3421473.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
 


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



CryptedUrlWebRequestCodingStrategy and bookmarkable pages

2011-04-12 Thread Vitaly Tsaplin
Hi everyone,

I am using CryptedUrlWebRequestCodingStrategy to encode urls. I also
put an instance of BookmarkablePageLink on my page and the link that
has been generated by this is NOT bookmarkable. What's wrong I am
doing? Do I always have to mount my page as bookmarkable?

Best regards,
Vitaly

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



Re: Apache Wicket Cookbook Published!

2011-04-12 Thread Tomasz Dziurko
I ordered my copy to Poland almost two weeks ago and still no printed
version :/ But PDF on my Kindle is working fine :)

-- 
Best regards / Pozdrawiam,
Tomasz Dziurko
www.tomaszdziurko.pl
 http://www.programatico.pl/


Form Submission of Disabled-Selected Fields Not Working

2011-04-12 Thread eugenebalt
I ran into a problem which could be a bug.

I have a field on the form which is disabled (a disabled
CheckBoxMultipleChoice). However, one item in that field is pre-selected, so
it's a Disabled+Selected situation.

There is another Ajax fields that does a target.addComponent() of this
CheckBoxMultipleChoice, but does NOT change the model in any way. The
CheckBoxMultipleChoice's model should remain the same.

When the form is submitted in onSubmit(), I get NULLs from getInput(),
getValue(), and getModelObject() on that disabled CheckBoxMultipleChoice
when the Ajax component is altered in any way. As I said, there should not
be any changes to the CheckBoxMultipleChoice's model, because I don't do a
setModel(..) anywhere. What I expect to get is a Model holding the
pre-selected disabled item, which was the case prior to Form.onSubmit(). It
should be the initial pre-selections which should not have been erased.

If I don't touch the Ajax component, then it's fine, I get the correct
selection from retrieving the model of my disabled CheckBoxMultipleChoice.

Any thoughts appreciated. Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-Submission-of-Disabled-Selected-Fields-Not-Working-tp3445600p3445600.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: Apache Wicket Cookbook Published!

2011-04-12 Thread splitshade
I Got mine today, 

well done and thank you for all the great work!

Regards

Martin

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3445604.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: Apache Wicket Cookbook Published!

2011-04-12 Thread andrea del bene
You are in good company :-). I've ordered my copy on 31 March and I 
still waiting patiently for it.


@Martijn
Nice pic :-)!

Just a general question about packthub...

I've ordered the printed version on the 26th of March, from the
Netherlands, but I haven't received it yet.

Did someone else also order the printed version? If so, did you
receive it yet or should I be worried now ;-)

Cheers,

Marco

On 2 April 2011 03:24, shetcsh...@bellsouth.net  wrote:

Yippee! My book has arrived.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3421473.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





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



[ANN] Plugin WicketForge 0.9.2 available for IDEA 9+

2011-04-12 Thread Minas Manthos
Recent change notes:

0.9.2
-Fixed: gutter jitter [Defect 77]
-Fixed: Repeated F4 from class needs me to move cursor [Defect 62]
-Fixed: WicketForge does not recognize FormComponentPanel as a Panel [Defect
70]
-Fixed: Border hierarchy not recognised [Enhancement 68]
-Minor changes

0.9.1
-Fixed: Exception on ListView.populateItem() of inner classes. [Defect 67]
-Fixed: Typo 'Auth Roles'. [Defect 66]
-Added: Hitting 'Wicket Java/HTML Toggle' offers to create markup if not
present. [Enhancement 64]
-Minor changes

* rate this plugin at http://plugins.intellij.net/plugin/?id=1545 ;-)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ANN-Plugin-WicketForge-0-9-2-available-for-IDEA-9-tp3445657p3445657.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: Apache Wicket Cookbook Published!

2011-04-12 Thread Nivedan Nadaraj
Great stuff! Will get a copy!

Cheers
Niv

On Sat, Mar 26, 2011 at 1:52 AM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 Congrats.

 I trust Igor

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Friday, March 25, 2011 1:44 PM
 To: users@wicket.apache.org; d...@wicket.apache.org;
 annou...@wicket.apache.org
 Subject: Apache Wicket Cookbook Published!

 For the past nine months I have been quietly working on a book about
 Wicket. Unlike other books on the market this one does not attempt to
 teach you Wicket from the ground up. Instead, it is for developers who
 already know the basics and want to learn how to implement some of the
 more advanced use cases. Essentially, it contains recipes that show the
 reader how to implement solutions to some of, what I think are, the most
 commonly asked questions and stumbling blocks. This morning I was
 informed that the book has been published! You can read more about it
 and pick up a copy on PACKT's Site[1]. I hope you enjoy it, more details
 below...

 [1] https://www.packtpub.com/apache-wicket-cookbook/book

 ## Description ##

 Apache Wicket is one of the most famous Java web application frameworks.
 Wicket simplifies web development and makes it fun. Are you bored of
 going through countless pages of theory to find out how to get your web
 development done? With this book in hand, you don't need to go through
 hundreds of pages to figure out how you will actually build a web
 application. You will get practical solutions to your common everyday
 development tasks to pace up your development activities.

 Apache Wicket Cookbook provides you with information that gets your
 problems solved quickly without beating around the bush. This book is
 perfect for you if you are ready to take the next step from tutorials
 and step into the practical world. It will take you beyond the basics of
 using Apache Wicket and show you how to leverage Wicket's advanced
 features to create simpler and more maintainable solutions to what at
 first may seem complex problems.

 You will learn how to integrate with client-side technologies such as
 JavaScript libraries or Flash components, which will help you to build
 your application faster. You will discover how to use Wicket paradigms
 to factor out commonly used code into custom Components, which will
 reduce the maintenance cost of your application, and how to leverage the
 existing Wicket Components to make your own code simpler.

 A straightforward Cookbook with highly focused practical recipes to make
 your web application development easier with the Wicket web framework

 ## What you will learn from this book ##

 * Leverage Wicket to implement a wide variety of both simple and
 advanced use cases in a narrative that gets straight to the point
 * Make forms work in the crazy world of the Web by learning the ways of
 Wicket's form processing
 * Simplify localizing your Wicket applications
 * Take the boring out of your forms by discovering how to improve the
 user experience while simplifying your code at the same time
 * Leverage the built-in Table component to make displaying tabular data
 a snap
 * Think Wicket's Borders are not very useful? Learn to use them in
 unexpected places to simplify things
 * See how to integrate with Flash components and create interactive
 charts at the same time
 * Web 1.0 too boring? Learn how to tame Wicket's AJAX support and bring
 your application into Web 2.0
 * Simplify your security code by learning various security techniques
 * An application cannot be built with Wicket alone; see how to make it
 play nice with other frameworks

 ## Approach ##

 This is a hands-on practical guide to a large variety of topics and use
 cases. This book tries to use real-world examples when possible, but is
 not afraid to come up with a contrived pretext if it makes explaining
 the problem simpler. Unlike a lot of other books, this one does not try
 to maintain a continuous theme from chapter to chapter, such as
 demonstrating solutions on the same fictional application; doing so
 would be almost impossible given the wide variety of recipes presented
 here. Instead, this book concentrates on focused problems users are
 likely to encounter and shows clear solutions in a step-by-step manner.
 This book tries to teach by example and is not afraid to show a lot of
 code because, after all, it is for coders.

 ## Who this book is written for ##

 This book is for current users of the Apache Wicket framework; it is not
 an introduction to Wicket that will bore you with tons of theory.
 You are expected to have built or maintained a simple Wicket application
 in the past and to be looking to learn new and better ways of using
 Wicket. If you are ready to take your Wicket skills to the next level
 this book is for you.

 Cheers, and I hope you enjoy the book!
 -Igor

 -
 To unsubscribe,