Re: Why is getDisplayValue in getDisplayValue final?

2014-01-09 Thread Martin Grigorov
On Thu, Jan 9, 2014 at 11:32 PM, Igor Vaynberg wrote:

> On Wed, Jan 8, 2014 at 11:41 PM, Martin Grigorov 
> wrote:
> > Hi Igor,
> >
> > While I see what you mean I think that often this is not the case. At
> least
> > when using open source library.
> > Most of the time users/developers do not read Javadoc but use the code
> > directly.
>
> this is not my experience. most users can barely attach javadoc to
> their ide, not even speaking about source.


here is where we think differently
if the user is not experienced enough this is not a problem of the
library/framework/OS (LFOS) (s)he uses
if the LFOS stays in the way of the user/developer then the problem is in
the LFOS

now the question is whether the LFOS should provide a single (the proper)
way to do something or it should provide a sane default way and let the
user choose a better one for her/his use cases
the user may choose a worse way but this is not something the LFOS should
prevent on any price
more experienced users appreciate the provided flexibility

example from yesterday/today:
- a user complains that ajax multipart form submit doesn't work for FF
- I ask for a quickstart
- the user creates a quickstart and realizes that the problem is in his
custom code
- the user apologies and continues his work

I think users complain more when the LFOS doesn't allow them to do
something good than when the LFOS doesn't prevent them to do something bad.


>
> > If I want to override a method I'd first consult with the source of the
> > overridden method, not with the Javadoc of the overridden method or its
> > super.
>
> if you consulted with the source you would see that there is no reason
> to override that method directly as its functionality can  be
> completely replaced by overriding postprocess()... so why override the
> original?
>

For example to prevent MissingResourceException that may be thrown if the
app doesn't have a value for the resource key.


>
> -igor
>
>
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
> >
> > On Thu, Jan 9, 2014 at 1:12 AM, Igor Vaynberg  >wrote:
> >
> >> the method is final because overriding it means you will most likely
> >> break the contract of the resourceKey and postprocess methods which
> >> are meant to be used by you to customze the behavior of
> >> getDisplayValue().
> >>
> >> so lets say you create subclass MyEnumChoiceRenderer with an
> >> overridden getDisplayValue() that no longer calls postprocess(). then
> >> someone subclasses your subclass and overrides postprocess() expecting
> >> it to be called (thats what the javadoc says) but it wont be, because
> >> you broke the contract.
> >>
> >> having getDisplayValue() be final prevents you from breaking this
> >> contract and saving hours of head scratching down the road.
> >>
> >> if you look at EnumChoiceRenderer without getDisplayValue() there is
> >> only one meaningful line of code left:
> >>
> >> return Classes.simpleName(object.getDeclaringClass()) + '.' +
> object.name
> >> ();
> >>
> >> everything else is javadoc or declarations. so why all the fuss over a
> >> trivial line of code?
> >>
> >> -igor
> >>
> >> ps: ironically if you did want to override getDisplayValue() in a way
> >> that broke the contract you would have to make your subclass final so
> >> no one further down the road could subclass it...
> >>
> >>
> >> On Tue, Jan 7, 2014 at 6:37 AM, Oliver B. Fischer <
> mails...@swe-blog.net>
> >> wrote:
> >> > Hi,
> >> >
> >> > I just tried to customize EnumChoiceRenderer and to override
> >> > getDisplayValue, but is final. Why?
> >> >
> >> > Can I submit a patch to remove final?
> >> >
> >> > Bye,
> >> >
> >> > Oliver
> >> >
> >> > -
> >> > 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
> >>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


AW: set table disabled while ajax request is running

2014-01-09 Thread Christoph.Manig
The problem ist that the links in the table aren't ajax links. There are also 
the navigation toolbar and the the headers toolbar which I want to disable 
while the ajax request is running. The button which starts the ajax call isn't 
in the table too.


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden 
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 – 209
email:  christoph.ma...@t-systems.com

T-SYSTEMS INTERNATIONAL GMBH
Aufsichtsrat: Thomas Dannenfeldt (Vorsitzender)
Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan, Thilo 
Kusch, Dr. Markus Müller, Georg Pepping, Hagen Rickmann
Handelsregister: Amtsgericht Frankfurt am Main HRB 55933
Sitz der Gesellschaft: Frankfurt am Main
WEEE-Reg.-Nr. DE50335567


