Re: Problem with Android and ajax?

2011-08-26 Thread Martin Grigorov
You can also try at http://wicketstuff.org/wicket14/ajax/choice
I just updated it to 1.4.18.

On Thu, Aug 25, 2011 at 10:21 PM, Pedro Santos pedros...@gmail.com wrote:
 Hi Palmer, it is possible related to
 https://issues.apache.org/jira/browse/WICKET-3820 , upgrade to 1.4.18

 2011/8/25 PALMER, THOMAS C (ATTCORP) tp3...@att.com

 We have a problem with a mobile site on an Android.  Basically, we're
 updating select options via ajax with one option that should be selected
 after the update completes.  On an iPhone this works fine and the selected
 option shows in the list as selected.  On Android we get nothing in the
 dropdown at all until the page is refreshed (reloading the complete state).

 The Android user agent we're seeing (Mozilla/5.0 (Linux; U; Android
 2.1-update1; en-us; HTC-A6366/1.0 Build/ERE27) AppleWebKit/530.17 (KHTML,
 like Gecko) Version/4.0 Mobile Safari/530.17) will be treated as Safari
 based on the browser recognition code in wicket-event.js.  It appears the
 code in wicket-ajax.js in Wicket.replaceOuterHtmlSafari isn't doing the
 right thing for Android, despite them both being Webkit based.

 Any thoughts on a way to address this?  This is wicket 1.4.14.

 Thanks much -

 Tom Palmer
 Director, Strategic Technology Services
 ATT Hosting  Application Services | 2000 Perimeter Park Drive, Suite 140
 | Morrisville, NC 27560
 Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431
 thomas.pal...@att.commailto:thomas.pal...@att.com

 Confidentiality Notice and Disclaimer: This e-mail transmission may contain
 confidential and/or proprietary information of ATT that is intended only
 for the individual or entity named in the e-mail address. If you are not the
 intended recipient, you are hereby notified that any disclosure, copying,
 distribution, or reliance upon the contents of this e-mail is strictly
 prohibited. If you have received this e-mail transmission in error, please
 reply to the sender, so that ATT can arrange for proper delivery, and then
 please delete the message from your inbox. Thank you.




 --
 Pedro Henrique Oliveira dos Santos




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



How to override SignInPanel's error messages.

2011-08-26 Thread Florian B.
I'm using the SignInPanel on my web application and it works quite well. The
only thing I want to change are the error message which got rendered to the
feedback panel when no login or password is entered. 

The error message is not really nice at is contains the internal name of the
text field that is empty which the user is not aware of. So some how
changing it from Field 'password' is required. to Please enter a
password. would be great. 

Changing the error message for a log in failure was quite easy. I simply
added a new entry 'signInFailed' in the properties file of my log in page.

Is there a way to do this also for the missing values? Or do I have to
implement a custom SignInPanel?






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-SignInPanel-s-error-messages-tp3770610p3770610.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: Feedback panel don't show messages of child component

2011-08-26 Thread Florian B.
No I'm not doing any ajax on this page. 

I got it somehow working that the feedback panel show info messages form the
ActionPanels constructor but the error messages after the delete button was
pressed are still not shown. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Feedback-panel-don-t-show-messages-of-child-component-tp3759993p3770617.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: How to override SignInPanel's error messages.

2011-08-26 Thread Florian B.
I finally solved my problem perhaps it's not the best way but it works for
me. 

After digging in the sources of the SignInPanel I figured out the following.
setRequired() is always called in the constructor of a PasswortTextField.
setRequired() is a method of the FormComponent class which has also a method
reportRequiredError() that writes the error message.  In the implementation
of the method you can see that the resource key for the required error
message is Required. So I simply override this key in the properties file
of my login page and it worked perfectly. 

private void reportRequiredError()
{
error(new ValidationError().addMessageKey(Required));
}

I know it is not the best solution as this will override the required error
message of any other FormComponent object on the login page on which
setRequired(true) was called. But as the SignInForm is the only Form on my
login page this is ok for me. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-SignInPanel-s-error-messages-tp3770610p3770703.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: How to override SignInPanel's error messages.

2011-08-26 Thread Martin Grigorov
enable DEBUG logging of Localizer class and you'll see what resource
keys are attempted
this way you'll see that you can use myFormComponentId.Required=
and it will be used just for the component with id
myFormComponentId, all other will still use 'Required'.

On Fri, Aug 26, 2011 at 3:18 PM, Florian B. florian.bernst...@gmail.com wrote:
 I finally solved my problem perhaps it's not the best way but it works for
 me.

 After digging in the sources of the SignInPanel I figured out the following.
 setRequired() is always called in the constructor of a PasswortTextField.
 setRequired() is a method of the FormComponent class which has also a method
 reportRequiredError() that writes the error message.  In the implementation
 of the method you can see that the resource key for the required error
 message is Required. So I simply override this key in the properties file
 of my login page and it worked perfectly.

 private void reportRequiredError()
 {
    error(new ValidationError().addMessageKey(Required));
 }

 I know it is not the best solution as this will override the required error
 message of any other FormComponent object on the login page on which
 setRequired(true) was called. But as the SignInForm is the only Form on my
 login page this is ok for me.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-override-SignInPanel-s-error-messages-tp3770610p3770703.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: How to override SignInPanel's error messages.

2011-08-26 Thread Florian B.
A great, that's even better!

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-SignInPanel-s-error-messages-tp3770610p3770720.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: Login page hangs after custom page-expired error page

2011-08-26 Thread Bruno Borges
I think you must set your page as error page.

Make that change and try again.

*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Fri, Aug 26, 2011 at 1:27 AM, Scott Reed sr...@avacoda.com wrote:

 A created my own PageExpiredErrorPage. There is a button that is supposed
 to take the user to the login page so they can log in (similar to the button
 on the default page-expired error page). /
 /
 When the user first opens the web site, they see a log in page with URL
 /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
 com.mni.SignInPage?1/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/.
 http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.**
 SignInPage?1http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1
 

 *Default PageExpiredErrorPage behavior*
 After there is a page timeout and the /default /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
http://mydomain.com/rems/**wicket// http://mydomain.com/rems/wicket//
 .

 When the user selects that button they go to the login page with address /
http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
 com.mni.SignInPage?0http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
 /*and it goes to the home page as expected/desired when the user logs in.*/

 /*My custom page-expired error page behavior*/
 /After there is a page timeout and the /custom /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
 //http://mydomain.com/rems/**wicket// http://mydomain.com/rems/wicket//

 When the user selects that button they go to the login page with address
 /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
 com.mni.REMSPageExpiredPage#..**/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../..

 /*and it hangs when the user logs in*/./

 *custom page-expired error page HTML
 *

   body
   pThe page you requested has expired./p
   pa wicket:id=homeLinkReturn to home page/a/p
   /body

 *
 Java:
 *

   public class MyPageExpiredPage extends WebPage
   {
  public MyPageExpiredPage()
  {
super();

// link for home page btn
// WebPage#homePageLink returns a BookmarkablePageLink
add( homePageLink(homeLink));
  }
   }

 I would very much appreciate any assistance with this.
  Scott




Re: Book covering 1.5

2011-08-26 Thread nino martinez wael
We are running a couple of products on 1.5 and are having no problems.
I'd say go ahead and migrate now. Then you'll probably be ready for
when 1.5 are released depending on project complexity. Although afaik
it was not so hard to go from 1.4 - 1.5 will be a little harder going
from 1.3 to 1.5..

regards Nino

2011/8/25 Martijn Dashorst martijn.dasho...@gmail.com:
 On Thu, Aug 25, 2011 at 9:15 AM, Douglas Ferguson the...@gmail.com wrote:
 I remember from a few years ago that 1.5 is going to be a non trivial change 
 in architecture. Are there any
 docs available that explain how to migrate or what the differences are?

 http://lmgtfy.com/?q=wicket+1.5+migrationl=1

 Actually, now that I type this I remember Igor saying that migration may not 
 be advised..

 That would be while 1.5 is in development. Now that we are near 1.5
 final, migration will be advised as we will start development for 1.6
 soonish say when 1.5.1 or 1.5.2 is out, and then stop active 1.4
 support (we can only actively support so many versions).

 Martijn

 -
 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: Book covering 1.5

