1.5 - mapping different error pages for specific errors

2011-05-10 Thread nimmy
Hi,

How do you map different error pages for specific errors in Wicket v1.5RC2?

You used to override onRuntimeException in v1.4 but this is no longer the
case.

Thanks,
Nim

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5-mapping-different-error-pages-for-specific-errors-tp3511899p3511899.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 - mapping different error pages for specific errors

2011-05-10 Thread nimmy
Hi Martijn,

I did check out the migration guide but was confused by a reference to a
non-existing method:

In Wicket 1.4 it was needed to extend
org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException).
Wicket 1.5 gives even better control, by overriding
org.apache.wicket.Application.newExceptionMapper() it is possible to change
even the default processing of error pages.

Will lookup IRequestCycleLister instead.

Thanks for your help,
Nim



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5-mapping-different-error-pages-for-specific-errors-tp3511899p3511947.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: Question on sessions

2011-04-26 Thread nimmy
Thanks. Sounds good ... i'll try it.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-on-sessions-tp3474193p3474890.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: Is this a bug?

2011-04-25 Thread nimmy
no luck... since it is quoted it appears a string

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-this-a-bug-tp3473469p3473617.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



Question on sessions

2011-04-25 Thread nimmy
Hi,

I have a user who has a temporary session (i.e. is not logged in).  I need
to redirect him/her to an external page for to get an access token (e.g.
Facebook/Flickr access token). 

Is there anyway to keep the same session? I find that the user has a
different session after the redirection.

Thanks for your help.

Cheers,
Nim

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-on-sessions-tp3474193p3474193.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



1.5RC2 - URL question - Is this expected behaviour?

2011-04-05 Thread nimmy
Hi,

I have a bookmarkable page that takes 2 page parameters. The page parameters
determine the content that is displayed. The URL to the page is of the
format:

http://localhost:8080/view?2gid=2authKey=776bbb3e-83d1-4452-a7df-ff18b46169aa

I manually modified the page parameters in the URL expecting to see
different content but this does not happen. The content only changes when I
delete the page version parameter.

Is this expected behaviour? I would expect that changing the page parameters
would create a new version of the page. Is this not the case?

Thanks,
Nim



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC2-URL-question-Is-this-expected-behaviour-tp3427453p3427453.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.5RC2 - URL question - Is this expected behaviour?

2011-04-05 Thread nimmy
If the same instance of the page is used then I supposed I could reset the
page model in the page's onBeforeRender method by using
getRequest().getQueryParameters().getParameterValue(...)  as you suggested.
Currently, all the work is being done in the constructor.

This is purely curiosity. I don't expect users to manually modify query
parameters. I stumbled on to this while trying to take a shortcut during
debugging.

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC2-URL-question-Is-this-expected-behaviour-tp3427453p3427509.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Apache Wicket Cookbook Published!

2011-03-25 Thread nimmy
Congratulations on the book! My dead-tree format is in the post!

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



Absolute URL string

2011-03-18 Thread nimmy
Hi All,

I'm trying to display a label with the absolute URL for a bookmarkable page
on the page itself. I am doing this so that users can readily identify what
URL to email or IM to friends.

Unfortunately, I'm having some trouble with this.

I have tried:
RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(urlFor(MyBookmarkablePage.class,
params).toString()));

But the outputted URL has a '.' in it:
http://localhost:8080/./view?gid=1authKey=2bf48121-bdc7-462d-a030-f5a86893e1b4

I also tried:
RequestCycle.get().getUrlRenderer().renderFullUrl(getRequest().getOriginalUrl());

But this includes the page version number in the URL:
http://localhost:8080/view?0gid=1authKey=2bf48121-bdc7-462d-a030-f5a86893e1b4

Any idea how I can get the absolute URL for a bookmarkable page?

I am using Wicket 1.5 RC2

Thanks,
Nim 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Absolute-URL-string-tp3387031p3387031.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: Absolute URL string

2011-03-18 Thread nimmy
Hi Martin,

The requestCycle.urlFor(...) was still returning a '.' in the URL as I
described in my first post.