-Ursprüngliche Nachricht-
Von: Martin Grigorov [mailto:mgrigo...@apache.org] 
Gesendet: Donnerstag, 9. Januar 2014 16:09
An: users@wicket.apache.org
Betreff: Re: set table disabled while ajax request is running

You can use AjaxChannel with the same name for all Ajax buttons/links in the 
table and with type ACTIVE.
This way only one Ajax request for this channel will be executed. All other 
will be discarded.

Martin Grigorov
Wicket Training and Consulting


On Thu, Jan 9, 2014 at 5:02 PM,  wrote:

> It is nice to show additional text oder something like this, but I 
> cant hide or disable the shown table. So the user has still the 
> possibility to click at one of the toolbars, which will throw an exception.
>
> Are there no other ways?
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer 
> Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 - 209
> email:  christoph.ma...@t-systems.com
>
> T-SYSTEMS INTERNATIONAL GMBH
> Aufsichtsrat: Thomas Dannenfeldt (Vorsitzender)
> Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri 
> Abolhassan, Thilo Kusch, Dr. Markus Müller, Georg Pepping, Hagen 
> Rickmann
> Handelsregister: Amtsgericht Frankfurt am Main HRB 55933 Sitz der 
> Gesellschaft: Frankfurt am Main WEEE-Reg.-Nr. DE50335567
>
> -Ursprüngliche Nachricht-
> Von: Andrew Geery [mailto:andrew.ge...@gmail.com]
> Gesendet: Donnerstag, 9. Januar 2014 15:12
> An: users@wicket.apache.org
> Betreff: Re: set table disabled while ajax request is running
>
> The easiest way to do that is to use
>
> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/aja
> x/IAjaxIndicatorAware.html
>
> See
>
> http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3
> -lines-of-code/
> for
> an example.
>
> Andrew
>
>
> On Thu, Jan 9, 2014 at 7:07 AM, Martin Grigorov  >wrote:
>
> > Hi,
> >
> > You may show a veil above the table to prevent clicking on elements 
> > during the ajax call
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
> >
> > On Thu, Jan 9, 2014 at 1:01 PM,  wrote:
> >
> > > Hello,
> > >
> > > in my application I have a table with some custom toolbars. This 
> > > table shows some data from the database if the user clicks an ajax 
> > > button. But
> > if
> > > the user clicks the button again, the table will be replaced by a 
> > > new
> > table
> > > with the new data. Here an example:
> > >
> > > target.add(page.get("table").replaceWith(getNewTable(newData)));
> > >
> > > This works fine. :)
> > >
> > > Now the problem. When the user clicks the ajax button again the 
> > > ajax request begins running, but the user is able to click one of 
> > > toolbars of the shown table. So I get an exception: the 
> > > table.toolbar
> was not found.
> > > This is ok because of the replacement with a new table. I want to 
> > > disable the shown table while the ajax request is running. If the 
> > > request
> > detaches
> > > the old table will be replaced by the new table with enabled toolbars.
> > >
> > > I tried to override the onEvent-method of my table. Here you can 
> > > see the
> > > code:
> > > @Override
> > > public void onEvent(IEvent event){
> > > if(event.getPayload() instanceof AjaxRequestTarget){
> > > AjaxRequestTarget actualRequestTaget = 
> > > (AjaxRequestTarget)event.getPayload();
> > > actualRequestTaget.addListener(new
> > > AjaxRequestTarget.AbstractListener(){
> > > @Override
> > > public void onBeforeRespond(Map
> > > map, AjaxRequestTarget target) {
> > > setEnabled(false);
> > > }
> > > @Override
> > > public void onAfterRespond(Map
> > > map, AjaxRequestTarget.IJavaScriptResponse response) {
> > > setEnabled(true);
> > > }
> > > });
> > > }
> > > }
> > >
> > > But this didn't work. I can click the toolbars while the request 
> > >

Re: Why is getDisplayValue in getDisplayValue final?

2014-01-09 Thread Igor Vaynberg
On Wed, Jan 8, 2014 at 11:41 PM, Martin Grigorov  wrote:
> Hi Igor,
>
> While I see what you mean I think that often this is not the case. At least
> when using open source library.
> Most of the time users/developers do not read Javadoc but use the code
> directly.

