Re: AttributeModifier with html in the attribute?

2013-06-04 Thread Simon B
Hello Bertrand, 

Thank you for your answer I'll try option 3 and create a component
subclass.

Cheers
Simon



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-with-html-in-the-attribute-tp4659206p4659226.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: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-04 Thread divad91
Thank you for your response.

By overriding the updateAjaxAttributes and adding
attributes.setAllowDefault(true), my javascript validation works but my
behavior (ajax call) is not triggered.

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
attributes.setAllowDefault(true);
}

If I call the super class updateAjaxAttributes and I add the
setAllowDefault(true) method, it wont change anything. My field stay in
error after the ajax call

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setAllowDefault(true);
}

David




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216p4659227.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: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-04 Thread divad91
The ajax response are the same if I compare with a Wicket 6.6.0 application
version.
Looks like the AjaxFormChoiceComponentUpdatingBehavior is blocking the
jQuery Validation to unhighlight my field before the ajax call is triggered.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216p4659228.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: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-04 Thread divad91
The problem is really related with the onClick event.

I copied the class AjaxFormChoiceComponentUpdatingBehavior in my project
(hijacking) and changed the event click by onchange. The validation and
the ajax call are working perfectly.

Jquery validation bind a click event on my radioChoice. 
Adding a AjaxFormChoiceComponentUpdatingBehavior on my RadioChoice will
unbind or just don't execute my jQuery validation click event. Result, even
when my radio is checked, my field stays in error.

Is this a bug ? I know there was problem when adding multiple wicket
behavior on a field (only the last one added was executed) but in my case, I
only have 1 wicket behavior. 
All other events are added by Jquery validation.
Any idea ? 

Thanks
David



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216p4659229.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



AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread heikki
hello,

a simple question: I'd like that a certain javascript function is invoked,
after a Wicket Ajax call completes. I'm using Wicket 6.5.

I tried this:

// behaviour works fine except for the onComplete js that I'd like to
execute
public class MyAjaxBehavior extends AbstractDefaultAjaxBehavior {

// this doesn't do anything 
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);

IAjaxCallListener listener = new AjaxCallListener() {
@Override
public CharSequence getCompleteHandler(Component component) {
return alert('onComplete');;
}
};
attributes.getAjaxCallListeners().add(listener);
}

@Override
protected void respond(AjaxRequestTarget target){ ... }
}



Another thing I tried, but with the same result (no js executed on
complete), is client-side:

Wicket.Ajax.get({u:myListenerUrl + params, coh: myfunction });

(where myfunction is an existing js function).


Do you see what I'm doing wrong ?

Kind regards
Heikki Doeleman



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AbstractDefaultAjaxBehavior-complete-handler-tp4659230.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: AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread Sven Meier

Hi,

I pasted you #updateAjaxAttributes() into ChoicePage from 
wicket-examples and alert shows up there.


Sven

On 06/04/2013 05:02 PM, heikki wrote:

 // this doesn't do anything
 @Override
 protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
 super.updateAjaxAttributes(attributes);

 IAjaxCallListener listener = new AjaxCallListener() {
 @Override
 public CharSequence getCompleteHandler(Component component) {
 return alert('onComplete');;
 }
 };
 attributes.getAjaxCallListeners().add(listener);
 }



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



Re: AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread divad91
You could override the getSuccessScript() method. Return the javascript code
or method to be executed.
David



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AbstractDefaultAjaxBehavior-complete-handler-tp4659230p4659232.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: AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread heikki
Thanks for your replies.

Could it be that it has something to do with Wicket version ? Wicket
Examples seems to run on Wicket 1.5.10 ?

I also tried the suggested success handler, by adding this to my behavior

@Override
public CharSequence getSuccessHandler(Component component) {
return alert('success handler');;
}

but no luck, still no js executed..