The requestCycle.mapUrlFor(...) method did the trick.

Thank you for your help.

Cheers,
Nim

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Absolute-URL-string-tp3387031p3387093.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



1.5RC1 url mounting/encoding

2011-02-18 Thread nimmy

Hi,

Using Wicket 1.5RC1, how do I mount a Page to root that is other than the
home page? E.g.:

www.myapp.com -IndexPage.class

www.myapp.com/${username} -OtherPage.class with ${username} as a
pageparameter

thanks,
Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3312989.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.5RC1 url mounting/encoding

2011-02-18 Thread nimmy

Hi Christian,

Thanks for your reply. I have already set the Index page as the homepage. 

I was trying to figure out how to handle this: www.myapp.com/username where
username is variable

Cheers,
Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3313088.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.5RC1 url mounting/encoding

2011-02-18 Thread nimmy

Thanks for that Igor. I have another 1.5RC1 question - where do I set the
redirect flag? E.g. in 1.4, when the user logs out of the app I do the
following:

getSession().invalidate();
getRequestCycle().setRedirect(true);
setResponsePage(MyApplication.get().getHomePage());

The API has changed and I cannot find where to set the redirect flag.

Thanks for your help.

Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3313151.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: Using non-Model fields in Form

2011-02-01 Thread nimmy

I'm a newbie also but

Can't you just create a new model specifically for the RadioChoice
component? Each component can have its own model.



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.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: Dynamic tab question - now to pass a model to the panel?

2011-02-01 Thread nimmy

Hi,

Thanks for your reply. I'm pretty much doing what you suggested but have a
concrete Tab class as it is reused on another page:

public class AlbumTab extends AbstractTab {

private static final long serialVersionUID = 1L;
private IModelAlbum model;

public AlbumTab(IModelAlbum model) {
super(new PropertyModelString(model, name));
this.model = model;
}

@Override
public Panel getPanel(String id) {
return new TabPanel(id, model);
}
}

The Page has a hibernate backed LoadableDetachableModel - AlbumGroup.
AlbumGroup has a list of Albums. I iterate through the list and create a tab
for each Album and create a tabbed panel:

//create a tab for each album
ListITab tabs = new ArrayListITab();
for (Album album: model.getObject().getAlbums()) {
ITab tab = new AlbumTab(new ModelAlbum(album));
tabs.add(tab);
}
add(new TabbedPanel(content-tabs, tabs));

My confusion was/is on who calls detach() on the LDM. Each tab will have a
reference to the LDM.

I am now setting the LDM as the default model for the page (even though the
page does not use it). My reasoning is that once the page is Serialised, it
will call detach() on the LDM.


Any thoughts on my approach?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3252157.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: problems with redirectToInterceptPage

2010-10-04 Thread nimmy


Hi Chris,

I have successfully tested it on IE8.

I did some more digging in the 'Wicket in Action' book and figured out how to 
make the sign-in link work for a normal link - you have to override the 
isVisible method to disable the link or Wicket will get into a loop with steps 
3 and 4 from my last email:

3. the link onClick method does a redirectToInterceptPage - forwarding

the

user to the Signin panel

4. On successful authentication, Wicket forwards the user to the

interceptContinuationUrl, which is the last http request - to the link

listner

By disabling the link, you break this loop and Wicket rerenders the page.

Cheers,
Nim

Date: Sat, 2 Oct 2010 20:02:11 -0700
From: ml-node+2952891-407581717-160...@n4.nabble.com
To: nim_sa...@hotmail.com
Subject: RE: problems with redirectToInterceptPage



Have you confirmed that your fix works for you on IE7 and IE8?


My issue only surfaced in IE - worked fine in FF.


Chris


-Original Message-

From: nimmy [mailto:[hidden email]]

Sent: Sunday, 3 October 2010 9:04 AM

To: [hidden email]

Subject: RE: problems with redirectToInterceptPage







Hi Chris,



Thanks for your reply. I did some debugging and think that the problem
is

more to do with my logic.



This is what is currently happening:

1. PageA has a login link

2. Clicking the login link causes a new http request to the link

