How to prevent a concurrent click on ajax links (AjaxFallbackLink)

2013-07-12 Thread Steamus
When I fast click in an AjaxFallbackLink in my DataTable the first click
works correct but next click generates Access Denied (You do not have access
to the page you requested.). And there is an exception
“RequestListenerInterface.invoke(..) | behavior not enabled; ignore call.”

I was trying to investigate a forum and looks like it is famous problem. But
all advices proposed to read a topic
http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/.
 

Unfortunately the link unavailable any more. May be anybody can repeat a
solution or for last five years was proposed something new?

I really appreciate any help you can provide.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-concurrent-click-on-ajax-links-AjaxFallbackLink-tp4660226.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: Problem with swapping panels using Ajax links

2013-07-12 Thread Chris Whitcomb
I like the inline editing - that's pretty nice. However, I'm not sure my
users would.

I swap the panels usng replaceWith:

Page page = getPage();
EditPanel editPanel = new EditPanel(ReadPanel.this.getId(),
selectedDocumentModel);
ReadPanel.this.replaceWith(editPanel);
if(target != null){
  target.addComponent(editPanel);
} else {
  setResponsePage(page);
}

There are also 2 level of edit access.  Depending on what group (active
directory) they are in, they may be able to edit all fields or only some.  I
have created 2 edit panels and depending on their group membership,
determine which edit panel to display.

Thanks,
Chris


Paul Bors wrote
 What do you mean by swapping panels?
 
 Are you using Component.replace()?
 And why would you when you could do all this in-line (the same way as the
 new version of Jira does it)?
 
 Try this live example:
 1) Log on to http://Wicket.Apache.org
 2) From under the Learn left navigation menu select the Examples link
 3) Then the live action link on the page that come up
You will be redirected to http://www.wicket-library.com/
 4) Now select the ajax link for examples using wicket's built-in AJAX
 5) Select the Editable Label Example link that shows a label that can be
 edited inline via ajax
 6) Click the Source code from the upper right-corner and enjoy the
 simple
 example
 
 Remember that you can always use the AjaxFallback*** counterpart
 components
 if you would like to support browsers that don't have JS turned on (isn't
 this the de-facto now-a-day anyhow?).
 
 Have fun!





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-swapping-panels-using-Ajax-links-tp4660211p4660229.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 prevent a concurrent click on ajax links (AjaxFallbackLink)

2013-07-12 Thread Sven Meier

Read here:

http://stackoverflow.com/questions/11773885/customizing-indicatingajaxlink-in-wicket

Sven

On 07/12/2013 01:17 PM, Steamus wrote:

When I fast click in an AjaxFallbackLink in my DataTable the first click
works correct but next click generates Access Denied (You do not have access
to the page you requested.). And there is an exception
“RequestListenerInterface.invoke(..) | behavior not enabled; ignore call.”

I was trying to investigate a forum and looks like it is famous problem. But
all advices proposed to read a topic
http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/.

Unfortunately the link unavailable any more. May be anybody can repeat a
solution or for last five years was proposed something new?

I really appreciate any help you can provide.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-concurrent-click-on-ajax-links-AjaxFallbackLink-tp4660226.html
Sent from the Users forum mailing list archive at Nabble.com.

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






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



Re: WICKET-5083 and Page.isPageStateless

2013-07-12 Thread Sven Meier
So one of your components tries to access its model in #onInitialize(), 
which now may be called *after* #onRequestHandlerExecuted() was called.


Try to move this logic into #onConfigure().

Sven


On 07/12/2013 06:34 AM, Dirk Forchel wrote:

We've added a TransactionRequestCycleListener (extends
AbstractRequestCycleListener). This class handles transactions mainly like
this:

@Override
public void onRequestHandlerResolved(final RequestCycle cycle, final
IRequestHandler handler)
{
LOGGER.debug( start transaction --- +
cycle.getRequest().getUrl().toString() + --- );
Main.model.startTransaction(applicationName);
}

