Re: ResourceReference for resource in webapp dir

2012-02-09 Thread Martin Grigorov
Hi,

I recommend you to read again the article.
See below some improvements:

On Wed, Feb 8, 2012 at 7:33 PM, Kayode Odeyemi drey...@gmail.com wrote:
 On Wed, Feb 8, 2012 at 3:58 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Everything is possible.
 See http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
 You the request parameter to map to your real resource and load it.

 Thanks.

 I have all the classes in place now. Could you help with some pointers as
 to how to use this in a Page component renderHead? I'm working with
 something like this:

 private static final UrlResourceReference DASHBOARD_JS = new
 UrlResourceReference(
            /WEB-INF/js/dashboard.js);

Remove that completely ^^


 @Override
    public void renderHead(IHeaderResponse response) {
        response.renderJavaScriptReference(DASHBOARD_JS);

Here use the url generation approach with #urlFor(new
UrlResourceReference(), new PageParameters().add(dashboard.js));
This adds indexed parameter.

    }

 Application.java
 --
 super.mountResource(/WEB-INF/js/dashboard.js, new UrlResourceReference());

mountResource(/Dashboard/js, new UrlResourceReference());


 ContextRelativeURLResource.java
 -
 @Override
    protected ResourceResponse newResourceResponse(Attributes attributes) {

attributes.getPageParameters.get(0) will return you dashboard.js.
Load it with ServletContext.getResource() and with the WriteCallback
write its bytes into attributes.getResponse().

        final ResourceResponse resourceResponse = new ResourceResponse();

        if (resourceResponse.dataNeedsToBeWritten(attributes)) {

            final UrlContextResourceStream urlContextResourceStream = new
 UrlContextResourceStream(path);

  resourceResponse.setContentType(urlContextResourceStream.getContentType());

  resourceResponse.setLastModified(urlContextResourceStream.lastModifiedTime());
            resourceResponse.setFileName(path);
            resourceResponse.setWriteCallback(new WriteCallback() {

                @Override
                public void writeData(Attributes attributes) {
                    URL url = null;
                    try {
                        url = urlContextResourceStream.getResourceURL(); //
 getURL uses path passed into UrlResourceStream
                    } catch (MalformedURLException ex) {

                        throw new WicketRuntimeException(ex);
                    }
                }
            });
        }
        return resourceResponse;
    }

 UrlResourceReference.java
 ---
 @Override
    public IResource getResource() {
        return new ContextRelativeURLResource(getName());

    }

 I'm still getting this in the logs:
 /w/wicket/resource/org.apache.wicket.Application/WEB-INF/js/dashboard-ver-1328653530609.js

 Thank you.

  On Wed, Feb 8, 2012 at 5:30 PM, Kayode Odeyemi drey...@gmail.com wrote:
  On Mon, Feb 6, 2012 at 3:08 PM, Martin Grigorov mgrigo...@apache.org
 wrote:
 
  Hi,
 
  I'd not invest in AbstractResourceDependentResourceReference.
  This has been re-implemented in Wicket 6.0 and this class is no more
 there.
 
  For your case I can recommend you to take a look at Wro4j.
  With this library you can merge all resources which depend on each
  other at build time. For production you can even minimize them.
 
 
  Hi Martin,
 
  Assuming I decide not to use wro4j and I want to stick to using Wickets
  iRequestMapper, is it possible for me to achieve a mapping for resources
  that I have in webapp dir such as:
 
  com.company.Dashboard - /dashboard
 
  Such that if I have a js file in webapp/js/dashboard.js, I can simply map
  it to resolve to /dashboard/js/dashboard.js instead of
  /com.company.Dashboard/dashboard.js?
 
  While digging further into Wicket
  ResourceReference/Resourcestream/IRequestMapper/IRequestHandler
  architecture, I noticed that ResourceReference is designed such that a
  scope always returns Java package as part of the url to the resource.
 
  Using Resourcereference/IRequestMapper, is it possible for me to achieve
  the scenario I described above?
 
  Thanks
 
 
  On Mon, Feb 6, 2012 at 4:51 PM, Bertrand Guay-Paquet
  ber...@step.polymtl.ca wrote:
   Hi,
  
   Thanks for your reply. I'll try to explain why I require this.
  
   I want to use a ResRef to implement dependent resources based on
   AbstractResourceDependentResourceReference. Essentially, when a
 resource
   A.js is added to the response, I want B.js to be also automatically
  added.
  
   A.js and B.js are both located in the webapp dir instead of being
 package
   resources. This is why I wanted to make a ResRef point to the webapp
 dir
   directly.
  
   I don't have much experience with Wicket resources so maybe what I
  requested
   originally is the wrong tool for the task.
  
  
   On 04/02/2012 5:07 AM, Martin Grigorov wrote:
  
   Hi,
  
   I didn't understand why you want to use 

Re: Expiration of unversioned pages in Wicket 1.5

2012-02-09 Thread Martin Grigorov
Hi,

I'm not sure whether this is the fix for this problem but we improved
org.apache.wicket.request.cycle.RequestCycle#setResponsePage(Page)
to set statelessHint to false even for stateless pages because without
saving them in the store we are not able to find them later after the
redirect.

If you want to be stateless then you need to use
#setResponsePage(ClassPage) instead. Redirecting to a pre-created
page instance is not stateless at all - stateless means that a new
page instance will be created for each request.

On Thu, Feb 9, 2012 at 8:55 AM, David Rain david_r...@kb.cz wrote:
 Martin Grigorov mgrigorov at apache.org writes:


 can you create a ticket for this. I think I know what happens
 thanks!

 On Fri, Sep 9, 2011 at 6:57 PM, pasto peter.pastrnak at gmail.com wrote:
  Hi,
 
  in Wicket 1.5 RC7 is f.e. the RedirectPage set to unversioned, that makes
 it
  impossible to render using the REDIRECT_TO_RENDER strategy. Because of this
  flag the page instance is not being stored in the PageMap store, so it is
  not accessible during the render phase. Is there some setting that can tell
  Wicket to set unversioned pages as dirty (touch the page in pagemanager)
  when using this strategy? Or I just didn't get the point? :)
 
  Thank you,
  Peter.
 
  --
  View this message in context: http://apache-
 wicket.1842946.n4.nabble.com/Expiration-of-unversioned-pages-in-Wicket-1-5-
 tp3802099p3802099.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 



 Hi Martin!
 I'm interested if an issue was created for this bug and if the problem was
 solved then? I couldn't find it anywhere in JIRA and I am now facing the
 (nearly) same problem.
 I create the page (stateless), wrap it in PageProvider and
 RenderPageRequestHandler and make urlFor it to navigate a pure javascript
 modal window to it. But I get PageExpiredException for that new Page.
 If I call getSession().getPageManager().touchPage(...) after creation,
 everything's fine, but I think this is not conceptual (I use it just as 
 hotfix)

 Running Wicket 1.5.4

 Thanks for reply!

 David



 -
 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: continueToOriginalDestination seems to be incorrectly retaining destination across multiple logins

2012-02-09 Thread Martin Grigorov
Hi,

The intercept data should be cleaned at
org.apache.wicket.RestartResponseAtInterceptPageException, line 211 -
InterceptData.clear();
Put a breakpoint there and see what happens.

On Wed, Feb 8, 2012 at 7:55 PM, Evan Sable e...@novelution.com wrote:
 Hi,



 I'm using wicket 1.5-SNAPSHOT along with Shiro for
 authentication/authorization security, and when an unauthorized user tries
 to go to a page, Shiro calls redirectToInterceptPage behind the scenes, and
 during the login process, after a successful login, there is code that says:

 if (!continueToOriginalDestination()) {

       setResponsePage(getApplication().getHomePage());

 }



 It is working in the sense that if a user gets redirected to login, they are
 taken to the correct destination afterwards, and if a user just clicks the
 login link in a new browser they are redirected to the homepage after login.



 BUT, the problem is, if an initial user tries to go to a protected page,
 gets redirected to the login, logs in, and then logs out, and then, without
 closing the browser, clicks the login link and logs in with the same user
 again or even another user, it still redirects to the prior original
 destination, which should no longer take effect.  I would think that this
 should be forgotten upon logging out, which replaces the wicket session
 with:

 Session session = Session.get();

 session.replaceSession();



 I think I must be misunderstanding how continueToOriginalDestination is
 working - I thought it was placing the original destination url into the
 users session, which is why I figured that after the login which redirects,
 followed by the logout which replaces the session, it would be gone.



 Can someone please explain what I'm thinking about wrongly here and why the
 destination is being retained across multiple logins.  Also, how can I avoid
 this so that the original destination is only used the first time?    Btw,
 just to be clear, if I logout and then click to a new protected url, the
 original destination value is properly replaced with the new protected
 destination which redirects back to the intercept page.  The problem is only
 if I click directly to the login page without a new intercept, but after
 having previously utilized the continueToOriginalDestination in the prior
 login.

 Thanks very much for any help!

 -Evan




-- 
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: Expiration of unversioned pages in Wicket 1.5

2012-02-09 Thread vineet semwal
 what if RequestCycle#setResponsePage(Page) would have delegated to
RequestCycle#setResponsePage(ClassPage) or
RequestCycle#setResponsePage(ClassPage,Pageparameters)   after
checking whether the page#isstateless?
but then user wouldnt be able to pass state from constructor if he wanted ..

On Thu, Feb 9, 2012 at 1:37 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 I'm not sure whether this is the fix for this problem but we improved
 org.apache.wicket.request.cycle.RequestCycle#setResponsePage(Page)
 to set statelessHint to false even for stateless pages because without
 saving them in the store we are not able to find them later after the
 redirect.

 If you want to be stateless then you need to use
 #setResponsePage(ClassPage) instead. Redirecting to a pre-created
 page instance is not stateless at all - stateless means that a new
 page instance will be created for each request.

 On Thu, Feb 9, 2012 at 8:55 AM, David Rain david_r...@kb.cz wrote:
 Martin Grigorov mgrigorov at apache.org writes:


 can you create a ticket for this. I think I know what happens
 thanks!

 On Fri, Sep 9, 2011 at 6:57 PM, pasto peter.pastrnak at gmail.com wrote:
  Hi,
 
  in Wicket 1.5 RC7 is f.e. the RedirectPage set to unversioned, that makes
 it
  impossible to render using the REDIRECT_TO_RENDER strategy. Because of 
  this
  flag the page instance is not being stored in the PageMap store, so it is
  not accessible during the render phase. Is there some setting that can 
  tell
  Wicket to set unversioned pages as dirty (touch the page in pagemanager)
  when using this strategy? Or I just didn't get the point? :)
 
  Thank you,
  Peter.
 
  --
  View this message in context: http://apache-
 wicket.1842946.n4.nabble.com/Expiration-of-unversioned-pages-in-Wicket-1-5-
 tp3802099p3802099.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 



 Hi Martin!
 I'm interested if an issue was created for this bug and if the problem was
 solved then? I couldn't find it anywhere in JIRA and I am now facing the
 (nearly) same problem.
 I create the page (stateless), wrap it in PageProvider and
 RenderPageRequestHandler and make urlFor it to navigate a pure javascript
 modal window to it. But I get PageExpiredException for that new Page.
 If I call getSession().getPageManager().touchPage(...) after creation,
 everything's fine, but I think this is not conceptual (I use it just as 
 hotfix)

 Running Wicket 1.5.4

 Thanks for reply!

 David



 -
 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




-- 
thank you,

regards,
Vineet Semwal

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



Re: wizard starting background task

2012-02-09 Thread Thomas Götz

N. Metzger wrote:

 1) I start the background task in a lazy load panel, but haven't figured out
 yet how to display a progress bar while the lazy load is executing.

You might also take a look at http://wicket.visural.net/examples/submitters 
(hit the Calculate X*Y (Modal) button).

Cheers,
   -Tom



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



Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Matt
Hi everybody,

I've got some issue about the DatePicker.

I'm using Wicket 1.4.17 with wicket extension 1.4.17 as well.

I'v got a modal window, with a form and inside a datetextfield with a
datepicker. Everything is working fine with firefox but not with IE8.

In fact, i can display the calendar when i click on the calendar icon, i can
select a day (which closes the datepicker), but i can't close it with the
close button nor change the current month displayed ... . 

When i put my mouse over one of those buttons (close or change month), i
don't have the pointer cursor and when i click it does nothing.

I don't have any javascript error neither.

I tried the datepicker on IE8 but not in a modal window, and it's working.