And what about the coh parameter I tried in my Wicket.Ajax.get call ? Is
that supposed to have the same effect as overriding getCompleteHandler() ?
Any idea why it doesn't do anything, did I make some mistake ?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AbstractDefaultAjaxBehavior-complete-handler-tp4659230p4659233.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: AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread divad91
I am using wicket 6.6.0 and these behaviors:
AjaxFormComponentUpdatingBehavior AjaxFormSubmitBehavior.
In both case,  I am overriding the getPreconditionScript() and
getSuccessScript() method to display and hide a please wait gif around
each ajax call.

@Override
protected CharSequence getSuccessScript() {
return $.swtu.event.postAjaxHook();;
}

When I just want to display a dialog box for example after an Ajax call
(onChange behavior), I override the onUpdate or onEvent method and used the
target.appendJavaScript(...) method.

@Override
protected void onUpdate(AjaxRequestTarget target) {
target.appendJavaScript();
}

Hope this helps.
David




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AbstractDefaultAjaxBehavior-complete-handler-tp4659230p4659234.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: AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread Andrea Del Bene
As Sven has pointed out your code should work as it is. Try yo see if 
you have any kinds of JavaScript errors using a JavaScript console or a 
tool like FireBug

Hi,

I pasted you #updateAjaxAttributes() into ChoicePage from 
wicket-examples and alert shows up there.


Sven

On 06/04/2013 05:02 PM, heikki wrote:

 // this doesn't do anything
 @Override
 protected void updateAjaxAttributes(AjaxRequestAttributes 
attributes) {

 super.updateAjaxAttributes(attributes);

 IAjaxCallListener listener = new AjaxCallListener() {
 @Override
 public CharSequence getCompleteHandler(Component 
component) {

 return alert('onComplete');;
 }
 };
 attributes.getAjaxCallListeners().add(listener);
 }



-
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: AbstractDefaultAjaxBehavior complete handler

2013-06-04 Thread heikki
thanks. I checked of course that there are no JS errors. I also checked if
any of overridden onComplete(), getCompleteHandler(), and
getSuccessHandler() are executed, and they are not.

So I'm still a bit puzzled here. My behavior's respond() method works fine
and does not throw exceptions or anything.

Does anyone know if the coh param in Wicket.Ajax.get() should be able to
do the same trick ? (although it also doesn't work for me, it'd be good to
know).


Adding target.appendJavascript() in my respond() method works, though.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AbstractDefaultAjaxBehavior-complete-handler-tp4659230p4659236.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 it possible to add a static prefix to the generated URL from CryptoMapper?

2013-06-04 Thread Jesse Long

Hi Magnus,

Sorry for replying so late, but I wanted to add a word of caution here.

There is a problem with Form#dispatchEvent() when you change the number 
of URL segments. I cant remember the exact details, but it has something 
to do with the Url#resolveRelative() or the call to it making 
assumptions about the number of url segments. You can trigger the event 
by using a DropDownChoice with Javascript (not AJAX) on change events.


Cheers,
Jesse

On 28/05/2013 17:12, Martin Grigorov wrote:

Hi Magnus,

At the moment this doesn't seem to be very easy because #encryptUrl() and
#decryptUrl() methods are private..
If they were protected then it would be quite easy to extend the class and
provide your own #mapHandler() / #mapRequest() methods which decide
themselves what to encrypt/decrypt.
Feel free to file a ticket for improvement for this.

At the moment you can use your own root request mapper that wraps
CryptoMapper and removes/prepends user segment in the beginning of the
url for IPageClassRequestHandlers.



On Tue, May 28, 2013 at 5:52 PM, Magnus K Karlsson 
magnus.r.karls...@gmail.com wrote:


Hi!