2011-08-26 Thread Martin Grigorov
There are few articles about the new request processing architecture
and mounting of pages and resources at http://wicketinaction.com.
I'm planning to add another for the new event mechanism soon.

On Wed, Aug 24, 2011 at 7:34 PM, Fabian Schwarzer
fabian.schwar...@gmx.de wrote:
 Hi!

 Does anyone know if there is anyone out there writing a book covering the 
 upcoming Wicket release 1.5?
 Or is e.g. Wicket in Action planing a new edition?

 Thanks,
 Fabian
 -
 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



Cannot go to homepage from custom page expired error page

2011-08-26 Thread Scott Reed

My apologies. I am reposting this without the distracting pseudo-formatting.

I created my own PageExpiredErrorPage. There is a button that is 
supposed to take the user to the login page so they can log in (just 
like the button on the default page-expired error page). /

/
When the user first opens the web site, they see a log in page with URL
/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/.
http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1.
Default PageExpiredErrorPage behavior
After there is a page timeout and the /default /page-expired error page 
opens, the Return to home page button on the default page expired 
error page reports URL /

http://mydomain.com/rems/wicket//.

When the user selects that button they go to the login page with address /
http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
/and it goes to the home page as expected/desired when the user logs in./

/My custom page-expired error page behavior/
/After there is a page timeout and the /custom /page-expired error page 
opens, the Return to home page button on the default page expired 
error page reports URL /

//http://mydomain.com/rems/wicket//

When the user selects that button they go to the login page with address
/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../.. 


/and it hangs when the user logs in/./

custom page-expired error page HTML

   body
   h3Page Expired/h3
   pThe page you requested has expired./p
   pa wicket:id=homeLinkReturn to home page/a/p
   /body


Java:

   public class MyPageExpiredPage extends WebPage
   {
  public MyPageExpiredPage()
  {
super();

// link for home page btn
// WebPage#homePageLink returns a BookmarkablePageLink
add( homePageLink(homeLink));
  }
   }





Re: Login page hangs after custom page-expired error page

2011-08-26 Thread Scott Reed
Thanks, Bruno. I added isErrorPage() just in case. The docs just say 
This can help the framework prevent infinite failure loops. That's 
also not mentioned in Wicket in Action which says creating an error 
page is no different than creating a normal page.

  Scott

On 8/26/2011 9:15 AM, Bruno Borges wrote:

I think you must set your page as error page.

Make that change and try again.

*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com  wrote:


A created my own PageExpiredErrorPage. There is a button that is supposed
to take the user to the login page so they can log in (similar to the button
on the default page-expired error page). /
/
When the user first opens the web site, they see a log in page with URL
/http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
com.mni.SignInPage?1/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/.
http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.**
SignInPage?1http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1
*Default PageExpiredErrorPage behavior*
After there is a page timeout and the /default /page-expired error page
opens, the Return to home page button on the default page expired error
page reports URL /
http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//
.

When the user selects that button they go to the login page with address /
http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
com.mni.SignInPage?0http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
/*and it goes to the home page as expected/desired when the user logs in.*/

/*My custom page-expired error page behavior*/
/After there is a page timeout and the /custom /page-expired error page
opens, the Return to home page button on the default page expired error
page reports URL /
//http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//

When the user selects that button they go to the login page with address
/http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
com.mni.REMSPageExpiredPage#..**/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../..

/*and it hangs when the user logs in*/./

*custom page-expired error page HTML
*

   body
   pThe page you requested has expired./p
   pa wicket:id=homeLinkReturn to home page/a/p
   /body

*
Java:
*

   public class MyPageExpiredPage extends WebPage
   {
  public MyPageExpiredPage()
  {
super();

// link for home page btn
// WebPage#homePageLink returns a BookmarkablePageLink
add( homePageLink(homeLink));
  }
   }