The only thing that succeded, is that a changed the css attribute position
of the close button (set to relative), and then i can click the button but
the style is broken and i the the text Close above the image in backround
(tried to fix the style then but it's a pain in the ass).

Here is some of my code : 

/form wicket:id=modalForm
  div wicket:id=modal/div
  /form/

Panel added inside the modal : 

/form wicket:id=insideForm class=form
  ul
li ...
..
li
 labelWicket message/label
  input wicket:id=date type=text /input
/li/

Java code is classical, may be not useful (as html may be lol).

I try hard to fix this but nothing is really working. Maybe it comes from
the way i'm doing it but i can't figure out where ... .

If somebody has an idea, or had and fixed this issue in the past 

Thanks ^^

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-tp4372772p4372772.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



HTML5 offline storage

2012-02-09 Thread nino martinez wael
Hi

Have any of you tried using wicket with HTML 5 offline mode, and somehow
resynching data when coming online?

regards Nino


JQWicket BlockUIBehavior does not work after target.addComponent()

2012-02-09 Thread vov
Hi All,

Simple example:
-
final BlockUIBehavior blockBehavior = new BlockUIBehavior();
final FormVoid form = new FormVoid(form);
AjaxButton ajaxButton = new AjaxButton(block)
{
  @Override
  protected void onSubmit(AjaxRequestTarget target, Form? ajaxForm)
  {
target.addComponent(form); //(1)
blockBehavior.unblock(target);
  }
};
   
form.add(ajaxButton.add(JQBehaviors.mouseClick(blockBehavior.block(form;
add(form.add(blockBehavior));
-
BlockUIBehavior works only first time. 
On the second click to the button - nothing happens.

If remove (1) then it works without problems.

Does anybody know the reason of the problem and possible workaround?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JQWicket-BlockUIBehavior-does-not-work-after-target-addComponent-tp4372781p4372781.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: Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Martin Grigorov
Hi,

There is an open issue about this:
https://issues.apache.org/jira/browse/WICKET-4282
Unfortunately it doesn't have a quickstart to debug.
Please attach one and we will try to fix it.
Thanks!

On Thu, Feb 9, 2012 at 3:12 PM, Matt matthieu.laurent-...@sgcib.com wrote:
 Hi everybody,

 I've got some issue about the DatePicker.

 I'm using Wicket 1.4.17 with wicket extension 1.4.17 as well.

 I'v got a modal window, with a form and inside a datetextfield with a
 datepicker. Everything is working fine with firefox but not with IE8.

 In fact, i can display the calendar when i click on the calendar icon, i can
 select a day (which closes the datepicker), but i can't close it with the
 close button nor change the current month displayed ... .

 When i put my mouse over one of those buttons (close or change month), i
 don't have the pointer cursor and when i click it does nothing.

 I don't have any javascript error neither.

 I tried the datepicker on IE8 but not in a modal window, and it's working.

 The only thing that succeded, is that a changed the css attribute position
 of the close button (set to relative), and then i can click the button but
 the style is broken and i the the text Close above the image in backround
 (tried to fix the style then but it's a pain in the ass).

 Here is some of my code :

 /form wicket:id=modalForm
      div wicket:id=modal/div
  /form/

 Panel added inside the modal :

 /form wicket:id=insideForm class=form
  ul
    li ...
    ..
 li
  labelWicket message/label
  input wicket:id=date type=text /input
 /li/

 Java code is classical, may be not useful (as html may be lol).

 I try hard to fix this but nothing is really working. Maybe it comes from
 the way i'm doing it but i can't figure out where ... .

 If somebody has an idea, or had and fixed this issue in the past 

 Thanks ^^

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-tp4372772p4372772.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: Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Wilhelmsen Tor Iver
 When i put my mouse over one of those buttons (close or change month), i 
 don't have the pointer cursor and when i click it does nothing.

Welcome to the wonderful world of IE compatibility mode.

You probably need to add a DOCTYPE declaration to the top of your HTML:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; 
xmlns:wicket=http://wicket.apache.org;
...

- Tor Iver

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



Re: HTML5 offline storage

2012-02-09 Thread robert.mcguinness
nino,

i'm about to start a coding effort with offline storage and wicket.  i'll
keep you posted with any findings.

rob

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HTML5-offline-storage-tp4372779p4372803.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: Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Matt
Hi and thanks for the quick response.

I have already read this jira issue but it is not exactly the same as my
problem (though it's about ie8, so a fix woul be not to use it :p) ... i'm
really busy so i donno if can make a quickstart app ... .

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-tp4372772p4372817.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: HTML5 offline storage

2012-02-09 Thread nino martinez wael
Great:)

2012/2/9 robert.mcguinness robert.mcguinness@gmail.com

 nino,

 i'm about to start a coding effort with offline storage and wicket.  i'll
 keep you posted with any findings.

 rob

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/HTML5-offline-storage-tp4372779p4372803.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




call a javascript

2012-02-09 Thread cosmindumy
Hello again,
I want to call a javascript when a java event. Actually on method mymethod()
from my button I want to set a javascript and the first time the button is
rerendered to call it. 
How can I do this?
Thanks 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/call-a-javascript-tp4372863p4372863.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: wizard starting background task

2012-02-09 Thread N. Metzger
To give you more information:

I can ope a new page (or modal window) and start the wicketstuff progress
bar with a new ajax button on that page. 
I can also open a new page with the ajax lazy load panel that will display
the indicating gif while loading stuff in the background.

What I'm looking for is a way to NOT open a new page and NOT to click
another ajax button to start the background task and display the progress
bar. I would like the finish button of the wizard to take care of it.

Now I can of course replace the wizard with a row of pages or panel
replacements, but I don't want to lose the wizard functionality if possible.

Thanks for all your help,
Natalie

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wizard-starting-background-task-tp4371604p4372939.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: Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Matt

Wilhelmsen Tor Iver wrote
 
 You probably need to add a DOCTYPE declaration to the top of your HTML:
 
 lt;!DOCTYPE html PUBLIC quot;-//W3C//DTD XHTML 1.0
 Transitional//ENquot;
   quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquot;gt;
 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=http://wicket.apache.org;
 ...
 

I already had the DOCTYPE but not the xmlns:wicket ... i just had it but no
change ...

Thanks anyway Tor ^^

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-tp4372772p4373065.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: Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Matt


Mathieu Laurent
Objet Direct consultant for SGCIB ITEC
matthieu.laurent-...@sgcib.com

From: Matt [via Apache Wicket] 
[mailto:ml-node+s1842946n4373065...@n4.nabble.com]
Sent: Thursday, February 09, 2012 3:36 PM
To: LAURENT Matthieu (EXT) ItecCttRrc
Subject: RE: Problem DatePicker, ModalWindow and IE8

Wilhelmsen Tor Iver wrote
You probably need to add a DOCTYPE declaration to the top of your HTML:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22%3e
html xmlns=http://www.w3.org/1999/xhtml;http://www.w3.org/1999/xhtml%22 
xmlns:wicket=http://wicket.apache.org;http://wicket.apache.org%22%3e
...
I already had the DOCTYPE but not the xmlns:wicket ... i just had it but no 
change ...

Thanks anyway Tor ^^

If you reply to this email, your message will be added to the discussion below:
http://apache-wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-tp4372772p4373065.html
To unsubscribe from Problem DatePicker, ModalWindow and IE8, click 
herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4372772code=bWF0dGhpZXUubGF1cmVudC1leHRAc2djaWIuY29tfDQzNzI3NzJ8MTM4NjUxNzc4OQ==.
NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
*
This message and any attachments (the message) are confidential, intended 
solely for the addressee(s), and may contain legally privileged information.
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to 
alteration.   
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be 
liable for the message if altered, changed or
falsified.
  
Ce message et toutes les pieces jointes (ci-apres le message) sont 
confidentiels et susceptibles de contenir des informations couvertes 
par le secret professionnel. 
Ce message est etabli a l'intention exclusive de ses destinataires. Toute 
utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de 
ce message s'il a ete altere, deforme ou falsifie.
*


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-tp4372772p4373067.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: Expiration of unversioned pages in Wicket 1.5

2012-02-09 Thread Igor Vaynberg
this is a bad idea. what if the user does

MyPage p=new MyPage();
p.setSomeFlag(true);
setResponsePage(p);

wicket doesnt know that the instance of MyPage is prestine, so it
cannot make the decision to throw it away and redirect to another
instance.

-igor

On Thu, Feb 9, 2012 at 12:42 AM, vineet semwal
vineetsemwal1...@gmail.com wrote:
  what if RequestCycle#setResponsePage(Page) would have delegated to
 RequestCycle#setResponsePage(ClassPage) or
 RequestCycle#setResponsePage(ClassPage,Pageparameters)   after
 checking whether the page#isstateless?
 but then user wouldnt be able to pass state from constructor if he wanted ..

 On Thu, Feb 9, 2012 at 1:37 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 I'm not sure whether this is the fix for this problem but we improved
 org.apache.wicket.request.cycle.RequestCycle#setResponsePage(Page)
 to set statelessHint to false even for stateless pages because without
 saving them in the store we are not able to find them later after the
 redirect.

 If you want to be stateless then you need to use
 #setResponsePage(ClassPage) instead. Redirecting to a pre-created
 page instance is not stateless at all - stateless means that a new
 page instance will be created for each request.

 On Thu, Feb 9, 2012 at 8:55 AM, David Rain david_r...@kb.cz wrote:
 Martin Grigorov mgrigorov at apache.org writes:


 can you create a ticket for this. I think I know what happens
 thanks!

 On Fri, Sep 9, 2011 at 6:57 PM, pasto peter.pastrnak at gmail.com 
 wrote:
  Hi,
 
  in Wicket 1.5 RC7 is f.e. the RedirectPage set to unversioned, that makes
 it
  impossible to render using the REDIRECT_TO_RENDER strategy. Because of 
  this
  flag the page instance is not being stored in the PageMap store, so it is
  not accessible during the render phase. Is there some setting that can 
  tell
  Wicket to set unversioned pages as dirty (touch the page in pagemanager)
  when using this strategy? Or I just didn't get the point? :)
 
  Thank you,
  Peter.
 
  --
  View this message in context: http://apache-
 wicket.1842946.n4.nabble.com/Expiration-of-unversioned-pages-in-Wicket-1-5-
 tp3802099p3802099.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 



 Hi Martin!
 I'm interested if an issue was created for this bug and if the problem was
 solved then? I couldn't find it anywhere in JIRA and I am now facing the
 (nearly) same problem.
 I create the page (stateless), wrap it in PageProvider and
 RenderPageRequestHandler and make urlFor it to navigate a pure javascript
 modal window to it. But I get PageExpiredException for that new Page.
 If I call getSession().getPageManager().touchPage(...) after creation,
 everything's fine, but I think this is not conceptual (I use it just as 
 hotfix)

 Running Wicket 1.5.4

 Thanks for reply!

 David



 -
 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




 --
 thank you,

 regards,
 Vineet Semwal

 -
 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



StatelessForm: Cannot login

2012-02-09 Thread rene
Hello,

I have a strange problem with StatelessForms in combination with login in:
On my MainPage are two stateless forms. One for registration and one for the
login (registration isn't implemented yet). When I try to log in, Wicket
creates a new User() and saves it in the Session (I made this like it's
explained in Wicket in Action). A System.out.print(user created) in the
constructor of User confirms that. Everything seems to be ok. But when the
main page reloads, I am still logged out. 
And: When I change from StatelessForm to Form, everything works perfectly.
Something else might be important: When I request a page that requries
authorization and I'm not logged in, i'm being redirected to /login. There
is the same LoginPanel (with StatelessForm) as on the main page - and the
login works! But when I directly open /login it's the same as on the main
page and I can't login.
I also noticed that the login works (with StatelessForm) when I open a page
that requires authorization, then press the back button (back to main page)
and there try to log in.

The question is now, what am I doing worng? I can't find the problem in my
code, I have been trying a lot to find out what's worng but everything seems
to be correct. I couldn't find anything in the mailing list / on the web, I
searched a lot.

At the end I attached code from LoginPanel.java, WiaSession.java and
WicketApplication.java.

Thank you very much for your help!
(And sorry if there are one or two missspelled words - I don't speak english
natively.)


René

LoginPanel.java:
public class LoginPanel extends Panel {

public LoginPanel(String id) {
super(id);
add(new LoginForm(login));
}

private class LoginForm extends StatelessForm {

private String username;
private String password;

public LoginForm(String id) {
super(id);

setModel(new CompoundPropertyModel(this));
add(new TextField(username));
add(new PasswordTextField(password));
}

@Override
public final void onSubmit() {
if (tryToLogIn()) {
if (!continueToOriginalDestination()) {
setResponsePage(getApplication().getHomePage());
}
}
}

private boolean tryToLogIn() {
if (username != null  password != null) {
User user = Database.findUser(username);
if (user != null) {
if (user.comparePasswords(password)) {
WiaSession.get().setUser(user);
return true;
}
}
}
return false;
}
}
}

WiaSession.java:
public final class WiaSession extends WebSession {

private User user;

public WiaSession(Request request) {
super(request);
}

public static WiaSession get() {
return (WiaSession) Session.get();
}

public static boolean isLoggedIn() {
return WiaSession.get().isAuthenticated();
}

public boolean isAuthenticated() {
return (user != null);
}

public final synchronized User getUser() {
return user;
}

public final synchronized void setUser(User user) {
this.user = user;
}
}

WicketApplication.java, newSession overwritten:
@Override
public final Session newSession(Request request, Response response) {
return new WiaSession(request);
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-Cannot-login-tp4373476p4373476.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.4] addorReplace and then later visitor in same request

2012-02-09 Thread Igor Vaynberg
youve removed this from page hierarchy so you can no longer say
this.getPage().

call getPage() on the component that replaced this

-igor

On Thu, Feb 9, 2012 at 5:27 AM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Hi I

 have a problem where I first call addOrReplace on a components parent (in
 this case it replaces).

 And later in the same request I do this:
 ComponentHierarchyIterator visitChildren = this.getPage()
 .visitChildren(FeedbackPanel.class);

 However when the visitor above runs, it complains about that one of the
 components haven't got a page.

 org.apache.wicket.WicketRuntimeException: No Page found for component
 [ [Component id = saveButton]]
     at org.apache.wicket.Component.getPage(Component.java:1765)
     at 
 com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.addAllFeedbackPanels(TriggerSchedulePanel.java:1051)
     at 
 com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.cannotRefreshFeedbackIfOutSideConfig(TriggerSchedulePanel.java:1047)
     at 
 com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.onSubmit(TriggerSchedulePanel.java:1033)
     at 
 org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:103)
     at 
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$1.onSubmit(AjaxFormSubmitBehavior.java:172)
     at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1154)
     at org.apache.wicket.markup.html.form.Form.process(Form.java:838)
     at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
     at 
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:158)
     at 
 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
     at 
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:316)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at 
 org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
     at 
 org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
     at 
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:255)
     at 
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
     at 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
     at 
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at 
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
     at 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
     at 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
     at 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
     at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
     at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at 
 com.netdesign.ccadmin.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
     at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
     at 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
     at 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
     at 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
     at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
     at org.mortbay.jetty.Server.handle(Server.java:326)
     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
     at 
 org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     at 
 org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
     at 
 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

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



Re: wizard starting background task

2012-02-09 Thread Thomas Götz
Simply implement your own FinishButton, e.g. extend AjaxButton and put your 
logic in it's unSubmit(…) method.
Therefore you will have to override Wizard#newButtonBar(final String id) and 
provide your own impl, but WizardButtonBar does not have very much logic, so 
that's acceptable IMHO.

Cheers,
   -Tom


Am 09.02.2012 um 15:04 schrieb N. Metzger:

 To give you more information:
 
 I can ope a new page (or modal window) and start the wicketstuff progress
 bar with a new ajax button on that page. 
 I can also open a new page with the ajax lazy load panel that will display
 the indicating gif while loading stuff in the background.
 
 What I'm looking for is a way to NOT open a new page and NOT to click
 another ajax button to start the background task and display the progress
 bar. I would like the finish button of the wizard to take care of it.
 
 Now I can of course replace the wizard with a row of pages or panel
 replacements, but I don't want to lose the wizard functionality if possible.
 
 Thanks for all your help,
 Natalie
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wizard-starting-background-task-tp4371604p4372939.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: wicket and javascript

2012-02-09 Thread Martin Grigorov
See 
https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/autocomplete-tagit-parent/autocomplete-tagit/src/main/java/org/wicketstuff/tagit/TagItAjaxBehavior.java#L114

and few lines above how this template is populated

On Thu, Feb 9, 2012 at 7:18 PM, mukesh kumar mukesh.verma1...@gmail.com wrote:
 Hi,
  In my wicket application, for session timeout, i have used .js(javascript)
 file. And i am showing timeout message  from alert tag in .js file. And add
 this file to my all html page; its working fine.
                   But my problem is, for internationalization, i want to
 show that alert message from properties file. i tried, but unable to find
 solutions. My project is going on deadline, so please help me, and give me
 the solutions ASAP.
 Thanks !

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-and-javascript-tp4373587p4373587.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: StatelessForm: Cannot login

2012-02-09 Thread Per Newgro
If i understood your usecase correctly you're app is still stateless if 
you logged in.
Afaik no session is created for stateless pages. So after you've logged 
in the session
is away for your next page. And then the user is away to. You could 
debug it by print the

hashcode of getSession() in the page.

Cheers
Per

Hello,

I have a strange problem with StatelessForms in combination with login in:
On my MainPage are two stateless forms. One for registration and one for the
login (registration isn't implemented yet). When I try to log in, Wicket
creates a new User() and saves it in the Session (I made this like it's
explained in Wicket in Action). A System.out.print(user created) in the
constructor of User confirms that. Everything seems to be ok. But when the
main page reloads, I am still logged out.
And: When I change from StatelessForm to Form, everything works perfectly.
Something else might be important: When I request a page that requries
authorization and I'm not logged in, i'm being redirected to /login. There
is the same LoginPanel (with StatelessForm) as on the main page - and the
login works! But when I directly open /login it's the same as on the main
page and I can't login.
I also noticed that the login works (with StatelessForm) when I open a page
that requires authorization, then press the back button (back to main page)
and there try to log in.

The question is now, what am I doing worng? I can't find the problem in my
code, I have been trying a lot to find out what's worng but everything seems
to be correct. I couldn't find anything in the mailing list / on the web, I
searched a lot.

At the end I attached code from LoginPanel.java, WiaSession.java and
WicketApplication.java.

Thank you very much for your help!
(And sorry if there are one or two missspelled words - I don't speak english
natively.)


René

LoginPanel.java:
public class LoginPanel extends Panel {

 public LoginPanel(String id) {
 super(id);
 add(new LoginForm(login));
 }

 private class LoginForm extends StatelessForm {

 private String username;
 private String password;

 public LoginForm(String id) {
 super(id);

 setModel(new CompoundPropertyModel(this));
 add(new TextField(username));
 add(new PasswordTextField(password));
 }

 @Override
 public final void onSubmit() {
 if (tryToLogIn()) {
 if (!continueToOriginalDestination()) {
 setResponsePage(getApplication().getHomePage());
 }
 }
 }

 private boolean tryToLogIn() {
 if (username != null  password != null) {
 User user = Database.findUser(username);
 if (user != null) {
 if (user.comparePasswords(password)) {
 WiaSession.get().setUser(user);
 return true;
 }
 }
 }
 return false;
 }
 }
}

WiaSession.java:
public final class WiaSession extends WebSession {

 private User user;

 public WiaSession(Request request) {
 super(request);
 }

 public static WiaSession get() {
 return (WiaSession) Session.get();
 }

 public static boolean isLoggedIn() {
 return WiaSession.get().isAuthenticated();
 }

 public boolean isAuthenticated() {
 return (user != null);
 }

 public final synchronized User getUser() {
 return user;
 }

 public final synchronized void setUser(User user) {
 this.user = user;
 }
}

WicketApplication.java, newSession overwritten:
 @Override
 public final Session newSession(Request request, Response response) {
 return new WiaSession(request);
 }

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StatelessForm-Cannot-login-tp4373476p4373476.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: wizard starting background task

2012-02-09 Thread N. Metzger
Yes, I tried that, too. I'm having problems ordering events.
So I overwrite the finish button which then starts the background task as
well as opens up a modal window with the progress bar.
Szenario 1) The background process is started by the modal window itself and
I need to add a form that automatically clicks the ajax button on load to
start both the progress bar and the background task (how?).
Szenario 2) The background process is started by the finish button of the
wizard. After that the finish button opens up the modal window with the
progress bar. That leaves me with no option to update the progress bar from
the background task, doesn't it? 

