Re: Wicket 1.5 - setResponsePage() - page still tries to render HTML before redirect

2011-11-04 Thread bht
Hi,

To abort the construction of the page, you throw
ResetResponseException or subclasses.

Regards,

Bernard


On Fri, 4 Nov 2011 19:12:34 -0700 (PDT), you wrote:

Hi,

Geoff Hayman raised this issue previously here:
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-setResponsePage-page-still-tries-to-render-HTML-before-redirect-td3819145.html

but apparently got no response (and Nabble won't let me reply to that for
some reason... conspiracy?)

I've run into the same issue- with 1.5, you can no longer short-circuit the
constructor of a page, as Wicket complains if all the components haven't
been added so as to match the HTML. I often use this for things like access
control- if some condition isn't met, set the response to another page
without rendering any components. If this is an improper use of the
framework, what is the correct pattern for dealing with this?

I can work around this by rendering dummy data to my components, but that's
rather ugly. 

Thanks


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



Re: Yet another PageExpiredException question

2011-10-01 Thread bht
Hi Alec,

Wicket 1.5.1 includes an improvement that deals with expired pages
gracefully if they are mapped.

See https://issues.apache.org/jira/browse/WICKET-4014

Regards,

Bernard


On Fri, 30 Sep 2011 15:26:15 -0600, you wrote:

Hello,

I have recently reviewed our application log files and noticed a lot
of PageExpiredException error logs. Here are some of them:

1. PageExpiredException: Cannot find the rendered page in session
[pagemap=null,componentPath=1,versionNumber=0]
2. PageExpiredException: No behaviors attached to component
[MarkupContainer [Component id = mainMenuItemLink]]

We use approach described in this article
http://web.mac.com/jonathan.locke/iWeb/JonathanLocke/Blog/C68818AE-E983-4D7A-B6BF-E95CD886BFF2.html
to return the previous response page if it's not null and not equal to
the current page that threw exception. We do this for every exception
that goes throuh WebRequestCycle#onRuntimeException(). Is this a bad
idea?

The page that typically throws these exceptions has no-arg constructor
and constructor that takes PageParameters, which I assume qualifies it
as stateless. When I breakpoint in onAfterRender()
WebPage#isStateless() returns true. But the page has a lot of AJAX
components. Could this be causing PageExpiredExceptions?

Some people on this list recommended creating and returning a new
instance of the page that caused the error. Others, like the article
above, recommend returning the last rendered page.

What's the recommended way to handle PageExpiredExceptions?

Thanks,

Alec

-
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: Yet another PageExpiredException question

2011-10-01 Thread bht
Alec,

Please download the testcase from the Jira attachment. It contains
workarounds for HybridUrlCodingStrategy and AJAX requests.

Regards,

Bernard 



On Sat, 1 Oct 2011 13:40:10 -0600, you wrote:

Hello and thank you for a good JIRA resource.

I am using Wicket 1.4.18 and my page is mounted with HybridUrlCodingStrategy.

What can I do to recover from PageExpiredException?

Thanks,

Alec

On Sat, Oct 1, 2011 at 12:43 PM,  b...@actrix.gen.nz wrote:
 Hi Alec,

 Wicket 1.5.1 includes an improvement that deals with expired pages
 gracefully if they are mapped.

 See https://issues.apache.org/jira/browse/WICKET-4014

 Regards,

 Bernard


 On Fri, 30 Sep 2011 15:26:15 -0600, you wrote:

Hello,

I have recently reviewed our application log files and noticed a lot
of PageExpiredException error logs. Here are some of them:

1. PageExpiredException: Cannot find the rendered page in session
[pagemap=null,componentPath=1,versionNumber=0]
2. PageExpiredException: No behaviors attached to component
[MarkupContainer [Component id = mainMenuItemLink]]

We use approach described in this article
http://web.mac.com/jonathan.locke/iWeb/JonathanLocke/Blog/C68818AE-E983-4D7A-B6BF-E95CD886BFF2.html
to return the previous response page if it's not null and not equal to
the current page that threw exception. We do this for every exception
that goes throuh WebRequestCycle#onRuntimeException(). Is this a bad
idea?

The page that typically throws these exceptions has no-arg constructor
and constructor that takes PageParameters, which I assume qualifies it
as stateless. When I breakpoint in onAfterRender()
WebPage#isStateless() returns true. But the page has a lot of AJAX
components. Could this be causing PageExpiredExceptions?

Some people on this list recommended creating and returning a new
instance of the page that caused the error. Others, like the article
above, recommend returning the last rendered page.

What's the recommended way to handle PageExpiredExceptions?

Thanks,

Alec

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


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



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


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



Re: Redirect behaves differently between 1.4.15 and 1.4.18

2011-10-01 Thread bht
Hi Gert-Jan,

I can't comment on your unit test but I have found a similar issue in
1.5.1:

WicketTester does not handle RedirectToUrlException
https://issues.apache.org/jira/browse/WICKET-4104

IMHO in a page constructor, it is preferable to use
ResetResponseException or RedirectToUrlException.

Otherwise there can be unexpected results with setResponsePage where
contents of both pages are interleaved. However I haven't tried this
in onInitialize.

I would recommend to watch the Jira issue. We could learn from the
outcome.

Regards,

Bernard

On Wed, 21 Sep 2011 10:25:38 +0100, you wrote:

Hello all!

As I haven't received a single response yet, even though I created a 
unit test that fails after upgrading to a new version, which seems 
serious to me, I would like to ask you again:

This week we upgraded to Wicket 1.4.18 from 1.4.15 and suddenly, our 
unit tests started failing. It seems that it is caused by the fact that 
redirect behave differently. I have attached a unit test that 
demostrates this. It passes with 1.4.15, but fails with 1.4.18. To spare 
you the effort of unpacking the zip, here's the test class (Note: Page1 
is a simple WebPage that redirects to Page2 in it's onInitialize(), all 
classes are in the zip):

package com.roboreus.geosweep.wicket;

import org.apache.wicket.PageParameters;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.util.tester.WicketTester;
import org.junit.Test;

import static junit.framework.Assert.assertTrue;

public class RedirectTest {

 @Test
 public void testRedirect() throws Exception {

 WicketTester tester = new WicketTester();
 tester.startPage(Page1.class);

 assertTrue(Redirect expected, 
tester.getServletResponse().isRedirect());
 String redirectLocation = 
tester.getServletResponse().getRedirectLocation();
 assertTrue(Expected redirect location, 
!(redirectLocation.isEmpty()));

 String redirectUrl = RequestCycle.get().urlFor(Page2.class, new 
PageParameters()).toString();
 assertTrue(Expected redirect to ' + redirectUrl + ', but 
instead got one to ' + redirectLocation + '.,
redirectLocation.contains(redirectUrl));
 }
}

Do any of you know the cause of this and how to solve it?

Thanks and regards!

Gert-Jan Schouten


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



How to set Cookie on Redirect to URL

2011-09-28 Thread bht
Hi,

How do I add a cookie to a URL redirect response? I started with the
following class:

public class RedirectToUrlWithHandlerException extends
ReplaceHandlerException {
...

public RedirectToUrlWithHandlerException(final String redirectUrl,
final int statusCode, final IRequestHandler handler) {
super(new RedirectRequestHandler(redirectUrl, statusCode){
@Override
public void detach(IRequestCycle requestCycle) {
super.detach(requestCycle);
handler.detach(requestCycle);
}
@Override
public void respond(IRequestCycle requestCycle) {
super.respond(requestCycle);
handler.respond(requestCycle);
}
}, true);
}
}


and in the page:

throw new RedirectToUrlWithHandlerException(targetUrl, new
IRequestHandler(){
@Override
public void respond(IRequestCycle requestCycle) {
// Set cookie
cookieUtils.save(name, value);
}

@Override
public void detach(IRequestCycle requestCycle) { }
});

with cookieUtils:

instance.cookieUtils = new CookieUtils(cookieDefaults){
@Override
protected void initializeCookie(Cookie cookie) {
super.initializeCookie(cookie);
cookie.setPath(/);
}
};


Still no cookie in the response.

I know this is a tricky issue where older browsers don't always
cooperate, but the page being redirected to can't set the cookie
because the cookie is used to transfer information to it.

Many thanks,

Bernard

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



1.5 equivalent of setRedirect(false); ?

2011-09-02 Thread bht
Hi,

In 1.4, in a page constructor, we can call setRedirect(false);

What is the equivalent of this in Wicket 1.5?

The purpose of it is to avoid the creation of a new request. I am
aware of the consequences of doing this in 1.4, and I am prepared for
them in 1.5, too.

Many thanks.

Bernard

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



Re: 1.5 equivalent of setRedirect(false); ?

2011-09-02 Thread bht
Martin,

Thanks very much, got the idea!

Regards,

Bernard

On Fri, 2 Sep 2011 09:31:39 +0200, you wrote:

Wicket automatically decides whether redirect is needed for the
current request or not depending on the configured
org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy and by
comparing the current url with the one that the IRequestMapper has
generated for the page that is going to be rendered.
I.e. if the current is: /my/mount/point and the page is stateful then
the new url should be /my/mount/point?0 and Wicket will need to do a
redirect. Otherwise Refresh button wont work, or at least wont refresh
the current page but will create a new one. If you need to always
create a new one then better make your page stateless or map this page
with a custom IRequestMapper based on the default MountedMapper but
not producing ?0.

On Fri, Sep 2, 2011 at 8:18 AM,  b...@actrix.gen.nz wrote:
 Hi,

 In 1.4, in a page constructor, we can call setRedirect(false);

 What is the equivalent of this in Wicket 1.5?

 The purpose of it is to avoid the creation of a new request. I am
 aware of the consequences of doing this in 1.4, and I am prepared for
 them in 1.5, too.

 Many thanks.

 Bernard

 -
 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



1.5: How to get Page instance from RequestCycle in IRequestCycleListener

2011-09-02 Thread bht
Hi,

in 1.4, I could get the last page instance with
WebRequestCycle#getResponsePage()


In 1.5, I cannot find org.apache.wicket.Page instances, only
IRequestablePage, and this indirectly via
(RenderPageRequestHandler)getActiveRequestHandler()

Any help is appreciated.

Kind Regards,

Bernard

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



1.5: Content cannot be added below Body inside Border?

2011-08-28 Thread bht
Hi,

The following markup is used to stuff a form component inside the body
of a border where validation feedback is displayed below the form
component:

wicket:border
wicket:bodyForm Component/wicket:body
!-- feedbackContainer because of the br/ tag that has to be
removed
if feedbackLabel is empty --
span wicket:id = feedbackContainerbr/
span wicket:id=feedbackLabelFeedback here/span
/span
/wicket:border

In 1.4, this works as expected.

In 1.5, I get an error:

Unable to find component with id 'feedbackContainer' in
[FormFeedbackBelowBorder [Component id = emailFeedback]]
Expected:
'formPanel:registerForm:emailFeedback.feedbackContainer'.
Found with similar names:
'formPanel:registerForm:emailFeedback:emailFeedback_body:feedbackContainer'

It looks like Wicket thinks that the feedbackContainer is inside the
bodyContainer which it obviously isn't.

Is it no longer possible in 1.5 to add wicket tags inside
wicket:border but outside its wicket:body?

Thanks,

Bernard

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



Re: 1.5: Content cannot be added below Body inside Border?

2011-08-28 Thread bht