I would very much appreciate any assistance with this.
  Scott




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



Re: Login page hangs after custom page-expired error page

2011-08-26 Thread Martin Grigorov
actually #isErrorPage() is not used in current 1.5, so WIA is correct

On Fri, Aug 26, 2011 at 6:15 PM, Scott Reed sr...@avacoda.com wrote:
 Thanks, Bruno. I added isErrorPage() just in case. The docs just say This
 can help the framework prevent infinite failure loops. That's also not
 mentioned in Wicket in Action which says creating an error page is no
 different than creating a normal page.
  Scott

 On 8/26/2011 9:15 AM, Bruno Borges wrote:

 I think you must set your page as error page.

 Make that change and try again.

 *Bruno Borges*
 (21) 7672-7099
 *www.brunoborges.com*



 On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com  wrote:

 A created my own PageExpiredErrorPage. There is a button that is supposed
 to take the user to the login page so they can log in (similar to the
 button
 on the default page-expired error page). /
 /
 When the user first opens the web site, they see a log in page with URL
 /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.SignInPage?1/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/.
 http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.**

 SignInPage?1http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1
 *Default PageExpiredErrorPage behavior*
 After there is a page timeout and the /default /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
    http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//
 .

 When the user selects that button they go to the login page with address
 /
    http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.SignInPage?0http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
 /*and it goes to the home page as expected/desired when the user logs
 in.*/

 /*My custom page-expired error page behavior*/
 /After there is a page timeout and the /custom /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
 //http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//

 When the user selects that button they go to the login page with address
 /    http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.REMSPageExpiredPage#..**/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../..

 /*and it hangs when the user logs in*/./

 *custom page-expired error page HTML
 *

   body
   pThe page you requested has expired./p
   pa wicket:id=homeLinkReturn to home page/a/p
   /body

 *
 Java:
 *

   public class MyPageExpiredPage extends WebPage
   {
      public MyPageExpiredPage()
      {
        super();

        // link for home page btn
        // WebPage#homePageLink returns a BookmarkablePageLink
        add( homePageLink(homeLink));
      }
   }

 I would very much appreciate any assistance with this.
  Scott



 -
 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: Login page hangs after custom page-expired error page

2011-08-26 Thread Igor Vaynberg
can we remove it then?

-igor

On Fri, Aug 26, 2011 at 8:19 AM, Martin Grigorov mgrigo...@apache.org wrote:
 actually #isErrorPage() is not used in current 1.5, so WIA is correct

 On Fri, Aug 26, 2011 at 6:15 PM, Scott Reed sr...@avacoda.com wrote:
 Thanks, Bruno. I added isErrorPage() just in case. The docs just say This
 can help the framework prevent infinite failure loops. That's also not
 mentioned in Wicket in Action which says creating an error page is no
 different than creating a normal page.
  Scott

 On 8/26/2011 9:15 AM, Bruno Borges wrote:

 I think you must set your page as error page.

 Make that change and try again.

 *Bruno Borges*
 (21) 7672-7099
 *www.brunoborges.com*



 On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com  wrote:

 A created my own PageExpiredErrorPage. There is a button that is supposed
 to take the user to the login page so they can log in (similar to the
 button
 on the default page-expired error page). /
 /
 When the user first opens the web site, they see a log in page with URL
 /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.SignInPage?1/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/.
 http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.**

 SignInPage?1http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1
 *Default PageExpiredErrorPage behavior*
 After there is a page timeout and the /default /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
    http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//
 .

 When the user selects that button they go to the login page with address
 /
    http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.SignInPage?0http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
 /*and it goes to the home page as expected/desired when the user logs
 in.*/

 /*My custom page-expired error page behavior*/
 /After there is a page timeout and the /custom /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
 //http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//

 When the user selects that button they go to the login page with address
 /    http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.REMSPageExpiredPage#..**/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../..

 /*and it hangs when the user logs in*/./

 *custom page-expired error page HTML
 *

   body
   pThe page you requested has expired./p
   pa wicket:id=homeLinkReturn to home page/a/p
   /body

 *
 Java:
 *

   public class MyPageExpiredPage extends WebPage
   {
      public MyPageExpiredPage()
      {
        super();

        // link for home page btn
        // WebPage#homePageLink returns a BookmarkablePageLink
        add( homePageLink(homeLink));
      }
   }

 I would very much appreciate any assistance with this.
  Scott



 -
 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



