Re: Redirect to the HomePage on newSession

2013-02-15 Thread Stefan Renz


vov wrote:
 Is it possible to redirect user to the HomePage when new session is created?
 
 @Override
   public Session newSession(Request request, Response response)
 {
 
 //RequestCycle.get().setResponsePage(getHomePage());
 //or 
 //RequestCycle.get().replaceAllRequestHandlers(new
 RenderPageRequestHandler(new //PageProvider(getHomePage(;
 // do not work
 }
 
 The main idea is always show HomePage when user logged in to the application
 and not take into account the URL which was printed to the address line

Hi,

how about having a LoginPage/Panel that doesn't
continueToOriginalDestination()? Instead, it could setResponsePage(
Application.get().getHomePage() ) after successful authentication.

I think that should achieve what you want.

Bye
   Stefan


 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Redirect-to-the-HomePage-on-newSession-tp4656365.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
 

-- 
im Auftrag der eFonds Solutions AG, +49-89-579494-3417


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



Re: Redirect to the HomePage on newSession

2013-02-15 Thread vov
Hi Stefan,

It's a good solution but I have external authentication system and only
thing that I know - is  creation of the new session:(



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Redirect-to-the-HomePage-on-newSession-tp4656365p4656384.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: Twenty-Six Wicket Tricks Book

2013-02-15 Thread Sebastian Gaul
I cannot find anything related there. His blog started long after the book.
Am 14.02.2013 14:51 schrieb Ian Marshall ianmarshall...@gmail.com:

 Perhaps a good source of information is Jonathan's blog at:

http://codeact.wordpress.com http://codeact.wordpress.com

 Ian


 Sebastian Gaul wrote
  Does anyone know what happened to the book Twenty-Six Wicket Tricks
  by Jonathan Locke? Some code looks very promising and I would like to
  read it. However, the code seems to be very old and I cannot find any
  way to purchase the book. Is the project still alive?
 
  http://code.google.com/p/twenty-six-wicket-tricks/
 
  -
  To unsubscribe, e-mail:

  users-unsubscribe@.apache

  For additional commands, e-mail:

  users-help@.apache





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.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: Can AjaxFormSubmitBehavior skip validation on form field updating

2013-02-15 Thread e . spyrop . w
I think that, if you move your validations away from the fields, you will 
be able to handle this situation and others very gracefully.
I usually perform my validations on the buttons, themselves.
It requires quite more typing, but gives maximum flexibility.

Elias

wicket_new_user murthy.m...@gmail.com wrote on 12/02/2013 06:59:11 PM:

 wicket_new_user murthy.m...@gmail.com 
 12/02/2013 06:59 PM
 
 Subject
 
 Can AjaxFormSubmitBehavior skip validation on form field updating
 
 Is it possible to skip the Validation when using the 
AjaxFormSubmitBehavior.
 
 
 
 I have a text field (AutoComplete) and selecting will update the
 MultiListbox. There is a provision to remove the element from the List 
box. 
 When trying to add new element from the Textbox to Listbox
 if AjaxFormSubmitBehavior is used, then Other field validations are
 getting fired and resulting in error page/message.
 
 If AjaxFormComponentUpdatingBehavior is used, then the deleted 
element
 is getting dispalyed, as it is not been deleted from the model.
 
 
 Also tried using by turning off the defaultFormProcessing on
 AjaxFormSubmitBehavior, but unable to get the required Converted
 
 Thanks in advance
 WNU
 
 
 
 --
 View this message in context: http://apache-wicket.
 1842946.n4.nabble.com/Can-AjaxFormSubmitBehavior-skip-validation-on-
 form-field-updating-tp4656278.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: Several Form onSubmit, is it possible add via AbstractBehavior?

2013-02-15 Thread Sven Meier
You could add a custom Behavior to your FormCompoments. Let this 
Behavior implement IValidator and it will get notice of a form submit 
via #validate().


Hope this helps
Sven

On 02/14/2013 07:05 AM, Alex wrote:

Hi. I have AjaxFallbackButton on the form with defined onSubmit handler.
There also one custom AbstractBehavior added  to the form. This Behavior
does some action with form's components (add event handlers for form's text
controls) and next should intercept form's onSubmit event to do some action
also. I try do this by adding form.AjaxFormSubmitBehavior(form, onsubmit)
in this  AbstractBehavior (do this by override the onConfigure). As a result
only AjaxFormSubmitBehavior.onSubmit handler of MyCustomBehavior invoked but
form button's onSubmit is ignored. What is wrong in this case? Is it
possible to add additional onSubmit action to the form via custom Behavior
like in my case?
Thanks for advice.

..
form.add(new AjaxFallbackButton(submit,form) {
protected void onSubmit(AjaxRequestTarget target, Form?
aForm) {
   // some mail form submit actions
}
  });

form.add(new MyCustomBehavior(feedbackPanel));
..

public class MyCustomBehavior extends AbstractBehavior {
private FeedbackPanel feedback;
private Form form;

public MyCustomBehavior(FeedbackPanel feedback) {
  this.feedback = feedback;
}

@Override
 public void bind(Component component)  {
   super.bind(component)
   // here initialize form 
   this.form = (Form) component;
 }

@Override
public void onConfigure(Component component) {
 // here form's text controls event handlers added via
AjaxFormComponentUpdationBehavior
 this.form.add(new AjaxFormSubmitBehavior(this.form, onsubmit)
{
 @Override
protected void onSubmit(AjaxRequestTarget target) {
// form submit action, set flag of some
operation
// this onSubmit handler should be invoked
after main form onSubmit handler
 }
 @Override
protected void onError(AjaxRequestTarget target) {
 }
 }
 }
}





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Several-Form-onSubmit-is-it-possible-add-via-AbstractBehavior-tp4656347.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



Submit form before handle onclick

2013-02-15 Thread Gonzalo Aguilar Delgado
Hello, 

We have just a situation were the information of the form needs to be
updated before handling an ajax click event. 

The page has a form, with a bean and some TextFields that update the
properties in the bean. 
It has also an ajax component that also updates the bean. 

The problem is that we can fill in the form but if we do an event on the
ajax component every field filled in first step is lost because is not
submitted (and the bean updated) before handling the ajax click event. 


So the question is:

How can we submit the form before handling the click event?

Any suggestion?

Thank you in advance.


Re: Submit form before handle onclick

2013-02-15 Thread Sven Meier

Use AjaxFormSubmitBehavior with #setDefaultProcessing(false).

Sven

On 02/15/2013 11:01 AM, Gonzalo Aguilar Delgado wrote:

Hello,

We have just a situation were the information of the form needs to be
updated before handling an ajax click event.

The page has a form, with a bean and some TextFields that update the
properties in the bean.
It has also an ajax component that also updates the bean.

The problem is that we can fill in the form but if we do an event on the
ajax component every field filled in first step is lost because is not
submitted (and the bean updated) before handling the ajax click event.


So the question is:

How can we submit the form before handling the click event?

Any suggestion?

Thank you in advance.




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



Re: Several Form onSubmit, is it possible add via AbstractBehavior?

2013-02-15 Thread Alex
As I understand the only way to catch the form's onSubmit is by analyze form
components validation which is performed by form submitting. And if
validation is successful then form submit will be done for sure. Am I
correct understand? 

Trying to find workaround for this issue,in MyCustomBehavior I found form's
button and added AjaxEvenBehavior(onclick) to it. Strangely but
form.getDefaultButton() returned null and the only way to get form's Button
component is the traversing over all the form components and finding a
button component (not sure if it best way). So when I clicked the button the
AjaxEventBehavior.onEvent occurs (in MyCustomBehavior) and next
AjaxFallbackButton.onSubmit on main form had invoked. But I found that the
target parameter is null in main onSubmit handler of form's
AjaxFallbackButton. What wrong in this case? Why the target is null in
form's buton handler and not null in the form Behavior's button handler.
This is the same button in fact. In the form it have onSubmit handler, and
in MyCustomBehavior it have onEvent handler. A piece of code is given
below...
Thanks a lot for help.

public class MyCustomBehavior extends AbstractBehavior { 
..
   @Override
public void onConfigure(Component component) {
// this.form.getDefaultButton() - return null in fact (why)

Iterator? extends Component iter = form.iterator();
while (iter.hasNext()) {
FormComponent? fc = (FormComponent?)iter.next();
if (fc.isEnabled()  (fc instanceof Button)) {
fc.add(new AjaxEventBehavior(onclick) {
private static final long 
serialVersionUID = 1L;

@Override
protected void 
onEvent(AjaxRequestTarget target) {
// here target is not null  
System.out.println(clicked 
);
}
});
};  
 } // end of while 
} // end of onConfigure

}

// Main page

form.add(new AjaxFallbackButton(submit,form) {
 protected void onSubmit(AjaxRequestTarget target, Form? 
aForm) {
// here target is null (why?)
   .
  // some main actions for form submit...
 }
}); 
.
form.add(new MyCustomBehavior(feedback));
...
// End of main page



-
Best wishes,
Alex.
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Several-Form-onSubmit-is-it-possible-add-via-AbstractBehavior-tp4656347p4656393.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



Why does a ModalWindow create a form Tag to be rendered in?

2013-02-15 Thread mwwbf
Hi Everyone,
I'm using ModalWindows and AjaxEditableLabels and everything was working
fine for me.
But a stupid tester decided to use the return key(insted of just clicking
the next item) after he entered something in a AjaxEditableLable within a
ModalWindow.

This caused the Form created in 
https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
Line 1181
to submit.
After I Changed the form Tag in lline 1181 and the /form in line 1243 of
modal.js everything worked fine again.

Can anyone Tell me the reason for using a form at this location?

Thanks and greetings
michael



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-a-ModalWindow-create-a-form-Tag-to-be-rendered-in-tp4656394.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: Overriding onEvent to update choices side of Palette

2013-02-15 Thread grazia
Let me give you more context:

my page consists of:
- a lazy loading autocompletetextfield
- a form containing the palette

By selecting an option in the autocomplete, the left side of the palette
(choices side) should display that selection made in the autocomplete.

So, I have so far managed to add a AjaxFormUpdatingBehavior to the
autocomplete, which sends the event to the palette ( using
Component.*sendhttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#send%28org.apache.wicket.event.IEventSink,%20org.apache.wicket.event.Broadcast,%20T%29
*(IEventSinkhttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/event/IEventSink.html
sink,
Broadcasthttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/event/Broadcast.html
type,
T payload) ). For the palette to receive the event, I override the onEvent
method I showed you.

Now, the onEvent receives the AjaxRequestTarget, but
target.add(this) (where this is the palettte) does not do anything.
I tried:
target.add(this.getChoicesComponent()) and does not anything either.

Why not use the event triggered by the ART directly.  could you please
explain ?


On Thu, Feb 14, 2013 at 11:52 PM, Ernesto Reinaldo Barreiro-4 [via Apache
Wicket] ml-node+s1842946n465638...@n4.nabble.com wrote:

 Hi,

 It is difficult to understand what you are doing... Are you in the middle
 of an AjaxRequestTarget(ART)? If that what

   update.getTarget().add(this.getChoicesComponent());

 means? Why not use the event triggered by the ART directly.


 On Thu, Feb 14, 2013 at 10:34 PM, grazia [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4656381i=0wrote:


  Nobody has any idea ? I am stuck
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656380.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=4656381i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=4656381i=2
 
 


 --
 Regards - Ernesto Reinaldo Barreiro
 Antilia Soft
 http://antiliasoft.com/ http://antiliasoft.com/antilia


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656381.html
  To unsubscribe from Overriding onEvent to update choices side of Palette, 
 click
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4656376code=R3JhemlhLlJ1c3NvTGFzc25lckBnbWFpbC5jb218NDY1NjM3NnwyMjY4MDg1NDM=
 .
 NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656397.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: Why does a ModalWindow create a form Tag to be rendered in?

2013-02-15 Thread Sven Meier

Can anyone Tell me the reason for using a form at this location?


This is done to allow the following nesting:

body
--form Form [1]
div ModalWindow [2]
--div Form [3]
input FormComponent [4]

Note that in Wicket nested Forms [3] are rendered as divs.
When ModalWindow [2] pulls its content [3] out of the dom tree and puts 
it into a top-level div, the nested input fields [4] have to be 
wrapped in a synthetic form:


body
--form Form [1]
div ModalWindow [2]
--div
form * generated by modal.js *
--div Form [3]
input FormComponent [4]

There have been proposals already on how to improve this, see 
WICKET-1826 and WICKET-3404 for inspirations.
Hopefully this is something we can address in Wicket 7 (i.e. this won't 
be possible without API breaks).


Regards
Sven


On 02/15/2013 11:51 AM, mwwbf wrote:

Hi Everyone,
I'm using ModalWindows and AjaxEditableLabels and everything was working
fine for me.
But a stupid tester decided to use the return key(insted of just clicking
the next item) after he entered something in a AjaxEditableLable within a
ModalWindow.

This caused the Form created in
https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
Line 1181
to submit.
After I Changed the form Tag in lline 1181 and the /form in line 1243 of
modal.js everything worked fine again.

Can anyone Tell me the reason for using a form at this location?

Thanks and greetings
michael



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-a-ModalWindow-create-a-form-Tag-to-be-rendered-in-tp4656394.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: 6.0 Migration issue: wrap Wicket Ajax JS-code as previously with AjaxCallDecorators

2013-02-15 Thread Martin Dietze
On Thu, February 14, 2013, Fred!!! wrote:

 it's possible to set an throtteling delay by Wicket AjaxRequestAttributes. 
 Have a look at 
 https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-AjaxRequestAttributes

 Something like this:
 new AjaxEventBehavior(onkeydown){
void updateAjaxAttributes(AjaxRequestAttributes attr)
{
   attributes.setThrottlingSettings(new ThrottlingSettings(id, 
 delay))
}
 }

That looks good, thank you!

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
Die groessten Liebesgeschichten sind die, die nie stattgefunden haben

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



Another Wicket 6 migration issue: drag and drop (so far done with wiquery)

2013-02-15 Thread Martin Dietze
Another thing I am stuck trying to port my project from Wicket
1.4.x to 6.6.0 is DND-mechanics which so far had been
implemented using wiquery 1.2.

As I see the 'DroppableAjaxBehavior' class has disappeared from
wiquery since the 6.0 release. However no mention could be found
on either migration pages or mailing lists.

So far DND had been implemented like this:

| final DroppableAjaxBehavior droppableBehavior = new 
DroppableAjaxBehaviorItemFoo() {
| @Override
| public void onDrop( ItemFoo item, AjaxRequestTarget target ) {
|   // [...]
| }
| };
| droppableBehaviour.getDroppableBehavior().setAccept( new DroppableAccept( 
.fileItem ) );
| droppableBehaviour.getDroppableBehavior().setHoverClass( dropHover );
| add( droppableBehaviour );

Now as there's no DroppableAjaxBehavior anymore and no hint on
what replaced it I'm lost. I found a DroppableBehavior coming with
wiquery 6.2.0, but I can't see how this could be a simple
replacement, and to make things worse, there does not seem to be
any sample code for 6.2.0-based DND around.

Any hints?

Cheers,

M'bert

-- 
--- / http://herbert.the-little-red-haired-girl.org / -
=+= 
WE ARE THE BORG - RESISTANCE IS VOLTAGE DIVIDED BY CURRENT!

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



Re: Another Wicket 6 migration issue: drag and drop (so far done with wiquery)

2013-02-15 Thread Ernesto Reinaldo Barreiro
Hi,

It seems that behavior was not ported into 6.x branch. I have created

https://github.com/WiQuery/wiquery/issues/17

and will try to fix the issue ASAP.


On Fri, Feb 15, 2013 at 2:20 PM, Martin Dietze d...@fh-wedel.de wrote:

 Another thing I am stuck trying to port my project from Wicket
 1.4.x to 6.6.0 is DND-mechanics which so far had been
 implemented using wiquery 1.2.

 As I see the 'DroppableAjaxBehavior' class has disappeared from
 wiquery since the 6.0 release. However no mention could be found
 on either migration pages or mailing lists.

 So far DND had been implemented like this:

 | final DroppableAjaxBehavior droppableBehavior = new
 DroppableAjaxBehaviorItemFoo() {
 | @Override
 | public void onDrop( ItemFoo item, AjaxRequestTarget target ) {
 |   // [...]
 | }
 | };
 | droppableBehaviour.getDroppableBehavior().setAccept( new
 DroppableAccept( .fileItem ) );
 | droppableBehaviour.getDroppableBehavior().setHoverClass( dropHover );
 | add( droppableBehaviour );

 Now as there's no DroppableAjaxBehavior anymore and no hint on
 what replaced it I'm lost. I found a DroppableBehavior coming with
 wiquery 6.2.0, but I can't see how this could be a simple
 replacement, and to make things worse, there does not seem to be
 any sample code for 6.2.0-based DND around.

 Any hints?

 Cheers,

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 WE ARE THE BORG - RESISTANCE IS VOLTAGE DIVIDED BY CURRENT!

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




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: Why does a ModalWindow create a form Tag to be rendered in?

2013-02-15 Thread mwwbf
The proposted patch in WICKET-3404 should really be in 7.
Thanks for explaining!


Sven Meier wrote
Can anyone Tell me the reason for using a 
 form
  at this location?
 
 This is done to allow the following nesting:
 body
 --
 form
  Form [1]
 
 div
  ModalWindow [2]
 --
 div
  Form [3]
 
 input
  FormComponent [4]
 
 Note that in Wicket nested Forms [3] are rendered as 
 div
 s.
 When ModalWindow [2] pulls its content [3] out of the dom tree and puts 
 it into a top-level 
 div
 , the nested input fields [4] have to be 
 wrapped in a synthetic 
 form
 :
 body
 --
 form
  Form [1]
 
 div
  ModalWindow [2]
 --
 div
 
 form
  * generated by modal.js *
 --
 div
  Form [3]
 
 input
  FormComponent [4]
 
 There have been proposals already on how to improve this, see 
 WICKET-1826 and WICKET-3404 for inspirations.
 Hopefully this is something we can address in Wicket 7 (i.e. this won't 
 be possible without API breaks).
 
 Regards
 Sven
 
 
 On 02/15/2013 11:51 AM, mwwbf wrote:
 Hi Everyone,
 I'm using ModalWindows and AjaxEditableLabels and everything was working
 fine for me.
 But a stupid tester decided to use the return key(insted of just clicking
 the next item) after he entered something in a AjaxEditableLable within a
 ModalWindow.

 This caused the Form created in
 https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
 Line 1181
 to submit.
 After I Changed the 
 form
  Tag in lline 1181 and the 
 /form
  in line 1243 of
 modal.js everything worked fine again.

 Can anyone Tell me the reason for using a 
 form
  at this location?

 Thanks and greetings
 michael



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Why-does-a-ModalWindow-create-a-form-Tag-to-be-rendered-in-tp4656394.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache


 
 
 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-a-ModalWindow-create-a-form-Tag-to-be-rendered-in-tp4656394p4656412.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: AjaxEventBehavior called twice because of javascript onchange

2013-02-15 Thread divad91
My mistake, I works great with the nullvalid.

I just realize that if I have an onchange behavior and a javascript
(jQuery) onchange function bind on the same dropdown, with IE, calling the
javascript onchange function will also call the wicket onchange behavior.

Can't figure out why.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxEventBehavior-called-twice-because-of-javascript-onchange-tp4656329p4656413.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: Twenty-Six Wicket Tricks Book

2013-02-15 Thread Ian Marshall
You could always visit the Coding: On Software Design Process section of
Jonathan's blog (it's an excellent book, by the way) and ask him your
question from there.

Ian


Sebastian Gaul wrote
 I cannot find anything related there. His blog started long after the
 book.
 Am 14.02.2013 14:51 schrieb Ian Marshall lt;

 IanMarshall.UK@

 gt;:
 
 Perhaps a good source of information is Jonathan's blog at:

http://codeact.wordpress.com lt;http://codeact.wordpress.comgt;

 Ian


 Sebastian Gaul wrote
  Does anyone know what happened to the book Twenty-Six Wicket Tricks
  by Jonathan Locke? Some code looks very promising and I would like to
  read it. However, the code seems to be very old and I cannot find any
  way to purchase the book. Is the project still alive?
 
  http://code.google.com/p/twenty-six-wicket-tricks/
 
  -
  To unsubscribe, e-mail:

  users-unsubscribe@.apache

  For additional commands, e-mail:

  users-help@.apache





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache








--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656414.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: DropDownChoice not updating model

2013-02-15 Thread Lucio Crusca
In data Thursday 14 February 2013 12:59:05, Sven Meier ha scritto:
 Then the DropDownChoice should work fine.
 
 Try to create a quickstart please.

You are so f***ing smart :)

The quickstart just worked and showed me what I was doing wrong, basically 
this:

District currentSelection = ... // retrieve current district from database
if (currentSelection != null)
  myDropDownChoice.setModel(new CompoundPropertyModel(currentSelection)); 

which is a plain blunder because I was changing the model under the hood. The 
fix was quite easy: cut away those lines, since DropDownChoice already takes 
care of showing the currently selected item.

Thanks.

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



Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-15 Thread evan
Hi Francois,

Thanks, but actually this still has issues.  At first I thought it was
clearly the simple thing I was missing, but then I remembered there's still
a problem - the line in renderHead copied from the original
MultiFileUploadField uses private members container, max, and upload, so the
extending class won't be able to do this.  I realize I could create my own
versions of each of these (like you suggested with YOURJS), and then
override every method that uses any of them, replacing the reference with
the new versions.  But that might propagate to usage of other fields, and at
that point it might be simpler to just copy the entire contents of the
original class's code into a new version of the class of my own, with the
only modification being the location of the .js resource.  Neither of these
two things would be hard to do, and maybe they are simply the only
solutions, but it feels like that's not great, because it loses the ability
to leverage the fact that future versions of the api class might improve in
other ways and there'd be maintenance issues keeping my version up-to-date
with the rest of the api.  Is that just what needs to be done, or is there
possibly some other way to use the existing class directly and just swap
some alternate resource file in place of the default one? 

Thanks again,
-Evan


Francois Meillet wrote
 Hi Evan,
 
 try this
 
 private static final ResourceReference YOURJS = new
 JavaScriptResourceReference( YourClassWhereJavascriptReside.js.class,
 YourModifiedJavascript.js);
 
 @Override
 public void renderHead(IHeaderResponse response)
 {
   response.render(JavaScriptHeaderItem.forReference(YOURJS));
   response.render(OnDomReadyHeaderItem.forScript(new MultiSelector(' +
 getInputName() +
   ', document.getElementById(' + 
 container.getMarkupId() + '),
  + max + ,' +
   getString(org.apache.wicket.mfu.delete) +
 ').addElement(document.getElementById(' +
   upload.getMarkupId() + '));));
 }





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-modify-internal-JavascriptResourceReference-packaged-with-component-tp4656344p4656416.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



DropDownChoice - single choice, preselect automatically

2013-02-15 Thread prasopes
I know I can preselect the value of DropDownChoice by setting the
corresponding value in the model.

My use case is this: I have several DropDownChoice with
OnChangeAjaxBehaviors. Selection of value in one DDChoice enables second
DDChoice. The values in second DDChoice depend on the value selected in the
first DDChoice. In case the second DDChoice has only one possible value, I
would like to have it preselected automatically.

However, I'm unsure in which lifecycle phase I should look at the number of
options of second DDChoice and manipulate its model to achieve preselection.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-single-choice-preselect-automatically-tp4656417.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: Behavior.renderHead stopped working after migration from 1.4 to 6.5

2013-02-15 Thread Artur

Hi,


try something on the lines...

@Override
public void afterRender(Component component) {
component.getResponse().write(your HTML here);
}

THANK YOU!

It was exactly what I was looking for!
Works great.



Artur


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



Re: DropDownChoice - single choice, preselect automatically

2013-02-15 Thread Sven Meier

#onConfigure() would be a good place to preselect something.

Sven

On 02/15/2013 05:21 PM, prasopes wrote:

I know I can preselect the value of DropDownChoice by setting the
corresponding value in the model.

My use case is this: I have several DropDownChoice with
OnChangeAjaxBehaviors. Selection of value in one DDChoice enables second
DDChoice. The values in second DDChoice depend on the value selected in the
first DDChoice. In case the second DDChoice has only one possible value, I
would like to have it preselected automatically.

However, I'm unsure in which lifecycle phase I should look at the number of
options of second DDChoice and manipulate its model to achieve preselection.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-single-choice-preselect-automatically-tp4656417.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: DropDownChoice not updating model

2013-02-15 Thread Sven Meier

 You are so f***ing smart :)

Sometimes :P.

Sven

On 02/15/2013 04:43 PM, Lucio Crusca wrote:

In data Thursday 14 February 2013 12:59:05, Sven Meier ha scritto:

Then the DropDownChoice should work fine.

Try to create a quickstart please.

You are so f***ing smart :)

The quickstart just worked and showed me what I was doing wrong, basically
this:

District currentSelection = ... // retrieve current district from database
if (currentSelection != null)
   myDropDownChoice.setModel(new CompoundPropertyModel(currentSelection));

which is a plain blunder because I was changing the model under the hood. The
fix was quite easy: cut away those lines, since DropDownChoice already takes
care of showing the currently selected item.

Thanks.

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




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



Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-15 Thread Francois Meillet

Le 15 févr. 2013 à 16:48, evan e...@novelution.com a écrit :

 Hi Francois,
 
 Thanks, but actually this still has issues.  At first I thought it was
 clearly the simple thing I was missing, but then I remembered there's still
 a problem - the line in renderHead copied from the original
 MultiFileUploadField uses private members container, max, and upload, so the
 extending class won't be able to do this.  I realize I could create my own
 versions of each of these (like you suggested with YOURJS), and then
 override every method that uses any of them, replacing the reference with
 the new versions.  But that might propagate to usage of other fields, and at
 that point

 it might be simpler to just copy the entire contents of the
 original class's code into a new version of the class of my own,
I would not do that, as you say after, there will be maintenances issues

 with the
 only modification being the location of the .js resource.  Neither of these
 two things would be hard to do, and maybe they are simply the only
 solutions, but it feels like that's not great, because it loses the ability
 to leverage the fact that future versions of the api class might improve in
 other ways and there'd be maintenance issues keeping my version up-to-date
 with the rest of the api.  Is that just what needs to be done, or is there
 possibly some other way to use the existing class directly and just swap
 some alternate resource file in place of the default one? 
 
As you say, you 'd like to make a minor modification to the actual javascript 
in , MultiFileUploadField.js,
so in this case I will choose the renderHead override method.


François Meillet
Formation Wicket - Développement Wicket



 Thanks again,
 -Evan
 
 
 Francois Meillet wrote
 Hi Evan,
 
 try this
 
 private static final ResourceReference YOURJS = new
 JavaScriptResourceReference( YourClassWhereJavascriptReside.js.class,
 YourModifiedJavascript.js);
 
 @Override
 public void renderHead(IHeaderResponse response)
 {
  response.render(JavaScriptHeaderItem.forReference(YOURJS));
  response.render(OnDomReadyHeaderItem.forScript(new MultiSelector(' +
 getInputName() +
  ', document.getElementById(' + 
 container.getMarkupId() + '),
  + max + ,' +
  getString(org.apache.wicket.mfu.delete) +
 ').addElement(document.getElementById(' +
  upload.getMarkupId() + '));));
 }
 
 
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/how-to-modify-internal-JavascriptResourceReference-packaged-with-component-tp4656344p4656416.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: how to modify internal JavascriptResourceReference packaged with component

2013-02-15 Thread evan
Okay, so you are saying I need to create my own versions of each of those
private variables referenced in renderHead, and override any methods that
use any of them, to reference my own, is that right?  Unfortunately, it
still has maintenance implications, but I guess that might just be
inevitable given what I want to do.

Thanks for the help!


Francois Meillet wrote
 Le 15 févr. 2013 à 16:48, evan lt;

 evan@

 gt; a écrit :
 
 Hi Francois,
 
 Thanks, but actually this still has issues.  At first I thought it was
 clearly the simple thing I was missing, but then I remembered there's
 still
 a problem - the line in renderHead copied from the original
 MultiFileUploadField uses private members container, max, and upload, so
 the
 extending class won't be able to do this.  I realize I could create my
 own
 versions of each of these (like you suggested with YOURJS), and then
 override every method that uses any of them, replacing the reference with
 the new versions.  But that might propagate to usage of other fields, and
 at
 that point
 
 it might be simpler to just copy the entire contents of the
 original class's code into a new version of the class of my own,
 I would not do that, as you say after, there will be maintenances issues
 
 with the
 only modification being the location of the .js resource.  Neither of
 these
 two things would be hard to do, and maybe they are simply the only
 solutions, but it feels like that's not great, because it loses the
 ability
 to leverage the fact that future versions of the api class might improve
 in
 other ways and there'd be maintenance issues keeping my version
 up-to-date
 with the rest of the api.  Is that just what needs to be done, or is
 there
 possibly some other way to use the existing class directly and just swap
 some alternate resource file in place of the default one? 
 
 As you say, you 'd like to make a minor modification to the actual
 javascript in , MultiFileUploadField.js,
 so in this case I will choose the renderHead override method.
 
 
 François Meillet
 Formation Wicket - Développement Wicket





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-modify-internal-JavascriptResourceReference-packaged-with-component-tp4656344p4656422.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: Another Wicket 6 migration issue: drag and drop (so far done with wiquery)

2013-02-15 Thread Emond Papegaaij
DroppableBehavior is the replacement of DroppableAjaxBehavior. You use it
like this:

final DroppableBehavior droppableBehavior = new DroppableBehavior();
droppableBehavior.setDropEvent( new AjaxDropCallback() {
protected void drop(AjaxRequestTarget target, Component source,
Component dropped) {
// [...]
}
} );
droppableBehavior.setAccept( new DroppableAccept( .fileItem ) );
droppableBehavior.setHoverClass( dropHover );
add( droppableBehavior );

Best regards,
Emond


On Fri, Feb 15, 2013 at 2:20 PM, Martin Dietze d...@fh-wedel.de wrote:

 Another thing I am stuck trying to port my project from Wicket
 1.4.x to 6.6.0 is DND-mechanics which so far had been
 implemented using wiquery 1.2.

 As I see the 'DroppableAjaxBehavior' class has disappeared from
 wiquery since the 6.0 release. However no mention could be found
 on either migration pages or mailing lists.

 So far DND had been implemented like this:

 | final DroppableAjaxBehavior droppableBehavior = new
 DroppableAjaxBehaviorItemFoo() {
 | @Override
 | public void onDrop( ItemFoo item, AjaxRequestTarget target ) {
 |   // [...]
 | }
 | };
 | droppableBehaviour.getDroppableBehavior().setAccept( new
 DroppableAccept( .fileItem ) );
 | droppableBehaviour.getDroppableBehavior().setHoverClass( dropHover );
 | add( droppableBehaviour );

 Now as there's no DroppableAjaxBehavior anymore and no hint on
 what replaced it I'm lost. I found a DroppableBehavior coming with
 wiquery 6.2.0, but I can't see how this could be a simple
 replacement, and to make things worse, there does not seem to be
 any sample code for 6.2.0-based DND around.

 Any hints?

 Cheers,

 M'bert

 --
 --- / http://herbert.the-little-red-haired-girl.org /
 -
 =+=
 WE ARE THE BORG - RESISTANCE IS VOLTAGE DIVIDED BY CURRENT!

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




Re: how to modify internal JavascriptResourceReference packaged with component

2013-02-15 Thread Francois Meillet
if the question is how to modify internal JavascriptResourceReference packaged 
with component

I will just override
@Override
public void renderHead(IHeaderResponse response)
{
// initialize the javascript library
response.render(JavaScriptHeaderItem.forReference(JS));
response.render(OnDomReadyHeaderItem.forScript(new 
MultiSelector(' + getInputName() +
', document.getElementById(' + 
container.getMarkupId() + '),  + max + ,' +
getString(org.apache.wicket.mfu.delete) + 
').addElement(document.getElementById(' +
upload.getMarkupId() + '));));
}

Max is the max number of files a user can upload.
container.getMarkupId() is container
upload.getMarkupId() is upload

Hope this helps


François Meillet
Formation Wicket - Développement Wicket





Le 15 févr. 2013 à 20:11, evan e...@novelution.com a écrit :

 Okay, so you are saying I need to create my own versions of each of those
 private variables referenced in renderHead, and override any methods that
 use any of them, to reference my own, is that right?  Unfortunately, it
 still has maintenance implications, but I guess that might just be
 inevitable given what I want to do.
 
 Thanks for the help!
 
 
 Francois Meillet wrote
 Le 15 févr. 2013 à 16:48, evan lt;
 
 evan@
 
 gt; a écrit :
 
 Hi Francois,
 
 Thanks, but actually this still has issues.  At first I thought it was
 clearly the simple thing I was missing, but then I remembered there's
 still
 a problem - the line in renderHead copied from the original
 MultiFileUploadField uses private members container, max, and upload, so
 the
 extending class won't be able to do this.  I realize I could create my
 own
 versions of each of these (like you suggested with YOURJS), and then
 override every method that uses any of them, replacing the reference with
 the new versions.  But that might propagate to usage of other fields, and
 at
 that point
 
 it might be simpler to just copy the entire contents of the
 original class's code into a new version of the class of my own,
 I would not do that, as you say after, there will be maintenances issues
 
 with the
 only modification being the location of the .js resource.  Neither of
 these
 two things would be hard to do, and maybe they are simply the only
 solutions, but it feels like that's not great, because it loses the
 ability
 to leverage the fact that future versions of the api class might improve
 in
 other ways and there'd be maintenance issues keeping my version
 up-to-date
 with the rest of the api.  Is that just what needs to be done, or is
 there
 possibly some other way to use the existing class directly and just swap
 some alternate resource file in place of the default one? 
 
 As you say, you 'd like to make a minor modification to the actual
 javascript in , MultiFileUploadField.js,
 so in this case I will choose the renderHead override method.
 
 
 François Meillet
 Formation Wicket - Développement Wicket
 
 
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/how-to-modify-internal-JavascriptResourceReference-packaged-with-component-tp4656344p4656422.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: Another Wicket 6 migration issue: drag and drop (so far done with wiquery)

2013-02-15 Thread Ernesto Reinaldo Barreiro
Hi,

I just added old AJAX behaviors for backward compatibility.

On Fri, Feb 15, 2013 at 8:28 PM, Emond Papegaaij
emond.papega...@gmail.comwrote:

 DroppableBehavior is the replacement of DroppableAjaxBehavior. You use it
 like this:

 final DroppableBehavior droppableBehavior = new DroppableBehavior();
 droppableBehavior.setDropEvent( new AjaxDropCallback() {
 protected void drop(AjaxRequestTarget target, Component source,
 Component dropped) {
 // [...]
 }
 } );
 droppableBehavior.setAccept( new DroppableAccept( .fileItem ) );
 droppableBehavior.setHoverClass( dropHover );
 add( droppableBehavior );

 Best regards,
 Emond


 On Fri, Feb 15, 2013 at 2:20 PM, Martin Dietze d...@fh-wedel.de wrote:

  Another thing I am stuck trying to port my project from Wicket
  1.4.x to 6.6.0 is DND-mechanics which so far had been
  implemented using wiquery 1.2.
 
  As I see the 'DroppableAjaxBehavior' class has disappeared from
  wiquery since the 6.0 release. However no mention could be found
  on either migration pages or mailing lists.
 
  So far DND had been implemented like this:
 
  | final DroppableAjaxBehavior droppableBehavior = new
  DroppableAjaxBehaviorItemFoo() {
  | @Override
  | public void onDrop( ItemFoo item, AjaxRequestTarget target ) {
  |   // [...]
  | }
  | };
  | droppableBehaviour.getDroppableBehavior().setAccept( new
  DroppableAccept( .fileItem ) );
  | droppableBehaviour.getDroppableBehavior().setHoverClass( dropHover );
  | add( droppableBehaviour );
 
  Now as there's no DroppableAjaxBehavior anymore and no hint on
  what replaced it I'm lost. I found a DroppableBehavior coming with
  wiquery 6.2.0, but I can't see how this could be a simple
  replacement, and to make things worse, there does not seem to be
  any sample code for 6.2.0-based DND around.
 
  Any hints?
 
  Cheers,
 
  M'bert
 
  --
  --- / http://herbert.the-little-red-haired-girl.org /
  -
  =+=
  WE ARE THE BORG - RESISTANCE IS VOLTAGE DIVIDED BY CURRENT!
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia