Re: AjaxRequests and middle mouse-clicks on links and buttons

2015-03-26 Thread Patrick Davids

Hi Martin,
I missed something.

We have a kind of own LinkComponent class here and someone in our team 
implemented an AjaxFallbackLink in the upper class hierarhcy, so 
currently we have a AjaxFallbackLink case here.

I didnt know that.

Thats the reason why I have a null AjaxRequestTarget.
Sorry, for giving a wrong hint here...

I removed the AjaxFallbackLink.

Now, the browser opens a new tab, with just having "javascript:;" as url.
(This also avoids the NPE issue mentioned in my previous mail.)

So, my question is reducing now to (and is not really wicket related 
anymore):

What the best practise to prevent a middle mouse click?

best regards
Patrick

Am 25.03.2015 um 18:25 schrieb Martin Grigorov:

Hi,

I don't use a mouse (and I have no one around) so I cannot test the use
case.
I cannot see how
org.apache.wicket.ajax.markup.html.form.AjaxButton#onSubmit(org.apache.wicket.ajax.AjaxRequestTarget,
org.apache.wicket.markup.html.form.Form)
or 
org.apache.wicket.ajax.markup.html.AjaxLink#onClick(org.apache.wicket.ajax.AjaxRequestTarget)
would deliver null as a target.
The target is created
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#onRequest(). Put a
breakpoint there is see what happens.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 25, 2015 at 3:33 PM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:


Hi all,
I have a problem here, I would like to ask you for feedback.

I am not sure, if its more a jquery/js / wicket issue, so thanx in advance
for any brainstorming and hints.

Browsers often features the middle mouse button to open a link or button
in a new tab.
This is quite browser-specific, so I'm looking for the most independent
solution.

Clicking the middle mouse on a ajaxified Link or Button, the browser opens
a new tab and starts a usual request cycle.

This leads into wicket call e.g.
onClick(AjaxRequestTarget target)
but then the target parameter is null.
(I cannot use AjaxFallbackLinks in my case)

I'm able to handle this NPEs by implementing null-checks on every ajax
link.
Hmm... not the perfect solution.

So, I could try to prevent middle mouse clicks by a global javascript on
all pages.
I've seen several scripts, and here also it seems to be very
browser-specific (mousewheel, or not... event.which seem to differ and
so...).
Also, not my favorite solution, yet.

Then I thought about wicket solution. Is there any possible way?
I know about a IComponentOnConfigureListener, which can be used to have to
implement an application-wide onConfigure() for any component in page
hierarchy.
Is there something siilar e.g. IComponentOnAjaxRequestListener?
So I could implement some code there, checking for null and stop any
further code-calls on ajaxified wicket components, to avoid running into
NPEs in later code?

All these are my thoughts for now.

Thanx a lot for feedback...

kind regards
Patrick

-
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: AjaxRequests and middle mouse-clicks on links and buttons

2015-03-26 Thread Martin Grigorov
http://stackoverflow.com/questions/23886278/disable-middle-mouse-click

You can register a global Wicket Ajax 'precondition' that stops the Ajax
request when the conditions are satisfied.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Mar 26, 2015 at 11:07 AM, Patrick Davids <
patrick.dav...@nubologic.com> wrote:

> Hi Martin,
> I missed something.
>
> We have a kind of own LinkComponent class here and someone in our team
> implemented an AjaxFallbackLink in the upper class hierarhcy, so currently
> we have a AjaxFallbackLink case here.
> I didnt know that.
>
> Thats the reason why I have a null AjaxRequestTarget.
> Sorry, for giving a wrong hint here...
>
> I removed the AjaxFallbackLink.
>
> Now, the browser opens a new tab, with just having "javascript:;" as url.
> (This also avoids the NPE issue mentioned in my previous mail.)
>
> So, my question is reducing now to (and is not really wicket related
> anymore):
> What the best practise to prevent a middle mouse click?
>
> best regards
> Patrick
>
> Am 25.03.2015 um 18:25 schrieb Martin Grigorov:
>
>  Hi,
>>
>> I don't use a mouse (and I have no one around) so I cannot test the use
>> case.
>> I cannot see how
>> org.apache.wicket.ajax.markup.html.form.AjaxButton#onSubmit(
>> org.apache.wicket.ajax.AjaxRequestTarget,
>> org.apache.wicket.markup.html.form.Form)
>> or org.apache.wicket.ajax.markup.html.AjaxLink#onClick(org.
>> apache.wicket.ajax.AjaxRequestTarget)
>> would deliver null as a target.
>> The target is created
>> at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#onRequest(). Put a
>> breakpoint there is see what happens.
>>
>> Martin Grigorov
>> Freelancer, available for hire!
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Wed, Mar 25, 2015 at 3:33 PM, Patrick Davids <
>> patrick.dav...@nubologic.com> wrote:
>>
>>  Hi all,
>>> I have a problem here, I would like to ask you for feedback.
>>>
>>> I am not sure, if its more a jquery/js / wicket issue, so thanx in
>>> advance
>>> for any brainstorming and hints.
>>>
>>> Browsers often features the middle mouse button to open a link or button
>>> in a new tab.
>>> This is quite browser-specific, so I'm looking for the most independent
>>> solution.
>>>
>>> Clicking the middle mouse on a ajaxified Link or Button, the browser
>>> opens
>>> a new tab and starts a usual request cycle.
>>>
>>> This leads into wicket call e.g.
>>> onClick(AjaxRequestTarget target)
>>> but then the target parameter is null.
>>> (I cannot use AjaxFallbackLinks in my case)
>>>
>>> I'm able to handle this NPEs by implementing null-checks on every ajax
>>> link.
>>> Hmm... not the perfect solution.
>>>
>>> So, I could try to prevent middle mouse clicks by a global javascript on
>>> all pages.
>>> I've seen several scripts, and here also it seems to be very
>>> browser-specific (mousewheel, or not... event.which seem to differ and
>>> so...).
>>> Also, not my favorite solution, yet.
>>>
>>> Then I thought about wicket solution. Is there any possible way?
>>> I know about a IComponentOnConfigureListener, which can be used to have
>>> to
>>> implement an application-wide onConfigure() for any component in page
>>> hierarchy.
>>> Is there something siilar e.g. IComponentOnAjaxRequestListener?
>>> So I could implement some code there, checking for null and stop any
>>> further code-calls on ajaxified wicket components, to avoid running into
>>> NPEs in later code?
>>>
>>> All these are my thoughts for now.
>>>
>>> Thanx a lot for feedback...
>>>
>>> kind regards
>>> Patrick
>>>
>>> -
>>> 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: AjaxRequests and middle mouse-clicks on links and buttons

2015-03-26 Thread Christoph Läubrich
IMO all kinds of "how to prevent user-action-xyz" aproaches are flawed 
and bad design.


The "middle-mouse-button" is just one of several methods to open links 
in a new tab/window. E.g. in most browsers you can archive this via 
right-click, holding STRG or Command-Key or Plugin or...


So your best choice would be to have some kind of "onclick" action and a 
dummy-link that only shows some kind of "sorry this action requires JS" 
that is opend then.

Alternativly for links you can simply set the target to "#" or something.

Am 26.03.2015 10:07, schrieb Patrick Davids:

Hi Martin,
I missed something.

We have a kind of own LinkComponent class here and someone in our team 
implemented an AjaxFallbackLink in the upper class hierarhcy, so 
currently we have a AjaxFallbackLink case here.

I didnt know that.

Thats the reason why I have a null AjaxRequestTarget.
Sorry, for giving a wrong hint here...

I removed the AjaxFallbackLink.

Now, the browser opens a new tab, with just having "javascript:;" as url.
(This also avoids the NPE issue mentioned in my previous mail.)

So, my question is reducing now to (and is not really wicket related 
anymore):

What the best practise to prevent a middle mouse click?

best regards
Patrick




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



Re: wicket abort ajax handling of multipart form when the server is stopped

2015-03-26 Thread Yiu Wing TSANG
Yes, this is fine, thanks.

On Wed, Mar 25, 2015 at 2:19 PM, Martin Grigorov 
wrote:

> I guess it will be just before Apache Con, i.e. in two weeks.
>
> Can you use -SNAPSHOT until then ?
>
> Martin Grigorov
> Freelancer, available for hire!
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Mar 25, 2015 at 6:53 AM, ywtsang  wrote:
>
> > Sorry that I missed to mention the browser.
> >
> > Thanks for the quick help.
> >
> > Do we have any schedule for the next wicket-7 release?
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/wicket-abort-ajax-handling-of-multipart-form-when-the-server-is-stopped-tp4670076p4670084.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 abort ajax handling of multipart form when the server is stopped

2015-03-26 Thread Martin Grigorov
Note that you have to explicitly set a request timeout for the AjaxButton
if you want to be notified about the error in connection.
See the comments in the ticket for details.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Mar 26, 2015 at 1:12 PM, Yiu Wing TSANG  wrote:

> Yes, this is fine, thanks.
>
> On Wed, Mar 25, 2015 at 2:19 PM, Martin Grigorov 
> wrote:
>
> > I guess it will be just before Apache Con, i.e. in two weeks.
> >
> > Can you use -SNAPSHOT until then ?
> >
> > Martin Grigorov
> > Freelancer, available for hire!
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Wed, Mar 25, 2015 at 6:53 AM, ywtsang  wrote:
> >
> > > Sorry that I missed to mention the browser.
> > >
> > > Thanks for the quick help.
> > >
> > > Do we have any schedule for the next wicket-7 release?
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/wicket-abort-ajax-handling-of-multipart-form-when-the-server-is-stopped-tp4670076p4670084.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: Issues with multiple FeedbackPanels

2015-03-26 Thread avchavan
Thsnk. That worked.
Now have a different problem.
I have an AjaxLink on its click based on some conditioned i have to show
same message using feedbackMessage.

if(session.getMyList().size() == 0){

myListView.getFeedbackMessages().clear();

myListView.info(funcMeldingen.getMessage(2584));
}

I am doing this in my code but the message doesnt show up on the screen.
call goes inside the if condition.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Issues-with-multiple-FeedbackPanels-tp4670087p4670104.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: How to handle click on removed links - WicketRuntimeException (Component 'xxx' has been removed from page)?

2015-03-26 Thread TylerDurden69
I get the same exception.

The question is why the component is still visible and activated if it 'has
been removed from page'?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-handle-click-on-removed-links-WicketRuntimeException-Component-xxx-has-been-removed-from-page-tp4666431p4670105.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: How to handle click on removed links - WicketRuntimeException (Component 'xxx' has been removed from page)?

2015-03-26 Thread Martin Grigorov
Hi,

It must have been in the component tree during the page rendering time.
But later it has been removed, most probably within some Ajax operation.
Perhaps in a different browser tab/window.

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Mar 26, 2015 at 5:53 PM, TylerDurden69 
wrote:

> I get the same exception.
>
> The question is why the component is still visible and activated if it 'has
> been removed from page'?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-handle-click-on-removed-links-WicketRuntimeException-Component-xxx-has-been-removed-from-page-tp4666431p4670105.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: Issues with multiple FeedbackPanels

2015-03-26 Thread mscoon
Note sure what may be wrong unless you show more code.

Some guesses:

1. You are refreshing the feedback panels in the ajax request target?

I.e. in your ajax link's on click:

void onClick(AjaxRequestTarget target) {
   ... do stuff, add message
   target.add(feedback1, feedback2);
}

2. Neither of your feedback message filters  accepts message 2584.

On Thu, Mar 26, 2015 at 3:23 PM, avchavan 
wrote:

> Thsnk. That worked.
> Now have a different problem.
> I have an AjaxLink on its click based on some conditioned i have to show
> same message using feedbackMessage.
>
> if(session.getMyList().size() == 0){
>
> myListView.getFeedbackMessages().clear();
>
> myListView.info(funcMeldingen.getMessage(2584));
> }
>
> I am doing this in my code but the message doesnt show up on the screen.
> call goes inside the if condition.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Issues-with-multiple-FeedbackPanels-tp4670087p4670104.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
>
>