this is not my experience. most users can barely attach javadoc to
their ide, not even speaking about source.

> If I want to override a method I'd first consult with the source of the
> overridden method, not with the Javadoc of the overridden method or its
> super.

if you consulted with the source you would see that there is no reason
to override that method directly as its functionality can  be
completely replaced by overriding postprocess()... so why override the
original?

-igor


>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Jan 9, 2014 at 1:12 AM, Igor Vaynberg wrote:
>
>> the method is final because overriding it means you will most likely
>> break the contract of the resourceKey and postprocess methods which
>> are meant to be used by you to customze the behavior of
>> getDisplayValue().
>>
>> so lets say you create subclass MyEnumChoiceRenderer with an
>> overridden getDisplayValue() that no longer calls postprocess(). then
>> someone subclasses your subclass and overrides postprocess() expecting
>> it to be called (thats what the javadoc says) but it wont be, because
>> you broke the contract.
>>
>> having getDisplayValue() be final prevents you from breaking this
>> contract and saving hours of head scratching down the road.
>>
>> if you look at EnumChoiceRenderer without getDisplayValue() there is
>> only one meaningful line of code left:
>>
>> return Classes.simpleName(object.getDeclaringClass()) + '.' + object.name
>> ();
>>
>> everything else is javadoc or declarations. so why all the fuss over a
>> trivial line of code?
>>
>> -igor
>>
>> ps: ironically if you did want to override getDisplayValue() in a way
>> that broke the contract you would have to make your subclass final so
>> no one further down the road could subclass it...
>>
>>
>> On Tue, Jan 7, 2014 at 6:37 AM, Oliver B. Fischer 
>> wrote:
>> > Hi,
>> >
>> > I just tried to customize EnumChoiceRenderer and to override
>> > getDisplayValue, but is final. Why?
>> >
>> > Can I submit a patch to remove final?
>> >
>> > Bye,
>> >
>> > Oliver
>> >
>> > -
>> > 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
>>
>>

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



Re: Form multipart exception on firefox : "xmlAsString is undefined"

2014-01-09 Thread jp
I finally found that the problem occures because of a javascript decorator on
my ajax links. I need to investigate but without my decorators, all works
fine. I should look those decorators first ... :(

Thanks for your help.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-multipart-exception-on-firefox-xmlAsString-is-undefined-tp4663577p4663592.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-Bootstrap Question

2014-01-09 Thread Gabriel Landon
In the init() method of your application class :

final BootstrapSettings settings = new BootstrapSettings();
//add theme (optional)
settings.setThemeProvider(new
SingleThemeProvider(BootswatchTheme.CERULEAN));
Bootstrap.install(this, settings);


In your page class :
 @Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
Bootstrap.renderHead(response);
// font-awesome (optional)
   
response.render(CssHeaderItem.forReference(FontAwesomeCssReference.instance()));
}

Then you should have all the css and js needed in your page.

regards,
Gabriel.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Bootstrap-Question-tp4663565p4663591.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: Form multipart exception on firefox : "xmlAsString is undefined"

2014-01-09 Thread jp
I try to reproduce it on a quickstart application without success.
Ajax link producing the problem are ajax tabs (from wicket-extensions).
I see on Firebug that when the problem occure the temporary iframe is empty
and does not contains .


I Keep trying to reproduce ...

Note: The problem occured on Firefox on Windows 7 and Ubuntu

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-multipart-exception-on-firefox-xmlAsString-is-undefined-tp4663577p4663589.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 is getDisplayValue in getDisplayValue final?

2014-01-09 Thread Oliver B. Fischer
I dont remember exactly, but I guess I did it four or five times. That 
is not much but know what each of these is a hidden fork of the original 
implementation.


I wish I had written my custom annotation @WicketFork for these classes ;-)

Bye,

Oliver

Am 08.01.14 10:07, schrieb Martin Grigorov:

This is true.
The good thing is that Wicket is open source and you can copy the class and
modify it locally.
If you want to remove the copied code later you will contact us and tell us
your use case.
This way we get some feedback from our users and improve either Wicket code
or users' code :)

