Re: CAS (or single sign on): how to?

2012-02-14 Thread Sam Zilverberg
A couple of implementation questions:

1) Do you use the RestartResponseAtInterceptPageException to redirect
users to the cas site when the user is not logged in and the cookie is not
present, or something else?
2) Do you allow loging in also through the normal sites, not using the
cas?
3) Shared data store - is this a wicket/java object or just any
resource(like db) that both apps have access to?
4) Did you override some of wicket session store methods to support the
extraction of the id from the shared data store?
5) Session expiration -where do you add a session expiration listener? on
the wicket app level or in the web.xml?

Thanks a lot for the help so far.
I started looking this kind of info a couple of days ago but couldn't find
anything useful.
I only found info about implementation using the container (tomcat) or
spring-security (which i don't use).

On Tue, Feb 14, 2012 at 12:58 AM, Dan Retzlaff dretzl...@gmail.com wrote:

 Hi Sam,

 We have a similar use case, and we use a home-grown approach within Wicket:
 1. The authenticating application persists a session ID into a shared data
 store, and puts the ID into a new site-wide cookie. We use Wicket's
 Session#getId() for the ID, but could equivalently use UUID.randomUUID().
 2. When other apps' IAuthorizationStrategy detects an
 unauthorized/unauthenticated request, it tries to authenticate using this
 site-wide cookie. It basically just verifies that the session ID in the
 cookie corresponds to an active session in the shared data store.

 One thing to consider is your session expiration/logout logic. Our use case
 is more like user handoff than concurrent Wicket sessions, and we have a
 session expiration listener that invalidates the session in the shared data
 store from the owning application. If your use case is not so simple,
 then you'll have to define your own site-wide authentication expiration
 event(s).

 On Mon, Feb 13, 2012 at 1:55 PM, Sam Zilverberg samzilverb...@gmail.com
 wrote:

  Hi,
 
  Our base wicket app is deploy around 40-50 times on a couple of tomcats.
  Each instance has a different configuration but the code base is the same
  app.
  Each instance has its own context and it looks something like this:
  app a : baseurl/a
  app baba: baseurl/baba
 
  Currently the authentication and authorization for each site is handled
 by
  the wicket app assigned to that context.
  We implemented IAuhorizationStrategy and are using the signin page from
 the
  examples + captcha after a couple of tries.
 
  We want an app at baseurl/login that will take care of loging in instead
 of
  all the different apps doing it for themselves.
  Whats the best way to implement such a CAS mechanism? (preferably using
  wicket, spring is ok too)
 
  Thanks,
  Sam.
 



Re: refresh and AjaxFallbackDefaultDataTable

2012-02-14 Thread Sven Meier

Hi,

in Ajax requests the page id is not incremented, to keep the page 
version in the browser's url in sync with the state on the server.


When the page is refreshed (F5), the following happens:
- WebPageRenderer#respond() checks whether the url has changed, which it 
has not yet. So no redirect seems necessary.
- while rendering (more correctly in onBeforeRender()) the DataView 
removes all its children, thus resulting in a version increment

- all links render itself with the new page version

Thus the browser still shows the old version in the URL. But all future 
Ajax requests are targetting a different page version than visible in 
the browser URL :(.


Sven

Am 13.02.2012 20:13, schrieb Jonathan Tougas:

I'm getting some inconsistent behavior with
AjaxFallbackDefaultDataTable. Here are two scenarios that can be run on
wicket-examples:

*Scenario 1*
1 - navigate to
http://wicketstuff.org/wicket/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.AjaxDataTablePage
2 - click the link to navigate to page 2
3 - refresh (F5)

After the page refresh, you're still on page 2 - as expected

*Scenario 2:*
1 - navigate to
http://wicketstuff.org/wicket/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.AjaxDataTablePage
2 - refresh (F5)
3 - click the link to navigate to results page 2
4 - refresh (F5)

After the page refresh you're back to page 1 - oops

The navigation links work fine until the page is refreshed. After a page
refresh the navigation links point to the wrong page version (or so it
seems), so refreshing a second time doesn't work as expected. I'm fairly
new to Wicket so I may be missing something, and I haven't found a bug
report for this. Can someone confirm or explain what Im not getting please?

Cheers!




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



Link URLs (with JSessionID) truncated during URL rewriting

2012-02-14 Thread Ian Marshall
Hello All,

Has anyone else apart from me suffered from this problem of URLs being
truncated to become invalid?

I would appreciate it if anyone else shared my pain!

Ian Marshall


Ian Marshall wrote
 
 Hello All,
 
 A user's first visit to my app's home page results in the URL
 
   http://[My domain]/main/PageHome;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0
 
 Each org.apache.wicket.markup.html.link.Link on my home page has the URL
 of the form
 
   http://[My
 domain]/main/..;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0-1.ILinkListener-lnkAbout
 
 (of length 102 characters for the particular link URL copied here). These
 URLs are invalid, because of the two dots present instead of the completed
 path.
 
 Is there any way I can configure Wicket to suppress this URL abbreviation,
 or is this operation the province of the web application server or web
 browser?
 
 As a work-around, I have already coded the supression of JSessionIDs in my
 links' URLs, and am coding the app to give a warning if session cookies
 are disabled. But I would appreciate any pointers.
 
 Ian Marshall
 
 
 My operating environment
 -
 Web application server: (Jetty? in) Google App Engine
 Wicket version: 1.5.3 (I know: it's not the very latest version!)
 Web browsers:   Mozilla Firefox 10.0.1
 Microsoft Internet Explorer 8.0.6001.18702
 as found on my HTC Wildfire S running Google
 Android 2.3.5
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4386619.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: jQuery form validation with wicket ajax

2012-02-14 Thread Paul Jackson
Thanks for that link! I never managed to work out how to get jquery events to 
override the buttons onClick attribute. This should simplify our validation 
code a lot.

Paul

-Original Message-
From: Alec Swan [mailto:alecs...@gmail.com] 
Sent: 13 February 2012 16:38
To: users@wicket.apache.org
Subject: Re: jQuery form validation with wicket ajax

This thread describes a purely client-side solution to your problem:
http://stackoverflow.com/questions/1506729/how-to-intercept-the-onclick-event.
You can solve this problem for all you AJAX links by assigning them a special 
class, e.g. class=ajaxLink, and then apply the technique to $(form 
.ajaxLink).

On Mon, Feb 13, 2012 at 3:55 AM, Paul Jackson paul.jack...@cdl.co.uk wrote:
 We use an OnBeforeRenderListener to add onClick events to the buttons and 
 ajax buttons on a form that we want to be validated. We have to handle the 
 normal buttons and ajax buttons slightly differently.

 Ajax button:

            button.add(new AttributeModifier(onclick, new 
 ModelString(if (! $('# + formMarkupId
                    + ').validate().form()) {return false};)) {

 Normal Button:

            button.add(new WiQueryEventBehavior(new 
 Event(MouseEvent.CLICK) {
                @Override
                public JsScope callback() {
                    return JsScope.quickScope(return $('# + 
 formMarkupId + ').validate().form(););
                }
            }));

 Hope that helps.

 Paul

 -Original Message-
 From: Gerrit Scholz | QUERPLEX.de [mailto:gerrit.sch...@querplex.de]
 Sent: 13 February 2012 10:18
 To: users@wicket.apache.org
 Subject: jQuery form validation with wicket ajax

 Hello there,
 I try to use jQuery validaton (http://docs.jquery.com/Plugins/Validation) 
 with a wicket AJAX button. I register the jQuery validator on the form. If I 
 use a normal wicket submit button or link, the jQuery form validation works. 
 But if I use an AJAX button or link, the jQuery form validation is not 
 called. How can I call the jQuery validation before AJAX update.
 Thanks,
 Gerrit



 --
 - QUERPLEX GmbH Nürnberg | www.querplex.de Kornmarkt 2
 D-90402 Nürnberg
 --
 -
 Tel +49 (0)911 94 11 98 - 0
 Fax +49 (0)911 94 11 98 - 59
 --
 -
 Registergericht Nürnberg HRB 20 123
 Geschäftsführerin: Angelika Benkert
 --
 -
 **
 Please consider the environment - do you really need to print this email?

 This email is intended only for the person(s) named above and may contain 
 private and confidential information. If it has come to you in error, please 
 destroy and permanently delete any copy in your possession and contact us on 
 +44 (0) 161 480 4420. The information in this email is copyright © CDL Group 
 Holdings Limited. We cannot accept any liability for any loss or damage 
 sustained as a result of software viruses. It is your responsibility to carry 
 out such virus checking as is necessary before opening any attachment.

 Cheshire Datasystems Limited uses software which automatically screens 
 incoming emails for inappropriate content and attachments. If the software 
 identifies such content or attachment, the email will be forwarded to our 
 Technology Department for checking. You should be aware that any email which 
 you send to Cheshire Datasystems Limited is subject to this procedure.

 Cheshire Datasystems Limited, Strata House, Kings Reach Road, 
 Stockport SK4 2HD Registered in England and Wales with Company Number 
 3991057 VAT registration: 727 1188 33

-
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.4: Rather curious case of the IInitializer List

2012-02-14 Thread Sven Meier

Hi Richard,

you're right, this implementation looks 'curious' but it was intentional.

Note the javadoc of Collection.unmodifiableList():
'Query operations on the returned list read through to the specified list'

Sven


Am 13.02.2012 23:58, schrieb richard emberson:

While looking at the extensions code,
I noted that in the 1.5.4 InitializerStringResourceLoader
constructor that the list of IInitializer is empty but
in the InitializerStringResourceLoader loadStringResource
method there are two initializers in that same IInitializer list.

So, how can this be?

Well, in Application, first the initializers list is
wrapped in a Collections.unmodifiableList and returned
by the Application getInitializers method. This is
called when creating an instance of the InitializerStringResourceLoader.
Later, the Application load(properties) method is called
which, in turn, calls addInitializer twice which adds
two IInitializer to the Application's initializers list.

Now, the InitializerStringResourceLoader loadStringResource
is called and, behold, the InitializerStringResourceLoader
IInitializer list now has two members.

It seems that, under the covers, Application and 
InitializerStringResourceLoader

share the same IInitializer list!!! This sharing is, well,
not documented, rather, its depends upon the implementation of
Collections.unmodifiableList.

So, I don't wish to criticize; maybe this was the intent;
maybe its very clever; but for me its, well, curious.

Richard




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



Last cause: $Proxy153 cannot be cast to org.omg.CORBA.Object

2012-02-14 Thread Ivan V. Kokhan
Hello All,

 

I have a Wicket application on the JBoss-4.2.2 GA server.

 

User visits the link:

https://name_of_host.com:8443/webform/?code=c30bd05e-da65-45ab-9217-fcb72969
1138

 

And receive the error message in the browser:

 

==

Unexpected RuntimeException

 

Last cause: $Proxy153 cannot be cast to org.omg.CORBA.Object

WicketMessage: Can't instantiate page using constructor 'public
de.connectodent.HomePage(org.apache.wicket.request.mapper.parameter.PagePara
meters)' at .

 

 

Stacktrace

 

Root cause:

java.lang.ClassCastException: $Proxy153 cannot be cast to
org.omg.CORBA.Object

at
com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteOb
ject.java:212)

at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:131)

at
de.connectodent.server.ConnectToServer.lookupHandlers(ConnectToServer.java:5
12)

...

==

 

Immediately after pressing the browser's Refresh button - this message
disappears and the application works fine.

I see this error the same in FireFox and in Opera.

 

Please prompt how to avoid the appearance of this message?

 

Thanks,

Ivan

 

 

 



Re: Problem with date format on changing locale

2012-02-14 Thread cosmindumy
I actually want to know if I  can set date format. I want to set it after
submit. 
There is #forDatePattern(...) but this can be used at page initialization,
instead of constructor.
Thnaks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-date-format-on-changing-locale-tp4383834p4386555.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: modal window takes very long time to close

2012-02-14 Thread James Carman
This is what I was trying to find:

http://mail-archives.apache.org/mod_mbox/wicket-users/200904.mbox/%3ca737c1240904170336h2231a4aej48e6f3ec783bd...@mail.gmail.com%3E


On Mon, Feb 13, 2012 at 11:08 AM, fachhoch fachh...@gmail.com wrote:
 any help with this , My modal window is taking too long to close.


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/modal-window-takes-very-long-time-to-close-tp4377803p4384240.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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



RE: refresh and AjaxFallbackDefaultDataTable

2012-02-14 Thread Wilhelmsen Tor Iver
 Thus the browser still shows the old version in the URL. But all future Ajax 
 requests are targetting a different page version than visible in the browser 
 URL :(.

Can't you fix that with a 

getPage().dirty();

in the Ajax request handler?

- Tor Iver

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



Wicket 1.5 and JSP/servlet wrapping

2012-02-14 Thread Johan Isaksson
Hi!

In the project I'm on we want to upgrade from Wicket 1.4 to 1.5 (1.5.4) and
one major thing is not working yet.
There's a need to wrap old JSP/servlets into the new Wicket based
application and the old 1.4-approach is not working anymore.

Simplified html output in 1.4
body
 div id=container
  wrappedContentFromJsp
 /div
body

Simplified html output in 1.5
body
 wrappedContentFromJsp
 div id=container
 /div
body

So, all the JSP content renders outside the tag that we like to wrap it in.
The wrapping magic happens in our internal AbstractServletWrapperPanel and
the WebMarkupContainer.onRender(MarkupStream markupStream) override.
However, in Wicket 1.5 we can't invoke markupStream.next() since it's no
longer provided. I have not found a way around this yet.

Working code for 1.4 with a sample panel implementation as reference:
public abstract class AbstractServletWrapperPanel extends Panel {

 public AbstractServletWrapperPanel(String id, final  String
servletName, String tagId) {
  super(id);
  add(new WebMarkupContainer(tagId) {

   @Override
   protected void onRender(MarkupStream markupStream) {
markupStream.next();
try {
 WebRequestCycle cycle = (WebRequestCycle) RequestCycle.get();
 ServletRequest request =
cycle.getWebRequest().getHttpServletRequest();
 ServletResponse response =
cycle.getWebResponse().getHttpServletResponse();
 ServletContext context = ((WebApplication)
Application.get()).getServletContext();
 RequestDispatcher rd = context.getNamedDispatcher(servletName);
 if (rd != null) {
  rd.include(request, response);
 } else {
  // handling...
 }
} catch (Exception e) {
 // handling...
}
   }
  });
 }
}

//Impl
public class WrapperPanel extends AbstractServletWrapperPanel {
 private static final long serialVersionUID = 1L;

 public WrapperPanel(String id, final String servletName) {
  super(id, servletName, wrappedContentId);
 }
}

//WrapperPanel html
body
 wicket:panel
  wicket:container wicket:id=wrappedContentId/
 /wicket:panel
/body

In the 1.5 version I'm getting the request and response via
* (HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()
*
(HttpServletResponse)RequestCycle.get().getResponse().getContainerResponse()

Then I've tried to:

* use the onRender()-magic without markupStream.next() that's no longer
provided in 1.5
* move it to onComponentTagBody(MarkupStream markupStream, ComponentTag
tag)
  * Note: To invoke onComponentTagBody() I had to open up the container tag
wicket:container/wicket:container.
  * I also tried without invoking markupStream.next() as that step is
performed in Component.internalRenderComponent() just before
onComponentTagBody is invoked at all.
* move it to onComponentTag(ComponentTag tag)
* combined above with setting setRenderBodyOnly(true) in the
WebMarkupContatiner.onInitialize()
* use a div tag instead of a wicket:container
* use debug mode to track down the rendering process of 1.5. But still, I
guess I'm missing out some key part of the new 1.5 way of rendering
components.
* invoke getAssociatedMarkupStream() from onRender() but that raises the
following error
  * org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html'
for component '... AbstractServletWrapperPanel$1' not found.

Since it's not an option to migrate all that JSP functionality to Wicket
anytime soon this is kind of a showstopper for us at the moment.

For reference, the 1.4 way of doing this is much similar to the approach I
found in the article
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/

I also posted this question on SO,
http://stackoverflow.com/questions/9257706/wicket-1-5-and-jsp-servlet-wrapping

Any help solving this issue would be very appreciated!

Thanks,

Johan


SpringComponentInjector and non null fields

2012-02-14 Thread martin.dilger
Hi,

I just realized painfully, that SpringComponentInjector only injects Beans,
when the Fields are non-null.
Is there a reason for this Behavior?
The Reason I ask is, we use the SpringComponentInjector in all our Tests
to inject Mocks with Injector.get().inject(this).
This only works, if we set all Mocks to null in tearDown.
No problem so far, but this is surely not a typical use case, but
nonetheless, I would like to know if this is desired, and if we could
propably allow to configure this behavior (as a flag or whatever?). 
Just for me to understand this  better.
Thanks

Martin

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-null-fields-tp4386918p4386918.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Header contribution from a component resolved via an IComponentResolver

2012-02-14 Thread Sven Meier

Hi,

auto-components are added to the component tree not until rendering of 
markup, this is too late for header contributions.


Sven

Am 14.02.2012 07:33, schrieb Chris Colman:

Added a JIRA for this:

https://issues.apache.org/jira/browse/WICKET-4408

If I explicitly add the component to the parent it works but I can't do
this in our app.



From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
Sent: Tuesday, 14 February 2012 4:11 PM
To: users@wicket.apache.org
Subject: Header contribution from a component resolved via an
IComponentResolver

Is header contribution meant to work when a component is not added
directly but added but added via an IComponentResolver?

I have component and have added a renderHead override:

Class MyComponent extends Panel
{
/**
  * Write out necessary header markup.
  */
@Override
public void renderHead(IHeaderResponse response)
{
 StringBuffer sb = new StringBuffer();

 sb.append(script src=\/jquery.easing.1.3.min.js\/script);
 sb.append(script src=\/trans-banner.min.js\/script);

 response.renderString(sb.toString());
}
}

But this method is never called. Is header contribution meant to work
this easily or am I missing something?

Using latest 1.5.x snapshot.

Yours sincerely,

Chris Colman

Pagebloom Team Leader,
Step Ahead Software


pagebloom - your business  your website growing together

Sydney:   (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120
Email: chr...@stepahead.com.aumailto://chr...@stepahead.com.au
Website:
http://www.pagebloom.comblocked::http://www.pagebloom.com/
http://develop.stepaheadsoftware.com
blocked::http://develop.stepaheadsoftware.com/






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



Re: SpringComponentInjector and non null fields

2012-02-14 Thread Robert Kühne
There is a remark on this here:
https://cwiki.apache.org/WICKET/spring.html


When doing this it is important to remember not to initialize
dependencies, to null or any other value, e.g.private ContactDao
dao=null;. Don't do this because the injector will run before the
subclass initializes its fields, and so the dao=null will override the
created proxy with null.

Robert

Am 14.02.2012 13:58, schrieb martin.dilger:
 Hi,

 I just realized painfully, that SpringComponentInjector only injects Beans,
 when the Fields are non-null.
 Is there a reason for this Behavior?
 The Reason I ask is, we use the SpringComponentInjector in all our Tests
 to inject Mocks with Injector.get().inject(this).
 This only works, if we set all Mocks to null in tearDown.
 No problem so far, but this is surely not a typical use case, but
 nonetheless, I would like to know if this is desired, and if we could
 propably allow to configure this behavior (as a flag or whatever?). 
 Just for me to understand this  better.
 Thanks

 Martin

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-null-fields-tp4386918p4386918.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





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

AW: jQuery form validation with wicket ajax

2012-02-14 Thread Gerrit Scholz | QUERPLEX.de
If I intercept the onclick event my function is called but the processing not 
stop. Mean that the wicket (onclick) javascript is running parallel.
So I write a AttributeModifier that prepends my function to the onclick 
attribute. Now the validation works fine, but on the onSubmit method of the 
wicket ajax button the AjaxRequestTarget is null so the component to refresh 
cannot be added.

Gerrit

-Ursprüngliche Nachricht-
Von: Paul Jackson [mailto:paul.jack...@cdl.co.uk] 
Gesendet: Dienstag, 14. Februar 2012 10:38
An: users@wicket.apache.org
Betreff: RE: jQuery form validation with wicket ajax

Thanks for that link! I never managed to work out how to get jquery events to 
override the buttons onClick attribute. This should simplify our validation 
code a lot.

Paul

-Original Message-
From: Alec Swan [mailto:alecs...@gmail.com]
Sent: 13 February 2012 16:38
To: users@wicket.apache.org
Subject: Re: jQuery form validation with wicket ajax

This thread describes a purely client-side solution to your problem:
http://stackoverflow.com/questions/1506729/how-to-intercept-the-onclick-event.
You can solve this problem for all you AJAX links by assigning them a special 
class, e.g. class=ajaxLink, and then apply the technique to $(form 
.ajaxLink).

On Mon, Feb 13, 2012 at 3:55 AM, Paul Jackson paul.jack...@cdl.co.uk wrote:
 We use an OnBeforeRenderListener to add onClick events to the buttons and 
 ajax buttons on a form that we want to be validated. We have to handle the 
 normal buttons and ajax buttons slightly differently.

 Ajax button:

            button.add(new AttributeModifier(onclick, new 
 ModelString(if (! $('# + formMarkupId
                    + ').validate().form()) {return false};)) {

 Normal Button:

            button.add(new WiQueryEventBehavior(new
 Event(MouseEvent.CLICK) {
                @Override
                public JsScope callback() {
                    return JsScope.quickScope(return $('# + 
 formMarkupId + ').validate().form(););
                }
            }));

 Hope that helps.

 Paul

 -Original Message-
 From: Gerrit Scholz | QUERPLEX.de [mailto:gerrit.sch...@querplex.de]
 Sent: 13 February 2012 10:18
 To: users@wicket.apache.org
 Subject: jQuery form validation with wicket ajax

 Hello there,
 I try to use jQuery validaton (http://docs.jquery.com/Plugins/Validation) 
 with a wicket AJAX button. I register the jQuery validator on the form. If I 
 use a normal wicket submit button or link, the jQuery form validation works. 
 But if I use an AJAX button or link, the jQuery form validation is not 
 called. How can I call the jQuery validation before AJAX update.
 Thanks,
 Gerrit



 --
 - QUERPLEX GmbH Nürnberg | www.querplex.de Kornmarkt 2
 D-90402 Nürnberg
 --
 -
 Tel +49 (0)911 94 11 98 - 0
 Fax +49 (0)911 94 11 98 - 59
 --
 -
 Registergericht Nürnberg HRB 20 123
 Geschäftsführerin: Angelika Benkert
 --
 -
 **
 Please consider the environment - do you really need to print this email?

 This email is intended only for the person(s) named above and may contain 
 private and confidential information. If it has come to you in error, please 
 destroy and permanently delete any copy in your possession and contact us on 
 +44 (0) 161 480 4420. The information in this email is copyright © CDL Group 
 Holdings Limited. We cannot accept any liability for any loss or damage 
 sustained as a result of software viruses. It is your responsibility to carry 
 out such virus checking as is necessary before opening any attachment.

 Cheshire Datasystems Limited uses software which automatically screens 
 incoming emails for inappropriate content and attachments. If the software 
 identifies such content or attachment, the email will be forwarded to our 
 Technology Department for checking. You should be aware that any email which 
 you send to Cheshire Datasystems Limited is subject to this procedure.

 Cheshire Datasystems Limited, Strata House, Kings Reach Road, 
 Stockport SK4 2HD Registered in England and Wales with Company Number
 3991057 VAT registration: 727 1188 33

-
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



---
QUERPLEX GmbH Nürnberg | www.querplex.de
Kornmarkt 2
D-90402 Nürnberg

Re: 1.5.4: Rather curious case of the IInitializer List

2012-02-14 Thread richard emberson

Since the intent is to access the latest snapshot of the
Application IInitializer list, why not simply have the
InitializerStringResourceLoader loadStringResource
method call
Application.get().getInitializers().

I would suggest that it is cleaner.

And, yes, I know that Java's unmodifiableList is a flawed
attempt at having a cheap mutable to immutable transformation.
Sadly, its the best Java standard library can offer.

Richard

On 02/14/2012 01:19 AM, Sven Meier wrote:

Hi Richard,

you're right, this implementation looks 'curious' but it was intentional.

Note the javadoc of Collection.unmodifiableList():
'Query operations on the returned list read through to the specified
list'

Sven


Am 13.02.2012 23:58, schrieb richard emberson:

While looking at the extensions code,
I noted that in the 1.5.4 InitializerStringResourceLoader
constructor that the list of IInitializer is empty but
in the InitializerStringResourceLoader loadStringResource
method there are two initializers in that same IInitializer list.

So, how can this be?

Well, in Application, first the initializers list is
wrapped in a Collections.unmodifiableList and returned
by the Application getInitializers method. This is
called when creating an instance of the InitializerStringResourceLoader.
Later, the Application load(properties) method is called
which, in turn, calls addInitializer twice which adds
two IInitializer to the Application's initializers list.

Now, the InitializerStringResourceLoader loadStringResource
is called and, behold, the InitializerStringResourceLoader
IInitializer list now has two members.

It seems that, under the covers, Application and
InitializerStringResourceLoader
share the same IInitializer list!!! This sharing is, well,
not documented, rather, its depends upon the implementation of
Collections.unmodifiableList.

So, I don't wish to criticize; maybe this was the intent;
maybe its very clever; but for me its, well, curious.

Richard




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




--
Quis custodiet ipsos custodes

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



Re: replaceOuterHtmlSafari not working proerly

2012-02-14 Thread Igor Vaynberg
file this in our jira so it doesnt get lost

-igor

On Mon, Feb 13, 2012 at 9:56 PM, pmaks piyu...@live.com wrote:
 Hi All,
 Please have a look at below images

 before form submit
 http://apache-wicket.1842946.n4.nabble.com/file/n4386241/before-submit.png

 after form submit (it shows the feedback panel for required fields error),
 notice form is missing.
 http://apache-wicket.1842946.n4.nabble.com/file/n4386241/after-submit.png

 Probelm is element on which outerHTML is called is removed from DOM.
 I debug a bit and doubt source of the problem is following function in
 wicket-ajax.js.

 Wicket.replaceOuterHtmlSafari = function(element, text) {
 …
        element.outerHTML = text;       // not working properly on chrome  
 safari
 .
 }

 Is this a known issue on safari/chrome, is there any workaround for this.

 Thanks

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/replaceOuterHtmlSafari-not-working-proerly-tp4383380p4386241.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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



Re: SpringComponentInjector and non null fields

2012-02-14 Thread martin.dilger
Hi,

thanks, this is true, but I dont think this is the Point I refer to, since I
call Injector.get().inject(this) in our Test, so I explicitely request
SpringBean-injection.
The Problem is this Line in Class Injector:

if (field.get(object) == null)
{

Object value = 
factory.getFieldValue(field, object);

if (value != null)
{
field.set(object, value);
}
}

Injection only happens, if the Field is non-null.
I can not think of any use-case why this is?

Any comments?

Thanks in advance!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-null-fields-tp4386918p4387511.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: 1.5.4: Rather curious case of the IInitializer List

2012-02-14 Thread Sven Meier
I'd rather have an InitializerCollection (similar to other wicket 
*Collection classes).

This could safely be passed around.

Sven

Am 14.02.2012 15:11, schrieb richard emberson:

Since the intent is to access the latest snapshot of the
Application IInitializer list, why not simply have the
InitializerStringResourceLoader loadStringResource
method call
Application.get().getInitializers().

I would suggest that it is cleaner.

And, yes, I know that Java's unmodifiableList is a flawed
attempt at having a cheap mutable to immutable transformation.
Sadly, its the best Java standard library can offer.

Richard

On 02/14/2012 01:19 AM, Sven Meier wrote:

Hi Richard,

you're right, this implementation looks 'curious' but it was 
intentional.


Note the javadoc of Collection.unmodifiableList():
'Query operations on the returned list read through to the specified
list'

Sven


Am 13.02.2012 23:58, schrieb richard emberson:

While looking at the extensions code,
I noted that in the 1.5.4 InitializerStringResourceLoader
constructor that the list of IInitializer is empty but
in the InitializerStringResourceLoader loadStringResource
method there are two initializers in that same IInitializer list.

So, how can this be?

Well, in Application, first the initializers list is
wrapped in a Collections.unmodifiableList and returned
by the Application getInitializers method. This is
called when creating an instance of the 
InitializerStringResourceLoader.

Later, the Application load(properties) method is called
which, in turn, calls addInitializer twice which adds
two IInitializer to the Application's initializers list.

Now, the InitializerStringResourceLoader loadStringResource
is called and, behold, the InitializerStringResourceLoader
IInitializer list now has two members.

It seems that, under the covers, Application and
InitializerStringResourceLoader
share the same IInitializer list!!! This sharing is, well,
not documented, rather, its depends upon the implementation of
Collections.unmodifiableList.

So, I don't wish to criticize; maybe this was the intent;
maybe its very clever; but for me its, well, curious.

Richard




-
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: SpringComponentInjector and non null fields

2012-02-14 Thread Igor Vaynberg
that is there to give users a chance at test time to override
injection partially, as in

component c=new mycomponent();
c.service1=mock(service.class);
injector.inject(c);

injector will inject everything but service1. key here is to make sure
service doesnt have to be defined in the test's spring context.

-igor

On Tue, Feb 14, 2012 at 8:08 AM, martin.dilger
martin.dil...@googlemail.com wrote:
 Hi,

 thanks, this is true, but I dont think this is the Point I refer to, since I
 call Injector.get().inject(this) in our Test, so I explicitely request
 SpringBean-injection.
 The Problem is this Line in Class Injector:

 if (field.get(object) == null)
                                {

                                        Object value = 
 factory.getFieldValue(field, object);

                                        if (value != null)
                                        {
                                                field.set(object, value);
                                        }
                                }

 Injection only happens, if the Field is non-null.
 I can not think of any use-case why this is?

 Any comments?

 Thanks in advance!

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-null-fields-tp4386918p4387511.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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



Re: SpringComponentInjector and non null fields

2012-02-14 Thread martin.dilger
ok,

understood, thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-null-fields-tp4386918p4387545.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: jQuery form validation with wicket ajax

2012-02-14 Thread Alec Swan
Are you saying that AjaxRequestTarget is not null without your onclick
attribute changes and is null with your changes? If so, please post
the changes you made to onclick attribute.

On Tue, Feb 14, 2012 at 7:06 AM, Gerrit Scholz | QUERPLEX.de
gerrit.sch...@querplex.de wrote:
 If I intercept the onclick event my function is called but the processing not 
 stop. Mean that the wicket (onclick) javascript is running parallel.
 So I write a AttributeModifier that prepends my function to the onclick 
 attribute. Now the validation works fine, but on the onSubmit method of the 
 wicket ajax button the AjaxRequestTarget is null so the component to refresh 
 cannot be added.

 Gerrit

 -Ursprüngliche Nachricht-
 Von: Paul Jackson [mailto:paul.jack...@cdl.co.uk]
 Gesendet: Dienstag, 14. Februar 2012 10:38
 An: users@wicket.apache.org
 Betreff: RE: jQuery form validation with wicket ajax

 Thanks for that link! I never managed to work out how to get jquery events to 
 override the buttons onClick attribute. This should simplify our validation 
 code a lot.

 Paul

 -Original Message-
 From: Alec Swan [mailto:alecs...@gmail.com]
 Sent: 13 February 2012 16:38
 To: users@wicket.apache.org
 Subject: Re: jQuery form validation with wicket ajax

 This thread describes a purely client-side solution to your problem:
 http://stackoverflow.com/questions/1506729/how-to-intercept-the-onclick-event.
 You can solve this problem for all you AJAX links by assigning them a special 
 class, e.g. class=ajaxLink, and then apply the technique to $(form 
 .ajaxLink).

 On Mon, Feb 13, 2012 at 3:55 AM, Paul Jackson paul.jack...@cdl.co.uk wrote:
 We use an OnBeforeRenderListener to add onClick events to the buttons and 
 ajax buttons on a form that we want to be validated. We have to handle the 
 normal buttons and ajax buttons slightly differently.

 Ajax button:

            button.add(new AttributeModifier(onclick, new
 ModelString(if (! $('# + formMarkupId
                    + ').validate().form()) {return false};)) {

 Normal Button:

            button.add(new WiQueryEventBehavior(new
 Event(MouseEvent.CLICK) {
                @Override
                public JsScope callback() {
                    return JsScope.quickScope(return $('# +
 formMarkupId + ').validate().form(););
                }
            }));

 Hope that helps.

 Paul

 -Original Message-
 From: Gerrit Scholz | QUERPLEX.de [mailto:gerrit.sch...@querplex.de]
 Sent: 13 February 2012 10:18
 To: users@wicket.apache.org
 Subject: jQuery form validation with wicket ajax

 Hello there,
 I try to use jQuery validaton (http://docs.jquery.com/Plugins/Validation) 
 with a wicket AJAX button. I register the jQuery validator on the form. If I 
 use a normal wicket submit button or link, the jQuery form validation works. 
 But if I use an AJAX button or link, the jQuery form validation is not 
 called. How can I call the jQuery validation before AJAX update.
 Thanks,
 Gerrit



 --
 - QUERPLEX GmbH Nürnberg | www.querplex.de Kornmarkt 2
 D-90402 Nürnberg
 --
 -
 Tel +49 (0)911 94 11 98 - 0
 Fax +49 (0)911 94 11 98 - 59
 --
 -
 Registergericht Nürnberg HRB 20 123
 Geschäftsführerin: Angelika Benkert
 --
 -
 **
 Please consider the environment - do you really need to print this email?

 This email is intended only for the person(s) named above and may contain 
 private and confidential information. If it has come to you in error, please 
 destroy and permanently delete any copy in your possession and contact us on 
 +44 (0) 161 480 4420. The information in this email is copyright © CDL Group 
 Holdings Limited. We cannot accept any liability for any loss or damage 
 sustained as a result of software viruses. It is your responsibility to 
 carry out such virus checking as is necessary before opening any attachment.

 Cheshire Datasystems Limited uses software which automatically screens 
 incoming emails for inappropriate content and attachments. If the software 
 identifies such content or attachment, the email will be forwarded to our 
 Technology Department for checking. You should be aware that any email which 
 you send to Cheshire Datasystems Limited is subject to this procedure.

 Cheshire Datasystems Limited, Strata House, Kings Reach Road,
 Stockport SK4 2HD Registered in England and Wales with Company Number
 3991057 VAT registration: 727 1188 33

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


 

Re: refresh and AjaxFallbackDefaultDataTable

2012-02-14 Thread Jonathan Tougas

 Can't you fix that with a
 getPage().dirty();
 in the Ajax request handler?


Hmm tried your suggestion, but no luck. How would it help anyway? It's
dirty() that is causing the page to change version in the first place
right? RefreshingView.onPopulate() - MarkupContainer.removeAll() -
Component.addStateChange() - Page.componentStateChanging() - Page.dirty()
- new version number!

I did find a fix for this though. Changing the rendering strategy from the
default REDIRECT_TO_BUFFER to ONE_PASS_RENDER. With this strategy, the
initial request is not redirect to *?%version%*, which means when the
user presses refresh, a new page is recreated from scratch every time. Ajax
updates are applied on the version of the page that originally rendered
them, so there's no ambiguity like the scenario I describe. The drawback of
course is that page refreshes lose ajax updates, but the semantic in that
case at least is very clear and it's what I expected in the first place.

On Tue, Feb 14, 2012 at 7:32 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

  Thus the browser still shows the old version in the URL. But all future
 Ajax requests are targetting a different page version than visible in the
 browser URL :(.

 Can't you fix that with a

 getPage().dirty();

 in the Ajax request handler?

 - Tor Iver

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




Re: CAS (or single sign on): how to?

2012-02-14 Thread Dan Retzlaff
Hi, Sam. Responses inline.

On Tue, Feb 14, 2012 at 12:07 AM, Sam Zilverberg samzilverb...@gmail.comwrote:

 1) Do you use the RestartResponseAtInterceptPageException to redirect
 users to the cas site when the user is not logged in and the cookie is not
 present, or something else?
 2) Do you allow loging in also through the normal sites, not using the
 cas?


We do not have a single authentication application; each application has
the ability to authenticate the user and create the site-wide cookie. That
said, yes, we use RestartResponseAtInterceptPage in that situation.


 3) Shared data store - is this a wicket/java object or just any
 resource(like db) that both apps have access to?


We use a relational database. I intentionally left my statement vague,
though, since depending on your deployment there are multiple viable
approaches to sharing the set of active sessions.


 4) Did you override some of wicket session store methods to support the
 extraction of the id from the shared data store?


I assume you mean id *for* the shared data store, and no it's just
o.a.w.Session.get().getId() which is public. I don't know why we selected
that unique ID though; it's really arbitrary.


 5) Session expiration -where do you add a session expiration listener? on
 the wicket app level or in the web.xml?


We use web.xml. The only reason ISessionStore#registerUnboundListener()
didn't work is because we needed to grab something out of the underlying
HttpSession which isn't exposed to UnboundListeners. But that requirement
is unique to our app.

For further context, we use this to allow customization of our application
on a client-by-client basis. Most of our clients use our generic app, but
we can extend the app with custom development for larger/paying clients
while minimizing impact to shared functionality. These clients can
authenticate from the generic login page, and then get HTTP redirected and
immediately logged into their custom app.

Hope that helps!

Dan


 On Tue, Feb 14, 2012 at 12:58 AM, Dan Retzlaff dretzl...@gmail.com
 wrote:

  Hi Sam,
 
  We have a similar use case, and we use a home-grown approach within
 Wicket:
  1. The authenticating application persists a session ID into a shared
 data
  store, and puts the ID into a new site-wide cookie. We use Wicket's
  Session#getId() for the ID, but could equivalently use UUID.randomUUID().
  2. When other apps' IAuthorizationStrategy detects an
  unauthorized/unauthenticated request, it tries to authenticate using this
  site-wide cookie. It basically just verifies that the session ID in the
  cookie corresponds to an active session in the shared data store.
 
  One thing to consider is your session expiration/logout logic. Our use
 case
  is more like user handoff than concurrent Wicket sessions, and we have
 a
  session expiration listener that invalidates the session in the shared
 data
  store from the owning application. If your use case is not so simple,
  then you'll have to define your own site-wide authentication expiration
  event(s).
 
  On Mon, Feb 13, 2012 at 1:55 PM, Sam Zilverberg samzilverb...@gmail.com
  wrote:
 
   Hi,
  
   Our base wicket app is deploy around 40-50 times on a couple of
 tomcats.
   Each instance has a different configuration but the code base is the
 same
   app.
   Each instance has its own context and it looks something like this:
   app a : baseurl/a
   app baba: baseurl/baba
  
   Currently the authentication and authorization for each site is handled
  by
   the wicket app assigned to that context.
   We implemented IAuhorizationStrategy and are using the signin page from
  the
   examples + captcha after a couple of tries.
  
   We want an app at baseurl/login that will take care of loging in
 instead
  of
   all the different apps doing it for themselves.
   Whats the best way to implement such a CAS mechanism? (preferably using
   wicket, spring is ok too)
  
   Thanks,
   Sam.