listner

3. the link onClick method does a redirectToInterceptPage - forwarding

the

user to the Signin panel

4. On successful authentication, Wicket forwards the user to the

interceptContinuationUrl, which is the last http request - to the link

listner (step 2)

5. Wicket processes the link's onClick method. As there is no page to

display, Wicket re-render the last page that was displayed (the signin

page)



I changed the link to an AjaxLink and the functionality works are

required.

The below code fragment from the 'PageMap' explains why:



// The intercept continuation URL should be saved exactly as the

// original request specified.

// Only if it is an ajax request just redirect to the page where the

request is from.

if (cycle.getRequest() instanceof WebRequest 

((WebRequest)cycle.getRequest()).isAjax())

{

interceptContinuationURL =

cycle.urlFor(cycle.getRequest().getPage()).toString();

}

else

{

// wicket-2061: getURL() returns a properly bdecoded/b URL. But
we

need is a

// properly bencoded/b URL.

interceptContinuationURL = / + cycle.getRequest().getURL();

interceptContinuationURL =

WicketURLEncoder.FULL_PATH_INSTANCE.encode(interceptContinuationURL);

}



I'm not sure whether I should stick with an AjaxLink or manually

forward to

the signin panel with the refferer URL as a query parameter. I'm a bit

weary about using Ajax.



Cheers,

Nim



Date: Fri, 1 Oct 2010 17:48:42 -0700

From: [hidden email]

To: [hidden email]

Subject: RE: problems with redirectToInterceptPage







Could it be related to this issue I raised a little while ago:





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


Try the fix and see if your problem goes away like mine did.





Regards,



Chris Colman





-Original Message-



From: nimmy [mailto:[hidden email]]



Sent: Friday, 1 October 2010 9:22 PM



To: [hidden email]



Subject: problems with redirectToInterceptPage











Hi All,







I'm having some trouble with 'redirectToInterceptPage' and would

appreciate



any help you can provide







I have a 'login' link on my page - PageA.







My intention is that:



1. if the user clicks on the 'login' link the user will be forwarded
to



the



Index page, which includes the standard Wicket SignInPanel (the Index



page



is similar to the gmail start/splash page)



2. If the user successfully authenticates, the user should be returned



back



to PageA- the original page.







Currently:



1. the user clicks the 'login' link and is forwarded to the Index page



2. on successful authentication, the user stays on the Index page







Some details:



1. PageA is a bookmarkable page with 2 page parameters. Sample URL is



http://localhost:8080/PageA?id=1authKey=f68d282f-7552-404b-b0b1-
96fadc7b04dc



2. The User does not have to be authenticated to view PageA. An



authenticated user will be able to see an additional panel (I haven't

got



to



this bit yet)



3. My login link has the standard onClick function with



redirectToInterceptPage(new Index());







My debugging shows:



1. User sign-in process works - i.e. the user is successfully



authenticated



(using Spring-Security)



2. The continueToOriginalDestination() method returns true



3. getURL() called from the onClick method of the 'login' link returns



?wicket:interface=:4:header:signin::ILinkListener:: and not the



bookmarkable



URL as I expected







I have tried throwing a RestartResponseAtInterceptPageException but



this



does not work.







My feeling is that the correct URL is not being

RE: problems with redirectToInterceptPage

2010-10-02 Thread nimmy


Hi Chris,

Thanks for your reply. I did some debugging and think that the problem is more 
to do with my logic.

This is what is currently happening:
1. PageA has a login link
2. Clicking the login link causes a new http request to the link listner
3. the link onClick method does a redirectToInterceptPage - forwarding the user 
to the Signin panel
4. On successful authentication, Wicket forwards the user to the 
interceptContinuationUrl, which is the last http request - to the link listner 
(step 2)
5. Wicket processes the link's onClick method. As there is no page to display, 
Wicket re-render the last page that was displayed (the signin page)

I changed the link to an AjaxLink and the functionality works are required. The 
below code fragment from the 'PageMap' explains why:

// The intercept continuation URL should be saved exactly as the
// original request specified.
// Only if it is an ajax request just redirect to the page where the request is 
from.
if (cycle.getRequest() instanceof WebRequest  
((WebRequest)cycle.getRequest()).isAjax())
{
interceptContinuationURL = 
cycle.urlFor(cycle.getRequest().getPage()).toString();
}
else
{
// wicket-2061: getURL() returns a properly bdecoded/b URL. But we need 
is a
// properly bencoded/b URL.
interceptContinuationURL = / + cycle.getRequest().getURL();
interceptContinuationURL = 
WicketURLEncoder.FULL_PATH_INSTANCE.encode(interceptContinuationURL);
}

I'm not sure whether I should stick with an AjaxLink or manually forward to the 
signin panel with the refferer URL as a query parameter. I'm a bit weary about 
using Ajax.

Cheers,
Nim

Date: Fri, 1 Oct 2010 17:48:42 -0700
From: ml-node+2952087-1007324699-160...@n4.nabble.com
To: nim_sa...@hotmail.com
Subject: RE: problems with redirectToInterceptPage



Could it be related to this issue I raised a little while ago:


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

Try the fix and see if your problem goes away like mine did.


Regards,

Chris Colman


-Original Message-

From: nimmy [mailto:[hidden email]]

Sent: Friday, 1 October 2010 9:22 PM

To: [hidden email]

Subject: problems with redirectToInterceptPage





Hi All,



I'm having some trouble with 'redirectToInterceptPage' and would
appreciate

any help you can provide



I have a 'login' link on my page - PageA.



My intention is that:

1. if the user clicks on the 'login' link the user will be forwarded to

the

Index page, which includes the standard Wicket SignInPanel (the Index

page

is similar to the gmail start/splash page)

2. If the user successfully authenticates, the user should be returned

back

to PageA- the original page.



Currently:

1. the user clicks the 'login' link and is forwarded to the Index page

2. on successful authentication, the user stays on the Index page



Some details:

1. PageA is a bookmarkable page with 2 page parameters. Sample URL is

http://localhost:8080/PageA?id=1authKey=f68d282f-7552-404b-b0b1-
96fadc7b04dc

2. The User does not have to be authenticated to view PageA. An

authenticated user will be able to see an additional panel (I haven't
got

to

this bit yet)

3. My login link has the standard onClick function with

redirectToInterceptPage(new Index());



My debugging shows:

1. User sign-in process works - i.e. the user is successfully

authenticated

(using Spring-Security)

2. The continueToOriginalDestination() method returns true

3. getURL() called from the onClick method of the 'login' link returns

?wicket:interface=:4:header:signin::ILinkListener:: and not the

bookmarkable

URL as I expected



I have tried throwing a RestartResponseAtInterceptPageException but

this

does not work.



My feeling is that the correct URL is not being saved in the PageMap

therefore the application is not able to return the user to the target

page.



Has anyone experienced this problem? Any idea what the fix is?



Any suggestions greatly appreciated.



Thanks,

Nim

--

View this message in context: http://apache-
wicket.1842946.n4.nabble.com/problems-with-redirectToInterceptPage-

tp2892437p2892437.html

Sent from the Users forum mailing list archive at Nabble.com.



-

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]


-

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]








View message @ 
http://apache-wicket.1842946.n4.nabble.com/problems-with-redirectToInterceptPage-tp2892437p2952087.html


To unsubscribe from problems with redirectToInterceptPage, click here.


  
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-redirectToInterceptPage-tp2892437p2952773.html
Sent from the Users forum mailing list archive at Nabble.com

problems with redirectToInterceptPage

2010-10-01 Thread nimmy

Hi All,

I'm having some trouble with 'redirectToInterceptPage' and would appreciate
any help you can provide

I have a 'login' link on my page - PageA. 

My intention is that:
1. if the user clicks on the 'login' link the user will be forwarded to the
Index page, which includes the standard Wicket SignInPanel (the Index page
is similar to the gmail start/splash page)
2. If the user successfully authenticates, the user should be returned back
to PageA- the original page.