How many times you had to copy code for this reason ?
There are no many complains about this in the mailing lists or in Jira.
Last few years we don't use 'final' as the in the early development of
Wicket. But we cannot just go over the code and remove all finals. Some of
them have to be final. But if the user gives us a good reason we will
consider it.

Martin Grigorov
Wicket Training and Consulting


On Wed, Jan 8, 2014 at 10:40 AM, Oliver B. Fischer wrote:


I see the good point in it but in the moment when I needed a different
behaviour it is still final. No one will wait for the next release if you
have to do it now.

Bye,

Oliver

Am 07.01.14 16:54, schrieb Martin Grigorov:

  http://wicket.sourceforge.net/faqs.html#why-final
-
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: set table disabled while ajax request is running

2014-01-09 Thread Martin Grigorov
You can use AjaxChannel with the same name for all Ajax buttons/links in
the table and with type ACTIVE.
This way only one Ajax request for this channel will be executed. All other
will be discarded.

Martin Grigorov
Wicket Training and Consulting


On Thu, Jan 9, 2014 at 5:02 PM,  wrote:

> It is nice to show additional text oder something like this, but I cant
> hide or disable the shown table. So the user has still the possibility to
> click at one of the toolbars, which will throw an exception.
>
> Are there no other ways?
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics
> Hoyerswerdaer Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 - 209
> email:  christoph.ma...@t-systems.com
>
> T-SYSTEMS INTERNATIONAL GMBH
> Aufsichtsrat: Thomas Dannenfeldt (Vorsitzender)
> Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan,
> Thilo Kusch, Dr. Markus Müller, Georg Pepping, Hagen Rickmann
> Handelsregister: Amtsgericht Frankfurt am Main HRB 55933
> Sitz der Gesellschaft: Frankfurt am Main
> WEEE-Reg.-Nr. DE50335567
>
> -Ursprüngliche Nachricht-
> Von: Andrew Geery [mailto:andrew.ge...@gmail.com]
> Gesendet: Donnerstag, 9. Januar 2014 15:12
> An: users@wicket.apache.org
> Betreff: Re: set table disabled while ajax request is running
>
> The easiest way to do that is to use
>
> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/IAjaxIndicatorAware.html
>
> See
>
> http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/
> for
> an example.
>
> Andrew
>
>
> On Thu, Jan 9, 2014 at 7:07 AM, Martin Grigorov  >wrote:
>
> > Hi,
> >
> > You may show a veil above the table to prevent clicking on elements
> > during the ajax call
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> >
> >
> > On Thu, Jan 9, 2014 at 1:01 PM,  wrote:
> >
> > > Hello,
> > >
> > > in my application I have a table with some custom toolbars. This
> > > table shows some data from the database if the user clicks an ajax
> > > button. But
> > if
> > > the user clicks the button again, the table will be replaced by a
> > > new
> > table
> > > with the new data. Here an example:
> > >
> > > target.add(page.get("table").replaceWith(getNewTable(newData)));
> > >
> > > This works fine. :)
> > >
> > > Now the problem. When the user clicks the ajax button again the ajax
> > > request begins running, but the user is able to click one of
> > > toolbars of the shown table. So I get an exception: the table.toolbar
> was not found.
> > > This is ok because of the replacement with a new table. I want to
> > > disable the shown table while the ajax request is running. If the
> > > request
> > detaches
> > > the old table will be replaced by the new table with enabled toolbars.
> > >
> > > I tried to override the onEvent-method of my table. Here you can see
> > > the
> > > code:
> > > @Override
> > > public void onEvent(IEvent event){
> > > if(event.getPayload() instanceof AjaxRequestTarget){
> > > AjaxRequestTarget actualRequestTaget =
> > > (AjaxRequestTarget)event.getPayload();
> > > actualRequestTaget.addListener(new
> > > AjaxRequestTarget.AbstractListener(){
> > > @Override
> > > public void onBeforeRespond(Map
> > > map, AjaxRequestTarget target) {
> > > setEnabled(false);
> > > }
> > > @Override
> > > public void onAfterRespond(Map
> > > map, AjaxRequestTarget.IJavaScriptResponse response) {
> > > setEnabled(true);
> > > }
> > > });
> > > }
> > > }
> > >
> > > But this didn't work. I can click the toolbars while the request is
> > > running and then I get the old excetion. The table will be disabled
> > > if
> > the
> > > request has finished.
> > >
> > > Is there any possibility to realize it?
> > >
> > >
> > >
> > > Mit freundlichen Grüßen
> > > Christoph Manig
> > > Systems Engineer
> > >
> > > T-Systems International GmbH
> > > Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer
> > > Str. 18
> > > 01099 Dresden
> > > tel.:   +49 (0) 351 / 8152 - 188
> > > fax:+49 (0) 351 / 8152 - 209
> > > email:  christoph.ma...@t-systems.com
> > >
> > >
> > >
> > >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


AW: set table disabled while ajax request is running

2014-01-09 Thread Christoph.Manig
It is nice to show additional text oder something like this, but I cant hide or 
disable the shown table. So the user has still the possibility to click at one 
of the toolbars, which will throw an exception.

Are there no other ways?


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden 
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 - 209
email:  christoph.ma...@t-systems.com

T-SYSTEMS INTERNATIONAL GMBH
Aufsichtsrat: Thomas Dannenfeldt (Vorsitzender)
Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan, Thilo 
Kusch, Dr. Markus Müller, Georg Pepping, Hagen Rickmann
Handelsregister: Amtsgericht Frankfurt am Main HRB 55933
Sitz der Gesellschaft: Frankfurt am Main
WEEE-Reg.-Nr. DE50335567

-Ursprüngliche Nachricht-
Von: Andrew Geery [mailto:andrew.ge...@gmail.com] 
Gesendet: Donnerstag, 9. Januar 2014 15:12
An: users@wicket.apache.org
Betreff: Re: set table disabled while ajax request is running

The easiest way to do that is to use
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/IAjaxIndicatorAware.html

See
http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/
for
an example.

Andrew


On Thu, Jan 9, 2014 at 7:07 AM, Martin Grigorov wrote:

> Hi,
>
> You may show a veil above the table to prevent clicking on elements 
> during the ajax call
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Jan 9, 2014 at 1:01 PM,  wrote:
>
> > Hello,
> >
> > in my application I have a table with some custom toolbars. This 
> > table shows some data from the database if the user clicks an ajax 
> > button. But
> if
> > the user clicks the button again, the table will be replaced by a 
> > new
> table
> > with the new data. Here an example:
> >
> > target.add(page.get("table").replaceWith(getNewTable(newData)));
> >
> > This works fine. :)
> >
> > Now the problem. When the user clicks the ajax button again the ajax 
> > request begins running, but the user is able to click one of 
> > toolbars of the shown table. So I get an exception: the table.toolbar was 
> > not found.
> > This is ok because of the replacement with a new table. I want to 
> > disable the shown table while the ajax request is running. If the 
> > request
> detaches
> > the old table will be replaced by the new table with enabled toolbars.
> >
> > I tried to override the onEvent-method of my table. Here you can see 
> > the
> > code:
> > @Override
> > public void onEvent(IEvent event){
> > if(event.getPayload() instanceof AjaxRequestTarget){
> > AjaxRequestTarget actualRequestTaget = 
> > (AjaxRequestTarget)event.getPayload();
> > actualRequestTaget.addListener(new
> > AjaxRequestTarget.AbstractListener(){
> > @Override
> > public void onBeforeRespond(Map 
> > map, AjaxRequestTarget target) {
> > setEnabled(false);
> > }
> > @Override
> > public void onAfterRespond(Map 
> > map, AjaxRequestTarget.IJavaScriptResponse response) {
> > setEnabled(true);
> > }
> > });
> > }
> > }
> >
> > But this didn't work. I can click the toolbars while the request is 
> > running and then I get the old excetion. The table will be disabled 
> > if
> the
> > request has finished.
> >
> > Is there any possibility to realize it?
> >
> >
> >
> > Mit freundlichen Grüßen
> > Christoph Manig
> > Systems Engineer
> >
> > T-Systems International GmbH
> > Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer 
> > Str. 18
> > 01099 Dresden
> > tel.:   +49 (0) 351 / 8152 - 188
> > fax:+49 (0) 351 / 8152 - 209
> > email:  christoph.ma...@t-systems.com
> >
> >
> >
> >
>

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



Re: set table disabled while ajax request is running

2014-01-09 Thread Andrew Geery
The easiest way to do that is to use
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/IAjaxIndicatorAware.html

See
http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/
for
an example.

Andrew


On Thu, Jan 9, 2014 at 7:07 AM, Martin Grigorov wrote:

> Hi,
>
> You may show a veil above the table to prevent clicking on elements during
> the ajax call
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Jan 9, 2014 at 1:01 PM,  wrote:
>
> > Hello,
> >
> > in my application I have a table with some custom toolbars. This table
> > shows some data from the database if the user clicks an ajax button. But
> if
> > the user clicks the button again, the table will be replaced by a new
> table
> > with the new data. Here an example:
> >
> > target.add(page.get("table").replaceWith(getNewTable(newData)));
> >
> > This works fine. :)
> >
> > Now the problem. When the user clicks the ajax button again the ajax
> > request begins running, but the user is able to click one of toolbars of
> > the shown table. So I get an exception: the table.toolbar was not found.
> > This is ok because of the replacement with a new table. I want to disable
> > the shown table while the ajax request is running. If the request
> detaches
> > the old table will be replaced by the new table with enabled toolbars.
> >
> > I tried to override the onEvent-method of my table. Here you can see the
> > code:
> > @Override
> > public void onEvent(IEvent event){
> > if(event.getPayload() instanceof AjaxRequestTarget){
> > AjaxRequestTarget actualRequestTaget =
> > (AjaxRequestTarget)event.getPayload();
> > actualRequestTaget.addListener(new
> > AjaxRequestTarget.AbstractListener(){
> > @Override
> > public void onBeforeRespond(Map map,
> > AjaxRequestTarget target) {
> > setEnabled(false);
> > }
> > @Override
> > public void onAfterRespond(Map map,
> > AjaxRequestTarget.IJavaScriptResponse response) {
> > setEnabled(true);
> > }
> > });
> > }
> > }
> >
> > But this didn't work. I can click the toolbars while the request is
> > running and then I get the old excetion. The table will be disabled if
> the
> > request has finished.
> >
> > Is there any possibility to realize it?
> >
> >
> >
> > Mit freundlichen Grüßen
> > Christoph Manig
> > Systems Engineer
> >
> > T-Systems International GmbH
> > Systems Integration - SC Travel, Transport & Logistics
> > Hoyerswerdaer Str. 18
> > 01099 Dresden
> > tel.:   +49 (0) 351 / 8152 - 188
> > fax:+49 (0) 351 / 8152 - 209
> > email:  christoph.ma...@t-systems.com
> >
> >
> >
> >
>


Re: Determine which submit buttons was pressed

2014-01-09 Thread gmparker2000
Maybe I'm missing something but it seems to me that the submittingComponent
parameter passed to process is just an anonymously generated class that
implements IFormSubmitter.  Although it is not null when process is called,
it only gives me access to the form and whether or not default form
processing is enabled.  Is there someway that this can lead me to the button
that triggered the submit?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Determine-which-submit-buttons-was-pressed-tp4663550p4663582.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: set table disabled while ajax request is running

2014-01-09 Thread Martin Grigorov
Hi,

You may show a veil above the table to prevent clicking on elements during
the ajax call

Martin Grigorov
Wicket Training and Consulting


On Thu, Jan 9, 2014 at 1:01 PM,  wrote:

> Hello,
>
> in my application I have a table with some custom toolbars. This table
> shows some data from the database if the user clicks an ajax button. But if
> the user clicks the button again, the table will be replaced by a new table
> with the new data. Here an example:
>
> target.add(page.get("table").replaceWith(getNewTable(newData)));
>
> This works fine. :)
>
> Now the problem. When the user clicks the ajax button again the ajax
> request begins running, but the user is able to click one of toolbars of
> the shown table. So I get an exception: the table.toolbar was not found.
> This is ok because of the replacement with a new table. I want to disable
> the shown table while the ajax request is running. If the request detaches
> the old table will be replaced by the new table with enabled toolbars.
>
> I tried to override the onEvent-method of my table. Here you can see the
> code:
> @Override
> public void onEvent(IEvent event){
> if(event.getPayload() instanceof AjaxRequestTarget){
> AjaxRequestTarget actualRequestTaget =
> (AjaxRequestTarget)event.getPayload();
> actualRequestTaget.addListener(new
> AjaxRequestTarget.AbstractListener(){
> @Override
> public void onBeforeRespond(Map map,
> AjaxRequestTarget target) {
> setEnabled(false);
> }
> @Override
> public void onAfterRespond(Map map,
> AjaxRequestTarget.IJavaScriptResponse response) {
> setEnabled(true);
> }
> });
> }
> }
>
> But this didn't work. I can click the toolbars while the request is
> running and then I get the old excetion. The table will be disabled if the
> request has finished.
>
> Is there any possibility to realize it?
>
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics
> Hoyerswerdaer Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 - 209
> email:  christoph.ma...@t-systems.com
>
>
>
>