communication between Page instances on Wicket 1.5

2011-08-26 Thread Sander Plas
I tried this on IRC first, but it seems that everybody is busy over 
there so i thought i'd try it here :)


It seems that in wicket 1.5, the only way to let 2 Pages (for example, a 
page in a modal window + the page that opened that modal window) 
communicate with each other (call each others methods, send 
intercomponent events, etc.) is via a PageReference.


If i dont use PageReference but just the Page instances themselves it 
seems like there are 2 versions of the same page: changes made by the 
popup page to the main page are lost by the time the 
WindowClosedCallback.onClose() gets called. I found this out when i was 
trying to create a simple yes/no dialog.


Is this the way it is supposed to be?

In 1.4 page objects could communicate directly with each other.

I'm not saying this is a bad thing, just wondering wether this is the 
intended behaviour, and if it is, if this shouldn't be documented in the 
1.5 migration guide.. and/or other places?


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



Possible fix for linking to home page from page-expired page?

2011-08-26 Thread Scott Reed
I found that replacing add(linkHomePage( homeLink )) with my code 
below works. Can anyone explain?

Thanks,
   Scorr

void addHomeBtn( String id, MarkupContainer parent, final WebPage page )
  {
final AbstractDefaultAjaxBehavior homeBehavior = new 
AbstractDefaultAjaxBehavior()

{
  private static final long serialVersionUID = 1L;
  public void respond( AjaxRequestTarget target )
  {
// go home
page.setResponsePage( page.getApplication().getHomePage() );
  }
};
parent.add( homeBehavior );

// home button
final WebMarkupContainer homeBtn = new WebMarkupContainer( id )
{
  private static final long serialVersionUID = 1L;

  @Override
  public void onComponentTag(ComponentTag tag)
  {
tag.put(onclick, 
wicketAjaxGet('+homeBehavior.getCallbackUrl()+'));

  }
};
parent.add( homeBtn );
  }

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



Re: Basic l10n / i18n question: must page be re-rendered?

2011-08-26 Thread Alexandros Karypidis

Hi again,

Just to add to this that the following will work for pages with parameters:

@Override
protected void onSelectionChanged(Locale newSelection) {
super.onSelectionChanged(newSelection);
// the following tells wicket to instantiate a new page using 
the current page's class
getRequestCycle().setResponsePage(getPage().getClass(), 
getPage.getParameters());

}


On 23/8/2011 10:41 μμ, Alexandros Karypidis wrote:

Hi Gregor,

I've found a way to do this by manipulating the request cycle. 
However, it will only work if you don't mind losing any page state, as 
it generates a new page rendering. I do this by overriding 
onSelectionChanged(...) of the DropDownChoiceLocale as follows:


@Override
protected void onSelectionChanged(Locale newSelection) {
super.onSelectionChanged(newSelection);
// the following tells wicket to instantiate a new page using 
the current page's class

getRequestCycle().setResponsePage(getPage().getClass());
}

Maybe a more knowledgeable user could suggest a better alternative?

On 23/8/2011 9:13 μμ, Gregor Kaczor wrote:
I have exactly the same problem, though i use an xml file for the 
translations. Any help out there?


On 08/23/2011 02:09 PM, Alexandros Karypidis wrote:

Hello,

I have written a locale selector by extending DropDownChoice (you 
can see the essential stuff of the implementation below). The 
problem is that when the user changes the locale, the page needs to 
be re-rendered using the newly selected locale. This does NOT 
happen. Instead, only the select input box seems to be refreshed 
to use the new locale, whereas the rest of the page content is still 
rendered using the previously selected locale. However, the locale 
has been changed in the Session which can be seen when the user 
navigates to another page (e.g. by clicking on a link), as the new 
page is rendered using the newly-selected locale.