Currently:
1. the user clicks the 'login' link and is forwarded to the Index page
2. on successful authentication, the user stays on the Index page

Some details:
1. PageA is a bookmarkable page with 2 page parameters. Sample URL is
http://localhost:8080/PageA?id=1authKey=f68d282f-7552-404b-b0b1-96fadc7b04dc
2. The User does not have to be authenticated to view PageA. An
authenticated user will be able to see an additional panel (I haven't got to
this bit yet)
3. My login link has the standard onClick function with
redirectToInterceptPage(new Index());

My debugging shows:
1. User sign-in process works - i.e. the user is successfully authenticated
(using Spring-Security)
2. The continueToOriginalDestination() method returns true
3. getURL() called from the onClick method of the 'login' link returns
?wicket:interface=:4:header:signin::ILinkListener:: and not the bookmarkable
URL as I expected

I have tried throwing a RestartResponseAtInterceptPageException but this
does not work.

My feeling is that the correct URL is not being saved in the PageMap
therefore the application is not able to return the user to the target page.

Has anyone experienced this problem? Any idea what the fix is?

Any suggestions greatly appreciated.

Thanks,
Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/problems-with-redirectToInterceptPage-tp2892437p2892437.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



Wicket and Spring Security question

2010-09-22 Thread nimmy

Hi All,

I'm playing with a very basic 'hello world' type project to test Wicket and
Spring Security
(https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html).
I'm new to both Wicket and Spring Security.

I keep having the below error:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: spring-security-web classes are not available. You
need these to use filter-chain-map
Offending resource: class path resource [applicationContext-security.xml]

The Spring-security-web jar is definitely in the classpath. Anyone
experience this problem before.

I realise that this is more of a Spring question but have had not had much
help on the Spring forums. Appreciate your help.

Cheers,
Nim 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Spring-Security-question-tp2549867p2549867.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



[wicket newbie] - appending query parameter to ajax link

2010-09-13 Thread nimmy

Hi Guys,

I'm trying to implement the typical 'check availability' functionality for a
username.

I have an IndicatingAjaxFallbackLink. I would like to append the value of a
form component [username TextField] to the ajax link as a query parameter.

I've tried:
1. overriding onComponentTag in the IndicatingAjaxFallbackLink but I do not
get access to the getCallbackUrl method

2. add an AbstractDefaultAjaxBehaviour but: 1. End up with onEvent and
onClick and don't know where to put the serverside logic. 2. Am not able to
get the param value from RequestCycle.

The only method that works for me is to submit the whole form without
validation and get the value from the textfield on the serverside. 

I would prefer not to submit the whole form.

Appreciate your help with this.

Cheers,
Nim


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-newbie-appending-query-parameter-to-ajax-link-tp2537522p2537522.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



RE: [wicket newbie] - appending query parameter to ajax link

2010-09-13 Thread nimmy


Thanks for your help Igor. It worked like a charm.

For other readers new to wicket :

1. add an AjaxEventBehaviour(onclick) to the IndicatingAjaxFallbackLink
2. Override getCallbackScript to append the param values as described in the 
email below
3. Do your server side processing in the onEvent method of the 
AjaxEventBehaviour and not on the onSubmit method of the 
IndicatingAjaxFallbackLink

Cheers,
Nim

Date: Mon, 13 Sep 2010 08:15:42 -0700
From: ml-node+2537614-574240720-160...@n4.nabble.com
To: nim_sa...@hotmail.com
Subject: Re: [wicket newbie] - appending query parameter to ajax link



override getcallbackscript(boolean) and return something like:


return generateCallbackScript(wicketAjaxGet(' + getCallbackUrl() +

myparam='+Wicket.$(id of component).value);


-igor


On Mon, Sep 13, 2010 at 7:23 AM, nimmy [hidden email] wrote:



 Hi Guys,



 I'm trying to implement the typical 'check availability' functionality for a

 username.



 I have an IndicatingAjaxFallbackLink. I would like to append the value of a

 form component [username TextField] to the ajax link as a query parameter.



 I've tried:

 1. overriding onComponentTag in the IndicatingAjaxFallbackLink but I do not

 get access to the getCallbackUrl method



 2. add an AbstractDefaultAjaxBehaviour but: 1. End up with onEvent and

 onClick and don't know where to put the serverside logic. 2. Am not able to

 get the param value from RequestCycle.



 The only method that works for me is to submit the whole form without

 validation and get the value from the textfield on the serverside.



 I would prefer not to submit the whole form.



 Appreciate your help with this.



 Cheers,

 Nim





 --

 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-newbie-appending-query-parameter-to-ajax-link-tp2537522p2537522.html
 Sent from the Wicket - User mailing list archive at Nabble.com.



 -

 To unsubscribe, e-mail: [hidden email]

 For additional commands, e-mail: [hidden email]





-

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]








View message @ 
http://apache-wicket.1842946.n4.nabble.com/wicket-newbie-appending-query-parameter-to-ajax-link-tp2537522p2537614.html


To unsubscribe from [wicket newbie] - appending query parameter to ajax link, 
click here.


  
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-newbie-appending-query-parameter-to-ajax-link-tp2537522p2537685.html
Sent from the Wicket - User mailing list archive at Nabble.com.


RE: [wicket newbie] - appending query parameter to ajax link

2010-09-13 Thread nimmy


Thanks for your help Mike

Date: Mon, 13 Sep 2010 08:32:00 -0700
From: ml-node+2537637-1380929500-160...@n4.nabble.com
To: nim_sa...@hotmail.com
Subject: Re: [wicket newbie] - appending query parameter to ajax link



  I think its easier to attach an ajax behaviour to the text field (like 

onkeyup) that will push the changes to wicket for validation.  You can 

use target.addComponent(indicator) to get the indication to be shown 

based on the results of the validation.


Look at subclassing AjaxFormComponentUpdatingBehavior which can push the 

single field value through to wicket for processing.


You might be able to append the parameter by implementing:


 protected IAjaxCallDecorator getAjaxCallDecorator()

 {

 return null;

 }


in your IndicatingAjaxFallbackLink sub class.


But the easiest way is to modify the getCallbackUrl method in the 

behaviour itself.


something like this: (I assume that a Component targetComponent is a 

private field)


@Override

 protected final CharSequence getCallbackScript(boolean 

onlyTargetActivePage) {


 /*

  * Encode the callback script appending to the url the current 

client side value of the component values.

  */

 CharSequence baseUrl = super.getCallbackUrl(onlyTargetActivePage);


 String callbackScript = baseUrl + value='+Wicket.$('

 + targetComponent.getMarkupId() + ').value;


 String script = wicketAjaxGet(' + callbackScript + );;


 return script;


 }


This will create urlvalue=Wicket.$(targetComponent.markupID).value


The second part is to fetch the value parameter on the wicket side and 

process it:


 Request request = RequestCycle.get().getRequest();


 String value = request.getParameter(value);


Regards,


Mike



 Hi Guys,



 I'm trying to implement the typical 'check availability' functionality for a

 username.



 I have an IndicatingAjaxFallbackLink. I would like to append the value of a

 form component [username TextField] to the ajax link as a query parameter.



 I've tried:

 1. overriding onComponentTag in the IndicatingAjaxFallbackLink but I do not

 get access to the getCallbackUrl method



 2. add an AbstractDefaultAjaxBehaviour but: 1. End up with onEvent and

 onClick and don't know where to put the serverside logic. 2. Am not able to

 get the param value from RequestCycle.



 The only method that works for me is to submit the whole form without

 validation and get the value from the textfield on the serverside.



 I would prefer not to submit the whole form.



 Appreciate your help with this.



 Cheers,

 Nim






-

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]








View message @ 
http://apache-wicket.1842946.n4.nabble.com/wicket-newbie-appending-query-parameter-to-ajax-link-tp2537522p2537637.html


To unsubscribe from [wicket newbie] - appending query parameter to ajax link, 
click here.


  
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-newbie-appending-query-parameter-to-ajax-link-tp2537522p2538012.html
Sent from the Wicket - User mailing list archive at Nabble.com.