Re: Form multipart exception on firefox : "xmlAsString is undefined"

2014-01-09 Thread Martin Grigorov
Hi,

Can you reproduce this in a quickstart app ?
If YES then please attach it to a ticket in Jira.
What OS do you use ?

Martin Grigorov
Wicket Training and Consulting


On Thu, Jan 9, 2014 at 1:43 PM, Jean-Philippe Signorino <
jeanphilippe.signor...@gmail.com> wrote:

> Hello,
>
> I have a wicket page with a form. The form has to be multipart because an
> upload file component can be added dynamically into the form by ajax. When
> this upload file component is added/removed from the form, a javacript
> error occurred sometimes on Firefox :  "xmlAsString is undefined"
>
>
> The code failing is in wicket-ajax-jquery (Wicket6) in htmlToDomDocument
> method :
> "var xmlAsString = htmlDocument.body.outerText;"
>
> I don't understand multipart form mechanism but I have done some
> investigations :
> 'htmlToDomDocument' method is called only when multipart form "iframe" is
> in 'BackCompat' mode. On Firefox, empty iframes are in 'BackCompat' mode.
> So 'htmlToDomDocument ' can be called on Firefox. However, body.outerText
> is an IE/Webkit property , not a Firefox property.
>
>
> Thanks, Jean-Philippe
>


Form multipart exception on firefox : "xmlAsString is undefined"

2014-01-09 Thread Jean-Philippe Signorino
Hello,

I have a wicket page with a form. The form has to be multipart because an
upload file component can be added dynamically into the form by ajax. When
this upload file component is added/removed from the form, a javacript
error occurred sometimes on Firefox :  "xmlAsString is undefined"


The code failing is in wicket-ajax-jquery (Wicket6) in htmlToDomDocument
method :
"var xmlAsString = htmlDocument.body.outerText;"

I don't understand multipart form mechanism but I have done some
investigations :
'htmlToDomDocument' method is called only when multipart form "iframe" is
in 'BackCompat' mode. On Firefox, empty iframes are in 'BackCompat' mode.
So 'htmlToDomDocument ' can be called on Firefox. However, body.outerText
is an IE/Webkit property , not a Firefox property.


Thanks, Jean-Philippe


set table disabled while ajax request is running

2014-01-09 Thread Christoph.Manig
Hello,

in my application I have a table with some custom toolbars. This table shows 
some data from the database if the user clicks an ajax button. But if the user 
clicks the button again, the table will be replaced by a new table with the new 
data. Here an example:

target.add(page.get("table").replaceWith(getNewTable(newData)));

This works fine. :)

Now the problem. When the user clicks the ajax button again the ajax request 
begins running, but the user is able to click one of toolbars of the shown 
table. So I get an exception: the table.toolbar was not found. This is ok 
because of the replacement with a new table. I want to disable the shown table 
while the ajax request is running. If the request detaches the old table will 
be replaced by the new table with enabled toolbars.

I tried to override the onEvent-method of my table. Here you can see the code:
@Override
public void onEvent(IEvent event){
if(event.getPayload() instanceof AjaxRequestTarget){
AjaxRequestTarget actualRequestTaget = 
(AjaxRequestTarget)event.getPayload();
actualRequestTaget.addListener(new 
AjaxRequestTarget.AbstractListener(){
@Override
public void onBeforeRespond(Map map, 
AjaxRequestTarget target) {
setEnabled(false);
}
@Override
public void onAfterRespond(Map map, 
AjaxRequestTarget.IJavaScriptResponse response) {
setEnabled(true);
}
});
}
}

