Re: FormValidators and messages property file

2014-10-02 Thread Martin Grigorov
Hi,

As I said the simplest is to just use form.error(the.key):

@Override
public void validate(Form? form)
{
Date fromDate = fromDateFormComponent.getConvertedInput();
Date toDate = toDateFormComponent.getConvertedInput();

if (fromDate != null
  toDate != null
  fromDate.after(toDate))
{
form.error(getClass().getSimpleName() + . +
fromDateAfterToDate);
}
}


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 2, 2014 at 12:30 AM, msalman mohammad_sal...@yahoo.com wrote:

 Well, I wanted these to be independent validation classes.  But now it
 seems
 like a bad idea.  I will make them part of the form.

 Martin, your comments and help are much appreciated.

 Thanks.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/FormValidators-and-messages-property-file-tp4667767p4667790.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: unable to find property UploadProgressBar.starting

2014-10-02 Thread Martin Grigorov
https://issues.apache.org/jira/browse/WICKET-5713

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Oct 1, 2014 at 11:11 PM, Garret Wilson gar...@globalmentor.com
wrote:

 On 10/1/2014 5:17 PM, Martin Grigorov wrote:

 ...
 Are you aware of JDK APIs (e.g. ClassLoader) or Servlet APIs (e.g.
 SevletContext) that make it simple to find the list of resources in a
 folder in the classpath ?
 E.g. give me a list of all files with extension '.properties' in
 /META-INF/wicket/ ?


 Hmmm... not offhand. That was the brainstorming part. ;)

  I don't claim to know anything about this IIinitializer system, other than
 it causes a problem under a certain use case. I'm just offering
 brainstorming suggestions for improvement.

  Suggestions and feedback (especially negative!) are always welcome!
 Now let's find a technical solution that doesn't cost much!



 Assign me a JIRA item and I'll look into it more, I promise. :D

 OK, I imagine once my team gets the installer code to use separate
 dependency JARs all will be OK even under the current system. I'm back to
 my project now. Thanks for the tips.


 Garret

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




Add extra debug information to component markup

2014-10-02 Thread Daniel Stoch
Hi,

I want to add extra debug information to component markup or modify
existing wicketpath info.

For now it can be easily done by using a custom default
IMarkupSourcingStrategy which has onComponentTag() method. But inside
Component.getMarkupSourcingStrategy() the default strategy is get
using a static call to a singleton
DefaultMarkupSourcingStrategy.get(). Maybe there should be a method
inside IMarkupSettings:
  IMarkupSourcingStrategy getDefaultMarkupSourcingStrategy()
which can be used in Component.getMarkupSourcingStrategy() instead a
direct call to DefaultMarkupSourcingStrategy.get().

Another solution is to invent another extension point to allow to
customize all components tags, but this described above is very simple
to implement I think.

PS. I want to add some extra information about class names where every
component come from (to allow developers, especially not GUI guys, to
easily find a source code).

--
Daniel

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



Re: Add extra debug information to component markup

2014-10-02 Thread Martin Grigorov
Hi,

You can use Behavior#onComponentTag().
And IComponentInstantiationListenener to add this behavior to all/some
components.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 2, 2014 at 12:35 PM, Daniel Stoch daniel.st...@gmail.com
wrote:

 Hi,

 I want to add extra debug information to component markup or modify
 existing wicketpath info.

 For now it can be easily done by using a custom default
 IMarkupSourcingStrategy which has onComponentTag() method. But inside
 Component.getMarkupSourcingStrategy() the default strategy is get
 using a static call to a singleton
 DefaultMarkupSourcingStrategy.get(). Maybe there should be a method
 inside IMarkupSettings:
   IMarkupSourcingStrategy getDefaultMarkupSourcingStrategy()
 which can be used in Component.getMarkupSourcingStrategy() instead a
 direct call to DefaultMarkupSourcingStrategy.get().

 Another solution is to invent another extension point to allow to
 customize all components tags, but this described above is very simple
 to implement I think.

 PS. I want to add some extra information about class names where every
 component come from (to allow developers, especially not GUI guys, to
 easily find a source code).

 --
 Daniel

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




Re: Add extra debug information to component markup

2014-10-02 Thread Daniel Stoch
You are fast :).
I wanted to write about this solution - came to my mind right now :)

--
Thanks,
Daniel

On Thu, Oct 2, 2014 at 12:38 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 You can use Behavior#onComponentTag().
 And IComponentInstantiationListenener to add this behavior to all/some
 components.

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Thu, Oct 2, 2014 at 12:35 PM, Daniel Stoch daniel.st...@gmail.com
 wrote:

 Hi,

 I want to add extra debug information to component markup or modify
 existing wicketpath info.

 For now it can be easily done by using a custom default
 IMarkupSourcingStrategy which has onComponentTag() method. But inside
 Component.getMarkupSourcingStrategy() the default strategy is get
 using a static call to a singleton
 DefaultMarkupSourcingStrategy.get(). Maybe there should be a method
 inside IMarkupSettings:
   IMarkupSourcingStrategy getDefaultMarkupSourcingStrategy()
 which can be used in Component.getMarkupSourcingStrategy() instead a
 direct call to DefaultMarkupSourcingStrategy.get().

 Another solution is to invent another extension point to allow to
 customize all components tags, but this described above is very simple
 to implement I think.

 PS. I want to add some extra information about class names where every
 component come from (to allow developers, especially not GUI guys, to
 easily find a source code).

 --
 Daniel

 -
 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



Mapping two UI componets to Single Model