Natalie

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wizard-starting-background-task-tp4371604p4373685.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: StatelessForm: Cannot login

2012-02-09 Thread Per Newgro

And maybe this javadoc helps
Session#bind()
/**
 * Force binding this session to the application's {@link 
ISessionStore session store} if not

 * already done so.
 * p
 * A Wicket application can operate in a session-less mode as long 
as stateless pages are used.
 * Session objects will be then created for each request, but they 
will only live for that
 * request. You can recognize temporary sessions by calling {@link 
#isTemporary()} which
 * basically checks whether the session's id is null. Hence, 
temporary sessions have no session

 * id.
 * /p
 * p
 * By calling this method, the session will be bound (made 
not-temporary) if it was not bound
 * yet. It is useful for cases where you want to be absolutely sure 
this session object will be

 * available in next requests. If the session was already bound (
 * {@link ISessionStore#lookup(Request) returns a session}), this 
call will be a noop.

 * /p
 */

Am 09.02.2012 18:45, schrieb Per Newgro:
If i understood your usecase correctly you're app is still stateless 
if you logged in.
Afaik no session is created for stateless pages. So after you've 
logged in the session
is away for your next page. And then the user is away to. You could 
debug it by print the

hashcode of getSession() in the page.

Cheers
Per

Hello,

I have a strange problem with StatelessForms in combination with 
login in:
On my MainPage are two stateless forms. One for registration and one 
for the

login (registration isn't implemented yet). When I try to log in, Wicket
creates a new User() and saves it in the Session (I made this like it's
explained in Wicket in Action). A System.out.print(user created) in 
the
constructor of User confirms that. Everything seems to be ok. But 
when the

main page reloads, I am still logged out.
And: When I change from StatelessForm to Form, everything works 
perfectly.

Something else might be important: When I request a page that requries
authorization and I'm not logged in, i'm being redirected to /login. 
There
is the same LoginPanel (with StatelessForm) as on the main page - and 
the
login works! But when I directly open /login it's the same as on the 
main

page and I can't login.
I also noticed that the login works (with StatelessForm) when I open 
a page
that requires authorization, then press the back button (back to main 
page)

and there try to log in.

The question is now, what am I doing worng? I can't find the problem 
in my
code, I have been trying a lot to find out what's worng but 
everything seems
to be correct. I couldn't find anything in the mailing list / on the 
web, I

searched a lot.

At the end I attached code from LoginPanel.java, WiaSession.java and
WicketApplication.java.

Thank you very much for your help!
(And sorry if there are one or two missspelled words - I don't speak 
english

natively.)


René

LoginPanel.java:
public class LoginPanel extends Panel {

 public LoginPanel(String id) {
 super(id);
 add(new LoginForm(login));
 }

 private class LoginForm extends StatelessForm {

 private String username;
 private String password;

 public LoginForm(String id) {
 super(id);

 setModel(new CompoundPropertyModel(this));
 add(new TextField(username));
 add(new PasswordTextField(password));
 }

 @Override
 public final void onSubmit() {
 if (tryToLogIn()) {
 if (!continueToOriginalDestination()) {
 setResponsePage(getApplication().getHomePage());
 }
 }
 }

 private boolean tryToLogIn() {
 if (username != null  password != null) {
 User user = Database.findUser(username);
 if (user != null) {
 if (user.comparePasswords(password)) {
 WiaSession.get().setUser(user);
 return true;
 }
 }
 }
 return false;
 }
 }
}

WiaSession.java:
public final class WiaSession extends WebSession {

 private User user;

 public WiaSession(Request request) {
 super(request);
 }

 public static WiaSession get() {
 return (WiaSession) Session.get();
 }

 public static boolean isLoggedIn() {
 return WiaSession.get().isAuthenticated();
 }

 public boolean isAuthenticated() {
 return (user != null);
 }

 public final synchronized User getUser() {
 return user;
 }

 public final synchronized void setUser(User user) {
 this.user = user;
 }
}

WicketApplication.java, newSession overwritten:
 @Override
 public final Session newSession(Request request, Response 
response) {

 return new WiaSession(request);
 }

--
View this message in context: 

Re: [1.5.4] addorReplace and then later visitor in same request

2012-02-09 Thread nino martinez wael
Doh and thanks again!
On Feb 9, 2012 5:57 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:

 youve removed this from page hierarchy so you can no longer say
 this.getPage().

 call getPage() on the component that replaced this

 -igor

 On Thu, Feb 9, 2012 at 5:27 AM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
  Hi I
 
  have a problem where I first call addOrReplace on a components parent (in
  this case it replaces).
 
  And later in the same request I do this:
  ComponentHierarchyIterator visitChildren = this.getPage()
  .visitChildren(FeedbackPanel.class);
 
  However when the visitor above runs, it complains about that one of the
  components haven't got a page.
 
  org.apache.wicket.WicketRuntimeException: No Page found for component
  [ [Component id = saveButton]]
  at org.apache.wicket.Component.getPage(Component.java:1765)
  at
 com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.addAllFeedbackPanels(TriggerSchedulePanel.java:1051)
  at
 com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.cannotRefreshFeedbackIfOutSideConfig(TriggerSchedulePanel.java:1047)
  at
 com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.onSubmit(TriggerSchedulePanel.java:1033)
  at
 org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:103)
  at
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$1.onSubmit(AjaxFormSubmitBehavior.java:172)
  at
 org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1154)
  at org.apache.wicket.markup.html.form.Form.process(Form.java:838)
  at
 org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
  at
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:158)
  at
 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
  at
 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:316)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at
 org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
  at
 org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
  at
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:255)
  at
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
  at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
  at
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
  at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
  at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
  at
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
  at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
  at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at
 com.netdesign.ccadmin.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
  at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
  at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
  at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:326)
  at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  at
 org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  at
 org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
  at
 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

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




Re: wizard starting background task

2012-02-09 Thread nino martinez wael
Then pass the reference around so it is possible:)
On Feb 9, 2012 6:47 PM, N. Metzger nmetz...@odu.edu wrote:

 Yes, I tried that, too. I'm having problems ordering events.
 So I overwrite the finish button which then starts the background task as
 well as opens up a modal window with the progress bar.
 Szenario 1) The background process is started by the modal window itself
 and
 I need to add a form that automatically clicks the ajax button on load to
 start both the progress bar and the background task (how?).
 Szenario 2) The background process is started by the finish button of the
 wizard. After that the finish button opens up the modal window with the
 progress bar. That leaves me with no option to update the progress bar from
 the background task, doesn't it?

 Natalie

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/wizard-starting-background-task-tp4371604p4373685.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: Expiration of unversioned pages in Wicket 1.5

2012-02-09 Thread vineet semwal
yeah very true if it was done that way then user's state will be lost
in this use case,thanks !

On Thu, Feb 9, 2012 at 9:27 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 this is a bad idea. what if the user does

 MyPage p=new MyPage();
 p.setSomeFlag(true);
 setResponsePage(p);

 wicket doesnt know that the instance of MyPage is prestine, so it
 cannot make the decision to throw it away and redirect to another
 instance.

 -igor

 On Thu, Feb 9, 2012 at 12:42 AM, vineet semwal
 vineetsemwal1...@gmail.com wrote:
  what if RequestCycle#setResponsePage(Page) would have delegated to
 RequestCycle#setResponsePage(ClassPage) or
 RequestCycle#setResponsePage(ClassPage,Pageparameters)   after
 checking whether the page#isstateless?
 but then user wouldnt be able to pass state from constructor if he wanted ..

 On Thu, Feb 9, 2012 at 1:37 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 I'm not sure whether this is the fix for this problem but we improved
 org.apache.wicket.request.cycle.RequestCycle#setResponsePage(Page)
 to set statelessHint to false even for stateless pages because without
 saving them in the store we are not able to find them later after the
 redirect.

 If you want to be stateless then you need to use
 #setResponsePage(ClassPage) instead. Redirecting to a pre-created
 page instance is not stateless at all - stateless means that a new
 page instance will be created for each request.

 On Thu, Feb 9, 2012 at 8:55 AM, David Rain david_r...@kb.cz wrote:
 Martin Grigorov mgrigorov at apache.org writes:


 can you create a ticket for this. I think I know what happens
 thanks!

 On Fri, Sep 9, 2011 at 6:57 PM, pasto peter.pastrnak at gmail.com 
 wrote:
  Hi,
 
  in Wicket 1.5 RC7 is f.e. the RedirectPage set to unversioned, that 
  makes
 it
  impossible to render using the REDIRECT_TO_RENDER strategy. Because of 
  this
  flag the page instance is not being stored in the PageMap store, so it 
  is
  not accessible during the render phase. Is there some setting that can 
  tell
  Wicket to set unversioned pages as dirty (touch the page in pagemanager)
  when using this strategy? Or I just didn't get the point? :)
 
  Thank you,
  Peter.
 
  --
  View this message in context: http://apache-
 wicket.1842946.n4.nabble.com/Expiration-of-unversioned-pages-in-Wicket-1-5-
 tp3802099p3802099.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 



 Hi Martin!
 I'm interested if an issue was created for this bug and if the problem was
 solved then? I couldn't find it anywhere in JIRA and I am now facing the
 (nearly) same problem.
 I create the page (stateless), wrap it in PageProvider and
 RenderPageRequestHandler and make urlFor it to navigate a pure javascript
 modal window to it. But I get PageExpiredException for that new Page.
 If I call getSession().getPageManager().touchPage(...) after creation,
 everything's fine, but I think this is not conceptual (I use it just as 
 hotfix)

 Running Wicket 1.5.4

 Thanks for reply!

 David



 -
 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




 --
 thank you,

 regards,
 Vineet Semwal

 -
 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




-- 
thank you,

regards,
Vineet Semwal

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



Re: Wicket in a Dot Net World

2012-02-09 Thread nino martinez wael
Ohh crap. :( thats bad. The worst part are it being closed source. For me
it would mean changing jobs. Theres just too many things. Build server unit
testing version control etc are a whole new thing. Just in those things a
huge investment buying licenses (afaik all are $/commercial in ms land) .
After that the porting of code can begin. Its gonna be expensive. Ask if he
has calculated the roi on it, if not get a. Net consultant to help on a
rough estimate and put a little on the top to be sure..

Regards
On Feb 7, 2012 8:57 PM, shetc sh...@bellsouth.net wrote:

 Well friends, it's happened -- the company I work for has been bought by a
 larger competitor. Sadly, the new bosses prefer to work with .NET

 I don't suppose anyone has ported Wicket to .NET?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-in-a-Dot-Net-World-tp4366058p4366058.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: StatelessForm: Cannot login

2012-02-09 Thread René Bernhardsgrütter

Hi Per, thank you very much for your answers.
Yes, that was it. I added WiaSession.get().bind(); to my LoginPanel and 
now it works as it should :-)

Every time when the LoginPanel is showed, the session will be binded.

Phu, I was trying to fix that over three days ^^

Regards,
René

On 02/09/2012 06:53 PM, Per Newgro wrote:

And maybe this javadoc helps
Session#bind()
/**
 * Force binding this session to the application's {@link 
ISessionStore session store} if not

 * already done so.
 * p
 * A Wicket application can operate in a session-less mode as long 
as stateless pages are used.
 * Session objects will be then created for each request, but they 
will only live for that
 * request. You can recognize temporary sessions by calling {@link 
#isTemporary()} which
 * basically checks whether the session's id is null. Hence, 
temporary sessions have no session

 * id.
 * /p
 * p
 * By calling this method, the session will be bound (made 
not-temporary) if it was not bound
 * yet. It is useful for cases where you want to be absolutely 
sure this session object will be

 * available in next requests. If the session was already bound (
 * {@link ISessionStore#lookup(Request) returns a session}), this 
call will be a noop.

 * /p
 */

Am 09.02.2012 18:45, schrieb Per Newgro:
If i understood your usecase correctly you're app is still stateless 
if you logged in.
Afaik no session is created for stateless pages. So after you've 
logged in the session
is away for your next page. And then the user is away to. You could 
debug it by print the

hashcode of getSession() in the page.

Cheers
Per

Hello,