But this didn't work. I can click the toolbars while the request is running and 
then I get the old excetion. The table will be disabled if the request has 
finished.

Is there any possibility to realize it?



Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 - 209
email:  christoph.ma...@t-systems.com





Re: 42lines wicket full calendar

2014-01-09 Thread Vit Rozkovec
Looking at github, there is already one pull request pending that seems 
to have the feature you need:

https://github.com/42Lines/wicket-fullcalendar/pulls


On 13.9.2012 10:04, Gytis wrote:

Hello,
Recently I started to use wicket-fullcalendar of 42lines.
I`d like to ask is there any possibility to change week starting day (by
default it is Sunday, but I need it to be Monday)?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/42lines-wicket-full-calendar-tp4651969.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: StalePageException when AjaxFallbackLink opened in new tab

2014-01-09 Thread Martin Grigorov
It is a known issue: https://issues.apache.org/jira/browse/WICKET-4733
I have no workaround for you.

Martin Grigorov
Wicket Training and Consulting


On Thu, Jan 9, 2014 at 11:14 AM, Rakesh A wrote:

> Hi,
>
> Yes, page does have 'AbstractAjaxTimerBehavior' added to it.
>
> Regards,
> Rakesh.A
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/StalePageException-when-AjaxFallbackLink-opened-in-new-tab-tp4663568p4663573.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: StalePageException when AjaxFallbackLink opened in new tab

2014-01-09 Thread Rakesh A
Hi,

Yes, page does have 'AbstractAjaxTimerBehavior' added to it.

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StalePageException-when-AjaxFallbackLink-opened-in-new-tab-tp4663568p4663573.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: StalePageException when AjaxFallbackLink opened in new tab

2014-01-09 Thread Martin Grigorov
Hi,

Do you have Ajax timer behavior running on this page too ?

Martin Grigorov
Wicket Training and Consulting


On Thu, Jan 9, 2014 at 10:14 AM, Rakesh A wrote:

> Hi,
>
> I've few AjaxFallbackLink links in my page [not versioned], when I try to
> right click on these link and use the "open in new tab" option, page gets
> opened in new tab and results a StalePageException, because render count
> doesn't match [verified this by debugging
> org.apache.wicket.core.request.handler.PageProvider.getStoredPage(int)],
> but
> it gets into a infinate loop of refresh [due to repeated StalePageException
> s].
>
> Can one point me to how to fix this?
>
> Regards,
> Rakesh.A
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/StalePageException-when-AjaxFallbackLink-opened-in-new-tab-tp4663568.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: Determine which submit buttons was pressed

2014-01-09 Thread Martin Grigorov
Hi,


On Wed, Jan 8, 2014 at 6:14 PM, gmparker2000 wrote:

> I had tried that but unfortunately at the point I'm trying to make the
> determination this call returns null.
>
>
> Form myForm = new EasyForm("myForm") {
> public void process(IFormSubmitter submittingComponent) {
>

Wicket passes the submitting component as argument to this method. ^^


> // this returns null
> IFormSubmitter btn = this.findSubmittingButton();
>
> if (btn == ...) {
> // do something before validation
> }
>
> super.process(submittingComponent);
> }
>
>
> The only way I could make this work so far is something like this:
>
> public void process(IFormSubmitter submittingComponent) {
> IFormSubmitter btn = this.findSubmittingButton();
> String qs = this.getRequest().getUrl().getQueryString();
>
> if (qs.contains("myButtonName")) {
>

Can you show us all GET and POST parameters ?


> // do something
> }
>
> super.process(submittingComponent);
>  }
>
> This is ugly.  Hoping there is a better way.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Determine-which-submit-buttons-was-pressed-tp4663550p4663554.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
>
>


StalePageException when AjaxFallbackLink opened in new tab

2014-01-09 Thread Rakesh A
Hi,

I've few AjaxFallbackLink links in my page [not versioned], when I try to
right click on these link and use the "open in new tab" option, page gets
opened in new tab and results a StalePageException, because render count
doesn't match [verified this by debugging
org.apache.wicket.core.request.handler.PageProvider.getStoredPage(int)], but
it gets into a infinate loop of refresh [due to repeated StalePageException
s].

Can one point me to how to fix this?

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StalePageException-when-AjaxFallbackLink-opened-in-new-tab-tp4663568.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