@Override
public void onRequestHandlerExecuted(final RequestCycle cycle, final
IRequestHandler handler)
{
if(handler instanceof FooExceptionRequestHandler)
{
LOGGER.warn( rollback transaction --- +
cycle.getRequest().getUrl().toString() + --- );
Main.model.rollbackIfNotCommitted();
}
else
{
if( Main.model.hasCurrentTransaction() )
{
LOGGER.debug( commit transaction --- +
cycle.getRequest().getUrl().toString() + --- );
Main.model.commit();
}
else
{
LOGGER.debug( no transaction to commit --- +
cycle.getRequest().getUrl().toString() + --- );
}
}
}


The Model#currentTransaction() just returns the current transaction for this
thread and looks like:

/**
* Returns the transaction for this model,
* that is bound to the currently running thread.
* @throws IllegalStateException if there is no cope transaction bound to
current thread
  * @see Thread#currentThread()
  */
public Transaction currentTransaction()
{
final Transaction result = transactions.currentIfBound();
if(result==null)
throw new IllegalStateException(there is no transaction bound 
to this
thread, see Model#startTransaction);
return result;
}

We use our own persistence framework to handle transactions to the
underlying database. No magic all about.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WICKET-5083-and-Page-isPageStateless-tp4660166p4660220.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



[ANNOUNCE] Apache Wicket 6.9.1 released

2013-07-12 Thread Martijn Dashorst
The Apache Wicket PMC announces Apache Wicket 6.9.1!

This is a patch release for 6.9.0 where we inadvertently broke CDI
injection into (amongst others) anonymous inner classes. See below
for more information regarding this release.

Please note that this patch release **only** fixes WICKET-5264.

Starting with Wicket 6 we use semantic versioning for the future
development of Wicket, and as such no API breaks are present in this
release compared to 6.0.0.

JQuery update in 6.9.0
--

As of Wicket 6.9 we ship JQuery 1.10.1. The JQuery project has
decided to remove deprecated APIs from their codebase from JQuery 1.9
and up. This means that JQuery plugins using these deprecated APIs no
longer work. See the JQuery migration guide for more information,
available from http://jquery.com/upgrade-guide/1.9/

If your application depends on these deprecated APIs you can easily
downgrade to JQuery 1.8.3-the previously provided JQuery that still
contains these APIs. Download the 1.8.3 release of jquery and add it
to your project in its application's init method:

@Override
protected void init() {
getJavaScriptLibrarySettings()
.setJQueryReference(yourJquery183ResourceReference);
}

CDI injection issue
---

In the CDI releases of Weld 2.0.1 and prior, it was assumed that
injection in anonymous inner classes was not legal and when
attempted, it resulted in an exception:

Caused by: org.jboss.weld.exceptions.DefinitionException:
WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] private class
com.example.HomePage$AForm cannot be a non-static inner class

This was reported as
https://issues.apache.org/jira/browse/WICKET-5226, as it became an
issue in Glassfish 4, which ships with Weld 2.0.1 (or earlier). We
implemented a fix for this particular issue by not injecting into
anonymous inner classes.