I have a strange problem with StatelessForms in combination with 
login in:
On my MainPage are two stateless forms. One for registration and one 
for the
login (registration isn't implemented yet). When I try to log in, 
Wicket

creates a new User() and saves it in the Session (I made this like it's
explained in Wicket in Action). A System.out.print(user created) 
in the
constructor of User confirms that. Everything seems to be ok. But 
when the

main page reloads, I am still logged out.
And: When I change from StatelessForm to Form, everything works 
perfectly.

Something else might be important: When I request a page that requries
authorization and I'm not logged in, i'm being redirected to /login. 
There
is the same LoginPanel (with StatelessForm) as on the main page - 
and the
login works! But when I directly open /login it's the same as on the 
main

page and I can't login.
I also noticed that the login works (with StatelessForm) when I open 
a page
that requires authorization, then press the back button (back to 
main page)

and there try to log in.

The question is now, what am I doing worng? I can't find the problem 
in my
code, I have been trying a lot to find out what's worng but 
everything seems
to be correct. I couldn't find anything in the mailing list / on the 
web, I

searched a lot.

At the end I attached code from LoginPanel.java, WiaSession.java and
WicketApplication.java.

Thank you very much for your help!
(And sorry if there are one or two missspelled words - I don't speak 
english

natively.)


René

LoginPanel.java:
public class LoginPanel extends Panel {

 public LoginPanel(String id) {
 super(id);
 add(new LoginForm(login));
 }

 private class LoginForm extends StatelessForm {

 private String username;
 private String password;

 public LoginForm(String id) {
 super(id);

 setModel(new CompoundPropertyModel(this));
 add(new TextField(username));
 add(new PasswordTextField(password));
 }

 @Override
 public final void onSubmit() {
 if (tryToLogIn()) {
 if (!continueToOriginalDestination()) {
 setResponsePage(getApplication().getHomePage());
 }
 }
 }

 private boolean tryToLogIn() {
 if (username != null  password != null) {
 User user = Database.findUser(username);
 if (user != null) {
 if (user.comparePasswords(password)) {
 WiaSession.get().setUser(user);
 return true;
 }
 }
 }
 return false;
 }
 }
}

WiaSession.java:
public final class WiaSession extends WebSession {

 private User user;

 public WiaSession(Request request) {
 super(request);
 }

 public static WiaSession get() {
 return (WiaSession) Session.get();
 }

 public static boolean isLoggedIn() {
 return WiaSession.get().isAuthenticated();
 }

 public boolean isAuthenticated() {
 return (user != null);
 }

 public final synchronized User getUser() {
 return user;
 }

 public final 

Re: StatelessForm: Cannot login

2012-02-09 Thread Per Newgro
lol. Next time ask the community earlier. I always try to solve my 
problems alone.
Sometimes it helps to build a quickstart and focus to the problem. But 
if i realy don't have an idea
and google is not helping to - then i ask here. Normally you get help in 
short time.


Btw: Thanks to all helping others out of their problems.

Cheers
Per


Am 09.02.2012 20:00, schrieb René Bernhardsgrütter:

Hi Per, thank you very much for your answers.
Yes, that was it. I added WiaSession.get().bind(); to my LoginPanel 
and now it works as it should :-)

Every time when the LoginPanel is showed, the session will be binded.

Phu, I was trying to fix that over three days ^^

Regards,
René

On 02/09/2012 06:53 PM, Per Newgro wrote:

And maybe this javadoc helps
Session#bind()
/**
 * Force binding this session to the application's {@link 
ISessionStore session store} if not

 * already done so.
 * p
 * A Wicket application can operate in a session-less mode as 
long as stateless pages are used.
 * Session objects will be then created for each request, but 
they will only live for that
 * request. You can recognize temporary sessions by calling 
{@link #isTemporary()} which
 * basically checks whether the session's id is null. Hence, 
temporary sessions have no session

 * id.
 * /p
 * p
 * By calling this method, the session will be bound (made 
not-temporary) if it was not bound
 * yet. It is useful for cases where you want to be absolutely 
sure this session object will be

 * available in next requests. If the session was already bound (
 * {@link ISessionStore#lookup(Request) returns a session}), this 
call will be a noop.

 * /p
 */

Am 09.02.2012 18:45, schrieb Per Newgro:
If i understood your usecase correctly you're app is still stateless 
if you logged in.
Afaik no session is created for stateless pages. So after you've 
logged in the session
is away for your next page. And then the user is away to. You could 
debug it by print the

hashcode of getSession() in the page.

Cheers
Per

Hello,

I have a strange problem with StatelessForms in combination with 
login in:
On my MainPage are two stateless forms. One for registration and 
one for the
login (registration isn't implemented yet). When I try to log in, 
Wicket
creates a new User() and saves it in the Session (I made this like 
it's
explained in Wicket in Action). A System.out.print(user created) 
in the
constructor of User confirms that. Everything seems to be ok. But 
when the

main page reloads, I am still logged out.
And: When I change from StatelessForm to Form, everything works 
perfectly.

Something else might be important: When I request a page that requries
authorization and I'm not logged in, i'm being redirected to 
/login. There
is the same LoginPanel (with StatelessForm) as on the main page - 
and the
login works! But when I directly open /login it's the same as on 
the main

page and I can't login.
I also noticed that the login works (with StatelessForm) when I 
open a page
that requires authorization, then press the back button (back to 
main page)

and there try to log in.

The question is now, what am I doing worng? I can't find the 
problem in my
code, I have been trying a lot to find out what's worng but 
everything seems
to be correct. I couldn't find anything in the mailing list / on 
the web, I

searched a lot.

At the end I attached code from LoginPanel.java, WiaSession.java and
WicketApplication.java.

Thank you very much for your help!
(And sorry if there are one or two missspelled words - I don't 
speak english

natively.)


René

LoginPanel.java:
public class LoginPanel extends Panel {

 public LoginPanel(String id) {
 super(id);
 add(new LoginForm(login));
 }

 private class LoginForm extends StatelessForm {

 private String username;
 private String password;

 public LoginForm(String id) {
 super(id);

 setModel(new CompoundPropertyModel(this));
 add(new TextField(username));
 add(new PasswordTextField(password));
 }

 @Override
 public final void onSubmit() {
 if (tryToLogIn()) {
 if (!continueToOriginalDestination()) {
 setResponsePage(getApplication().getHomePage());
 }
 }
 }

 private boolean tryToLogIn() {
 if (username != null  password != null) {
 User user = Database.findUser(username);
 if (user != null) {
 if (user.comparePasswords(password)) {
 WiaSession.get().setUser(user);
 return true;
 }
 }
 }
 return false;
 }
 }
}

WiaSession.java:
public final class WiaSession extends WebSession {

 private User user;

 public WiaSession(Request request) {
  

Very simple Wicket test to verify panel type...

2012-02-09 Thread Bjørn Grønbæk
Hi,

I'm just starting out with Wicket and WicketTester...

I have a page that adds one of several panels, depending of its
PageParameter. I would like to verify that behaviour with WicketTester...
but how to?

The code is something like this:

String type = null;
Panel p = null;

if(getPageParameters() != null)
type = getPageParameters().getString(BRAND_TYPE);

if(type != null  type.equals(BRAND))
p = new PanelA(id);
else
p = new PanelB(id);
 add(p);

I've tried something like this:

wicketTester.startPage(CreatePage.class);
wicketTester.assertRenderedPage(CreatePage.class);
wicketTester.assertComponent(:panelid,PanelA.class);

but that doesn't work. The test fails with this message:
junit.framework.AssertionFailedError: component 'CreatePage' is not
type:PanelA

Am I using the AssertComponent in a wrong way?
How else can I perform a test like that?
Could you point me to a good resource on how I find the path to components?


-- 

Best Regard

Bjørn Grønbæk

Software Engineer

m: bjorn.gronb...@endomondo.com first%20name.last%20n...@endomondo.com
p: +45 22669501
w: *www.endomondo.com* http://www.endomondo.com/
t: *www.twitter.com/endomondo* http://www.twitter.com/endomondo
f:* **www.facebook.com/endomondo* http://www.facebook.com/endomondo
e: www.endomondo.com/profile/406738 http://www.endomondo.com/profile/your


Re: Wicket Ajax direction and roadmap regarding push-like updates

2012-02-09 Thread Pierre Goupil
I was using wicketstuff-push with Wicket 1.4. And it used to prevent me
from unit-testing because of NPEs in the push code, IIRC.

Regards,

Pierre Goupil




On Wed, Feb 8, 2012 at 5:58 PM, pkc pkci...@gmail.com wrote:

 Sounds promising.  As a wicket user, I would like to see a very tight
 integration of a push API in wicket-core.  It seems most solutions are
 overly complicated and it would be nice to have a simple API that just let
 you add listeners or set up channels, then fire off a job and wicket core
 would take care of making sure the background updates were coordinated with
 normal page events and state.  Similar to the Atmosphere solution,  ideally
 there would be a lightweight, default/fallback implementation that doesn't
 involve adding a bunch of dependencies to wicket core.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-direction-and-roadmap-regarding-push-like-updates-tp4351890p4370083.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




-- 
Si tu penses que la violence ne résout rien, c'est que tu n'as pas tapé
assez fort.


RE: Problem DatePicker, ModalWindow and IE8

2012-02-09 Thread Chris Colman
I had a similar problem. After trying many things the only solution was
to do as the devs suggested: make sure the ModalWindow that opens the
modal with the form in it is ITSELF in a form. Not sure why this is the
only way to get modal forms with DatePickers working on IE 8 - it just
is.

We fixed this in the Wicketstuff ModalX framework by setting up n
ModalWindowS each enclosed in a form - all set up in your base page
class. This ensures that every page in your app has available at any
time n 'already form wrapped' ModalWindowS to you. N is chosen by the
developer to be the maximum number of nested forms that you will ever
need. 2-3 is fine for most apps. 3 is good because it allows nesting to
2 levels of modals + 1 for an extra ModalX MessageBox if required to
alert the user while on the 2 form.

-Original Message-
From: Matt [mailto:matthieu.laurent-...@sgcib.com]
Sent: Friday, 10 February 2012 12:13 AM
To: users@wicket.apache.org
Subject: Problem DatePicker, ModalWindow and IE8

Hi everybody,

I've got some issue about the DatePicker.

I'm using Wicket 1.4.17 with wicket extension 1.4.17 as well.

I'v got a modal window, with a form and inside a datetextfield with a
datepicker. Everything is working fine with firefox but not with IE8.

In fact, i can display the calendar when i click on the calendar icon,
i
can
select a day (which closes the datepicker), but i can't close it with
the
close button nor change the current month displayed ... .

When i put my mouse over one of those buttons (close or change month),
i
don't have the pointer cursor and when i click it does nothing.

I don't have any javascript error neither.

I tried the datepicker on IE8 but not in a modal window, and it's
working.

The only thing that succeded, is that a changed the css attribute
position
of the close button (set to relative), and then i can click the
button
but
the style is broken and i the the text Close above the image in
backround
(tried to fix the style then but it's a pain in the ass).

Here is some of my code :

/form wicket:id=modalForm
  div wicket:id=modal/div
  /form/

Panel added inside the modal :

/form wicket:id=insideForm class=form
  ul
li ...
..
li
 labelWicket message/label
  input wicket:id=date type=text /input
/li/

Java code is classical, may be not useful (as html may be lol).

I try hard to fix this but nothing is really working. Maybe it comes
from
the way i'm doing it but i can't figure out where ... .

If somebody has an idea, or had and fixed this issue in the past 

Thanks ^^

--
View this message in context: http://apache-
wicket.1842946.n4.nabble.com/Problem-DatePicker-ModalWindow-and-IE8-
tp4372772p4372772.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: Expiration of unversioned pages in Wicket 1.5

2012-02-09 Thread David Rain
 On Thu, Feb 9, 2012 at 1:37 PM, Martin Grigorov mgrigorov at apache.org 
wrote:
  Hi,
 
  I'm not sure whether this is the fix for this problem but we improved
  org.apache.wicket.request.cycle.RequestCycle#setResponsePage(Page)
  to set statelessHint to false even for stateless pages because without
  saving them in the store we are not able to find them later after the
  redirect.
 
  If you want to be stateless then you need to use
  #setResponsePage(ClassPage) instead. Redirecting to a pre-created
  page instance is not stateless at all - stateless means that a new
  page instance will be created for each request.
 
  On Thu, Feb 9, 2012 at 8:55 AM, David Rain david_rain at kb.cz wrote:
  Martin Grigorov mgrigorov at apache.org writes:
 
 
  can you create a ticket for this. I think I know what happens
  thanks!
 
  On Fri, Sep 9, 2011 at 6:57 PM, pasto peter.pastrnak at gmail.com 
wrote:
   Hi,
  
   in Wicket 1.5 RC7 is f.e. the RedirectPage set to unversioned, that 
makes
  it
   impossible to render using the REDIRECT_TO_RENDER strategy. Because of 
this
   flag the page instance is not being stored in the PageMap store, so it 
is
   not accessible during the render phase. Is there some setting that can 
tell
   Wicket to set unversioned pages as dirty (touch the page in 
pagemanager)
   when using this strategy? Or I just didn't get the point? :)
  
   Thank you,
   Peter.
  
   --
   View this message in context: http://apache-
  wicket.1842946.n4.nabble.com/Expiration-of-unversioned-pages-in-Wicket-1-
5-
  tp3802099p3802099.html
   Sent from the Users forum mailing list archive at Nabble.com.
  
   -
   To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
   For additional commands, e-mail: users-help at wicket.apache.org
  
  
 
 
 
  Hi Martin!
  I'm interested if an issue was created for this bug and if the problem was
  solved then? I couldn't find it anywhere in JIRA and I am now facing the
  (nearly) same problem.
  I create the page (stateless), wrap it in PageProvider and
  RenderPageRequestHandler and make urlFor it to navigate a pure javascript
  modal window to it. But I get PageExpiredException for that new Page.
  If I call getSession().getPageManager().touchPage(...) after creation,
  everything's fine, but I think this is not conceptual (I use it just as 
hotfix)
 
  Running Wicket 1.5.4
 
  Thanks for reply!
 
  David
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com
 
  -
  To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
  For additional commands, e-mail: users-help at wicket.apache.org
 
 

Hi Martin!
Sorry for confusion! I didn't mean stateless page, but unversioned one. I'll 
give you an simplest example, it will do best:

PAGE 1:
public class WicketMainPage extends WebPage {
public WicketMainPage() {
PopupPage page = new PopupPage(Created:  + new Date());
//  getSession().getPageManager().touchPage(page);
PageProvider pp = new PageProvider(page);
RenderPageRequestHandler rh = new RenderPageRequestHandler(pp);
add(new Label(url, urlFor(rh).toString()));
}
}

as you can see, I only create an instance of second page (which is not 
bookmarkable as it has some parameters), wrap it in page provider and request 
handler and simply output URL for it (of course it is an stateful URL).

The second page is just simple outputting text from constructor
PAGE 2:
public class PopupPage extends WebPage {
public PopupPage(String text) {
add(new Label(text, text));
}
}

When I run this, the app outputs an relative part of URL to the second page... 
if I copy this into browser, everything works, when pages are versioned. But 
when I set setVersionPagesByDefault(false) I start to get PageExpiredException 
whe trying to access the second page. When I uncomment the touchPage line, 
everythings works even with unversiones paged.
I tried to debug the code of Wicket and I noticed, then the page is touched 
and thus stored in touched pages adn then in page map only when it is 
versioned.
So with unversiones paged, the second request (which carries only a pageId in 
URL in form /wicket/page?1...) does not find the page by id and the 
PageProvider throws the exception in getPageInstance().

I think, that instead of explicitly touching the page, it should be done by 
Wicket when retrieving the url for it. Somewhere in mapUrlFor or mapHandler, 
etc...

Thanks for your patience.
David




-
To 

Re: Very simple Wicket test to verify panel type...

2012-02-09 Thread Hans Lesmeister
Hi,

panelid instead of :panelid?
You can dump the Component-Tree to the console with tester.dumpXXX


Am 09.02.12 21:59 schrieb Bjørn Grønbæk unter
bjorn.gronb...@endomondo.com:

 Hi,
 
 I'm just starting out with Wicket and WicketTester...
 
 I have a page that adds one of several panels, depending of its
 PageParameter. I would like to verify that behaviour with WicketTester...
 but how to?
 
 The code is something like this:
 
 String type = null;
 Panel p = null;
 
 if(getPageParameters() != null)
 type = getPageParameters().getString(BRAND_TYPE);
 
 if(type != null  type.equals(BRAND))
 p = new PanelA(id);
 else
 p = new PanelB(id);
  add(p);
 
 I've tried something like this:
 
 wicketTester.startPage(CreatePage.class);
 wicketTester.assertRenderedPage(CreatePage.class);
 wicketTester.assertComponent(:panelid,PanelA.class);
 
 but that doesn't work. The test fails with this message:
 junit.framework.AssertionFailedError: component 'CreatePage' is not
 type:PanelA
 
 Am I using the AssertComponent in a wrong way?
 How else can I perform a test like that?
 Could you point me to a good resource on how I find the path to components?
 



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



Re: Very simple Wicket test to verify panel type...

2012-02-09 Thread Martin Grigorov
Hi

One way to see the component paths is:
org.apache.wicket.util.tester.BaseWicketTester#debugComponentTrees

Another way is by using DebugBar from wicket-devutils. At
http://www.wicket-library.com/wicket-examples/forminput , in the
top-right corner there is a link Inspector, click it and it will
show you more info, check Page section.

On Thu, Feb 9, 2012 at 10:59 PM, Bjørn Grønbæk
bjorn.gronb...@endomondo.com wrote:
 Hi,

 I'm just starting out with Wicket and WicketTester...

 I have a page that adds one of several panels, depending of its
 PageParameter. I would like to verify that behaviour with WicketTester...
 but how to?

 The code is something like this:

        String type = null;
        Panel p = null;

        if(getPageParameters() != null)
            type = getPageParameters().getString(BRAND_TYPE);

        if(type != null  type.equals(BRAND))
            p = new PanelA(id);
        else
            p = new PanelB(id);
         add(p);

 I've tried something like this:

 wicketTester.startPage(CreatePage.class);
 wicketTester.assertRenderedPage(CreatePage.class);
 wicketTester.assertComponent(:panelid,PanelA.class);

 but that doesn't work. The test fails with this message:
 junit.framework.AssertionFailedError: component 'CreatePage' is not
 type:PanelA

 Am I using the AssertComponent in a wrong way?
 How else can I perform a test like that?
 Could you point me to a good resource on how I find the path to components?


 --

 Best Regard

 Bjørn Grønbæk

 Software Engineer

 m: bjorn.gronb...@endomondo.com first%20name.last%20n...@endomondo.com
 p: +45 22669501
 w: *www.endomondo.com* http://www.endomondo.com/
 t: *www.twitter.com/endomondo* http://www.twitter.com/endomondo
 f:* **www.facebook.com/endomondo* http://www.facebook.com/endomondo
 e: www.endomondo.com/profile/406738 http://www.endomondo.com/profile/your



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