public class FormFeedbackBelowBorder extends Border implements
IFeedback {

private static final long serialVersionUID = 1L;
private String inputStyleClassNormal;
private String inputStyleClassFeedback;
private MyFeedbackLabel feedbackLabel;
// feedbackContainer: So we can make it invisible.
private WebMarkupContainer feedbackContainer;
// component: Required for filters
private Component component;

public FormFeedbackBelowBorder(final String id, Component
component,
final String inputStyleClassNormal, final String
inputStyleClassFeedback) {
super(id);
this.component = component;
this.inputStyleClassNormal = inputStyleClassNormal;
this.inputStyleClassFeedback = inputStyleClassFeedback;
// Insert component into wicket:body/ of this container:
this.getBodyContainer().add(component);
// MarkupContainer is required so that the br/ can be hidden
if no
// feedback is shown
this.feedbackContainer =
new WebMarkupContainer(feedbackContainer);
this.feedbackLabel = new MyFeedbackLabel(feedbackLabel,
component);
this.feedbackContainer.add(this.feedbackLabel);
add(this.feedbackContainer);
}

Regards,

Bernard




On Sun, 28 Aug 2011 14:18:34 +0300, you wrote:

it should be possible
show the java code

On Sun, Aug 28, 2011 at 2:19 PM,  b...@actrix.gen.nz wrote:
 Hi,

 The following markup is used to stuff a form component inside the body
 of a border where validation feedback is displayed below the form
 component:

 wicket:border
    wicket:bodyForm Component/wicket:body
    !-- feedbackContainer because of the br/ tag that has to be
 removed
    if feedbackLabel is empty --
    span wicket:id = feedbackContainerbr/
        span wicket:id=feedbackLabelFeedback here/span
    /span
 /wicket:border

 In 1.4, this works as expected.

 In 1.5, I get an error:

 Unable to find component with id 'feedbackContainer' in
 [FormFeedbackBelowBorder [Component id = emailFeedback]]
        Expected:
 'formPanel:registerForm:emailFeedback.feedbackContainer'.
        Found with similar names:
 'formPanel:registerForm:emailFeedback:emailFeedback_body:feedbackContainer'

 It looks like Wicket thinks that the feedbackContainer is inside the
 bodyContainer which it obviously isn't.

 Is it no longer possible in 1.5 to add wicket tags inside
 wicket:border but outside its wicket:body?

 Thanks,

 Bernard

 -
 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: 1.5: Content cannot be added below Body inside Border?

2011-08-28 Thread bht
Thanks Martin, it works.

On Sun, 28 Aug 2011 14:35:02 +0300, you wrote:

Border.add() delegates to .addToBodyContainer().
Use .addToBorder() to add something that is ot of the body.
It is in the migration guide


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



Re: Prevent Double Submit When Holding Enter Button

2011-07-09 Thread bht
Hi,

I would think that under normal conditions, Wicket prevents double
submits from occcuring. That should be part of any framework
functionality.

So if you observe a scenario where double submit is possible, then
please create a testcase with a quickstart, see
http://wicket.apache.org/start/quickstart.html
, and report it at http://issues.apache.org/jira/browse/WICKET

Bernard.

On Sat, 9 Jul 2011 18:01:15 +0800, you wrote:

nope,
i'm submitting via normal Button component

On Sat, Jul 9, 2011 at 5:55 PM, Josh Kamau joshnet2...@gmail.com wrote:
 Are you submitting via ajax?

 On Sat, Jul 9, 2011 at 12:39 PM, Horacio Natyural 
 horacio.natyu...@gmail.com wrote:

 btw,

 this happens when I hold the Enter button without releasing it..


 Thanks

 On Sat, Jul 9, 2011 at 5:31 PM, Horacio Natyural
 horacio.natyu...@gmail.com wrote:
  Hi,
 
  Is there a way that I can prevent a double submit when I'm holding the
  enter button?
  I'm using a normal Button component.
 
  I can't seem to prevent it from submitting the form twice..
 
  Thanks
  Carlo


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



IDE / Server Support

2011-03-24 Thread bht
Hi,

How do you get fast deployment in development with large Wicket EJB
applications?

Wicket pages are ordinary class files that do not always seem to have
special redeployment support like JSP files or HTML files.

I have an EJB 3.1 app deployed on GlassFish 3.1. Web pages in the web
directory deploy automatically in milliseconds, but whenever I save a
Java class file, deploy on save deploys the whole application.

This is not a big deal with hello world apps, but it hurts badly
otherwise. As an example I tried the Wicket example application with
hundreds of class files which takes more than half a minute to deploy
on fast computers, and during that time, the IDE freezes.

I thought that a decent servlet container should be able to detect
single class file changes and hot-deploy them individually. But I
might be wrong. The NetBeans folks think otherwise and refer me to the
GlassFish server docs.

I don't care so much about their view because what matters to me is
the fact that - say a PHP developer - just saves his files and hits
the reload button, and that is what I try to get, too. Otherwise I
feel I am fighting an uphill battle.

Any thoughts are appreciated.

Bernard

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



Re: Handling first AJAX request when cookies are disabled

2011-03-21 Thread bht
Without having tested it, I would try to create a permanent session,
hoping that the framework would do the rest in order to create server
side state for the page:

session.bind()

The idea behind this is that Wicket can do AJAX only for stateful
pages.

Regards,

Bernard



On Sat, 19 Mar 2011 07:59:46 -0700, you wrote:

I'm struggling with a problem that probably has an easy solution.  When 
cookies are disabled, if the first action on viewing the site is an AJAX 
request, it fails because the jsessionid hasn't been written into the URL.  I 
notice that on other sites (such as wicketstuff), this doesn't happen because 
the first request gets a 302 (Temporarily Moved) to a URL that includes the 
jsessionid.  Is this being done by the servlet container (I'm using Jetty), or 
is it handled elsewhere in the stack?

One workaround to this problem is to setGatherExtenededBrowserInfo(true), but 
that results in the temporary display of an error page, which freaked out my 
boss.

Any ideas how to best handle this?  Thanks, and sorry if this has been 
discussed before.  I searched in vain.

-Don


-
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



inheriting abstract panels and pages

2011-03-12 Thread bht
Hi,

I was pleasantly surprised to see that Wicket inherits
MyPageAbstract.html for two page classes MyPage1.java extends
MyPageAbstract and MyPage2.java extends MyPageAbstract.

The two implementations work fine without having their own markup -
Wicket loads the markup MyPageAbstract.html for them.

But with panels, I get:

Markup of type 'html' for component 'MyPanel1' not found.

True, there is no such markup, but why can Wicket not load
MyPanelAbstract.html in the same way as with pages?


Thanks

Bernard


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



Re: inheriting abstract panels and pages

2011-03-12 Thread bht
Sorry, it actually works, had a typo :)

On Sun, 13 Mar 2011 16:24:55 +1300, you wrote:

Hi,

I was pleasantly surprised to see that Wicket inherits
MyPageAbstract.html for two page classes MyPage1.java extends
MyPageAbstract and MyPage2.java extends MyPageAbstract.

The two implementations work fine without having their own markup -
Wicket loads the markup MyPageAbstract.html for them.

But with panels, I get:

Markup of type 'html' for component 'MyPanel1' not found.

True, there is no such markup, but why can Wicket not load
MyPanelAbstract.html in the same way as with pages?


Thanks

Bernard


-
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: How to invalidate session after panel replacement?

2010-12-11 Thread bht
Thanks Ernesto.

It is doable without JavaScript:

WebRequestCycle requestCycle = (WebRequestCycle) RequestCycle.get();
WebRequest webRequest = (WebRequest) requestCycle.getRequest();
HttpServletRequest httpServletRequest =
webRequest.getHttpServletRequest();
httpServletRequest.getSession().setMaxInactiveInterval(5);

It is not perfect, and I thought that Wicket, depending so heavily on
the session, would provide a means to destroy it after use.

Regards,

Bernard


On Fri, 10 Dec 2010 11:08:58 +0100, you wrote:

Bernard,

There was someone asking something similar a few day ago... One idea
that might work is

-Put an ajax behavior on your page (AbstractDefaultAjaxBehavior) and
use it to generate a callback url.
-Use a non wicket AJAX (e.g. jquery AJAX) to call this behavior.
-Make your panel call back this behavior when it is loaded. E.g make
it implement IHeaderContributor and on

public void renderHead(IHeaderResponse response)
{
   response.renderOnDomReadyJavascript(Put your AJAX call here!);
}
I think you can't use wicket AJAX because it will redirect you if you
invalidate the session.
 -On the AbstractDefaultAjaxBehavior.respond(AjaxRequestTarget target)
invalidate your session.

Regards.

Ernesto


On Fri, Dec 10, 2010 at 9:47 AM,  b...@actrix.gen.nz wrote:
 Hi,

 I need to invalidate the web session after a panel of the current page
 is replaced.

 All my attempts are failing because webSession.invalidate() or even
 webSession.replaceSession(); have an influence on the current
 request/response.

 Typically, one would just show a new page, e.g.

 Session.invalidate();
 setResponsePage(...);

 but I don't have this option.

 Is there any hook that I can use to expire the session after the work
 on the current page is done? It is quite tricky because the page that
 is loaded back into the browser with redirect after post needs the
 session to replace the panel.

 I have tried this but it doesn't work:

 replacedPanel.getPage().add(new AbstractBehavior(){
    private boolean lastTime = false;
   �...@override
    public void detach(Component component) {
        super.detach(component);
        if(lastTime){
            AuthenticatedWebSession webSession =
 (AuthenticatedWebSession)Session.get();
            webSession.replaceSession();
        }else{
            lastTime = true;
        }
    }
 });
 replacedPanel.replaceWith(newPanel);

 Many thanks,

 Bernard


 -
 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



How to invalidate session after panel replacement?

2010-12-10 Thread bht
Hi,

I need to invalidate the web session after a panel of the current page
is replaced.

All my attempts are failing because webSession.invalidate() or even
webSession.replaceSession(); have an influence on the current
request/response.

Typically, one would just show a new page, e.g.

Session.invalidate();
setResponsePage(...);

but I don't have this option.

Is there any hook that I can use to expire the session after the work
on the current page is done? It is quite tricky because the page that
is loaded back into the browser with redirect after post needs the
session to replace the panel.

I have tried this but it doesn't work:

replacedPanel.getPage().add(new AbstractBehavior(){
private boolean lastTime = false;
@Override
public void detach(Component component) {
super.detach(component);
if(lastTime){
AuthenticatedWebSession webSession =
(AuthenticatedWebSession)Session.get();
webSession.replaceSession();
}else{
lastTime = true;
}
}
});
replacedPanel.replaceWith(newPanel);

Many thanks,

Bernard


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



Re: How to get form submit to return to previous page?

2010-09-02 Thread bht
What about

redirectToInterceptPage(new FormPage());

and in FormPage onSubmit:

if (!continueToOriginalDestination()) {
setResponsePage(Application.get().getHomePage());
}

Regards,

Bernard


On Wed, 1 Sep 2010 20:30:20 -0700, you wrote:

do not pass the page, pass the page reference, see page#getpagereference()

-igor

On Wed, Sep 1, 2010 at 6:21 PM, Chris Merrill ch...@webperformance.com wrote:
 On 9/1/2010 7:26 PM, Chris Colman wrote:
 I have a form/page that can be invoked from different pages so I can't
 easily specify which page should be returned to after submit.

 When I needed to do this, I passed the original page into the page 
 constructor
 where it was passed to the onSubmit() handler. Then the onSubmit() method
 set it as the return page:
  getRequestCycle().setResponsePage(_return_to_page);


 --
  -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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: DropDownChoice and generics

2010-09-02 Thread bht
Hi,

IModelPerson personModel = getPersonModel();

ListGender genders = getGenderList();

DropDownChoice dropDownChoiceGender = new 
DropDownChoice(genderFieldId, new PropertyModelGender(personModel,
gender), genderList);

Regards,

Bernard


On Thu, 2 Sep 2010 10:02:27 +0300, you wrote:

Hello,
the generics solution for the DropdownChoice is weird in my opinion.

I want to write like this:

ListGender genders = getGenderList();
DropdownChoicePerson new DropDownChoicePerson(fieldId, new
PropertyModelPerson(currentPerson, gender), genders);

But the compilation fails because of the mismatch between generics.
Actually how to solve such situations? Wicket's generic's are quite
weird in my opinion and I cannot understand them probably correctly...

I want to assign object(in my case Gender to Person) from the list via
PropertyModel to my object but cannot understand, how to do it. Did
not find even any examples from the manual.

Sigmar

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

2010-08-24 Thread bht
Hi,

If you use the default ant projects in NetBeans, then you get deploy
on save with session preservation.

I haven't found this functionality in maven under netbeans yet.

You don't need to re-start any server just save your file and reload
the page.

The advantage is that you can develop the application under the server
that you will deploy it on in production.

Regards,

Bernard


On Tue, 24 Aug 2010 10:27:32 -0700 (PDT), you wrote:


Per the  http://wicket.apache.org/start/quickstart.html quickstart page , I
built the quickstart project ala:

c:\var\dev\netbeansmvn archetype:create 
 -DarchetypeGroupId=org.apache.wicket 
 -DarchetypeArtifactId=wicket-archetype-quickstart 
 -DarchetypeVersion=1.4.10 -DgroupId=foo.bar -DartifactId=foo

opened it in Netbeans, created the action jetty:run and started the
application. All is well and I can see the greeting page.

If I change the text on the html file or alter the message in the class file
- nothing happens. If I shutdown and restart jetty:run, the changes appear.
I added the scanIntervalSeconds:

   plugin
   groupIdorg.mortbay.jetty/groupId
   artifactIdmaven-jetty-plugin/artifactId
configuration
   
scanIntervalSeconds3/scanIntervalSeconds
/configuration
   /plugin

to the POM file but still no change. Is there something else I must do in
Netbeans to see and publish changes I make to Wicket files or ... is there a
better way to do this so that I'm not constantly restarting the web server?

I also tried the 'Start' class - and I can see the pages - but they do not
refresh when I change anything on them or their related class files.

What is generally the best routine for the smoothest development workflow
with wicket. A different IDE?


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



Re: [1.5] new wicket URL-related questions

2010-08-23 Thread bht
Hi,

A2:

http://blog.armstrongconsulting.com/?p=14

A4:

I will look at this in 1.5 myself at some stage as well, so please
keep in touch. Meanwhile, have you seen

http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html

I have a special use case for this where I don't want to create
browser history entries of different versions of a stateful page (back
button problem solution).


Regards,

Bernard



On Mon, 23 Aug 2010 20:53:26 +0200, you wrote:

Hi!

As I'm testing wicket 1.5-SNAPSHOT, I'm seeing some strange behaviors:
With 1.4 I've used to have url's like:
showuser/id/1234
now when I open simply the page without params, I will see the following
URL:
showuser?[0-9]+
When I looked at the JavaDoc of the new MountMapper (which is the
replacement for mountBookmarkablePage), I saw that I'm having this URL,
because my page is not stateless.
Q1: with 1.4 this was possible, because the URL contained the pagemap
instance number, or is there something else?
Q2: (a little n00b question) how can I find out which component makes my
page stateful?

when I try to hit the URL now:
showuser/id/1234
then I'm going to have indexed parameters and not named parameter with
'id' name. Q3: Why is that?
if I have a page with URL in browser:
showuser?8id=123
and I rewrite the id to 124, then I'm going to still see the page for
123, which is really disturbing! Q4: is there a solution for this to
work? Or should I make my page stateless to be able to do this?? (How?)

Also how could I make Wicket to use by default the /id/1234 format
instead of ?3id=1234 for link creation??

Thanks for your help.

Best Regards,
Peter Major

-
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



Stateless Login Form possible?

2010-08-20 Thread bht
Hi,

I had a stateless login form that did actually not expire

... until I added an image as submit button.

Sorry to raise this topic again, but AFAIK this has not been answered
yet:

ImageButton - always stateful ?

http://apache-wicket.1842946.n4.nabble.com/ImageButton-always-stateful-td1875620.html

I feel I am forced to use ImageButton because I need it as
IFormSubmittingComponent so I can distinguish between two different
submit methods.

It is really as simple as two image buttons on the form - one as
login, the other as forgot password

Many thanks for any ideas!

Bernard


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



Re: Stateless Login Form possible?

2010-08-20 Thread bht
Hi Johan,

Thanks.

How is it possible that this is true with any ImageButton constructor:

(getImageResource() == null  localizedImageResource.isStateless())


On Fri, 20 Aug 2010 13:25:11 +0200, you wrote:

an image button can be stateless:

   protected boolean getStatelessHint()
   {
   return getImageResource() == null  
 localizedImageResource.isStateless();
   }

but that must be true.

On Fri, Aug 20, 2010 at 13:19,  b...@actrix.gen.nz wrote:
 Hi,

 I had a stateless login form that did actually not expire

 ... until I added an image as submit button.

 Sorry to raise this topic again, but AFAIK this has not been answered
 yet:

 ImageButton - always stateful ?

 http://apache-wicket.1842946.n4.nabble.com/ImageButton-always-stateful-td1875620.html

 I feel I am forced to use ImageButton because I need it as
 IFormSubmittingComponent so I can distinguish between two different
 submit methods.

 It is really as simple as two image buttons on the form - one as
 login, the other as forgot password

 Many thanks for any ideas!

 Bernard


 -
 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



Page expired with Panel Replacement without Cookie Support

2010-08-18 Thread bht
Hi,

I switched off cookie suport in FireFox 3.6.3 to test whether an
application still works via URL rewriting:

In FireFox Tools|Option|Privacy|History|FireFox will:Use Custom
Settings for History|Uncheck Accept Cookies from Sites

Then with the most basic panel replacement (no AJAX), I always get
page expired errors.

Works fine with cookie support.

public class Panel1 extends Panel{

public Panel1(String id) {
super(id);
add(new Link(switch) {
@Override
public void onClick() {
Panel1.this.replaceWith(new
Panel2(Panel1.this.getId()));
}
});
}
}

What am I missing?

Many thanks,

Bernard

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



Re: Page expired with Panel Replacement without Cookie Support

2010-08-18 Thread bht
Hi,

I filed a testcase here:
https://issues.apache.org/jira/browse/WICKET-3000

Bernard

On Wed, 18 Aug 2010 20:47:22 +1200, you wrote:

Hi,

I switched off cookie suport in FireFox 3.6.3 to test whether an
application still works via URL rewriting:

In FireFox Tools|Option|Privacy|History|FireFox will:Use Custom
Settings for History|Uncheck Accept Cookies from Sites

Then with the most basic panel replacement (no AJAX), I always get
page expired errors.

Works fine with cookie support.

public class Panel1 extends Panel{

public Panel1(String id) {
super(id);
add(new Link(switch) {
@Override
public void onClick() {
Panel1.this.replaceWith(new
Panel2(Panel1.this.getId()));
}
});
}
}

What am I missing?

Many thanks,

Bernard

-
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



Delegate loading of wicket-event.js?

2010-08-17 Thread bht
Hi,

I get two instances of wicket-event.js and other resources in the
browser cache due to the probing for client cookie suport on the first
page in the browser session. One with jsessionid in the URl and one
without.

Can Wicket delegate the loading of these (extracted from the jar file)
files to outside the path of the wicket servlet filter eg ../scripts
same as static css files, images?

Example:

script type=text/javascript
src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83/script

Many thanks,

Bernard

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



Re: Delegate loading of wicket-event.js?

2010-08-17 Thread bht
Thanks Igor.
https://issues.apache.org/jira/browse/WICKET-2999

Regards,

Bernard


On Tue, 17 Aug 2010 18:31:50 -0700, you wrote:

you should file this as a bug, packagedresourcereference urls should
not be encoded with the session id

-igor

On Tue, Aug 17, 2010 at 6:30 PM,  b...@actrix.gen.nz wrote:
 Hi,

 I get two instances of wicket-event.js and other resources in the
 browser cache due to the probing for client cookie suport on the first
 page in the browser session. One with jsessionid in the URl and one
 without.

 Can Wicket delegate the loading of these (extracted from the jar file)
 files to outside the path of the wicket servlet filter eg ../scripts
 same as static css files, images?

 Example:

 script type=text/javascript
 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=27928765fd5f30bedfe2cc2d1e83/script

 Many thanks,

 Bernard

 -
 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



How to get submitting component in onError()?

2010-08-15 Thread bht
Hi,

In a form with two submit buttons, a result must be calculated in
onError(), using the value of a FormComponent and depending on which
of the submit buttons was pressed.

I found that findSubmittingButton() and getDefaultButton() return null
in onError().

What to do?

Many thanks,

Bernard


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



Re: How to get submitting component in onError()?

2010-08-15 Thread bht
Hi James,

Thank you very much for your reply.

It didn't work because the form was submitted with input type=image,
and I did not add an ImageButton for it.

Things would be a little easier if there was an overridable onClick()
method for submitting components not this Where was I type of back
to front logic.

When using an ImageButton, one is forced to store the image as
resource in the Java package structure which is another complication
because web designers want to control such images in the web
directory.

Many thanks,

Bernard


On Sun, 15 Aug 2010 10:47:58 -0400, you wrote:

From the looks of the code for findSubmittingButton(), it shouldn't
matter whether you're in onError() or onSubmit().  What does
findSubmittingButton() return in onSubmit()?

On Sun, Aug 15, 2010 at 6:59 AM,  b...@actrix.gen.nz wrote:
 Hi,

 In a form with two submit buttons, a result must be calculated in
 onError(), using the value of a FormComponent and depending on which
 of the submit buttons was pressed.

 I found that findSubmittingButton() and getDefaultButton() return null
 in onError().

 What to do?

 Many thanks,

 Bernard


 -
 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



jsessionid in URLs of non-versioned Pages

2010-08-15 Thread bht
Hi,

I use panel replacement on setVersioned(false) pages in combination
with HybridUrlCodingStrategy and the default
IRequestCycleSettings.REDIRECT_TO_BUFFER so that users stay on the
same page and cannot see previos versions when pressing the back
button. That is because all pages have the same URL.

With the first request the servlet container
doesn't know you have cookie support. So it will append the
jsessionid to the URL.

After that with the second request it sees the cookie coming in and
then it doesn't append the jsessionid anymore.

This is then creating two pages in browser history one with jsessionid
and one without it which is causing me a headache:

If on subsequent requests, the user presses the back button and
re-submits, then the submit hits the only last version of the
non-versioned page which lacks the (replaced) form to submit to and
the page crashes.

Any ideas would be highly appreciated.

Regards,

Bernard

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



Re: FormComponentPanel Behavior

2010-07-30 Thread bht
Yes I did. Is it better not to not do this?

Regards,

Bernard

On Thu, 29 Jul 2010 16:54:28 -0300, you wrote:

Hi Bernard, did you call setRequired method on your FormComponentPanel input
components?
like: formComponentPanel.fieldOne.setRequired(true)

On Thu, Jul 29, 2010 at 4:33 PM, b...@actrix.gen.nz wrote:

 Hi,

 org.apache.wicket.markup.html.form.FormComponentPanel
 aims to act to the outside world as one component.

 I want it to behave in a way that it flags missing required input on
 behalf of its enclosed components.

 Imagine an input component with 4 fields for a credit card number.

 If input in any of the fields is missing, then I want to highlight (eg
 with FormComponentFeedbackBorder) the enclosing component not any
 individual sub-fields .

 As an easy test example, please consider

 org.apache.wicket.examples.forminput.Multiply which is included in the
 Wicket distribution.


 http://www.wicketstuff.org/wicket/forminput/?wicket:bookmarkablePage=sources:org.apache.wicket.examples.source.SourcesPageSourcesPage_class=org.apache.wicket.examples.forminput.FormInputsource=Multiply.java

 What is the best way to change this example so that a Required error
 is generated for Multiply if any of its components are empty? I found
 that checkRequired() is not called.

 Many thanks.

 Bernard


 -
 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: How to Update contents of a child component?

2010-07-30 Thread bht
Hi,

Have you checked that rendered values in your components are
model-driven? If so then I think it should work. I sometimes set
values in the constructor with brute force when I do not expect any
changes. This is not what you want in this case.

I found it most helpful to exclusively use LoadableDetachableModel,
remove the Serializable interface from my model objects and let
SerializableChecker sort out some model problems for me. I went so far
as to use a LDM in my WebSession. After some time I had sufficient
practice with models that things started to become really easy.

Regards,

Bernard


On Fri, 30 Jul 2010 02:17:01 -0700 (PDT), you wrote:


Hi All

I would like to know an elegant solution to deal with the following issue.

For CRUD operations this is the approach I have taken.

List of Components
1.ContainerPanel 
2.SearchPanel
3.SearchResultsPanel
4.DetailsPanel and this contains a child component that has a
MultiSelectControl

The ContainerPanel adds the SearchPanel. The SearchPanel, adds
SearchResultsPanel and DetailsPanel.

So when I first load/render the ContainerPanel, I hide the
SearchResultsPanel and DetailsPanel.
When some search is done then I make the SearchResultsPanel visible.

OnClick event of an item of the SearchResultsPanel , I unhide and update the
Model of the Details panel. Now,for some reason it does not seem to refresh
the child component in DetailsPanel(.ie. MultiSelectControl)

So on every OnClick, I want the Details panel to refresh the content of the
nested component in Details Panel. At the moment, I can't see a way to do
this, other than removing the nested component and re-creating it.  I am
sure its not the right way to do it.

Has anyone had a similar scenario before? I would like to use a cleaner way
to approach this.

Also is this approach for CRUD acceptable as in using the container
approach?
Thanks again,


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



FormComponentPanel Behavior

2010-07-29 Thread bht
Hi,

org.apache.wicket.markup.html.form.FormComponentPanel 
aims to act to the outside world as one component.

I want it to behave in a way that it flags missing required input on
behalf of its enclosed components.

Imagine an input component with 4 fields for a credit card number.

If input in any of the fields is missing, then I want to highlight (eg
with FormComponentFeedbackBorder) the enclosing component not any
individual sub-fields .

As an easy test example, please consider

org.apache.wicket.examples.forminput.Multiply which is included in the
Wicket distribution.

http://www.wicketstuff.org/wicket/forminput/?wicket:bookmarkablePage=sources:org.apache.wicket.examples.source.SourcesPageSourcesPage_class=org.apache.wicket.examples.forminput.FormInputsource=Multiply.java

What is the best way to change this example so that a Required error
is generated for Multiply if any of its components are empty? I found
that checkRequired() is not called.

Many thanks.

Bernard


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



How to get checkRequired() called in FormComponentPanel

2010-07-25 Thread bht
Hi,

I have implemented a date chooser custom component with 3 combined
DropDownChoice components.

Like

http://blog.aparnachaudhary.net/2009/07/29/date-dropdownchoice-apache-wicket/

My overriding boolean checkRequired() is not called when the form is
submitted.

I then used FormComponentPanel with the same result.

checkRequired() is called for all 3 contained DropDownChoice
components but not for the containing custom component.

I need this for a FeedbackBorder around the custom component that must
indicate missing input.

Any ideas?

Many thanks,

Bernard

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



Re: including wicket component into jsp

2010-06-28 Thread bht
Have you checked that the wicket filter is called?

I found that the struts filter does not call filterChain.doFilter().
That may or may not be your problem depending whether anything else is
in its path after it. I suspect however that this is what you need
otherwise how can Wicket get the request if the wicket filter is not
called?

Regards

Bernard

On Mon, 28 Jun 2010 10:54:38 -0700 (PDT), you wrote:


Hi all,

I know the many posts have been written on the same problem, but I have been
looking at the answers for 5 hours without having a simple example to work
with..
I basically need to include a single component (a menu) into my jsp pages,
because we are migrating the application from struts/jsp to wicket.
I tried with the following code but it didn't work:

WICKET APPLICATION:

public class WicketApplication extends WebApplication
{
   public WicketApplication(){}
   public ClassHomePage getHomePage(){   return HomePage.class;}
   @Override
   protected void init(){
   getMarkupSettings().setStripWicketTags(true);
   
getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);
   }
}