Unfortunately this was not a bug that needed fixing on our part, but
rather in the Weld framework (see
https://issues.jboss.org/browse/WELD-1441)

Therefore we reverted the commits done for WICKET-5226 and hope that
Glassfish will upgrade their Weld implementation soon. For the whole
story read
https://issues.apache.org/jira/browse/WICKET-5264

Using this release
--

With Apache Maven update your dependency to (and don't forget to
update any other dependencies on Wicket projects to the same version):

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-core/artifactId
version6.9.1/version
/dependency

Or download and build the distribution yourself, or use our
convenience binary package

 * Source: http://www.apache.org/dyn/closer.cgi/wicket/6.9.1
 * Binary: http://www.apache.org/dyn/closer.cgi/wicket/6.9.1/binaries

Upgrading from earlier versions
---

If you upgrade from 6.y.z this release is a drop in replacement. If
you come from a version prior to 6.0.0, please read our Wicket 6
migration guide found at

 * https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+6.0

Have fun!

— The Wicket team

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



Re: How to prevent a concurrent click on ajax links (AjaxFallbackLink)

2013-07-12 Thread Steamus
Thank you, Sven

The indicator works well, but unfortunately it doesn’t resolve the problem. 
If a user want to double click on some link we have crash as before. 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-concurrent-click-on-ajax-links-AjaxFallbackLink-tp4660226p4660239.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 prevent a concurrent click on ajax links (AjaxFallbackLink)

2013-07-12 Thread Ernesto Reinaldo Barreiro
See IAjaxIndicatorAware. Use it to display a veil that protect your page.


On Fri, Jul 12, 2013 at 5:03 PM, Steamus steam...@gmail.com wrote:

 Thank you, Sven

 The indicator works well, but unfortunately it doesn’t resolve the problem.
 If a user want to double click on some link we have crash as before.




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-concurrent-click-on-ajax-links-AjaxFallbackLink-tp4660226p4660239.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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: How to prevent a concurrent click on ajax links (AjaxFallbackLink)

2013-07-12 Thread Igor Vaynberg
the easiest way to do it is to tell the ajax channel used by the link
to drop requests if one is already in progress, this is called an
active channel.


add(new AjaxLink(..) {
  updateAjaxAttributes(attrs) {
 attrs.setChannel(new AjaxChannel(blocking, AjaxChannel.Type.ACTIVE));
  }
}

if you wan to block across a group of links then create a channel
singleton and give it to all the links.

-igor


On Fri, Jul 12, 2013 at 4:17 AM, Steamus steam...@gmail.com wrote:
 When I fast click in an AjaxFallbackLink in my DataTable the first click
 works correct but next click generates Access Denied (You do not have access
 to the page you requested.). And there is an exception
 “RequestListenerInterface.invoke(..) | behavior not enabled; ignore call.”

 I was trying to investigate a forum and looks like it is famous problem. But
 all advices proposed to read a topic
 http://wicketinaction.com/2008/12/preventing-double-ajax-requests-in-3-lines-of-code/.

 Unfortunately the link unavailable any more. May be anybody can repeat a
 solution or for last five years was proposed something new?

 I really appreciate any help you can provide.




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-concurrent-click-on-ajax-links-AjaxFallbackLink-tp4660226.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: Problem with swapping panels using Ajax links

2013-07-12 Thread Paul Bors
Okay but in-line editing doesn't necessary mean you need to edit a single
field at a time.

You could have the user hit an Edit button and toggle a bunch of components
from labels to form fields and even toggle the Cancel button's visibility.

As for your code snippet, don't you have to add to the Ajax target the
parent of the panel that was switched out?
target.addComponent(editPanel.getParent());

~ Thank you,
  Paul Bors

-Original Message-
From: Chris Whitcomb [mailto:cwhitc...@osc.state.ny.us] 
Sent: Friday, July 12, 2013 7:30 AM
To: users@wicket.apache.org
Subject: RE: Problem with swapping panels using Ajax links

I like the inline editing - that's pretty nice. However, I'm not sure my
users would.

I swap the panels usng replaceWith:

Page page = getPage();
EditPanel editPanel = new EditPanel(ReadPanel.this.getId(),
selectedDocumentModel); ReadPanel.this.replaceWith(editPanel);
if(target != null){
  target.addComponent(editPanel);
} else {
  setResponsePage(page);
}

There are also 2 level of edit access.  Depending on what group (active
directory) they are in, they may be able to edit all fields or only some.  I
have created 2 edit panels and depending on their group membership,
determine which edit panel to display.

Thanks,
Chris


Paul Bors wrote
 What do you mean by swapping panels?
 
 Are you using Component.replace()?
 And why would you when you could do all this in-line (the same way as 
 the new version of Jira does it)?
 
 Try this live example:
 1) Log on to http://Wicket.Apache.org
 2) From under the Learn left navigation menu select the Examples 
 link
 3) Then the live action link on the page that come up