So, how can I force the current page to be re-rendered?

Implementation of my locale selector is as follows:

Markup: select wicket:id=localeSelection/select
Component code:
public class LocaleDropDown extends DropDownChoiceLocale {
//...
public LocaleDropDown(final String id, final ListLocale 
choices) {

// ...
setModel(new IModelLocale() {
public Locale getObject() {
return getSession().getLocale();
}
@Override
public void setObject(Locale locale) {
getSession().setLocale(locale);
// need something here to tell wicket to refresh the 
entire page?

}
});
// ...
}

@Override
protected boolean wantOnSelectionChangedNotifications() {
// post an event when user changes the selected value in the 
drop-down box

return true;
}
}

-- Kind regards, Alex

-
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: Login page hangs after custom page-expired error page

2011-08-26 Thread Martin Grigorov
for 1.6 - yes, I think. unless we find it useful for something

On Fri, Aug 26, 2011 at 6:54 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 can we remove it then?

 -igor

 On Fri, Aug 26, 2011 at 8:19 AM, Martin Grigorov mgrigo...@apache.org wrote:
 actually #isErrorPage() is not used in current 1.5, so WIA is correct

 On Fri, Aug 26, 2011 at 6:15 PM, Scott Reed sr...@avacoda.com wrote:
 Thanks, Bruno. I added isErrorPage() just in case. The docs just say This
 can help the framework prevent infinite failure loops. That's also not
 mentioned in Wicket in Action which says creating an error page is no
 different than creating a normal page.
  Scott

 On 8/26/2011 9:15 AM, Bruno Borges wrote:

 I think you must set your page as error page.

 Make that change and try again.

 *Bruno Borges*
 (21) 7672-7099
 *www.brunoborges.com*



 On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com  wrote:

 A created my own PageExpiredErrorPage. There is a button that is supposed
 to take the user to the login page so they can log in (similar to the
 button
 on the default page-expired error page). /
 /
 When the user first opens the web site, they see a log in page with URL
 /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.SignInPage?1/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/.
 http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.**

 SignInPage?1http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1
 *Default PageExpiredErrorPage behavior*
 After there is a page timeout and the /default /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
    http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//
 .

 When the user selects that button they go to the login page with address
 /
    http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.SignInPage?0http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
 /*and it goes to the home page as expected/desired when the user logs
 in.*/

 /*My custom page-expired error page behavior*/
 /After there is a page timeout and the /custom /page-expired error page
 opens, the Return to home page button on the default page expired error
 page reports URL /
 //http://mydomain.com/rems/**wicket//http://mydomain.com/rems/wicket//

 When the user selects that button they go to the login page with address
 /    http://mydomain.com/rems/**wicket/wicket/bookmarkable/**

 com.mni.REMSPageExpiredPage#..**/http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../..

 /*and it hangs when the user logs in*/./

 *custom page-expired error page HTML
 *

   body
   pThe page you requested has expired./p
   pa wicket:id=homeLinkReturn to home page/a/p
   /body

 *
 Java:
 *

   public class MyPageExpiredPage extends WebPage
   {
      public MyPageExpiredPage()
      {
        super();

        // link for home page btn
        // WebPage#homePageLink returns a BookmarkablePageLink
        add( homePageLink(homeLink));
      }
   }

 I would very much appreciate any assistance with this.
  Scott



 -
 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





-- 
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: Login page hangs after custom page-expired error page

2011-08-26 Thread Bruno Borges
But still, why isn't Scott's case working?


*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*