PAGE MARKUP:
html
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

head  
titleWicket Quickstart Archetype Homepage/title
/head
body
strongWicket Quickstart Archetype Homepage/strong
br/br/
message will be here
/body
/html

PAGE CODE:

public class HomePage extends WebPage {
public HomePage(final PageParameters parameters) {
add(new Label(message, If you see this message wicket is properly
configured and running));
}
@Override
protected void onRender(final MarkupStream markupStream){
   System.out.println(RENDER OF THE PAGE!!);
}
}

JSP PAGE:
jsp:include page=/wic/ /

WEB.XML:

web-app
   filter
   filter-namewicket.embedwicket/filter-name
   filter-classembedwicket.WicketMenuFilter/filter-class
   init-param
   param-nameapplicationClassName/param-name
   param-valueembedwicket.WicketApplication/param-value
   /init-param
   /filter

 filter-mapping
  filter-namewicket.embedwicket/filter-name
   url-pattern/wic/*/url-pattern
   dispatcherINCLUDE/dispatcher
   dispatcherREQUEST/dispatcher
   dispatcherFORWARD/dispatcher
 /filter-mapping
/web-app


WicketMenuFilter:
THIS IS MY CUSTOM WICKET FILTER TO MANAGE INCLUDE URI, AS IT WAS SUGGESTED
BY A GUY HERE:
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
http://apache-wicket.1842946.n4.nabble.com/embedding-Wicket-into-JSP-td1867715.html
 

Basically I overrided the method
public String getRelativePath(HttpServletRequest request)

buy copying it and replacing the following lines:

String path = Strings.stripJSessionId(request.getRequestURI());
String contextPath = request.getContextPath();

with:

String requestURI = (String)
request.getAttribute(javax.servlet.include.request_uri);
if (requestURI == null) {
   requestURI = request.getRequestURI();
}
String path = Strings.stripJSessionId(requestURI);


I tried to debug the code and the filter is called, but then nothing is
displayed on the browser.. just a blank page..
If I call page directly(not the jsp) , it renders correctly..



Has anyone got a simple working example of this situation?

I would really appreciate id because I am going crazy..

Thank you very much.

Riccardo


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



Re: ResourceStreamLocator and mvn resource:resource copying resources in the right directory

2010-06-20 Thread bht
Hi Erik,

I know the problem. It is a JavaScript problem, where the browser has
to construct an absolute URL from the relative URL that is in the HTML
fragment. The question is relative to what context this URL has to be
constructed in the browser - relative to the source of the fragment,
to some iframe or to the source of the page it is inserted into.

I am not arguing with you that you have found a good solution to the
problem.

But if you wanted to solve the problem at the root of it, you would
code the relative URLs at the server, and make them absolute at the
client side. The conversion is quite trivial. I did this for a
JavaScript based e-commerce app some time ago. This will always work
because the browser cannot reqest relative URLs anyway.

Regarding Wicket's inability to do this out of the box, I am once
again disappointed. This is so basic it blows my mind. While Wicket is
very flexible in many areas, in some areas it forces special use cases
as best practice on site develpers who then don't have any choices.

RelativePathPrefixHandler just breaks things by making a stupid
assumption about paths. I wish I could replace it dynamically.

If I start making alternative suggesions, then I am hearing catchy
words like best practice community consensus , begginner and we
like to do it this way. That never convinces anyone because there is
no such thing as a community consensus, and especially not one that
agrees on a special use case.

I would say that putting HTML pages alongside Java source files is a
special use case for component deployment. It is ridiculous to call
this Wicket best practice for site development. Once you explore
benefits eg  better separation of concerns of the more general cases,
you run into trouble only because the original designers did not
consider them enough. A framework might originate from special use
cases but it should at some stage address general cases with higher
priority not as never ending afterthoughts. These things should be
pluggable.

Regards,

Bernard


On Sat, 19 Jun 2010 20:43:12 +0200, you wrote:

Hi Bernard,

We are using absolute URLs in one application (http://tipspot.com) that 
does not use the wicket ajax library, only javascript (based on jquery) 
written by the frontend developer. One of the things we do there is 
filling popups through ajax requests. As most of that information is 
completely stateless, we use a wicket page to produce the html 
fragments. The URL depth and path of the original page (containing the 
popup), and the page that is pasted into the popup, almost never 
matches. This is a problem for linking to other pages. I found it easy 
to make this problem go away by making all URLs absolute.

I did not look at RelativePathPrefixHandler as I was unaware of its 
existence. I am also not certain that any relative schema would be able 
to solve the problem cleanly/easily. Secondly having absolute paths is a 
non-issue for this application.

Regards,
 Erik.


Op 19-06-10 20:27, b...@actrix.gen.nz wrote:
 Thanks Erik.

 Why are you using absolute URLS?

 Are you using absolute URLs to support editing in the web directory,
 with a directory structure the same as the java package structure,
 without breaking images?

 Then it would look like you have found a different solution for the
 same problem. Interesting. Both solutions require only small changes.
 Have you tried to patch RelativePathPrefixHandler? With that change,
 you would no longer be restricted to absolute paths.


 Regards,

 Bernard


 On Sat, 19 Jun 2010 14:15:44 +0200, you wrote:


 Hi,

 https://issues.apache.org/jira/browse/WICKET-1974 describes a way to
 make all URLs absolute.

 Unfortunately the patch attached to the issue is still not applied so
 you'll have to build wicket yourself.

 Regards,
  Erik.


 Op 18-06-10 21:56, b...@actrix.gen.nz schreef:
  
 Hi Fernando,

 obviously quite a few including yourself are separating markup from
 Java packages to make it accessable to HTML developers.

 How do you cope with the fact that Wicket markup, when rendered in any
 folder without flattening the package structure, gets broken images?

 That is what I am trying to address with

 Cannot substitute RelativePathPrefixHandler
 https://issues.apache.org/jira/browse/WICKET-2881

 The three lines of Java code in RelativePathPrefixHandler are solving
 this problem.

 int lastIndex = attrValue.lastIndexOf(../);
 if (lastIndex= 0){
   attrValue = attrValue.substring(lastIndex + 3);
 }

 Regards,
 Bernard




 -
 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: ResourceStreamLocator and mvn resource:resource copying resources in the right directory

2010-06-19 Thread bht
Thanks Erik.

Why are you using absolute URLS?

Are you using absolute URLs to support editing in the web directory,
with a directory structure the same as the java package structure,
without breaking images?

Then it would look like you have found a different solution for the
same problem. Interesting. Both solutions require only small changes.
Have you tried to patch RelativePathPrefixHandler? With that change,
you would no longer be restricted to absolute paths.


Regards,

Bernard


On Sat, 19 Jun 2010 14:15:44 +0200, you wrote:

Hi,

https://issues.apache.org/jira/browse/WICKET-1974 describes a way to 
make all URLs absolute.

Unfortunately the patch attached to the issue is still not applied so 
you'll have to build wicket yourself.

Regards,
 Erik.


Op 18-06-10 21:56, b...@actrix.gen.nz schreef:
 Hi Fernando,

 obviously quite a few including yourself are separating markup from
 Java packages to make it accessable to HTML developers.

 How do you cope with the fact that Wicket markup, when rendered in any
 folder without flattening the package structure, gets broken images?

 That is what I am trying to address with

 Cannot substitute RelativePathPrefixHandler
 https://issues.apache.org/jira/browse/WICKET-2881

 The three lines of Java code in RelativePathPrefixHandler are solving
 this problem.

 int lastIndex = attrValue.lastIndexOf(../);
 if (lastIndex= 0){
  attrValue = attrValue.substring(lastIndex + 3);
 }

 Regards,
 Bernard




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



Re: ResourceStreamLocator and mvn resource:resource copying resources in the right directory

2010-06-18 Thread bht
Hi,

You could have the files in a sibling directory in the web directory
that is hidden by the wicket filter mapping. Has many benefits.

Allows web developers to freely edit and view files in context with
links that actually work. FInally HTML refactoring will work. Can
someone suggest how to get the three lines of code into Wicket that
are needed to support this?

Please See

Cannot substitute RelativePathPrefixHandler
https://issues.apache.org/jira/browse/WICKET-2881


Bernard








On Thu, 17 Jun 2010 16:31:09 -0300, you wrote:

Hi all,
I need to change the development enviroment for

IResourceStreamLocator locator =
new ResourceStreamLocator(new Path(new Folder(html)));
  getResourceSettings().setResourceStreamLocator(locator);

but, what I also need is that maven copy the resources form
 src/main/resources to src/main/WEB-INF/html. This is needed because when
maven creates the war file the resources should also be located in that
directory.

I've tried

plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-resources-plugin/artifactId
   version2.4.1/version
   executions
   execution
 idcopy-package-config/id
 phasepackage/phase
 goals
 goalcopy-resources/goal
 /goals
 configuration
 outputDirectory${basedir}/html/outputDirectory
resources
  resource

  directory${basedir}/src/main/resources/directory

filteringtrue/filtering
 /resource
/resources
 /configuration
   /execution
   /executions
  /plugin

and I got

[1] Inside the definition for plugin 'maven-resources-plugin' specify the
following:

configuration
  ...
  resourcesVALUE/resources
/configuration.


I don't know what else to do

thanks in advance


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



Re: ResourceStreamLocator and mvn resource:resource copying resources in the right directory

2010-06-18 Thread bht
Hi Fernando,

obviously quite a few including yourself are separating markup from
Java packages to make it accessable to HTML developers.

How do you cope with the fact that Wicket markup, when rendered in any
folder without flattening the package structure, gets broken images?

That is what I am trying to address with 

Cannot substitute RelativePathPrefixHandler
https://issues.apache.org/jira/browse/WICKET-2881

The three lines of Java code in RelativePathPrefixHandler are solving
this problem.

int lastIndex = attrValue.lastIndexOf(../);
if (lastIndex = 0){
attrValue = attrValue.substring(lastIndex + 3);
} 

Regards,
Bernard


On Fri, 18 Jun 2010 13:48:43 -0300, you wrote:

The solution I found:

application.init

getResourceSettings().addResourceFolder(/WEB-INF/html);

Your resources will be protected by web-inf and the configuration is the
same in local development machine and in the remote development machine,
where you can give permits to your web designers. Not the best solution but
the simplest.

In maven,

resource
filteringfalse/filtering
directorysrc/main/webapp//directory
/resource

On Fri, Jun 18, 2010 at 4:21 AM, b...@actrix.gen.nz wrote:

 Hi,

 You could have the files in a sibling directory in the web directory
 that is hidden by the wicket filter mapping. Has many benefits.

 Allows web developers to freely edit and view files in context with
 links that actually work. FInally HTML refactoring will work. Can
 someone suggest how to get the three lines of code into Wicket that
 are needed to support this?

 Please See

 Cannot substitute RelativePathPrefixHandler
 https://issues.apache.org/jira/browse/WICKET-2881


 Bernard








 On Thu, 17 Jun 2010 16:31:09 -0300, you wrote:

 Hi all,
 I need to change the development enviroment for
 
 IResourceStreamLocator locator =
 new ResourceStreamLocator(new Path(new Folder(html)));
   getResourceSettings().setResourceStreamLocator(locator);
 
 but, what I also need is that maven copy the resources form
  src/main/resources to src/main/WEB-INF/html. This is needed because when
 maven creates the war file the resources should also be located in that
 directory.
 
 I've tried
 
 plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-resources-plugin/artifactId
version2.4.1/version
executions
execution
  idcopy-package-config/id
  phasepackage/phase
  goals
  goalcopy-resources/goal
  /goals
  configuration
  outputDirectory${basedir}/html/outputDirectory
 resources
   resource
 
   directory${basedir}/src/main/resources/directory
 
 filteringtrue/filtering
  /resource
 /resources
  /configuration
/execution
/executions
   /plugin
 
 and I got
 
 [1] Inside the definition for plugin 'maven-resources-plugin' specify the
 following:
 
 configuration
   ...
   resourcesVALUE/resources
 /configuration.
 
 
 I don't know what else to do
 
 thanks in advance


 -
 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: Can I develop without recompiling/restarting after every change?

2010-06-06 Thread bht
Hi

Yes, I understand that. But you have to put the markup for each
component somewhere. If it's not on the classpath, then you will not be
able to package that component into a JAR for re-use.

As I wrote, both methods co-exist, and you can put markup on the
classpath and package it as jar while other markup is separate from
the classpath. How otherwise would I be able to use Wicket components
with my scheme? Please accept the good news that your but is not
justified.

No, we disagree because I think that doing nothing, i.e. keeping your
component markup on the classpath, *is* the best practice, that is, the
majority opinion on what makes the most sense for most people.

Quoting majority opinion and community consensus is a very weak
contribution to innovation, a sign that the speaker is running out of
genuine ideas. In such context I would typically say that my views
represent the other 100% of such perceived majority/consensus, just to
make it absolutely clear what kind of Orwellian bsht this is.

Page developers, especially those who work with markup, and that is
the majority that Wicket is targeting (not component developers) need
the markup in the context of their resolvable image, script and other
resource files which is in the web directory. Otherwise they cannot
view the markup in the browser. They don't care where these files are
at runtime as long as they are not broken at design time which they
currently are. You never seem to comment on this critical point.


If you feel that the default approach isn't the best practice, then you
are saying that the Wicket designers made a mistake by making this the
default. I disagree strongly with that sentiment.

You accept broken markup at design time and I don't accept it because
I have solved the problem.

I would not go as far as to say they made THAT mistake. As you know,
they gave us the option. But the non-default option is broken because
of the missing three lines of Java code, and whenever people try it,
they become part of your perceived community consensus due to
frustration. Like prisoners.

I think perhaps we mean different things by deploy on save. When I say
deploy I mean it in the J2EE sense, where the container re-loads my
WAR package. In my case, this re-loads my Spring context and a few dozen
JPA entity beans, which takes up to 15 seconds on my relatively modern
laptop. There is no way rearranging my markup (or running it on a fully
certified J2EE server) would turn this into milliseconds.

True. deploy on save is not invented here. It is a term used in
IDEs. The IDE decides what deployment method to use depending on file
location etc.. That is one of two reasons why I would recommend to not
store page markup in Java package directories.


Look, the only reason I took up this (now too long) thread is your use
of the words best practice, which implies a broadly held consensus.
Now that you've included as I see it I'm happy to let it drop.

Wrong.

Best practice does not imply broadly held consensus at all. I am not
using this as a buzzword as you are. If I invent a better mouse trap
today that is more effective at delivering the outcome than any other
technique, while the better mouse trap is not even available or known
to everyone, then using it becomes best practice overnight.

Regards

Bernard


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



Re: Can I develop without recompiling/restarting after every change?

2010-06-05 Thread bht
Hi,

I don't
agree that it's the best approach in all environments, and I think your
advice negates one of the best features of Wicket, namely the ability to
package complete Wicket components (including their markup and other
resources) into JAR files for convenient re-use across applications.


Wrong.

Let me repeat what I wrote in my previos article: This would not
break the ability of packaging markup of some components in the
classpath because Wicket can handle that at the same time.

If you study the effects of adding resource paths in Wicket then you
will find that both methods will co-exist, not negate each other as
you write.

There are environments such as yours and other trivial environments
where nothing needs to be done at all. That does not mean that doing
nothing is best practice. Best practice is something else. A best
approach in an individual case may be different from best practice,
and that is why you disagree.


I think perhaps you're missing the point here. In my development
environment (Eclipse+Tomcat) I *don't* re-deploy on save. That would be
far too slow. But any markup changes I make (and a good portion of the
Java changes, too) are usually picked up by the time I Alt-Tab to my
browser and refresh the page.

With my proposed method, your cycle would not be affected at all. You
would still have all your benefits. My method is inclusive and general
wheteher you chose to deploy on save or not.

Deploy on save would take only milliseconds (with my proposed path
structure applied) and the session would be preserved if you were
using GlassFish 3.0 and NetBeans, leading to a performance gain. You
may not need this functionality, but your setup seems to be slower
than what is achievable.

I think that was Martijn's point: if you're doing re-deploy on save in
your development environment (as the OP implied he was) then you're
doing it wrong. No amount of moving markup around is goint to change
this.

I am sorry your statement is wrong. You are assuming that I am using
Tomcat. For fully certified J2EE servers, and I wrote that my general
approach includes these, IDE instrumentation is not necessarily the
same as for Tomcat.


Yes I am moving markup around. And that (with an additional 3 lines of
framwork code) leads to a re-definition of best practice for Wicket
page development as I see it because of two gains:

- Markup re-factoring within the scope of the web directory becomes
possible because links are no longer broken

- Application server IDE instrumentation can make better deployment
choices for deploy on save optimisation

I am not claiming that you will personally benefit from this. You seem
to be happy enough with your setup.


Regards,

Bernard


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



Re: Can I develop without recompiling/restarting after every change?

2010-06-04 Thread bht
Hi,

My suggestions were meant to be general, and with best I actually
meant in all environments including certified J2EE servers.

Any number of environments (Igor suggested Jetty) may work with or
without these suggestions.

That is because deployment environments may or may not make decisions
on which way to deploy different file types, or depending on
directories they are loaded from. Files in the web directory are quite
obviously candidates for the fastest deployment method.

If the environment thinks that HTML files need to be deployed in the
same way as Java files, which is quite likely if they are stored in
Java packages, then deploy-on-save setups may slow down the
development process of complex applications due to heavy CPU use.

Therefore, fetching markup from the web directory not from the
classpath is clearly superior under some of these conditions.

This would not break the ability of packaging markup of some
components in the classpath because Wicket can handle that at the same
time.

There is no need to squeeze my comments into the frame of your
community consensus. I am perfectly happy if my comments are correct
only for the other 100% of the community that I am targeting.

OT:

If Wicket adds the trivial feature of resolving HTML resource links
differently then finally there will be separation of concerns.
It will be possible to resolve links to resources e.g. css files,
images when loading HTML files from the local file system in the
package structure in the web directory.

And finally one would be able to use markup refactoring that is
available in today's tools. This is cheap stuff and I am perplexed why
it is not happening. Three lines of code - better practice.

See https://issues.apache.org/jira/browse/WICKET-2881


Regards

Bernard


On Thu, 3 Jun 2010 08:26:45 -0400, you wrote:

Hrm, perhaps you should have qualified your advice: If you're using
NetBeans, then for best performance...

Also, the packaging of markup on the classpath allows you to create
re-usable JARs of components and IMHO is one of the best features of
Wicket. So perhaps the qualification should really be, If you're using
NetBeans, and you're not planning on packaging your Wicket components in
a re-usable JAR, then for best performance...

The way your original post is phrased makes it sound like a best
practice, and it implies the Wicket default to fetch markup from the
classpath is inferior. I don't think this is a consensus among the
community.

jk

On Thu, Jun 03, 2010 at 08:57:43PM +1200, b...@actrix.gen.nz wrote:
 Martijn,
 
 You are making a *lot* of assumptions.
 
 Not everybody uses Eclipse.
 
 Nobody in this thread would consider restarts acceptable, still we are
 using this subject.
 
 HTML files location has to do with performance in the developing
 process depending on how the IDE handles the files.
 
 Please advise how to configure the NetBeans IDE to redeploy a HTML
 file in a Java package in a J2EE app server with the same speed as
 HTML files in the web directory (milliseconds not seconds).
 
 
 Thanks
 
 Bernard
 
 
 
 
 On Sun, 30 May 2010 15:23:09 +0200, you wrote:
 
 Huh?
 
 Storing the HTML in the packages has *nothing* to do with requiring
 restarts. Only wrongly configured IDEs may cause that.
 
 If your HTML doesn't get reloaded when you change it, then you should
 run Wicket in DEVELOPMENT mode. Also make sure you've configured
 Eclipse to copy all resources (not just .properties files)
 
 The Wicket Quickstart project and using Maven to generate your eclipse
 project files (mvn eclipse:eclipse) will configure everything
 correctly.
 
 Martijn
 
 On Sat, May 29, 2010 at 11:18 PM,  b...@actrix.gen.nz wrote:
  Hi,
 
  For best performance of redeploys in Wicket, consider storing HTML not
  in the Java package structure but in the web directory. So if your IDE
  and app server allow for hot deployment, then HTML changes deploy much
  faster, ie instantly. In your application init(), you add one
  statement
 
  getResourceSettings().addResourceFolder(wicket);
 
  where wicket matches the url-pattern in your filter-mapping in
  web.xml.
 
  PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
  background on how to take this one step further.
 
  Additionally, with GlassFish V3, you get session preservation on hot
  deployment of Java classes.
 
  You can enable deploy on save for convenience.
 
  If that is not fast enough, you can run your app in debug mode and hot
  swap classes after save while you are debugging it.
 
  All this comes with the NetBeans IDE. You really don't have to worry
  about this stuff anymore.
 
  Regards
 
  Bernard
 
 
 
  On Sat, 29 May 2010 16:12:46 +0100, you wrote:
 
 have you tried JRebel? ?I've not used it myself, but there was an
 interview on JavaPosse recently, sounds like it'd be an ideal fit for
 any Wicket developer.
 
 Dan
 
 On 22/07/28164 20:59, David Chang wrote:
  I am using Tomcat, any tips about how to develop out 
  

Re: Can I develop without recompiling/restarting after every change?

2010-06-03 Thread bht
Martijn,

You are making a *lot* of assumptions.

Not everybody uses Eclipse.

Nobody in this thread would consider restarts acceptable, still we are
using this subject.

HTML files location has to do with performance in the developing
process depending on how the IDE handles the files.

Please advise how to configure the NetBeans IDE to redeploy a HTML
file in a Java package in a J2EE app server with the same speed as
HTML files in the web directory (milliseconds not seconds).


Thanks

Bernard




On Sun, 30 May 2010 15:23:09 +0200, you wrote:

Huh?

Storing the HTML in the packages has *nothing* to do with requiring
restarts. Only wrongly configured IDEs may cause that.

If your HTML doesn't get reloaded when you change it, then you should
run Wicket in DEVELOPMENT mode. Also make sure you've configured
Eclipse to copy all resources (not just .properties files)

The Wicket Quickstart project and using Maven to generate your eclipse
project files (mvn eclipse:eclipse) will configure everything
correctly.

Martijn

On Sat, May 29, 2010 at 11:18 PM,  b...@actrix.gen.nz wrote:
 Hi,

 For best performance of redeploys in Wicket, consider storing HTML not
 in the Java package structure but in the web directory. So if your IDE
 and app server allow for hot deployment, then HTML changes deploy much
 faster, ie instantly. In your application init(), you add one
 statement

 getResourceSettings().addResourceFolder(wicket);

 where wicket matches the url-pattern in your filter-mapping in
 web.xml.

 PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
 background on how to take this one step further.

 Additionally, with GlassFish V3, you get session preservation on hot
 deployment of Java classes.

 You can enable deploy on save for convenience.

 If that is not fast enough, you can run your app in debug mode and hot
 swap classes after save while you are debugging it.

 All this comes with the NetBeans IDE. You really don't have to worry
 about this stuff anymore.

 Regards

 Bernard



 On Sat, 29 May 2010 16:12:46 +0100, you wrote:

have you tried JRebel?  I've not used it myself, but there was an
interview on JavaPosse recently, sounds like it'd be an ideal fit for
any Wicket developer.

Dan

On 22/07/28164 20:59, David Chang wrote:
 I am using Tomcat, any tips about how to develop out 
 recompiling/restarting after every change?

 Best.

 --- On Fri, 5/21/10, Jeremy Thomersonjer...@wickettraining.com  wrote:


 From: Jeremy Thomersonjer...@wickettraining.com
 Subject: Re: Can I develop without recompiling/restarting after every 
 change?
 To: users@wicket.apache.org
 Date: Friday, May 21, 2010, 12:17 PM
 the easiest way to do this is to use
 the Start class (Start.java) from the
 quickstart to run an embedded jetty instance in your
 IDE.  then, if you run
 it in debug mode, it will hotswap any possible changes (and
 tell you if you
 must restart if it's an incompatible change)

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, May 21, 2010 at 10:53 AM, ekallevige...@ekallevig.com
 wrote:


 I'm a front-end developer trying to learn Java (total

 n00b) and working on

 a
 wicket application at work.  The whole process

 feels very slow primarily

 because I have to recompile and restart JBoss every

 time I make a change.

 So I'm wondering what the best way is to avoid having

 to do this when

 editing .java/.js/.css/.html files during development?

 I'd like to just

 make
 changes and then refresh the browser to test -- is

 this possible?

 I've seen in the FAQ that you can change the

 application settings to

 auto-reload markup .html files -- where would I insert

 this setting

 (remember I'm a total n00b).

 As to .css/.js/.java files -- do I need jRebel or

 something like that to

 get
 these files to reload automatically?

 Thanks for helping out a super-beginner :)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html
 Sent from the Wicket - User mailing list archive at

 Nabble.com.



 -

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










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




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



Re: Can I develop without recompiling/restarting after every change?

2010-05-29 Thread bht
Hi,

For best performance of redeploys in Wicket, consider storing HTML not
in the Java package structure but in the web directory. So if your IDE
and app server allow for hot deployment, then HTML changes deploy much
faster, ie instantly. In your application init(), you add one
statement 

getResourceSettings().addResourceFolder(wicket);

where wicket matches the url-pattern in your filter-mapping in
web.xml.

PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
background on how to take this one step further.

Additionally, with GlassFish V3, you get session preservation on hot
deployment of Java classes.

You can enable deploy on save for convenience.

If that is not fast enough, you can run your app in debug mode and hot
swap classes after save while you are debugging it.

All this comes with the NetBeans IDE. You really don't have to worry
about this stuff anymore.

Regards

Bernard



On Sat, 29 May 2010 16:12:46 +0100, you wrote:

have you tried JRebel?  I've not used it myself, but there was an 
interview on JavaPosse recently, sounds like it'd be an ideal fit for 
any Wicket developer.

Dan

On 22/07/28164 20:59, David Chang wrote:
 I am using Tomcat, any tips about how to develop out recompiling/restarting 
 after every change?

 Best.

 --- On Fri, 5/21/10, Jeremy Thomersonjer...@wickettraining.com  wrote:


 From: Jeremy Thomersonjer...@wickettraining.com
 Subject: Re: Can I develop without recompiling/restarting after every 
 change?
 To: users@wicket.apache.org
 Date: Friday, May 21, 2010, 12:17 PM
 the easiest way to do this is to use
 the Start class (Start.java) from the
 quickstart to run an embedded jetty instance in your
 IDE.  then, if you run
 it in debug mode, it will hotswap any possible changes (and
 tell you if you
 must restart if it's an incompatible change)

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, May 21, 2010 at 10:53 AM, ekallevige...@ekallevig.com
 wrote:

  
 I'm a front-end developer trying to learn Java (total

 n00b) and working on
  
 a
 wicket application at work.  The whole process

 feels very slow primarily
  
 because I have to recompile and restart JBoss every

 time I make a change.
  
 So I'm wondering what the best way is to avoid having

 to do this when
  
 editing .java/.js/.css/.html files during development?

 I'd like to just
  
 make
 changes and then refresh the browser to test -- is

 this possible?
  
 I've seen in the FAQ that you can change the

 application settings to
  
 auto-reload markup .html files -- where would I insert

 this setting
  
 (remember I'm a total n00b).

 As to .css/.js/.java files -- do I need jRebel or

 something like that to
  
 get
 these files to reload automatically?

 Thanks for helping out a super-beginner :)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html
 Sent from the Wicket - User 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: How to replace RelativePathPrefixHandler

2010-05-19 Thread bht
Thanks Igor.

That indeed looks very promising, and I replaced
RelativePathPrefixHandler with a variant but that doesn't seem to
work.

I had already filed a Jira issue
https://issues.apache.org/jira/browse/WICKET-2881

before I saw your response.


Regards,

Bernard


On Wed, 19 May 2010 14:51:59 +1200, you wrote:

Hi,

It looks like Wicket may have the flexibility to replace elements of
the chain of IMarkupFilters without changing Wicket itself.

How can I replace RelativePathPrefixHandler with my own variant?

I have found

getPageSettings().getComponentResolvers();

But I am definitely missing the important bits.

Many thanks,

Bernard

-
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: HTML editing, HTML templates, HTML refactoring

2010-05-18 Thread bht
Yes:

wicket:link
link rel='stylesheet' type='text/css' href='../../../../style.css'/
/wicket:link

WicketMessage: Exception in rendering component: [MarkupContainer
[Component id = _link2]]
Root cause:

java.lang.IllegalArgumentException: Invalid path ../../../../style.css

The path is valid because if I click on it in the IDE then the stle
sheet is opened. I really want better IDE integration with Wicket, and
I think that does not exist.

https://issues.apache.org/jira/browse/WICKET-581
... you no longer need to use autolink. As of a couple of days ago in
1.3.0-incubating-SNAPSHOT, any href/src/whatever elements that are in
your HTML will be prepended to make them context-relative, no matter
where your page is mounted.

Unfortunately, the intended result would not be satisfactory even
without failure. I don't want to
- have the wicket filter serve the resources
- have the resources stored under WEB-INF/classes

So I tried in init()
getResourceSettings(addResourceFolder(wicket));

but that is where Wicket support ends because I still have to use
link rel='stylesheet' type='text/css' href='style.css'/ which works
at runtime but not for any IDE for offline viewing and refactoring.

Don't you think it would be time for Wicket to catch up with modern
IDE HTML features? We can't use them.

http://wicket.apache.org/

Line 2:

With proper mark-up/logic separation ...

?

Not really.


It works for the framework and component developers who want to bundle
the resources with their packages, but it does not work for page
development which has totally different requirements.


Regards

Bernard


On Tue, 18 May 2010 00:21:24 -0500, you wrote:

Have you tried using wicket:link around your resource references?


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



How to replace RelativePathPrefixHandler

2010-05-18 Thread bht
Hi,

It looks like Wicket may have the flexibility to replace elements of
the chain of IMarkupFilters without changing Wicket itself.

How can I replace RelativePathPrefixHandler with my own variant?

I have found

getPageSettings().getComponentResolvers();

But I am definitely missing the important bits.

Many thanks,

Bernard

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



HTML editing, HTML templates, HTML refactoring

2010-05-17 Thread bht
Hi,

IDE technology now offers HTML refactoring support even including css
style selectors.

Dreamweaver supports HTML remplates.

In principle, Wicket could support these technologies due to its clean
HTML approach.

However, I have not been able to get any of this to work, because
Wicket ignores its own Java package structure.

I am prepared to do whatever is necessary, e.g. storing HTML page
files outside Java packages. So far, if I do that, then I need to
duplicate the Java package structure in the web directory. With that,
all resource links e.g. images, css have to be ../../../... for the
web developers, but for Wicket they have to be .

So currently, refactoring does not work, and I have to copy every page
into the web root for viewing.

How can I provide the best editing experience for HTML developers so
that all links work, and so that Dreamweaver templates and IDE
refactoring are not broken?


Many thanks,

Bernard

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



Re: HTML editing, HTML templates, HTML refactoring

2010-05-17 Thread bht
Jeremy,

I am not asking for full previewbly in the sense that you are
describing. Obviously this is not possible in dynamic scenarios.

However, Dreamweaver provides templates where each panel can be
previewed in the context of a page so it is Dreamweaver that provides
full previewability. I have seen this documented at
http://www.2rue.de/hacking/wicket/leveraging-wicket-templates-for-offline-viewing-with-dreamweaver/

However, whether dynamic content can be previewed or not, it can
always be filled with something that gets replaced at runtime anyway. 

In any case, I want to get the HTML resource paths right, so how do I
do that? I haven't seen a solution for that yet.

Many thanks,

Bernard


On Mon, 17 May 2010 23:52:59 -0500, you wrote:

You won't get full previewability in Wicket.  A page can have a panel that
is marked with div wicket:id=myPanel  That panel could be any panel at
runtime - and there'd be no way to preview the page with the panel in it
without running the app.

I've seen teams successfully get their HTML designers to edit HTML in the
source tree if they were using Maven and could tell the designer to cd
myproject; mvn jetty:run.


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



Re: Best practises question

2010-05-15 Thread bht
Hi,

Where is it said that passing IModel is an issue? It could be an issue
if it is not a subclass of LoadableDetachableModel.

Bernard

On Sat, 15 May 2010 20:33:11 +0200, you wrote:

Hi,

Can someone explain me why it is a memory issue when an instance of an 
anonymous IModel class is passed to another page to be shared, but it seems to 
be no problem when a page reference is passed to another page and is put in an 
instance field (for example to be used in a button to navigate back to 
previous page)?

Many thanks.

Regards,
Rik



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

2010-05-03 Thread bht
A nice NetBeans plugin:
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=3586

Provides refactoring support and more.

So if you rename or move between packages any Wicket components
including pages then the plugin renames and moves the HTML, too.

I think that an IDE should provide refactoring support so I think that
Wicket needs that, too.

Regards,

Bernard


On Wed, 28 Apr 2010 15:17:11 -0400, you wrote:

Hi,

Wicket n00b here.  How good is Wicket Bench?  I read on the site that
it lacks maintainers and it didn't seem like it had alot of powerful
features, just some nice convenience things.  Is it a must have?
Also, is it compatible with the latest Wicket release?  I didn't see
anything on the wicket bench site saying what version of wicket it was
compatible with.

Brian Mulholland

-
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: wicketpath is not valid html

2010-04-27 Thread bht
Hi,

You can extend the DTD of the validator to accept the attribute.

!ATTLIST yourtag
  wicketpath  CDATA  #IMPLIED
  


Bernard


On Tue, 27 Apr 2010 09:11:37 +0200, you wrote:

Hi,

For our project, we use the Wicket Stuff HTML Validator 
(http://github.com/dashorst/wicket-stuff-markup-validator), which informs us 
of invalid HTML upfront. However, with the switch from wicket 1.3 to 1.4, this 
validator is giving many errors on the wicketpath attribute. 

This attributed used to be named wicket:path, and was renamed to wicketpath as 
part of WICKET-1877, because selenium is having trouble using wicket:path. It 
was opted to make the name configurable, but decided that 'we don't need yet 
another configuration option'. Could this please be reconsidered? I like to 
keep the wicket:path attributes in the generated markup, because they can be 
very handy for debugging, but I have to disable them to keep the HTML 
validator happy.

Best regards,
Emond Papegaaij

-
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



How to get stable DOM IDs without hacks?

2010-04-12 Thread bht
Hi,

Wicket has its own mind - it changes IDs in HTML forms so JavaScript
breaks.

Example:

Source:
input type=button wicket:id=addButton id=addButton
value=Add/

Generated:
input type=button id=addButtona value=Add name=addButton/

Please note that Wicket renames the id from addButton to
addButtona while it does not change the name attribute value.

So we would have to create a Button subclass and:

@Override
public String getMarkupId(){
// As an example, use the wicket:id value ...
return getId();
}

and in HTML, we have to write a warning as a reminder of this hack:
!-- Wicket overrides id from wicket:id value --

This is a maintenance problem and a performance problem because the
additinal classes cost memory and CPU.

Any ideas?

Thanks,

Bernard


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



Re: How to get stable DOM IDs without hacks?

2010-04-12 Thread bht
Thanks a lot to you both for your solutions!

Regards

Bernard

On Mon, 12 Apr 2010 23:36:16 -0400, you wrote:

Like Pierre said, component.setMarkupId(component.getId()) will work, but it 
was discussed just a couple of weeks ago why that's a bad approach.  The 
thread isn't appearing on nabble though, not sure why that is.  Anyway, a 
safer approach (to prevent duplicate ID issues) is to generate your javascript 
calls at the server using the markup ID as a parameter.  It sounds like you 
have a function like

function func() {
 var elem = document.getElementById(someId);
 // do stuff to the element
}

so just modify to

function func(id) {
 var elem = document.getElementById(id);
 // do stuff to the element
}

and output a call to that function using something like a 
StringHeaderContributor or implement IHeaderContributor if you need to call at 
page load or use AjaxRequestTarget if in an ajax request.

- Original Message -
From: Pierre Goupil
[mailto:goupilpie...@gmail.com]
To: users@wicket.apache.org
Sent: Mon, 12
Apr 2010 18:36:55 -0400
Subject: Re: How to get stable DOM IDs without
hacks?


 Hello,
 
 You can use myComponent.setMarkupId(blah), but then it's up to you to
 ensure the id uniqueness.
 
 Regards,
 
 Pierre
 
 
 On Tue, Apr 13, 2010 at 12:35 AM, b...@actrix.gen.nz wrote:
 
  Hi,
 
  Wicket has its own mind - it changes IDs in HTML forms so JavaScript
  breaks.
 
  Example:
 
  Source:
  input type=button wicket:id=addButton id=addButton
  value=Add/
 
  Generated:
  input type=button id=addButtona value=Add name=addButton/
 
  Please note that Wicket renames the id from addButton to
  addButtona while it does not change the name attribute value.
 
  So we would have to create a Button subclass and:
 
 @Override
 public String getMarkupId(){
 // As an example, use the wicket:id value ...
 return getId();
 }
 
  and in HTML, we have to write a warning as a reminder of this hack:
 !-- Wicket overrides id from wicket:id value --
 
  This is a maintenance problem and a performance problem because the
  additinal classes cost memory and CPU.
 
  Any ideas?
 
  Thanks,
 
  Bernard
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 Les deux règles universelles du bide :
 
 1) on n'explique pas un bide
 
 2) dans le futur, un bide sera toujours un bide.
 

-
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: Caching components

2010-03-26 Thread bht
But why in repeating views are the components duplicated for each row?
Wicket should re-use the components - one instance for each row could
do all the rendering. Not one instance for each row which is a waste.

Caching is a different concept as it also preserves the data which is
not wanted in repeaters unless one wants to cache the whole
collection.

Bernard


On Fri, 26 Mar 2010 06:50:24 -0700, you wrote:

the recommended way to handle this would be to cache the data not the
generated html

-igor

On Fri, Mar 26, 2010 at 1:11 AM, Martin Sachs sachs.mar...@gmail.com wrote:
 We have a lot of Repeating views, which containing a lot of components,
 which also contains repeatingviews.

 To know would should be rendered, we load some hopefully small
 (listsizes, objectbyId, ...) datas from DB in the constructor and/or in
 onBeforeRender and in isVisible. You are right, this is not a
 recommented way. Most of the time is database-loading and wicket has no
 performance-problem for us. We profile our application and never found
 wicket-components as hotspots.

 One reason for loading some data in contstructur or onBeforeRender is to
 prevent creating huge hierarchies. This is faster than override
 isVisible(), since isVisible would called more than one times.

 For our usecase the responsetime is much faster with HTML-Caching,
 because the Database-calls are minimized. We save the time for creating
 componentshierarchies (all three categories) with loading data.


 Martin

 Jeremy Thomerson schrieb:

 On Wed, Mar 24, 2010 at 3:26 AM, Martin Sachs sachs.mar...@gmail.com
 mailto:sachs.mar...@gmail.com wrote:

     hi,

     we need caching of components, since the construction of huge
     hierarchies is not cheap. The rendering ist fast. We cache the
     rendered
     HTML of a hole component via a beheaviour and write them on the next
     requests into a Label (unescaped). So instead of creating the complete
     hierarchie on every request, we create a much smaller one. But you
     must
     check, that the cachable components are stateless. Also we have JQuery
     for client-effects in this components, this would also be cached.

     The performance is much better with that: approx. 10-50 times better:
        100ms with cache (the response time is not much depending on count
     of users)
            vs
        1500 ms without cache depending how many parallel user


 A 15x gain is a big statement to make.  Can you please break this
 1500ms down into at least the following categories:

 1 - time in IModel#getObject() and all child calls of this (IOW,
 loading data)
 2 - time in constructor of components (without loading data in the
 constructor - hopefully you're not doing this)
 3 - time in rendering of components

 That would be a much better number to give other users.  I have NEVER
 seen where creating / rendering components could take 1400ms - unless
 you're doing something wrong like database calls in your component
 constructors.  So, I suspect that most of that 1400ms (I would guess
 at least 1250ms) is in your model loading.

 The only time I've seen (or seen proof of) the component hierarchy
 actually be the slow part of a Wicket page is if you were displaying a
 repeating view of some sort with thousands of rows and each row had a
 bunch of components in it - leading to tens of thousands of components
 being built in the hierarchy.

 --
 Jeremy Thomerson
 http://www.wickettraining.com


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



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


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



Re: Caching components

2010-03-26 Thread bht
Igor,

I don't understand the optimal use of the different repeaters list
views in different scenarios well enough yet, so I would be greateful
if someone could provide a link for more documentation.

As far as I understand, though, refreshingview.setreuseitemstrategy()
is about re-using items - it is all about models.

I am thinking about re-using the rendering component for ALL items in
the collection. That would not require any strategy. And I would want
this to work with database driven collections, so far I have used
DataProvider with LDMs. What needs to be done to get re-used
components in this scenario?

Bernard

On Fri, 26 Mar 2010 16:41:11 -0700, you wrote:

repeaters support this, see listview.setreuseitems() and
refreshingview.setreuseitemstrategy()

-igor

On Fri, Mar 26, 2010 at 1:50 PM,  b...@actrix.gen.nz wrote:
 But why in repeating views are the components duplicated for each row?
 Wicket should re-use the components - one instance for each row could
 do all the rendering. Not one instance for each row which is a waste.

 Caching is a different concept as it also preserves the data which is
 not wanted in repeaters unless one wants to cache the whole
 collection.

 Bernard


 On Fri, 26 Mar 2010 06:50:24 -0700, you wrote:

the recommended way to handle this would be to cache the data not the
generated html

-igor

On Fri, Mar 26, 2010 at 1:11 AM, Martin Sachs sachs.mar...@gmail.com wrote:
 We have a lot of Repeating views, which containing a lot of components,
 which also contains repeatingviews.

 To know would should be rendered, we load some hopefully small
 (listsizes, objectbyId, ...) datas from DB in the constructor and/or in
 onBeforeRender and in isVisible. You are right, this is not a
 recommented way. Most of the time is database-loading and wicket has no
 performance-problem for us. We profile our application and never found
 wicket-components as hotspots.

 One reason for loading some data in contstructur or onBeforeRender is to
 prevent creating huge hierarchies. This is faster than override
 isVisible(), since isVisible would called more than one times.

 For our usecase the responsetime is much faster with HTML-Caching,
 because the Database-calls are minimized. We save the time for creating
 componentshierarchies (all three categories) with loading data.


 Martin

 Jeremy Thomerson schrieb:

 On Wed, Mar 24, 2010 at 3:26 AM, Martin Sachs sachs.mar...@gmail.com
 mailto:sachs.mar...@gmail.com wrote:

     hi,

     we need caching of components, since the construction of huge
     hierarchies is not cheap. The rendering ist fast. We cache the
     rendered
     HTML of a hole component via a beheaviour and write them on the next
     requests into a Label (unescaped). So instead of creating the complete
     hierarchie on every request, we create a much smaller one. But you
     must
     check, that the cachable components are stateless. Also we have JQuery
     for client-effects in this components, this would also be cached.

     The performance is much better with that: approx. 10-50 times better:
        100ms with cache (the response time is not much depending on count
     of users)
            vs
        1500 ms without cache depending how many parallel user


 A 15x gain is a big statement to make.  Can you please break this
 1500ms down into at least the following categories:

 1 - time in IModel#getObject() and all child calls of this (IOW,
 loading data)
 2 - time in constructor of components (without loading data in the
 constructor - hopefully you're not doing this)
 3 - time in rendering of components

 That would be a much better number to give other users.  I have NEVER
 seen where creating / rendering components could take 1400ms - unless
 you're doing something wrong like database calls in your component
 constructors.  So, I suspect that most of that 1400ms (I would guess
 at least 1250ms) is in your model loading.

 The only time I've seen (or seen proof of) the component hierarchy
 actually be the slow part of a Wicket page is if you were displaying a
 repeating view of some sort with thousands of rows and each row had a
 bunch of components in it - leading to tens of thousands of components
 being built in the hierarchy.

 --
 Jeremy Thomerson
 http://www.wickettraining.com


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



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


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



-
To unsubscribe, e-mail: 

Re: jquery and wicket

2010-03-09 Thread bht
I can't tell you all the rules for compatibility and interoperability
with Wicket's own js library. I think you will find answers on that
with web searches. But I can tell you that I use jQuery without
problems. I use jsTree, jqModal and other components. I exchange data
via Wicket HiddenField. Please note that Wicket generates the names of
the hidden fields, so you might either want to override the names in
Java or use ids to address the hidden fields in your js.

Bernard

On Tue, 9 Mar 2010 10:36:04 +0100, you wrote:

Hi,

I'd like to use jquery in my wicket application. So far, I need
tooltips.

I think, I could use wiquery for that, right? On the wiquery homepage
the latest build is Revision 44 from 04/07/2009. Is that the most recent
one?

Can I use jquery plugins in combination with wiquery, e.g. qtip
(http://craigsworks.com/projects/qtip/)


Thanks,
Thorsten

-
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: jWicket release 0.5.0

2010-03-08 Thread bht
Thanks for the link to the issue.

Re: I don't know why they don't fix the problem.

I think the jQuery developer asks for a testcase. No testcase was
supplied, so I am not surprised that even after 7 months, nothing has
been done.

But when there is a testcase, and when even the offending line of code
is identified in jQuery and it is clear that it is a jQuery bug then
the author of jQuery likes to close issues with status WONTFIX
apparently with the purpose to hide them from the community. Please
refer to

http://dev.jquery.com/ticket/5743 where jQuery updates the DOM during
a call that is supposed to only get the dimensions of an element.

Regards

Bernard


On Mon, 8 Mar 2010 19:17:54 +0100, you wrote:

Hi Ernesto,

yes, I added a patch to jquery1.4.2.js. The DD problem is relatet to the 
ticket you cited (4996). After a DOM replacement IE is unable to calculate 
it's bounding rect in the way jQuery does and IE then throws an exception that 
stops the re-registration of the behavior.
The problem seems to be present since jQuery 1.3 and many related bus are open 
in jQuery's trac. I don't know why they don't fix the problem.
So I put together some hints and proposals and modified jQuery.js. If you need 
the patch try to check it out from wickststuff trunk or contect me again.

Good luck!
Stefan

-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Montag, 8. März 2010 19:07
An: users@wicket.apache.org
Betreff: Re: jWicket release 0.5.0

Hi Stefan,

My I ask what was your solution to the DD problem? Added a patch to jquery?
Was this related to [1] and using jquery 1.4.2, independently of your
project, and still find this issue.

Best,

Ernesto

References,

1-http://dev.jquery.com/ticket/4996

http://dev.jquery.com/ticket/4996

On Fri, Feb 26, 2010 at 2:57 PM, Stefan Lindner lind...@visionet.de wrote:

 I have committed jWicket version 0.5.0 to wicketstuff

 Changes:
 - jQuery update to Version 1.4.2
 - jQuery UI update to 1.8RC2
 - drag/drop/resize improvements to work in IE 6/7/8 after AJAX update or
 in LazyLoad panels
 - drag/drop/resize improvements for less footprint in HTML, smaller js
 code generation
 - Effects rewritten completely, now covering all effects
 - Effects now support a chain of multiple effects

 Known Issues
 - Example application not very attractive
 - Example applicatioin contains some debugging code

 Let me know if someone needs prebuild jar files.

 Stefan

 -
 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: jWicket release 0.5.0

2010-03-08 Thread bht
I don't know, in the header I read: Needs:  Test Case
The bug still has status new, neither confirmed nor assigned.

I am referring to http://dev.jquery.com/ticket/4996

What am I missing? They might need a complete standalone page,
preferably zipped that loads jquery.js from the web and displays an
error message. You might get some progress if you do that. At least
you put the ball back into their court. I did this more than once but
it did not help. Nevertheless at least I know what to expect.

The outcome could be that a bug needs to be filed against IE. But most
importantly the bug needs to be fixed in jQuery because jQuery is
crosss-platform and jQuery's existence is based on eliminating these
quirks.


On Mon, 8 Mar 2010 20:44:22 +0100, you wrote:

Hi Bernard,

there is a testcase in the attachments:

   $(document.createElement('div')).offset();

It's a real simple testcase.

Stefan

-Ursprüngliche Nachricht-
Von: b...@actrix.gen.nz [mailto:b...@actrix.gen.nz] 
Gesendet: Montag, 8. März 2010 20:23
An: users@wicket.apache.org
Betreff: Re: jWicket release 0.5.0

Thanks for the link to the issue.

Re: I don't know why they don't fix the problem.

I think the jQuery developer asks for a testcase. No testcase was
supplied, so I am not surprised that even after 7 months, nothing has
been done.

But when there is a testcase, and when even the offending line of code
is identified in jQuery and it is clear that it is a jQuery bug then
the author of jQuery likes to close issues with status WONTFIX
apparently with the purpose to hide them from the community. Please
refer to

http://dev.jquery.com/ticket/5743 where jQuery updates the DOM during
a call that is supposed to only get the dimensions of an element.

Regards

Bernard


On Mon, 8 Mar 2010 19:17:54 +0100, you wrote:

Hi Ernesto,

yes, I added a patch to jquery1.4.2.js. The DD problem is relatet to the 
ticket you cited (4996). After a DOM replacement IE is unable to calculate 
it's bounding rect in the way jQuery does and IE then throws an exception 
that stops the re-registration of the behavior.
The problem seems to be present since jQuery 1.3 and many related bus are 
open in jQuery's trac. I don't know why they don't fix the problem.
So I put together some hints and proposals and modified jQuery.js. If you 
need the patch try to check it out from wickststuff trunk or contect me again.

Good luck!
Stefan

-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Montag, 8. März 2010 19:07
An: users@wicket.apache.org
Betreff: Re: jWicket release 0.5.0

Hi Stefan,

My I ask what was your solution to the DD problem? Added a patch to jquery?
Was this related to [1] and using jquery 1.4.2, independently of your
project, and still find this issue.

Best,

Ernesto

References,

1-http://dev.jquery.com/ticket/4996

http://dev.jquery.com/ticket/4996

On Fri, Feb 26, 2010 at 2:57 PM, Stefan Lindner lind...@visionet.de wrote:

 I have committed jWicket version 0.5.0 to wicketstuff

 Changes:
 - jQuery update to Version 1.4.2
 - jQuery UI update to 1.8RC2
 - drag/drop/resize improvements to work in IE 6/7/8 after AJAX update or
 in LazyLoad panels
 - drag/drop/resize improvements for less footprint in HTML, smaller js
 code generation
 - Effects rewritten completely, now covering all effects
 - Effects now support a chain of multiple effects

 Known Issues
 - Example application not very attractive
 - Example applicatioin contains some debugging code

 Let me know if someone needs prebuild jar files.

 Stefan

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



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


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


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


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



Re: jWicket release 0.5.0

2010-03-08 Thread bht
Ernesto,

Possibly not enough. I would create a testcase as a web page with no
reference to Wicket as a start.

It is good to avoid any technical distraction because any distraction
causes friction and loss of energy.

You can of course mention that you are a Wicket developer, and give
some context to support your case, even mentioning that this is being
discussed in this group.

If you are 100% sure that your scenario is the same as in 4996, then I
would attach the testcase to that ticket. Otherwise I would open a new
one, without any reference to the old one.

If you are sure about the previous code snippet being not much
different from your attached testcase, then why not mention it,
pointing out that you are just trying to be helpful. You can then ask
what else they need to avoid any further delays.

In case it is the same issue then I would subscribe to the jQuery dev
mailing list (not user mailing list) and notify them that you are
trying to re-start the issue ...

Technically, the issue surprises me from this perspective:

jQuery is fault tolerant in a way that if you run a query that returns
an empty jQuery object and call methods on that empty object, then the
query does not fail. In this case however it fails. I would try to
emphasize this point if possible, concluding that this is in conflict
with jQuery's own apparent design principles.

Regards,

Bernard



On Tue, 9 Mar 2010 07:24:39 +0100, you wrote:

 Do you think would it be enough if I provide a wicket quick-start and
instructions on how to get it running and so on? It would be very easy to
create one reproducing the issue on a DD scenario.  Or create a new issues
and link it to the 4996?

Ernesto

On Mon, Mar 8, 2010 at 9:54 PM, b...@actrix.gen.nz wrote:

 I don't know, in the header I read: Needs:  Test Case
 The bug still has status new, neither confirmed nor assigned.

 I am referring to http://dev.jquery.com/ticket/4996

 What am I missing? They might need a complete standalone page,
 preferably zipped that loads jquery.js from the web and displays an
 error message. You might get some progress if you do that. At least
 you put the ball back into their court. I did this more than once but
 it did not help. Nevertheless at least I know what to expect.

 The outcome could be that a bug needs to be filed against IE. But most
 importantly the bug needs to be fixed in jQuery because jQuery is
 crosss-platform and jQuery's existence is based on eliminating these
 quirks.


 On Mon, 8 Mar 2010 20:44:22 +0100, you wrote:

 Hi Bernard,
 
 there is a testcase in the attachments:
 
$(document.createElement('div')).offset();
 
 It's a real simple testcase.
 
 Stefan
 
 -Ursprüngliche Nachricht-
 Von: b...@actrix.gen.nz [mailto:b...@actrix.gen.nz]
 Gesendet: Montag, 8. März 2010 20:23
 An: users@wicket.apache.org
 Betreff: Re: jWicket release 0.5.0
 
 Thanks for the link to the issue.
 
 Re: I don't know why they don't fix the problem.
 
 I think the jQuery developer asks for a testcase. No testcase was
 supplied, so I am not surprised that even after 7 months, nothing has
 been done.
 
 But when there is a testcase, and when even the offending line of code
 is identified in jQuery and it is clear that it is a jQuery bug then
 the author of jQuery likes to close issues with status WONTFIX
 apparently with the purpose to hide them from the community. Please
 refer to
 
 http://dev.jquery.com/ticket/5743 where jQuery updates the DOM during
 a call that is supposed to only get the dimensions of an element.
 
 Regards
 
 Bernard
 
 
 On Mon, 8 Mar 2010 19:17:54 +0100, you wrote:
 
 Hi Ernesto,
 
 yes, I added a patch to jquery1.4.2.js. The DD problem is relatet to the
 ticket you cited (4996). After a DOM replacement IE is unable to calculate
 it's bounding rect in the way jQuery does and IE then throws an exception
 that stops the re-registration of the behavior.
 The problem seems to be present since jQuery 1.3 and many related bus are
 open in jQuery's trac. I don't know why they don't fix the problem.
 So I put together some hints and proposals and modified jQuery.js. If you
 need the patch try to check it out from wickststuff trunk or contect me
 again.
 
 Good luck!
 Stefan
 
 -Ursprüngliche Nachricht-
 Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Gesendet: Montag, 8. März 2010 19:07
 An: users@wicket.apache.org
 Betreff: Re: jWicket release 0.5.0
 
 Hi Stefan,
 
 My I ask what was your solution to the DD problem? Added a patch to
 jquery?
 Was this related to [1] and using jquery 1.4.2, independently of your
 project, and still find this issue.
 
 Best,
 
 Ernesto
 
 References,
 
 1-http://dev.jquery.com/ticket/4996
 
 http://dev.jquery.com/ticket/4996
 
 On Fri, Feb 26, 2010 at 2:57 PM, Stefan Lindner lind...@visionet.de
 wrote:
 
  I have committed jWicket version 0.5.0 to wicketstuff
 
  Changes:
  - jQuery update to Version 1.4.2
  - jQuery UI update to 1.8RC2
  - drag/drop/resize improvements 

Wicket Examples on NetBeans

2010-02-25 Thread bht
Hi,

How can I run the wicket examples that are included in the
distribution in the NetBeans IDE?

I have tried to open the Maven project but I get errors [0]
'dependencies.dependency.version' is missing for
org.apache.wicket:wicket

It would be nice to have a quick and easy way to get these running in
NetBeans so that I can use the Wicket Examples as an easy reference
and starting point for the NetBeans developers (testcases for
performance issues etc.).

Ideally, I would just want to ask them to open the Maven project,
specify a server i.e. GlassFish V3 and run the project.

Many thanks

Bernard



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



Re: Large number components and redering time

2010-02-17 Thread bht
Swing uses a variety of TableCellRenderer on a per table instance
basis. What component are you suggesting to use for this behavior in
Wicket?

Bernard

On Wed, 17 Feb 2010 11:04:09 -0800, you wrote:

i would imagine you would have the same problem even in a local
environment such as swing...

the solution is quiet simple, instead of using wicket components to
model the table and the cell simply use a single component that writes
out html for the entire table.

-igor


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



Re: Large number components and redering time

2010-02-17 Thread bht
In case of repeated buttons I think I would use a combination of a
TableCellEditor and a TableCellRenderer with a button behind them,
still only single instances serving many rows. There would only be a
single event listener that would check selected row index. Would it
make sense to have that in Wicket in the future? Might save a lot of
memory.

If on the other hand this button would be only needed on specific
cells, not the pure repeater scenario, then of course one would use
simple button instances per cell as there would not be a significant
memory saving.

On Wed, 17 Feb 2010 13:37:01 -0800, you wrote:

On Wed, Feb 17, 2010 at 1:31 PM,  b...@actrix.gen.nz wrote:
 Swing uses a variety of TableCellRenderer on a per table instance
 basis.

if you had a table cell that needed a button then you wouldnt use a 
renderer
[snip]

-igor


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



Re: Large number components and redering time

2010-02-17 Thread bht
Many thanks. I like it. Good when memory is expensive :)

On Wed, 17 Feb 2010 16:21:16 -0800, you wrote:

we already provide support for all this...

class cheaprenderer implements ilinklistener {

  protected void oncomponenttagbody(...) {
...
getresponse.write(href=\);
getresponsr.write(urlfor(this, ilinklistener.interface)+x=+x+y=+y));

  }

  public final void onclick() {
onclick(getrequest().getparameter(x), getrequest().getparameter(y));
  }

  protected abstract void onclick(int x, int y) ;
}

-igor
[snip]

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



How to hide / show additional descriptive Row below empty DataView?

2010-02-13 Thread bht
Hi all,

How is it possible to dynamically show and hide an additional dummy
row No items to show below a DataView?

I tried this with code similar to code below but it does not work even
though isVisible() is called. I have a small testcase ready to go.
It's quite basic so I must be missing something obvious.

Many thanks

Bernard


In a DataView, with an AjaxFallbackLink delete action, in onClick I do
something like

item.setVisible(false);
target.addComponent(item);
target.addComponent(emptyRow);

with emptyRow as follows:

final WebMarkupContainer emptyRow = new
WebMarkupContainer(emptyRow){
@Override
public boolean isVisible(){
return rowProvider.size() == 0;
}
};
emptyRow.setOutputMarkupId(true);
add(emptyRow);

In HTML:

tr wicket:id=dataRow
td wicket:id=IdID/td
tda wicket:id=deleteDelete/a/td
/tr
tr wicket:id=emptyRow
td colspan=2No Items to show/td
/tr


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



Re: Help with Wicket Adoption Numbers

2010-01-08 Thread bht
Hi Lester,

If you think your boss will not accept the benefits, then why not show
him the risk of sticking with a technology (Struts) that is in
decline? Then suddenly he shoulders the burden of making the desision
of taking ownership of a sinking ship.

Regards

Bernard





On Fri, 08 Jan 2010 08:43:51 +0800, you wrote:

Hi,

I am facing a hurdle that need crossing in my final attempt to push 
Wicket for use in an organization.
I have:

1) Prototyped a small size module
2) Did 2-3 presentations on the key features and advantages of wicket

No one is disputing my claims about productivity and good OO code that 
was the result.

BUT, the technology evaluation committee is NOT recommending Wicket 
because of. of all things.
- Wicket's Low Adoption Rate
Can I find any numbers to blow this away?

My alternative is to accept the finding and work with Struts 2. Which 
will mean the stack will need to expand to DWR
 (for security). I REALLY don't want to go there, and am even 
considering not taking part in this project due to the high risk 
involved, only 9 months to introduce huge changes to a system that has 
lots of legacy problems (took about 3 years to build). I think a lot of 
those years were spent wrestling with the monster that is EJB 1.1. The 
only way I thought the project can even be on time is to scrap the 
entire presentation layer (aka Struts) and redo it in Wicket with 1 
dedicated developer while the rest of the team work on killing the beast 
that is EJB 1.1 by refactoring the biz code.

Sigh, my choices are stark. It's either to keep the job and plough ahead 
and probably fail spectacularly 9 months later or go hungry and explain 
to my wife why we need to spend less on the kid..

It's easy to blame the tech committee but they did help me find wicket 
by rejecting my initial proposal to build the new system on a 
(JQuery+JSON+REST) framework, which can be very productive as well, if 
not as clean as Wicket.

Sorry for rambling so much. Is there any way I can demolish the silly 
low adoption rate argument (omg I still don't believe it can be so lame)?

Lester



-
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: Tag Oriented Development

2009-12-25 Thread bht
JSF == Standard?

My question is: What should become a standard?

When I think about standards, then things that come to mind are:

- SQL
- ODBC
- Java
- JDBC
- EJB
- JPA

but not JSF. And not Spring. And not ... - you name it.

For some reason, possibly due to the fast evolving nature of the web,
web frameworks are higher up in the food chain, and I don't think that
we are ready yet to standardize on that level. People may say JSF is a
standard, so what? The fact that there are so many others seems to
prove my point.

Bernard



On Tue, 22 Dec 2009 14:59:16 +0200, you wrote:

In business, decision makers choose standards and JSF is standard so JSF is
good and JSF is the King. But couldn't be The King Is Naked ??

OR

Am i wrong ? JSF is really cool and i don't know the hidden features ??

I don't want to start framework wars, this is useless but I think Wicket
should be a JSR.

I don't know how a framework like Wicket become a JSR - a standard - but it
should be...


2009/12/22 Peter Thomas ptrtho...@gmail.com

 On Tue, Dec 22, 2009 at 5:47 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  @Tomas, @Martin,
 
  I already knew those links... Thanks anyway. Actually I went a bit
 further
  an implemented the same application on different technologies so that
  developers could evaluate for themselves the wonders of downsides of
 each
  technology... plus detailed explanations of how the code works
  Unfortunately I cannot share that code as is property of the company I
 work
  for


 That's a pretty solid approach, pity you can't share the code though.  I
 tried to do something similar as open-source:
 http://code.google.com/p/perfbench/

 Maybe you can contribute some analysis or even an implementation or two ;)
 I would be interested in your feedback, for e.g. which framework to attempt
 next - do let me know offline.



  But the problem is those who will take the final decision will take
  into account more political reasons that things like development
 speed,
  code quality, code re-usability and any other adds you throw at
 them...
 
 
  @Martin,
 
  Congratulations!  Hope I can say the same in  a few months.
 
  Best,
 
  Ernesto
 
  On Tue, Dec 22, 2009 at 12:57 PM, Peter Thomas ptrtho...@gmail.com
  wrote:
 
   On Tue, Dec 22, 2009 at 5:22 PM, Ernesto Reinaldo Barreiro 
   reier...@gmail.com wrote:
  
Hi Eelco,
   
On Tue, Dec 22, 2009 at 12:38 PM, Eelco Hillenius 
eelco.hillen...@gmail.com
 wrote:
   
  I love Wicket and the natural approach it offers to do
web-development...
  and I have been pushing hard to use it whenever possible...  but
 on
   the
  real world it is not enough to be an excellent product to gain
  wide acceptance...  Does last sentence ring a bell?

 I think we've gained pretty wide acceptance actually. Wicket In
  Action
 has been a best seller for Manning in the months right after it
 came
 out, and Wicket is by many considered as one of the leading web
 frameworks for Java. We've also had one of the most active email
  lists
 for years now. I'm sure Wicket lags behind JSF and Struts
  considerably
 when it comes to number of users, but hey, why would we care. You
  only
 need a bunch of serious users to maintain a framework, and Wicket
 has
 many thousands of them :-)

 You don't have to convince me about Wicket excellence! I love
 Wicket,
I've
been using it for over two years now, and right now I'm doing all my
efforts
to get it adopted at the company I'm working for... But being
 realistic
they
will probably jump to Struts 2, or Seam-JSF...
   
After re-reading my message  I see maybe it was bit pessimistic..
  maybe
out of my present frustration.
   
  
   may be useful when debating Wicket vs JSF where you work etc:
   http://tinyurl.com/jsf-sucks
  
   - Peter
  
  
   
Cheers,
   
Ernesto
   
  
 



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



Re: @RequireHttps - forms misbehaving

2009-12-21 Thread bht
VGJ,
You might have discovered a limitation of the system or a bug. As I
wrote, I would recommend you make a testcase with all distracting
detail removed and submit it as a jira issue, then post a link to the
the issue here.

I understand your frustration, but I think the above would be the best
investment of your own efforts.

Regards,

Bernard.

On Mon, 21 Dec 2009 11:13:49 -0700, you wrote:

Well, I'm still unable to spot anything strange.  No matter what page I
annotate, it doesn't switch to https until the form is submitted.  It then
goes to https (as if it's redirecting to itself?) and triggers the
validation on the page, even if the correct fields are filled in.  No matter
what page I annotate on this site, it happens the same way.

Here's an example from this app:

The login or create a new account page:

@RequireHttps
public class UserAccount extends BasePage
{
public UserAccount()
{
//get user from session
User user = ((UserSession)getSession()).getUser();

//pass go, collect $200
if (user != null)
throw new RestartResponseException(new ContactInfo());

add(new FeedbackPanel(feedbackPanel));

//get cart in session
ShoppingCartLocal cart = ((UserSession)getSession()).getCart();

//entities
Order order = cart.getOrder();
Customer customer = order.getCustomer();
String email = (order != null  customer != null) ? customer.getEmail()
: ;

//form model (entity)
if (user == null) user = new User();

//if email exists, pre-populate form
if (email != null  !email.equals())
user.setUsername(email);

final Form returnUserForm = new Form(retUserAccountForm, new
CompoundPropertyModel(user));
final Form newUserForm = new Form(newUserAccountForm, new
CompoundPropertyModel(user));

//add form components
returnUserForm.add(new TextField(username)
.setRequired(true)
.add(EmailAddressPatternValidator.getInstance()));
returnUserForm.add(new PasswordTextField(password));

returnUserForm.add(new Button(userAcctButton)
{
  public void onSubmit()
  {
ShoppingCartLocal  cart = null;

try
{
  //save form values, redirect
  User user = (User)returnUserForm.getModelObject();

  //get cart from session
  cart = ((UserSession)getSession()).getCart();

  //create order in session
  cart = CartProxy.authUserAccount(cart, user);

  //set cart back to session  log user in
  ((UserSession)getSession()).setCart(cart);
  ((UserSession)getSession()).setUser(
  cart.getOrder().getCustomer().getUser());

  //redirect
  setResponsePage(new ContactInfo());
}
catch (Exception exp)
{
  info(exp.getMessage());
  LogProxy.saveEntry(exp);
}
  }
});

returnUserForm.add(new Link(forgotPasswordLink)
{
  public void onClick()
  {
setResponsePage(new ForgotPassword());
  }
});


//add form components
newUserForm.add(new TextField(username)
.setRequired(true)
.add(EmailAddressPatternValidator.getInstance()));

newUserForm.add(new Button(userAcctButton)
{
  public void onSubmit()
  {
ShoppingCartLocal  cart = null;

try
{
  //save form values, redirect
  User user = (User)newUserForm.getModelObject();

  //get cart from session
  cart = ((UserSession)getSession()).getCart();

  //create order in session
  cart = CartProxy.createUserAccount(cart, user);

  //set cart back to session  log user in
  ((UserSession)getSession()).setCart(cart);
  ((UserSession)getSession()).setUser(
  cart.getOrder().getCustomer().getUser());

  //redirect
  setResponsePage(new ContactInfo());
}
catch (Exception exp)
{
  info(exp.getMessage());
  LogProxy.saveEntry(exp);
}
  }
});

//add forms
add(returnUserForm);
add(newUserForm);
}
}

...the BasePage class:

public abstract class BasePage extends WebPage
{
  private String pageTitle = My page title!;

  public BasePage()
  {
//add page title
add(new Label(title, new PropertyModel(this, pageTitle)));

//add page components
add(new TrailPanel(trailPanel,
  TrailFactory.getUserPageTrail(this.getPageClass().getSimpleName(;
add(new HeaderPanel(headerPanel));
add(new FooterPanel(footerPanel));
  }

  public final String getPageTitle()
  {
return pageTitle;
  }

  public final void setPageTitle(String title)
  {
this.pageTitle = title;
  }

  protected void redirect(String url)
  {
//disable wicket redirecting
getRequestCycle().setRedirect(false);

//make sure no output for the current cycle is sent

Re: @RequireHttps - forms misbehaving

2009-12-20 Thread bht
Hi VGJ,

If, as you say you can reproduce this in your storefront app no matter
where you use it then you may want to reduce this to a testcase and
create a jira issue from it.

You are already writing that you can reproduce it and consequently it
would be only a matter of removing all distracting detail from your
storefront until further simplification is no longer possible. I can't
see how otherwise anyone could help you with your issue.

In any case, glitches like you mention should not happen whether the
problem is in the Wicket framework domain or in the application
domain. If it is in the application domain, as it would usually be the
case because Wicket is mature, then there would still be a benefit of
publishing the issue e.g. in a Wiki article so that others would not
make the same mistake.

Good luck!

Bernard

On Fri, 18 Dec 2009 14:58:15 -0700, you wrote:

I was unable to re-create it in a simple web app w/ a few pages.  However,
no matter where I use it in my storefront app, it happens.

It's very strange because it starts a page late.  I put the annotation on
the User Account page, yet it doesn't switch to https until I reach the
*following* page in the checkout process.  I just stuck it on the general
Login page that exists outside of the checkout process...and when I click
the link from the home page to go to the Login page using
setResponsePage(new Login()), it doesn't switch to https.  Instead, I enter
the user/pass and submit...THEN it goes to https, then I'm able to re-enter
and login.

Very strange behavior...I have no idea what might be causing it.

I use various Panels throughout the side, would that have any influence on
it?  For example, the link in the header to go to the Login page is inside
of a straightforward Panel.  The entire site uses markup inheritance as
well.

On Fri, Dec 18, 2009 at 9:29 AM, VGJ zambi...@gmail.com wrote:

 I'll create one and post it, if I can.

 -v


 On Fri, Dec 18, 2009 at 9:21 AM, Igor Vaynberg 
 igor.vaynb...@gmail.comwrote:

 can you recreate in a quickstart?

 -igor

 On Fri, Dec 18, 2009 at 7:56 AM, VGJ zambi...@gmail.com wrote:
  I'm now using @RequireHttps to switch to https on certain pages but it's
 not
  quite working right.
 
  In our storefront app, I'm switching to https at the point in the
 checkout
  process where you view your cart, and then proceed to a page to either
 login
  or create an account.  When I submit my username and password, the
  validation fires as if I entered nothing into the form.  Enter it a
 second
  time and it works - the validation doesn't trigger.  Everything was
 entered
  correctly the first time around...so it's as if the form is being posted
 on
  its own, when the page loads?  Every page with @RequireHttps that has a
  form, does this.
 
  What do I need to do to change to accommodate validation under
 @RequireHttps
  pages?
 
  Currently you just see a lot of forms w/ fields like this:
 
  add(new TextField(username).setRequired(true));
 
  ...with a pretty common feedback panel:
 
 div id=feedbackPanel
   span wicket:id=feedbackPanel class=warning /
 /div
 
  Thanks!
 
  -v
 

 -
 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: Getting Page Expired in Glassfish but not in Jetty

2009-12-09 Thread bht
Hi,

It is usually easier to have identical development and production
platforms. If then you get an error as you describe, you usually catch
it in development before it reaches production.

So why don't you develop with GlassFish?


Bernard



On Thu, 10 Dec 2009 02:36:49 +0800, you wrote:

Hi all,

Currently I have a problem with my application wherein when I press the Back
button of the browser and navigate to a new page, I get a Page Expired error
consistently. However, this only happens when my application is deployed in
Glassfish, but not when I run it using Jetty. Any suggestions for what I
should check?

Related to that, I also experienced an error wherein there was a
target.add(form) in the onSubmit method of the button, which caused an
Exception in Glassfish whenever the feedback panel within the form was added
because the page could not be constructed; however In Jetty, the same code
caused no errors. The fix (removing target.add(form)) was simple enough, but
I was hoping someone could enlighten me regarding how different appservers
handle wicket page versions, etc. Is there a resource I can look up for
this? Thanks!


Regards,

Ces


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



Re: Very Basic Hello World - Applet

2009-12-09 Thread bht
Q: An applet tag does not get its archive attribute value resolved in
the output HTML in the same way
   as img src attributes. How can I fix this?
A: See
org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler
   This currently only supports the attributes href, src,
background.
   Solution: Add applet tag as WebMarkupContainer with behavior to
rewrite the attribute.
WebMarkupContainer clockContainer = new
WebMarkupContainer(clock);
clockContainer.add(new AbstractBehavior() {
private static final long serialVersionUID = 1L;
@Override
public void onComponentTag(Component component,
ComponentTag tag)
{
// Modify the relevant attribute
String attrName = archive;
IValueMap valueMap = tag.getAttributes();
String attrValue = valueMap.getString(attrName);
// We don't need the generalised checking as in
//
org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler:
//if ((attrValue != null) 
(attrValue.startsWith(/) == false) 
//(attrValue.indexOf(:)  0) 
!(attrValue.startsWith(#)))
if(attrValue != null){
IRequestCodingStrategy coder = RequestCycle.get()
.getProcessor()
.getRequestCodingStrategy();
valueMap.put(attrName,
coder.rewriteStaticRelativeUrl(attrValue));
}// if
}
});
add(clockContainer);


On Wed, 9 Dec 2009 21:53:51 +0600, you wrote:

I need to know how to set-up a simple hello world applet to Wicket , i have
almost browsed the entire web, and clueless of how to find it .. can some
one please help me out... or point me to a relevant site ..


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



Re: Very Basic Hello World - Applet

2009-12-09 Thread bht
And then there is:

script type=text/javascript
src=http://java.com/js/deployJava.js;/script
script type=text/javascript
// See
http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
deployJava.setInstallerType('kernel');
deployJava.runApplet({code:'path/YourClass.class',archive:'../jars/YourJar.jar',width:100,height:100},{legacy_lifecycle:true},'1.4');
/script

That is all you need to know to get your applet running.

Regards

Bernard

On Wed, 9 Dec 2009 21:53:51 +0600, you wrote:

I need to know how to set-up a simple hello world applet to Wicket , i have
almost browsed the entire web, and clueless of how to find it .. can some
one please help me out... or point me to a relevant site ..


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



Re: WicketStuff and wicket-contrib-javaee

2009-12-08 Thread bht
Hi Peter,

When my response has EJB in it, it can't be MASSIVE because EJB, you
hardly worry about it.

EJB is great, easy to use, and Wicket with EJB is even better. VERY
powerful combination. The thing is it just works, and there is no need
to talk about it much, especially with the NetBeans Wicket plugin,
NetBeans automatic Deploy on Save, refactoring support etc..

Many thanks for your contribution in this area.

Bernard

On Wed, 09 Dec 2009 11:51:18 +1100, you wrote:

Hey Peter,

Well, it would appear there hasn't been a massive response to your
question (which IMHO appears to be pretty common whenever you mention
EJB on this list), but anyway I'm very interested in what you've done
and I really hope you can take over the maintenance of
wicket-contrib-javaee.

Thanks,
Alan.




-
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



Global FeedbackPanel and ComponentFeedbackPanel on the same Page ?

2009-12-03 Thread bht
Hi,

It appears that Wicket already has everything I need:

- A global FeedbackPanel for any messages not necessarily associated
with components (a call error(...) displays the message on it)

- An individual ComponentFeedbackPanel for messages belonging to and
displayed in context of components.


My question is: Should I use both on the same page, and if so, how?

When I use both, then an error filtered by a ComponentFeedbackPanel is
also filtered by FeedbackPanel and the error is displayed twice, in
both panels.

I tried to avoid this by:

IFeedbackMessageFilter filter = new IFeedbackMessageFilter(){

public boolean accept(FeedbackMessage message) {
return ! message.isRendered();
}

};

FeedbackPanel feedbackPanel = new FeedbackPanel(feedback, filter);

ComponentFeedbackPanel componenFeedbackPanel = new
ComponentFeedbackPanel(fedbackText, textField);

But this simple approach fails because FeedbackPanel gets the message
before ComponentFeedbackPanel :(

I would rather not add a not-to-do list to FeedbackPanel, as I would
really like to keep this simple. Especially because
message.isRendered() looks useful.

Any ideas?

Many thanks.

Bernard

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



Re: Posting A Form To NonWicket

2009-11-21 Thread bht
Balaji,

If I understand you correctly, you want that the browser is redirected
to the response of a post request to site B after the user only sent a
post request to site A.

This is really not a Wicket question.

Web browsers cannot be directed to respond like this unless you send a
page with your form with the action URL of site B, AND let JavaScript
post it, started from the body onload() event or similar. But the
users might not universally accept to post to another site without
having clicket a button. So you might as well include a button for
them to click.

If you don't feel comfortable with this solution, then as others
pointed out, you need to let the server app post to the other site.

But that may be messy again, because the response is not necessarily
suited to be read by a computer.

If nothing of the above appeals to you, and I wouldn't be surprised
about that, then you might want to reconsider how to exchange data
with the other site.

In any case, Wicket seems to support everything that can possibly be
asked for in this scenario. The details of it have been written in
previous responses.

Bernard

On Sat, 21 Nov 2009 14:15:08 -0800 (PST), you wrote:


Thanks Igor. I'll give it a try. But the api doc says redirectrequesttarget
will only redirect to an external url, but I would like to post the form,
not just redirect.



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



Complications with loadable detachable models

2009-11-20 Thread bht
Hi

It appears that I am fighting against the framework that limits my
choices when I start using LDMs (LoadableDetachableModel).

Many examples in the framework documentation don't use LDMs. For
simplicity, they assume that the domain object e.g. person is
available to a model in an instance variable.

But LDM use is Wicket best practice. So if I switch to LDMs, then I
remove instance variables containing domain objects to avoid their
leakage into the session.

As a consequence of that, I must use wrapped PropertyModels that use
reflection and that are not refactor safe.

In addition, in onSubmit() methods, I have to manually extract the
domain object from the model.

If I use simple custom models per form field, overriding
org.apache.wicket.model.Model with inner classes, then I have to
manually extract the domain object from the LDM for each
setObject(...) and getObject() method.

To avoid these obstacles I would keep for convenience a transient
instance of the domain object. In onDetach(), I would set it to null
to avoid leakage into the session.

But how do I initialize it? I can do it in a Panel's constructor, but
in a stateful page, the constructor of a Panel is not called when it
is taken out of the session.

I found Page.onPageAttached() interesting for that, but I cannot use
it with a Panel sub class that is not hard-wired into the Page.

How can I use LDMs without this conflict? In the described scenario,
Wicket is really difficult to use, and that is because one has to be
so careful about domain objects leaking into the session.

Many thanks

Bernard


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



Help with Back Button Use Case

2009-11-12 Thread bht
Hi,

Wicket has excellent support of versioning due to its server side
state, and not only that, it is well documented e.g. in the feature
list, wiki.

In my use case, versioning is controlled with the objective of turning
it off with Component#setVersioned(false) on page level.

This appears to work for me in the following scenarios:

a) Page URL is non-bookmarkable, no explicit mount() for the page
   ?wicket:interface=:2:menu:edit-link::ILinkListener::
1   - ?wicket:interface=:3
1   - ?wicket:interface=:3
1   - ?wicket:interface=:3

b) Page URL is bookmarkable, mount() with HybridUrlCodingStrategy
   /edit
1   - /edit.3
1   - /edit.3
1   - /edit.3


The page changes state, i.e. it shows error messages and panels are
replaced while the user interacts with it.

When the user presses the back button, then the user does not get an
old version of the page but gets the page linking to it, which is good
in this use case.

The following scenario is bad for the use case:
c) Page URL is bookmarkable, no explicit mount() for the page
   ?wicket:bookmarkablePage=:EditPage
1   - ?wicket:bookmarkablePage=:EditPage
2   - ?wicket:interface=:3
2   - ?wicket:interface=:3
The back button shows the user 2 diferent versions of the page, the
latest one and the first.

My question is how Wicket can support this use case with bookmarkable
URLs bu without expensive page mounts.


I want that because with scenario b), I seem to need one mount for
every single page. With the number of mounts increasing, performance
is getting worse. Isn't there a cheap global mount with a URL coding
strategy that does not have that performance penalty, and that can be
applied to all pages while producting the same result as in scenario
b)?

Many thanks.

Bernard



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



Browser back, Panel replacement

2009-11-11 Thread bht
Hi,

I have been using panel replacement instead of multiple different
pages as a way to avoid a kind of back button problem but I am not
happy with my solution.

The objective is to prevent the user from going back after an update
to previous pages/versions of the page containing state of domain data
which really does not exist anymore.

This worked without AJAX when using HybridUrlCodingStrategy.

Because of a high number of pages, I want to get away from any
WebRequestCodingStrategy because of the Performance hint in
IRequestTargetUrlCodingStrategy#getMountEncoder. I don't mind ugly
URLs.  When I remove the HybridUrlCodingStrategy then the approach
does not seem to work anymore.

Also I am suspicous of any missing panel crashes on navigation with
the panel replacement approach.

How can I meet my objective? Is there a Wicket best practice approach
for this? I feel I am running round in circles considering options
such as IRequestCycleSettings.RenderStrategy, setVersioned(false).

My possibly oversimplified thought is that Wicket keeps changing page
state on the server and via HTTP post redirect back to the same page
there would never be a browser back option because the same page
cannot have multiple subsequent entries in the browser history.

I feel that this is such an obvious and common problem - I hope this
has already been written about and I just missed the article.


Many thanks,

Bernard

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



Serializable check

2009-11-05 Thread bht
Hi,

I am trying to prevent the leaking of business objects into the
session.

Michael made a good comment in

http://www.mail-archive.com/users@wicket.apache.org/msg31187.html

... you could e.g. temporarily remove the Serializable from your
model-classes and go spotting nonserializable exceptions until they
don't ocurr anymore.

which is what I did.

It works nicely until I hit a problem with ListDataProvider in
DataView, where I get an exception even if I use LDMs:

java.lang.ClassCastException: MyEntyty cannot be cast to
java.io.Serializable at
org.apache.wicket.markup.repeater.data.ListDataProvider.model(ListDataProvider.java:35)

It appears to me that the approach has a conflict with framework
classes.

What is the best way to spot session memory issues without hitting
this problem?

Many thanks,

Bernard

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



Re: Serializable check

2009-11-05 Thread bht
Igor,

Thanks very much for your suggestion which I followed.

I have overridden it and that is an improvement but still not good.

ListDataProvider dataProvider = new ListDataProvider(myList){
@Override
public IModelMyEntity model(Object object)
{
return new DetachableMyEntityModel((MyEntity) object);
}
};

SerializableChecker does a nice job spotting:

...
private final java.util.List
org.apache.wicket.markup.repeater.data.ListDataProvider.list[write:1]
[class=[Ljava.lang.Object;]

private final java.util.List
org.apache.wicket.markup.repeater.data.ListDataProvider.list[write:1][0]
[class=MyEntity] - field that is not serializable

I guess that private final ListT list; of ListDataProvider wants to
be serialized into the session which we don't want?

I am trying to apply best practice - may be I should not be using
ListDataProvider?

http://old.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html

instead of using listdataprovider you should use a dataprovider in
that uses detachablemodels for each individual item -igor 

Today, with 1.4, what is best to use for List results from
EntityManager? Still DataProvider?

Many thanks,

Bernard



On Thu, 5 Nov 2009 14:25:01 -0800, you wrote:

you have to override listdataprovider#model and return a detachable model.

-igor

On Thu, Nov 5, 2009 at 2:19 PM,  b...@actrix.gen.nz wrote:
 Hi,

 I am trying to prevent the leaking of business objects into the
 session.

 Michael made a good comment in

 http://www.mail-archive.com/users@wicket.apache.org/msg31187.html

 ... you could e.g. temporarily remove the Serializable from your
 model-classes and go spotting nonserializable exceptions until they
 don't ocurr anymore.

 which is what I did.

 It works nicely until I hit a problem with ListDataProvider in
 DataView, where I get an exception even if I use LDMs:

 java.lang.ClassCastException: MyEntyty cannot be cast to
 java.io.Serializable at
 org.apache.wicket.markup.repeater.data.ListDataProvider.model(ListDataProvider.java:35)

 It appears to me that the approach has a conflict with framework
 classes.

 What is the best way to spot session memory issues without hitting
 this problem?

 Many thanks,

 Bernard

 -
 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: Serializable check

2009-11-05 Thread bht
Thanks again Igor.

I have switched to plain IDataProvider as suggested, although I have
to admit that I still have to look at the phonebook example.

Again, IDataProvider is an improvement, but still not good.

It appears that SerializableChecker is complaining about a volatile
field not being Serializable. Is this a bug or do I miss anything?

I think that SerializableChecker is a wondeful tool, that is why I am
persevering:

org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
Unable to serialize class: MyEntity

...
private volatile java.util.List MyEntityDataProvider.entities
[class=java.util.Vector]

...


public class MyEntityDataProvider implements IDataProviderMyEntity{

private final Integer searchId;
private volatile ListMyEntity entities;

public MyEntityDataProvider(Integer searchId) {
this(searchId, null);
}

public MyEntityDataProvider(Integer searchId, ListMyEntity
entities) {
this.searchId = searchId;
this.entities = entities;
}

@Override
public IteratorMyEntity iterator(int first, int count)
{
return entities.iterator();
}

@Override
public int size()
{
if(this.entities == null){
SessionLocal sessionBean = MyApplication.getSessionBean();
this.entities = sessionBean.getMyEntities(this.searchId);
}
return this.entities.size();
}

@Override
public IModelMyEntity model(MyEntity entity)
{
return new DetachableMyEntityModel(entity);
}

@Override
public void detach()
{
}

}




On Thu, 5 Nov 2009 18:30:20 -0800, you wrote:

no, you should not be using listdataprovider, it is only for static
lists of things.

if you want best practice look at the phonebook example in wicket-stuff.

-igor

On Thu, Nov 5, 2009 at 5:52 PM,  b...@actrix.gen.nz wrote:
 Igor,

 Thanks very much for your suggestion which I followed.

 I have overridden it and that is an improvement but still not good.

 ListDataProvider dataProvider = new ListDataProvider(myList){
   �...@override
    public IModelMyEntity model(Object object)
    {
        return new DetachableMyEntityModel((MyEntity) object);
    }
 };

 SerializableChecker does a nice job spotting:

 ...
 private final java.util.List
 org.apache.wicket.markup.repeater.data.ListDataProvider.list[write:1]
 [class=[Ljava.lang.Object;]

 private final java.util.List
 org.apache.wicket.markup.repeater.data.ListDataProvider.list[write:1][0]
 [class=MyEntity] - field that is not serializable

 I guess that private final ListT list; of ListDataProvider wants to
 be serialized into the session which we don't want?

 I am trying to apply best practice - may be I should not be using
 ListDataProvider?

 http://old.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html

 instead of using listdataprovider you should use a dataprovider in
 that uses detachablemodels for each individual item -igor 

 Today, with 1.4, what is best to use for List results from
 EntityManager? Still DataProvider?

 Many thanks,

 Bernard



 On Thu, 5 Nov 2009 14:25:01 -0800, you wrote:

you have to override listdataprovider#model and return a detachable model.

-igor

On Thu, Nov 5, 2009 at 2:19 PM,  b...@actrix.gen.nz wrote:
 Hi,

 I am trying to prevent the leaking of business objects into the
 session.

 Michael made a good comment in

 http://www.mail-archive.com/users@wicket.apache.org/msg31187.html

 ... you could e.g. temporarily remove the Serializable from your
 model-classes and go spotting nonserializable exceptions until they
 don't ocurr anymore.

 which is what I did.

 It works nicely until I hit a problem with ListDataProvider in
 DataView, where I get an exception even if I use LDMs:

 java.lang.ClassCastException: MyEntyty cannot be cast to
 java.io.Serializable at
 org.apache.wicket.markup.repeater.data.ListDataProvider.model(ListDataProvider.java:35)

 It appears to me that the approach has a conflict with framework
 classes.

 What is the best way to spot session memory issues without hitting
 this problem?

 Many thanks,

 Bernard

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



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


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



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



Re: Serializable check

2009-11-05 Thread bht
Igor,

Creating the list of entities exclusively inside iterator() requires
two database calls for retrieving a list for a single request, the
additional call being required for the size() method that is called
prior to iterator(). That is an unfortunate side effect of this API.

I don't have a problem with that as I work around it, as others have
done before me, by fetching the data eagerly with the size() method
and then caching it in a volatile field for use by iterator().

I just can't afford to make two database calls.

So I wonder, what is the situation with SerializableChecker
complaining about that volatile field not being Serializable. Is this
a bug or do I miss anything?

Should I use something else instead of IDataProvider?

Many thanks.

Bernard


On Thu, 5 Nov 2009 20:05:37 -0800, you wrote:

you should create the list of entities inside iterator() call, not
hold on to it in a field. see the phonebook example.

-igor

On Thu, Nov 5, 2009 at 7:06 PM,  b...@actrix.gen.nz wrote:
 Thanks again Igor.

 I have switched to plain IDataProvider as suggested, although I have
 to admit that I still have to look at the phonebook example.

 Again, IDataProvider is an improvement, but still not good.

 It appears that SerializableChecker is complaining about a volatile
 field not being Serializable. Is this a bug or do I miss anything?

 I think that SerializableChecker is a wondeful tool, that is why I am
 persevering:

 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class: MyEntity

 ...
 private volatile java.util.List MyEntityDataProvider.entities
 [class=java.util.Vector]

 ...


 public class MyEntityDataProvider implements IDataProviderMyEntity{

    private final Integer searchId;
    private volatile ListMyEntity entities;

    public MyEntityDataProvider(Integer searchId) {
        this(searchId, null);
    }

    public MyEntityDataProvider(Integer searchId, ListMyEntity
 entities) {
        this.searchId = searchId;
        this.entities = entities;
    }

   �...@override
    public IteratorMyEntity iterator(int first, int count)
    {
        return entities.iterator();
    }

   �...@override
    public int size()
    {
        if(this.entities == null){
            SessionLocal sessionBean = MyApplication.getSessionBean();
            this.entities = sessionBean.getMyEntities(this.searchId);
        }
        return this.entities.size();
    }

   �...@override
    public IModelMyEntity model(MyEntity entity)
    {
        return new DetachableMyEntityModel(entity);
    }

   �...@override
    public void detach()
    {
    }

 }




 On Thu, 5 Nov 2009 18:30:20 -0800, you wrote:

no, you should not be using listdataprovider, it is only for static
lists of things.

if you want best practice look at the phonebook example in wicket-stuff.

-igor

On Thu, Nov 5, 2009 at 5:52 PM,  b...@actrix.gen.nz wrote:
 Igor,

 Thanks very much for your suggestion which I followed.

 I have overridden it and that is an improvement but still not good.

 ListDataProvider dataProvider = new ListDataProvider(myList){
   �...@override
    public IModelMyEntity model(Object object)
    {
        return new DetachableMyEntityModel((MyEntity) object);
    }
 };

 SerializableChecker does a nice job spotting:

 ...
 private final java.util.List
 org.apache.wicket.markup.repeater.data.ListDataProvider.list[write:1]
 [class=[Ljava.lang.Object;]

 private final java.util.List
 org.apache.wicket.markup.repeater.data.ListDataProvider.list[write:1][0]
 [class=MyEntity] - field that is not serializable

 I guess that private final ListT list; of ListDataProvider wants to
 be serialized into the session which we don't want?

 I am trying to apply best practice - may be I should not be using
 ListDataProvider?

 http://old.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html

 instead of using listdataprovider you should use a dataprovider in
 that uses detachablemodels for each individual item -igor 

 Today, with 1.4, what is best to use for List results from
 EntityManager? Still DataProvider?

 Many thanks,

 Bernard



 On Thu, 5 Nov 2009 14:25:01 -0800, you wrote:

you have to override listdataprovider#model and return a detachable model.

-igor

On Thu, Nov 5, 2009 at 2:19 PM,  b...@actrix.gen.nz wrote:
 Hi,

 I am trying to prevent the leaking of business objects into the
 session.

 Michael made a good comment in

 http://www.mail-archive.com/users@wicket.apache.org/msg31187.html

 ... you could e.g. temporarily remove the Serializable from your
 model-classes and go spotting nonserializable exceptions until they
 don't ocurr anymore.

 which is what I did.

 It works nicely until I hit a problem with ListDataProvider in
 DataView, where I get an exception even if I use LDMs:

 java.lang.ClassCastException: MyEntyty cannot be cast to
 java.io.Serializable at
 org.apache.wicket.markup.repeater.data.ListDataProvider.model(ListDataProvider.java:35)

 It 

Re: Serializable check

2009-11-05 Thread bht
Hi James,

Thanks for the question.

In this case, yes. In other cases where I use IDataProvider, no.
I know that IDataProvider provides functionality for pagination which
I don't use here, that is why I ignored it.

I must admit I have a few issues with IDataProvider but I don't want
to distract from the original issue.

So I wonder, what is the situation with SerializableChecker
complaining about that volatile field not being Serializable. Is this
a bug or do I miss anything?

Should I use something else instead of IDataProvider?

I just want to retrieve a list from the database, display it in a
table while not having to deal with fake Serializable issues when I
remove the Serializable interface from the business object. I have to
do this to check the application for leaks of that business object
into the session.

Many thanks.



Bernard


On Thu, 5 Nov 2009 23:29:02 -0500, you wrote:

Are you always retrieving the entire list?

[snip]


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



Re: Serializable check

2009-11-05 Thread bht
Thanks very much!

As pointed out, I was incorrectly using the keyword volatile instead
of transient. All is well now with IDataProvider and
SerializableChecker.

SerializableChecker is great!

Bernard

On Thu, 5 Nov 2009 22:30:59 -0800, you wrote:

class mydataprovider implements idataprovider {
   private transient list cache;
   private list getresult() {
   if (cache==null) {
// load the list from db;
cache=list;
} return cache;
 }

 public iterator iterator() { return getresult().iterator(); }
 public int size() { return getresult().size(); }
 public void detach() { cache=null; }
}

-igor


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



IDataProvider for growing Result Size

2009-10-17 Thread bht
Hi,

I am seeking some help or links to documentation with IDataProvider
for DataView.

In my use case the size of the data grows while the user clicks
through list pages.

I wrote an IDataProvider implementation that progressively returns
larger values with the size() method.

However it fails due to the size growing, if the user clicks on the
last page.

That is because DataView limits itself understandably, by only
requesting as many rows as the last invocation of size() tells it are
available.

But this limitation is unnecessary.

What is needed is that it keeps filling the page until the Iterator
for IDataProvider.iterator(int first, int count) returns false with
hasNext(), or until its page is full, in that case displaying a link
to the next page, ignoring the fact that size() is no longer accurate.

I hope that an easy solution for this requirement exists as I think
that there is no conflict with out-of-the-box correct behavior.

Again, very specifically, during the same cycle, after the
underestimated size() result, the iterator may return more data than
expected, and that excess data should be consumed normally in such a
way that the user can continue moving forward to subsequent pages as
long as more data becomes available.


Many thanks!

Bernard


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



Re: How do you achieve persistency

2009-10-06 Thread bht
Peter,

If you already used Hibernate, then you probalbly don't want to deal
with raw JDBC anymore. JPA is the new standard, and even Hibernate is
compatible with it. I use NetBeans + EJB 3.0 including JPA + Wicket
which looks like an easy combination to me. On that level, if your
persistence technology is not performing, then you can replace it with
something else easily, e.g. OpenJPA, EclipseLink.

I get the impression that out of a number of persistence frameworks
some will become legacy over time while JPA becomes mainstream. I have
read comments that due to the emergence of JPA, iBatis support has
shifted efforts away from Java, towards MS .NET.

I would not be distracted by any impression that part of the Wicket
community may be biased against EJB and JPA.

Please refer to https://issues.apache.org/jira/browse/WICKET-2416

Regards

Bernard

On Tue, 6 Oct 2009 09:34:55 + (GMT), you wrote:

What's the fast and easy way?

I am asking because of a lot of trouble with hibernate.



  

-
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



Page redirect after POST

2009-08-27 Thread bht
Hi,

With forms on Wicket pages, it appears that on submit which is HTTP
POST, Wicket redirects to the same page (the page from where the data
was sent) ad this is how we show feedback on the form page.

How is it possible to send the rendered form page back to the broser
as a direct response to the POST, not via a redirect?

Many thanks.

Bernard

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



Re: Wicket - Ajax(Fallback)Button and Form - possible solution to problem

2008-12-18 Thread bht

Jeremy,

jpswain referred to the gmail signup form. The gmail form initially hides
the check availability elements via div with style=display:none. It only
shows them when it detects that AJAX or JavaScript (don't know exactly) is
available. Would you know how we can implement this with wicket?
-- 
View this message in context: 
http://www.nabble.com/Wicket---Ajax%28Fallback%29Button-and-Form---possible-solution-to-problem-tp20373644p21085893.html
Sent from the Wicket - User 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