You will be redirected to http://www.wicket-library.com/
 4) Now select the ajax link for examples using wicket's built-in 
 AJAX
 5) Select the Editable Label Example link that shows a label that 
 can be edited inline via ajax
 6) Click the Source code from the upper right-corner and enjoy the 
 simple example
 
 Remember that you can always use the AjaxFallback*** counterpart 
 components if you would like to support browsers that don't have JS 
 turned on (isn't this the de-facto now-a-day anyhow?).
 
 Have fun!





--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Problem-with-swapping-panels-usin
g-Ajax-links-tp4660211p4660229.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



Wicket 6 Portlet in JBoss GateIn

2013-07-12 Thread heapifyman
Hello,

I'm trying to get a Wicket 6 app running as a Portlet in JBoss GateIn 3.6
using the wicketstuff-portlet lib (
https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/portlet-parent
).

So far I have managed to get the Wicket quickstart app running, i.e. I can
display simple things like a Label in the Wicket portlet.
However, as soon as I add a Form to my page I get an Exception (see
below).

Has anyone maybe a running example or can point me to some documentation?
Things I found on the web seem to be mostly for Wicket 1.5 or specific to
Liferay.

Thanks in advance.

Caused by: java.lang.IllegalArgumentException: Argument '_url' may not be
null.
at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
at org.apache.wicket.request.Url.parse(Url.java:205)
at org.apache.wicket.request.Url.parse(Url.java:192)
at
org.apache.wicket.protocol.http.servlet.ServletWebResponse.encodeRedirectURL(ServletWebResponse.java:224)
at
org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:236)
at
org.apache.wicket.protocol.http.BufferedWebResponse$SendRedirectAction.invoke(BufferedWebResponse.java:400)
at
org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:588)
at
org.apache.wicket.protocol.http.HeaderBufferingWebResponse.stopBuffering(HeaderBufferingWebResponse.java:60)
at
org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:97)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:269)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:720)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:657)
[jbossweb-7.0.13.Final.jar:]
at
org.gatein.pc.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:142)
[pc-portlet-2.4.1.Final.jar:2.4.1.Final]
at
org.gatein.pc.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:84)
[pc-portlet-2.4.1.Final.jar:2.4.1.Final]
at
org.apache.wicket.portlet.WicketPortlet.processMimeResponseRequest(WicketPortlet.java:407)
at
org.apache.wicket.portlet.WicketPortlet.processRequest(WicketPortlet.java:579)
at org.apache.wicket.portlet.WicketPortlet.doView(WicketPortlet.java:221)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:354)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:259)
...


Inmethod Grid on IE9

2013-07-12 Thread Jose Mauricio Meraz Mercado
Hi,

Currently on the application we are developing we are using InMethod grids,
when those grids have a horizontal scroll bar there is a strange behavior
that makes the div that has the contents grow when you select text or when
you select a record on the grid.

This behavior can be reproduced on
http://www.wicket-library.com/inmethod-grid/data-grid/simple (the
horizontal scroll bar has to be present, just passing the mouse on the rows
will cause the navigation bar to be pushed below). IE8, Firefox and Chrome
this works fine

We found this on the wicketstuff project with something similar to what we
have, but the solution provided doesn't work:
https://github.com/wicketstuff/core/issues/44

Has anyone experienced and resolved this?

Thanks for any help

We are using Wicket 1.4.19 and Inmethod-grid 1.4.9.1


Wicket 1.4.7 request listener

2013-07-12 Thread Entropy
My project uses wicket 1.4.7.  We need to run some standard code before and
after every request (including ajax).  How can I register sucha  listener?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-7-request-listener-tp4660248.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 1.4.7 request listener

2013-07-12 Thread Francois Meillet
Have a to 
http://apache-wicket.1842946.n4.nabble.com/Catch-the-doGet-doPost-on-every-request-and-override-it-td4652038.html


François Meillet
Formation Wicket - Développement Wicket





Le 12 juil. 2013 à 21:03, Entropy blmulholl...@gmail.com a écrit :

 My project uses wicket 1.4.7.  We need to run some standard code before and
 after every request (including ajax).  How can I register sucha  listener?
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-7-request-listener-tp4660248.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