I'm successfully testing CryptoMapper in Apache Wicket 6 with unique URL
for each Session. But I'm also depending on to be able to define security
constaint in the web.xml.

 security-constraint
 web-resource-collection
 web-resource-nameexample-wicket/web-resource-name
 url-pattern/user/*/url-pattern
 /web-resource-collection

 auth-constraint
 descriptionThese are the roles who have access./description
 role-nameROLE_USER/role-name
 role-nameROLE_ADMIN/role-name
 /auth-constraint
 /security-constraint

So my question is it possible to prefix predefined classes with
CryptoMapper?

Example

I used to mount pages with mountPage(/user/ + Foo.class.getSimpleName(),
Foo.class);

which resulted in URL: http://localhost:8080/example-wicket/user/Foo

now I would like to decrypt Foo and it's possible page parameters, but not
'user', e.g.


http://localhost:8080/example-wicket/user/o9SSJ_GJqmO_wPa3pBY9hhdoDOXrAjrVc8kgLXVijrc6zKG3_zokAWSik-hyrZBXM4h5Qc2JOn0WfAGPQo8eYA/o9Sc8/Jqme5/9SS98

--
Best Regards
Magnus K Karlsson

Mobile: +46 (0)70 218 00 84
Email: magnus.r.karls...@gmail.com
Blog: magnus-k-karlsson.blogspot.com




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



Wicket ID sometimes changes, sometimes stays the same

2013-06-04 Thread eugenebalt
Some of my components have the same static Wicket ID, but others look like
field7 or field5 while their ID is field.

What is the rule governing whether an ID changes or not? And how can I
enforce a static ID? Thanks





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ID-sometimes-changes-sometimes-stays-the-same-tp4659238.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: Wicket ID sometimes changes, sometimes stays the same

2013-06-04 Thread Sven Meier

If you specify an id attribute in your markup, Wicket will use it unaltered:

  span wicket:id=wicketId id=stableMarkupId/span

Sven

On 06/04/2013 09:51 PM, eugenebalt wrote:

Some of my components have the same static Wicket ID, but others look like
field7 or field5 while their ID is field.

What is the rule governing whether an ID changes or not? And how can I
enforce a static ID? Thanks





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ID-sometimes-changes-sometimes-stays-the-same-tp4659238.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: Wicket ID sometimes changes, sometimes stays the same

2013-06-04 Thread Sebastien
Hi,

Alternatively, you can use the programmatic way:
component.setOutputMarkupId(true).setMarkupId(myId);

Regards,
Sebastien.


On Tue, Jun 4, 2013 at 9:59 PM, Sven Meier s...@meiers.net wrote:

 If you specify an id attribute in your markup, Wicket will use it
 unaltered:

   span wicket:id=wicketId id=stableMarkupId/span

 Sven


 On 06/04/2013 09:51 PM, eugenebalt wrote:

 Some of my components have the same static Wicket ID, but others look like
 field7 or field5 while their ID is field.

 What is the rule governing whether an ID changes or not? And how can I
 enforce a static ID? Thanks





 --
 View this message in context: http://apache-wicket.1842946.**
 n4.nabble.com/Wicket-ID-**sometimes-changes-sometimes-**
 stays-the-same-tp4659238.htmlhttp://apache-wicket.1842946.n4.nabble.com/Wicket-ID-sometimes-changes-sometimes-stays-the-same-tp4659238.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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




Re: Browser Back Button Question

2013-06-04 Thread dhongyt
Is it a serialized object on the page? Or is it a serialized object on the
session object.
I have tried everything from removing the ProductAPI out.
Currently everything that is in my Session Service object should be
serialized I believe.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Browser-Back-Button-Question-tp4658397p4659241.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: WICKET-4500 / WICKET-5140 and RestartResponseAtInterceptPageException.clearOriginalDestination()

2013-06-04 Thread Dirk Forchel
Any idea? Any hint? Or should I add clearInterceptData() to the constructor
of each Page class with authorized access? A short description in source
code would be helpful.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WICKET-4500-WICKET-5140-and-RestartResponseAtInterceptPageException-clearOriginalDestination-tp4659205p4659242.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