2014-10-02 Thread manoj kumar
Can i Map a Two UI Components to a Single Model Object with some delimiter
seperating the two values?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mapping-two-UI-componets-to-Single-Model-tp4667796.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: DateTimeRangePicker

2014-10-02 Thread manoj kumar
Thanks for your reply  Martin Grigorov-4.

but i am unable to find a range date time picker using twitter bootstrap. is
there a widget already in wicket using jquery/jquery-ui ?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DateTimeRangePicker-tp4667763p4667797.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: DateTimeRangePicker

2014-10-02 Thread Martin Grigorov
The best I know of are here:
code: https://github.com/sebfz1/wicket-jquery-ui
demo (jQuery UI):
http://www.7thweb.net/wicket-jquery-ui/datepicker/DefaultDatePickerPage
demo (Kendo UI):
http://www.7thweb.net/wicket-jquery-ui/kendo/datetimepicker/KendoDatePickerPage

but again I think they do not support both 'range' and 'time' select
functionality in one

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 2, 2014 at 2:28 PM, manoj kumar malathkarma...@gmail.com
wrote:

 Thanks for your reply  Martin Grigorov-4.

 but i am unable to find a range date time picker using twitter bootstrap.
 is
 there a widget already in wicket using jquery/jquery-ui ?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/DateTimeRangePicker-tp4667763p4667797.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: Mapping two UI componets to Single Model

2014-10-02 Thread Martin Grigorov
Yes! Sure you can!

Give us more information what you want to do and we will give you more
information how to do it!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 2, 2014 at 2:21 PM, manoj kumar malathkarma...@gmail.com
wrote:

 Can i Map a Two UI Components to a Single Model Object with some delimiter
 seperating the two values?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Mapping-two-UI-componets-to-Single-Model-tp4667796.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: DateTimeRangePicker

2014-10-02 Thread Sebastien
Hi,

The only time picker jquery ui plugin I know for jquery ui is
http://trentrichardson.com/examples/timepicker/
but:
1/ the time is based on sliders (we like or not... personally I don't like
it too much)
2/ it is not a *range* datetimepicker.

In another side, jquery ui provides a range datepicker, but it is based on
2 datepickers...
So, I'm afraid a *range*datetimepicker does not exists yet (at least
publicly)

IMHO, the easiest way to have it would be to have 2 datetimepickers (using
the kendo ones for instance) and make them a single component. You can get
inspiration from datetimepicker implementation because it's already a
combination of a datepicker and a timepicker...

If - by change - you find a jquery ui rangedatetimepicker plugin of your
dream, please let me know and I will consider integrating it...

Hope this helps,
Sebastien


On Thu, Oct 2, 2014 at 2:33 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 The best I know of are here:
 code: https://github.com/sebfz1/wicket-jquery-ui
 demo (jQuery UI):
 http://www.7thweb.net/wicket-jquery-ui/datepicker/DefaultDatePickerPage
 demo (Kendo UI):

 http://www.7thweb.net/wicket-jquery-ui/kendo/datetimepicker/KendoDatePickerPage

 but again I think they do not support both 'range' and 'time' select
 functionality in one

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Thu, Oct 2, 2014 at 2:28 PM, manoj kumar malathkarma...@gmail.com
 wrote:

  Thanks for your reply  Martin Grigorov-4.
 
  but i am unable to find a range date time picker using twitter bootstrap.
  is
  there a widget already in wicket using jquery/jquery-ui ?
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/DateTimeRangePicker-tp4667763p4667797.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: Mapping two UI componets to Single Model

2014-10-02 Thread Sebastien
Hi,

If your question is related to your previous post about the
rangedatetimepicker [1], you better have to have a custom RangeDateTime (or
RangeValue, whatever) as model object...

[1]
http://apache-wicket.1842946.n4.nabble.com/DateTimeRangePicker-td4667763.html


On Thu, Oct 2, 2014 at 2:40 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 Yes! Sure you can!

 Give us more information what you want to do and we will give you more
 information how to do it!

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Thu, Oct 2, 2014 at 2:21 PM, manoj kumar malathkarma...@gmail.com
 wrote:

  Can i Map a Two UI Components to a Single Model Object with some
 delimiter
  seperating the two values?
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Mapping-two-UI-componets-to-Single-Model-tp4667796.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
 
 



Double submit with AjaxFormSubmitBehavior

2014-10-02 Thread Wayne W
Hi,

I have basically the following:

Form f = new Form('form) {

}


Double submit with AjaxFormSubmitBehavior

2014-10-02 Thread Wayne W
Hi,

I have basically the following

FormString typeInForm = new FormString(typeInForm) {
  @Override
  protected void onSubmit()
  {
doSubmit(this);
  }
};

AjaxFormSubmitBehavior ajax = new AjaxFormSubmitBehavior(onkeyup) {

  @Override
  protected void onSubmit(AjaxRequestTarget target) {
target.add(resultList);

  }
}
textField.add(ajax);

When the user just enter something in the the text field the both the form
onSubmit gets called once and the AjaxFormSubmitBehavior onSubmit  also
gets called. So far so good. However when the user hits return on the page
the forms onSubmit gets called twice. Looking at the call stack the second
call is coming from the AjaxFormSubmitBehavior.onEvent which intern calls
Form.onFormSubmitted


We need the form onSubmits because if the  user hits return  the
AjaxFormSubmitBehavior onSubmit never gets called.

How can I stop onSubmit getting called twice? I looked for a
'markformsubmitdone' or something but didn't see anything

many thanks