On Fri, Aug 26, 2011 at 5:12 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 for 1.6 - yes, I think. unless we find it useful for something

 On Fri, Aug 26, 2011 at 6:54 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
  can we remove it then?
 
  -igor
 
  On Fri, Aug 26, 2011 at 8:19 AM, Martin Grigorov mgrigo...@apache.org
 wrote:
  actually #isErrorPage() is not used in current 1.5, so WIA is correct
 
  On Fri, Aug 26, 2011 at 6:15 PM, Scott Reed sr...@avacoda.com wrote:
  Thanks, Bruno. I added isErrorPage() just in case. The docs just say
 This
  can help the framework prevent infinite failure loops. That's also not
  mentioned in Wicket in Action which says creating an error page is no
  different than creating a normal page.
   Scott
 
  On 8/26/2011 9:15 AM, Bruno Borges wrote:
 
  I think you must set your page as error page.
 
  Make that change and try again.
 
  *Bruno Borges*
  (21) 7672-7099
  *www.brunoborges.com*
 
 
 
  On Fri, Aug 26, 2011 at 1:27 AM, Scott Reedsr...@avacoda.com
  wrote:
 
  A created my own PageExpiredErrorPage. There is a button that is
 supposed
  to take the user to the login page so they can log in (similar to the
  button
  on the default page-expired error page). /
  /
  When the user first opens the web site, they see a log in page with
 URL
  /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
 
  com.mni.SignInPage?1/
 http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1/
 .
  
 http://192.168.33.20:9002/**rems/wicket/wicket/**bookmarkable/com.mni.**
 
  SignInPage?1
 http://192.168.33.20:9002/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?1
 
  *Default PageExpiredErrorPage behavior*
  After there is a page timeout and the /default /page-expired error
 page
  opens, the Return to home page button on the default page expired
 error
  page reports URL /
 http://mydomain.com/rems/**wicket//
 http://mydomain.com/rems/wicket//
  .
 
  When the user selects that button they go to the login page with
 address
  /
 http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
 
  com.mni.SignInPage?0
 http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.SignInPage?0
  /*and it goes to the home page as expected/desired when the user logs
  in.*/
 
  /*My custom page-expired error page behavior*/
  /After there is a page timeout and the /custom /page-expired error
 page
  opens, the Return to home page button on the default page expired
 error
  page reports URL /
  //http://mydomain.com/rems/**wicket//
 http://mydomain.com/rems/wicket//
 
  When the user selects that button they go to the login page with
 address
  /http://mydomain.com/rems/**wicket/wicket/bookmarkable/**
 
  com.mni.REMSPageExpiredPage#..**/
 http://mydomain.com/rems/wicket/wicket/bookmarkable/com.mni.REMSPageExpiredPage#../
 ..
 
  /*and it hangs when the user logs in*/./
 
  *custom page-expired error page HTML
  *
 
body
pThe page you requested has expired./p
pa wicket:id=homeLinkReturn to home page/a/p
/body
 
  *
  Java:
  *
 
public class MyPageExpiredPage extends WebPage
{
   public MyPageExpiredPage()
   {
 super();
 
 // link for home page btn
 // WebPage#homePageLink returns a BookmarkablePageLink
 add( homePageLink(homeLink));
   }
}
 
  I would very much appreciate any assistance with this.
   Scott
 
 
 
  -
  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
 
 



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




MarkupContainer.visitChildren traversal when visiting instances of a specific (non-container) class

2011-08-26 Thread Mika Viljanen
Hi,

(I was pretty sure I could find an answer to my question by searching
the list archives and the Wicket Jira, but didn't. But if there's an
answer somewhere already and I just missed it, I apologize and would
be very happy if I was pointed to it.)

Is the visitChildren method of MarkupContainer supposed to take into
account the return value of its IVisitor also if only specific,
non-container classes are to be visited?

The question naturally makes more sense with an example. Consider this
simple piece of code:

MarkupContainer container1 = new WebMarkupContainer(container1);
Label labelA1 = new Label(labelA1, A1);
Label labelA2 = new Label(labelA2, A2);

MarkupContainer container2 = new WebMarkupContainer(container2);
Label labelB1 = new Label(labelB1, B1);
Label labelB2 = new Label(labelB2, B2);

add(container1);
container1.add(labelA1, labelA2, container2);
container2.add(labelB1, labelB2);

container1.visitChildren(Label.class, new IVisitorComponent() {
@Override
public Object component(Component component) {
System.out.println(component.getDefaultModelObject());
return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
}
});

When I wrote the above code I thought the Visitor would only visit
labels A1 and A2, and it would skip B1 and B2, since they are deeper
in the object hierarchy and I use the return value
CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER. But the Visitor actually visits
all four labels anyway. If visitChildren is called without the first
parameter (Label.class), it only visits labels A1 and A2, but also
container2 (which is what I would expect it to do).

The reason for this is pretty obvious if you look at the source code
of visitChildren. The traversal depth check depends on the Visitor's
return value (e.g. CONTINUE_TRAVERSAL or
CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER), and that is set only if no
specific class was defined (i.e. the first parameter wasn't given and
all kinds of components are visited) or the class of the component
matched the given parameter. In this case when visitChildren advances
to container2, the Visitor isn't called (because only Labels are to be
visited) and the return value remains null (the default value). And so
the visiting continues to container2's children, resulting in B1 and
B2 appearing in the results...

Is this how visitChildren was designed to work? Like I said, I
expected it to work differently, but the problem might only be in my
expectations. :)

BR,
Mika

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



Re: MarkupContainer.visitChildren traversal when visiting instances of a specific (non-container) class

2011-08-26 Thread Igor Vaynberg
the way it works makes sense to me...

-igor


On Fri, Aug 26, 2011 at 3:24 PM, Mika Viljanen mika.vilja...@iki.fi wrote:
 Hi,

 (I was pretty sure I could find an answer to my question by searching
 the list archives and the Wicket Jira, but didn't. But if there's an
 answer somewhere already and I just missed it, I apologize and would
 be very happy if I was pointed to it.)

 Is the visitChildren method of MarkupContainer supposed to take into
 account the return value of its IVisitor also if only specific,
 non-container classes are to be visited?

 The question naturally makes more sense with an example. Consider this
 simple piece of code:

    MarkupContainer container1 = new WebMarkupContainer(container1);
    Label labelA1 = new Label(labelA1, A1);
    Label labelA2 = new Label(labelA2, A2);

    MarkupContainer container2 = new WebMarkupContainer(container2);
    Label labelB1 = new Label(labelB1, B1);
    Label labelB2 = new Label(labelB2, B2);

    add(container1);
    container1.add(labelA1, labelA2, container2);
    container2.add(labelB1, labelB2);

    container1.visitChildren(Label.class, new IVisitorComponent() {
        @Override
        public Object component(Component component) {
            System.out.println(component.getDefaultModelObject());
            return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
        }
    });

 When I wrote the above code I thought the Visitor would only visit
 labels A1 and A2, and it would skip B1 and B2, since they are deeper
 in the object hierarchy and I use the return value
 CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER. But the Visitor actually visits
 all four labels anyway. If visitChildren is called without the first
 parameter (Label.class), it only visits labels A1 and A2, but also
 container2 (which is what I would expect it to do).

 The reason for this is pretty obvious if you look at the source code
 of visitChildren. The traversal depth check depends on the Visitor's
 return value (e.g. CONTINUE_TRAVERSAL or
 CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER), and that is set only if no
 specific class was defined (i.e. the first parameter wasn't given and
 all kinds of components are visited) or the class of the component
 matched the given parameter. In this case when visitChildren advances
 to container2, the Visitor isn't called (because only Labels are to be
 visited) and the return value remains null (the default value). And so
 the visiting continues to container2's children, resulting in B1 and
 B2 appearing in the results...

 Is this how visitChildren was designed to work? Like I said, I
 expected it to work differently, but the problem might only be in my
 expectations. :)

 BR,
 Mika

 -
 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



Opening modal window at file upload completion

2011-08-26 Thread Chris Colman
Is it possible to open a modal window after file upload completion.
 
Even though I'm using the AJAX file upload which shows the progress bar
the submit handler doesn't contain a 'target' parameter required to
bring up a modal.
 
protected void onSubmit()
{
final FileUpload upload = fileUploadField.getFileUpload();
if (upload != null)
{
 // Create a new file
.
}
 
The reason is that I do some processing of the file after uploading and
I want to display to the user the results of that processing. Any ideas?