Re: How to set Wicket with embedded Jetty?

2011-02-07 Thread Attila Király
Hi Surapol,

Try adding this before registering the filter:

filterHolder.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, /*);

It seems wicket is not parsing the web.xml if that init parameter is
present.

Attila

2011/2/7 Surapol Pairojtanachai sura...@bridsystems.com

 I can easily create embedded jetty project (java web project without
 WEB-INF and web.xml), hence a very modular web server for many purposes. No
 need to have configuration for a simple/quick fix and small web server. Only
 embedded jetty with Wicket that I cannot do. It seems Wicket is really
 fixated to web.xml. Can this character be bypassed?

 Thanks,
 Surapol

 On 02/07/2011 11:56 AM, James Carman wrote:

 This is not a Wicket question, then.  I'd try the Jetty mailing lists.

 On Sun, Feb 6, 2011 at 11:47 PM, Surapol Pairojtanachai
 sura...@bridsystems.com  wrote:

 It doesn't create wicket project with embedded jetty. By embedded jetty,
 I
 mean no web.xml file. Is this possible?

 Regards,
 Surapol

 On 02/07/2011 11:28 AM, James Carman wrote:

 Why don't you try creating a quickstart
 (http://wicket.apache.org/start/quickstart.html) and just copy the
 code from the Start class that's provided for you there?


 On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
 sura...@bridsystems.comwrote:

 Please guide me on how to set Wicket to run with embedded Jetty. I run
 the code below and keep getting java.lang.IllegalStateException:
 filter
 path was not configured.

 Thanks in Advance,
 Surapol Pairojtanachai

   Server server = new Server();
   SelectChannelConnector connector = new SelectChannelConnector();
   connector.setHost(localhost);
   connector.setPort(8080);
   server.setConnectors(new Connector[] { connector });
   Context root = new Context(server, /, Context.SESSIONS);
 ServletHolder serverHolder = new ServletHolder(new
 DefaultServlet());
   root.addServlet(serverHolder, /*);
   FilterHolder filterHolder = new FilterHolder(WicketFilter.class);



 filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
 MyWebServer.class.getName());
   root.addFilter(filterHolder, /*, Handler.DEFAULT);
   server.start();
   server.join();



 ubuntu 10.10 amd64
 JDK 1.6.0.23 amd64
 Jetty 6.1.26



 -
 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


  -
 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




-- 
I would rather write programs to write programs than write programs.


Re: PageExpiredException since version 1.4.13

2011-02-07 Thread Daniel Soneira

Hi Pedro,

I've increased the max page map setting from 5 to 10 and the exception 
went away.

Thanks for the suggestion - for a quick fix that is good enough for now :)
Still it seems like a bug.
Can I help with some specific logs to determine the source of the problem?

Regards,
Daniel

On 04.02.2011 18:15, Pedro Santos wrote:

Hi Daniel, try to increase the application max page map number, if the
problem remains we can eliminate the WICKET-3108 as the source.

On Fri, Feb 4, 2011 at 2:46 PM, Daniel Soneiradaniel.sone...@joyn-it.atwrote:


Hi there,

I'm experiencing a weird problem that I've tried to solve for 2 days now.

After updating Wicket from 1.4.12 to the latest version (1.4.15) because of
WICKET-3136 (JVM 1.6 crash) one particular page (bookmarkable) always throws
a PageExpiredException on clicking an AjaxSubmitLink. I simply start the
application, open the page, click the link =  BAM, exception!

The curious thing about this is that, if I just remove (== not add) one
other button (from a group of 3 - all doing nearly the same thing) it works.
Those 3 buttons all subclass a nested abstract inner class inside another
nested class of the page. Also there are a lot of buttons / menu items on
that page.
But that one exact button is not causing the problem because I can remove
any of those 3 buttons of the group to get it working.
2 of those buttons: GOOD
3 of those buttons: EXCEPTION

The problem also vanishes if I remove code from the buttons that reference
the page implicitly like the following:

== CODE ==

public void onConfigure() {
super.onConfigure();
setEnabled(isFormEnabled()  isDetailObjectPersistent());
}

== == == ==

Here isFormEnabled and isDetailObjectPersistent are methods of the PAGE not
the buttons.

Essentially it looks like there is a problem serializing the whole page,
which is why the page map is null inside the following code block from
WebRequestCycleProcessor.resolve:

== CODE ==
if (requestParameters.isOnlyProcessIfPathActive())
{
.
if (pageMap == null) {
processRequest = 1;
}

}

== == == ==

I've tested all versions after 1.4.12 and they all show the same behavior
while 1.4.12 itself works for this case.
I don't think I'm able to reproduce this in a QuickStart without some major
effort since there is a deep class hierarchy involved, but I guess this
issue has something to do with WICKET-3108 (Problems with page maps stored
in session). I've tried to do a QuickStart with a simple test page with
nested classes - but that worked (sadly).

Also I'm having one @SpringBean inside the page that is used by those
buttons which seem to cause trouble.
Maybe someone can point me in the right direction?

Because of WICKET-3136 staying with 1.4.12 unfortunately is not an option
for us.
Any help is really appreciated.


Kind regards,
Daniel

PS: I know no one is looking forward to digging into a serialization / page
expired problem but maybe someone has mercy and helps me out on this one.

-
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



[1.5 RC1] Error serializing object class

2011-02-07 Thread nino martinez wael
One of my pages fails with this, im a little bit unsure what is causing the
error im using guice:

2011-02-07 12:07:10,112 ERROR [org.apache.wicket.util.lang.WicketObjects]  -
Error serializing object class com.netdesign.wallboard.page.DriverSetupPage
[object=[Page class = com.netdesign.wallboard.page.DriverSetupPage, id = 3,
render count = 1]]
java.lang.NullPointerException
at $Proxy37.equals(Unknown Source)
at java.util.Vector.indexOf(Vector.java:361)
at java.util.Vector.contains(Vector.java:320)
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:344)
at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:418)
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
at
org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:702)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at
org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at
org.apache.wicket.util.lang.WicketObjects.objectToByteArray(WicketObjects.java:482)
at
org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:364)
at
org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:153)
at
org.apache.wicket.page.PersistentPageManager$PersitentRequestAdapter.storeTouchedPages(PersistentPageManager.java:335)
at
org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:185)
at
org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
at
org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
at
org.apache.wicket.page.PageAccessSynchronizer$1.commitRequest(PageAccessSynchronizer.java:203)
at org.apache.wicket.Application$2.onDetach(Application.java:1507)
at
org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:99)
at
org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:95)
at
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:79)
at
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:93)
at
org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:505)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:251)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141)
at
com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
at
com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at

Re: [1.5 RC1] Error serializing object class

2011-02-07 Thread Major Péter

Hi,

in your DriverSetupPage you have an injected resource, which's equals 
method can not handle null arguments.


Regards,
Peter

On 2011-02-07 12:11, nino martinez wael wrote:

One of my pages fails with this, im a little bit unsure what is causing the
error im using guice:

2011-02-07 12:07:10,112 ERROR [org.apache.wicket.util.lang.WicketObjects]  -
Error serializing object class com.netdesign.wallboard.page.DriverSetupPage
[object=[Page class = com.netdesign.wallboard.page.DriverSetupPage, id = 3,
render count = 1]]
java.lang.NullPointerException
 at $Proxy37.equals(Unknown Source)
 at java.util.Vector.indexOf(Vector.java:361)
 at java.util.Vector.contains(Vector.java:320)
 at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:344)
 at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:418)
 at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at
org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:702)
 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
 at
org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
 at
org.apache.wicket.util.lang.WicketObjects.objectToByteArray(WicketObjects.java:482)
 at
org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:364)
 at
org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:153)
 at
org.apache.wicket.page.PersistentPageManager$PersitentRequestAdapter.storeTouchedPages(PersistentPageManager.java:335)
 at
org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:185)
 at
org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
 at
org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
 at
org.apache.wicket.page.PageAccessSynchronizer$1.commitRequest(PageAccessSynchronizer.java:203)
 at org.apache.wicket.Application$2.onDetach(Application.java:1507)
 at
org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:99)
 at
org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:95)
 at
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:79)
 at
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:93)
 at
org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:505)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:251)
 at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
 at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
 at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at
com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141)
 at
com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
 at
com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155)
 at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
 at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
 at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
 at 

[1.5 MIGRATION] - Where did StringHeaderContributor / TextTemplateHeaderContributor go?

2011-02-07 Thread Daniel Soneira
The migration wiki does not contain information on renamed / 
substitution classes.
I know AbstractHeaderContributor is a thing of the past but those 
classes could be converted into Behaviors quite easily.

Was there a reason to get rid of them in 1.5?
TextTemplate still exists but there is no easy (read: already in core) 
way to use them as header contributors.


Cheers,
Daniel

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



Re: [1.5 RC1] Error serializing object class

2011-02-07 Thread nino martinez wael
I hope it's not this one:

@Inject
private transient Injector injector;

I have several others, are there any way to discover which resource it's
talking about, can I step through it?

2011/2/7 Major Péter majorpe...@sch.bme.hu

 Hi,

 in your DriverSetupPage you have an injected resource, which's equals
 method can not handle null arguments.

 Regards,
 Peter


 On 2011-02-07 12:11, nino martinez wael wrote:

 One of my pages fails with this, im a little bit unsure what is causing
 the
 error im using guice:

 2011-02-07 12:07:10,112 ERROR [org.apache.wicket.util.lang.WicketObjects]
  -
 Error serializing object class
 com.netdesign.wallboard.page.DriverSetupPage
 [object=[Page class = com.netdesign.wallboard.page.DriverSetupPage, id =
 3,
 render count = 1]]
 java.lang.NullPointerException
 at $Proxy37.equals(Unknown Source)
 at java.util.Vector.indexOf(Vector.java:361)
 at java.util.Vector.contains(Vector.java:320)
 at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:344)
 at

 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at

 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at

 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at

 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at

 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at

 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at

 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:418)
 at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at

 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
 at

 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
 at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
 at

 org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:702)
 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
 at

 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
 at

 org.apache.wicket.util.lang.WicketObjects.objectToByteArray(WicketObjects.java:482)
 at

 org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:364)
 at

 org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:153)
 at

 org.apache.wicket.page.PersistentPageManager$PersitentRequestAdapter.storeTouchedPages(PersistentPageManager.java:335)
 at

 org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:185)
 at

 org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
 at

 org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
 at

 org.apache.wicket.page.PageAccessSynchronizer$1.commitRequest(PageAccessSynchronizer.java:203)
 at org.apache.wicket.Application$2.onDetach(Application.java:1507)
 at

 org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:99)
 at

 org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:95)
 at

 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:79)
 at

 org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:93)
 at
 org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:505)
 at

 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:251)
 at

 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
 at

 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
 at

 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at

 com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141)
 at

 com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
 at

 com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155)
 at

 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 at
 

Question about Unit Testing with custom Session

2011-02-07 Thread Dmitriy Neretin
Hello everybody,

After integration with spring I have following problem:

if I add following to my CustomSession:

InjectorHolder.getInjector().inject(this); (because I store some spring
beans in the custom session)

My WicketTester doesn't work anymore. I get this exception:
BeanFactory not initialized or already closed - call 'refresh' before
accessing beans via the ApplicationContext

What I have done in my Unit Tests:

@Before
public void setUp() {
MworldWicketApplication wicketWebApp = new MworldWicketApplication()
{

ApplicationContext ctx = new XmlWebApplicationContext();

@Override
public void init() {
addComponentInstantiationListener(new
SpringComponentInjector(this, ctx, true));
}
};

And I don't really understand what to do now :)

Can somebody help me?

P. S. The Application works. Affected are only unit tests


[wicket 1.5] Ajax recovery script

2011-02-07 Thread nino martinez wael
Hi

Does anybody have a java script which does the following modification to
wicket's ajax:

If the server are to long to respond, the script automatically invokes
fallback to the baseurl for the page?


I guess you could also have some reverse heartbeat technique, that would
update a timer, and when the timer reaches 0 it just tries to refresh the
page manually..However I'd also like for the manual refresh to wait for the
server comes up.. Any snipplets or ides?

regards Nino


Re: PageExpiredException since version 1.4.13

2011-02-07 Thread Pedro Santos
I'm afraid that the opposite statement is the right one :)
The version 1.4.12 wasn't respecting the max page map, than your app was
relying on the fact that it could always get page versions from it's page
map. Since this bug get resolved, you need to pay close attention to how
page map is getting managed if you want to keep using the max page map
property.
As a side note, Wicket 1.5 don't have page maps any more, page still get
incremented versions, but not in an specific page map.

On Mon, Feb 7, 2011 at 8:53 AM, Daniel Soneira daniel.sone...@joyn-it.atwrote:

 Hi Pedro,

 I've increased the max page map setting from 5 to 10 and the exception went
 away.
 Thanks for the suggestion - for a quick fix that is good enough for now :)
 Still it seems like a bug.
 Can I help with some specific logs to determine the source of the problem?

 Regards,
 Daniel


 On 04.02.2011 18:15, Pedro Santos wrote:

 Hi Daniel, try to increase the application max page map number, if the
 problem remains we can eliminate the WICKET-3108 as the source.

 On Fri, Feb 4, 2011 at 2:46 PM, Daniel Soneiradaniel.sone...@joyn-it.at
 wrote:

  Hi there,

 I'm experiencing a weird problem that I've tried to solve for 2 days now.

 After updating Wicket from 1.4.12 to the latest version (1.4.15) because
 of
 WICKET-3136 (JVM 1.6 crash) one particular page (bookmarkable) always
 throws
 a PageExpiredException on clicking an AjaxSubmitLink. I simply start the
 application, open the page, click the link =  BAM, exception!

 The curious thing about this is that, if I just remove (== not add) one
 other button (from a group of 3 - all doing nearly the same thing) it
 works.
 Those 3 buttons all subclass a nested abstract inner class inside another
 nested class of the page. Also there are a lot of buttons / menu items on
 that page.
 But that one exact button is not causing the problem because I can remove
 any of those 3 buttons of the group to get it working.
2 of those buttons: GOOD
3 of those buttons: EXCEPTION

 The problem also vanishes if I remove code from the buttons that
 reference
 the page implicitly like the following:

 == CODE ==

 public void onConfigure() {
super.onConfigure();
setEnabled(isFormEnabled()  isDetailObjectPersistent());
 }

 == == == ==

 Here isFormEnabled and isDetailObjectPersistent are methods of the PAGE
 not
 the buttons.

 Essentially it looks like there is a problem serializing the whole page,
 which is why the page map is null inside the following code block from
 WebRequestCycleProcessor.resolve:

 == CODE ==
if (requestParameters.isOnlyProcessIfPathActive())
{
.
if (pageMap == null) {
processRequest = 1;
}

}

 == == == ==

 I've tested all versions after 1.4.12 and they all show the same behavior
 while 1.4.12 itself works for this case.
 I don't think I'm able to reproduce this in a QuickStart without some
 major
 effort since there is a deep class hierarchy involved, but I guess this
 issue has something to do with WICKET-3108 (Problems with page maps
 stored
 in session). I've tried to do a QuickStart with a simple test page with
 nested classes - but that worked (sadly).

 Also I'm having one @SpringBean inside the page that is used by those
 buttons which seem to cause trouble.
 Maybe someone can point me in the right direction?

 Because of WICKET-3136 staying with 1.4.12 unfortunately is not an option
 for us.
 Any help is really appreciated.


 Kind regards,
 Daniel

 PS: I know no one is looking forward to digging into a serialization /
 page
 expired problem but maybe someone has mercy and helps me out on this one.

 -
 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




-- 
Pedro Henrique Oliveira dos Santos


Re: [wicket 1.5] Ajax recovery script

2011-02-07 Thread Pedro Santos
It possible to test if there in an AJAX activity by testing
the Wicket.Channel busy property. Those channels can be iterated on
 Wicket.channelManager.channels
If I got it right, than an JavaScript function can live testing this
property and, when an timeout was detected, invokes some callback that can
be the fallback to the baseurl.

On Mon, Feb 7, 2011 at 11:16 AM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 Hi

 Does anybody have a java script which does the following modification to
 wicket's ajax:

 If the server are to long to respond, the script automatically invokes
 fallback to the baseurl for the page?


 I guess you could also have some reverse heartbeat technique, that would
 update a timer, and when the timer reaches 0 it just tries to refresh the
 page manually..However I'd also like for the manual refresh to wait for the
 server comes up.. Any snipplets or ides?

 regards Nino




-- 
Pedro Henrique Oliveira dos Santos


Re: Question about Unit Testing with custom Session

2011-02-07 Thread Pedro Santos
I guess the problem is on the ApplicationContext object. Debug its creation
and see if it has all your beans. You can use another implementation for
tests, ex: FileSystemXmlApplicationContext

On Mon, Feb 7, 2011 at 11:10 AM, Dmitriy Neretin 
dmitriy.nere...@googlemail.com wrote:

 Hello everybody,

 After integration with spring I have following problem:

 if I add following to my CustomSession:

 InjectorHolder.getInjector().inject(this); (because I store some spring
 beans in the custom session)

 My WicketTester doesn't work anymore. I get this exception:
 BeanFactory not initialized or already closed - call 'refresh' before
 accessing beans via the ApplicationContext

 What I have done in my Unit Tests:

 @Before
public void setUp() {
MworldWicketApplication wicketWebApp = new MworldWicketApplication()
 {

ApplicationContext ctx = new XmlWebApplicationContext();

@Override
public void init() {
addComponentInstantiationListener(new
 SpringComponentInjector(this, ctx, true));
}
};

 And I don't really understand what to do now :)

 Can somebody help me?

 P. S. The Application works. Affected are only unit tests




-- 
Pedro Henrique Oliveira dos Santos


Re: Question about Unit Testing with custom Session

2011-02-07 Thread Martijn Dashorst
Did you provide the application to the wicket tester?

WicketTester tester = new WicketTester(myapp);

Martijn

On Mon, Feb 7, 2011 at 2:10 PM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Hello everybody,

 After integration with spring I have following problem:

 if I add following to my CustomSession:

 InjectorHolder.getInjector().inject(this); (because I store some spring
 beans in the custom session)

 My WicketTester doesn't work anymore. I get this exception:
 BeanFactory not initialized or already closed - call 'refresh' before
 accessing beans via the ApplicationContext

 What I have done in my Unit Tests:

 @Before
    public void setUp() {
        MworldWicketApplication wicketWebApp = new MworldWicketApplication()
 {

            ApplicationContext ctx = new XmlWebApplicationContext();

            @Override
            public void init() {
                addComponentInstantiationListener(new
 SpringComponentInjector(this, ctx, true));
            }
        };

 And I don't really understand what to do now :)

 Can somebody help me?

 P. S. The Application works. Affected are only unit tests




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: [1.5 RC1] Error serializing object class

2011-02-07 Thread Pedro Santos
The next RC should give you an better message:
https://issues.apache.org/jira/browse/WICKET-3354

On Mon, Feb 7, 2011 at 9:25 AM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 I hope it's not this one:

@Inject
private transient Injector injector;

 I have several others, are there any way to discover which resource it's
 talking about, can I step through it?

 2011/2/7 Major Péter majorpe...@sch.bme.hu

  Hi,
 
  in your DriverSetupPage you have an injected resource, which's equals
  method can not handle null arguments.
 
  Regards,
  Peter
 
 
  On 2011-02-07 12:11, nino martinez wael wrote:
 
  One of my pages fails with this, im a little bit unsure what is causing
  the
  error im using guice:
 
  2011-02-07 12:07:10,112 ERROR
 [org.apache.wicket.util.lang.WicketObjects]
   -
  Error serializing object class
  com.netdesign.wallboard.page.DriverSetupPage
  [object=[Page class = com.netdesign.wallboard.page.DriverSetupPage, id =
  3,
  render count = 1]]
  java.lang.NullPointerException
  at $Proxy37.equals(Unknown Source)
  at java.util.Vector.indexOf(Vector.java:361)
  at java.util.Vector.contains(Vector.java:320)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:344)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:418)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
  at
 
 
 org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:702)
  at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
  at
 
 
 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
  at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
  at
 
 
 org.apache.wicket.util.lang.WicketObjects.objectToByteArray(WicketObjects.java:482)
  at
 
 
 org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:364)
  at
 
 
 org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:153)
  at
 
 
 org.apache.wicket.page.PersistentPageManager$PersitentRequestAdapter.storeTouchedPages(PersistentPageManager.java:335)
  at
 
 
 org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:185)
  at
 
 
 org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
  at
 
 
 org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
  at
 
 
 org.apache.wicket.page.PageAccessSynchronizer$1.commitRequest(PageAccessSynchronizer.java:203)
  at org.apache.wicket.Application$2.onDetach(Application.java:1507)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:99)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:95)
  at
 
 
 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:79)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:93)
  at
 
 org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:505)
  at
 
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:251)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
  at
 
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at
 
 
 

Re: Question about Unit Testing with custom Session

2011-02-07 Thread Dmitriy Neretin
Hi,

of course. The point is if I delete this:

InjectorHolder.getInjector().inject(this);

from my session class everything works fine :(

On 7 February 2011 15:27, Martijn Dashorst martijn.dasho...@gmail.comwrote:

 Did you provide the application to the wicket tester?

 WicketTester tester = new WicketTester(myapp);

 Martijn

 On Mon, Feb 7, 2011 at 2:10 PM, Dmitriy Neretin
 dmitriy.nere...@googlemail.com wrote:
  Hello everybody,
 
  After integration with spring I have following problem:
 
  if I add following to my CustomSession:
 
  InjectorHolder.getInjector().inject(this); (because I store some spring
  beans in the custom session)
 
  My WicketTester doesn't work anymore. I get this exception:
  BeanFactory not initialized or already closed - call 'refresh' before
  accessing beans via the ApplicationContext
 
  What I have done in my Unit Tests:
 
  @Before
 public void setUp() {
 MworldWicketApplication wicketWebApp = new
 MworldWicketApplication()
  {
 
 ApplicationContext ctx = new XmlWebApplicationContext();
 
 @Override
 public void init() {
 addComponentInstantiationListener(new
  SpringComponentInjector(this, ctx, true));
 }
 };
 
  And I don't really understand what to do now :)
 
  Can somebody help me?
 
  P. S. The Application works. Affected are only unit tests
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com

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




Re: TextField submit via Ajax

2011-02-07 Thread jensiator

Thanks. I have been looking for this for s long. Thank again. 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-submit-via-Ajax-tp3002094p3264367.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: AjaxFormChoiceComponentUpdatingBehavior on RadioGroup

2011-02-07 Thread ilde...@gmail.com
Did you succeed in making AjaxFormChoiceComponentUpdatingBehavior work
on a RadioGroup?
I can't make it work, wicket 1.4.14

I need to save the selected value to my model object when a Radio in
the RadioGroup is selected.
This becaus every time an option is selected in the form, the whole
form is reloaded to see if some new condition is met and something new
becomes visible/enabled.
So in reloading the model, if I did not persist the values via Ajax
before, I lost user selection.

I am succeding in doing this with
AjaxFormChoiceComponentUpdatingBehavior on a RadioChoice but can't
figure out how to get the ajax callback on a Radio selection in a
RadioGroup.

any hint?

2010/4/9 Robert Gründler rob...@dubture.com:
 Hi all,

 i'm trying to use the AjaxFormChoiceComponentUpdatingBehavior on a RadioGroup 
 component,
 unfortunately, no ajax request is triggered when the RadioBoxes are clicked.

 Here's the code i'm using right now:

 Form form = new Form(addressform);
 String[] choices = new String[]{ Wicket, Spring, DB4O };
 group = new RadioGroup(group, new ModelString());
 ListViewString deliveryAddresses = new 
 ListViewString(deliveryaddresses, Arrays.asList(choices)) {
        @Override
        protected void populateItem(ListItemString item) {
                item.add(new RadioString(group-choice, new 
 ModelString()));
        }
 };

 group.setOutputMarkupId(true);
 group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
        @Override
        protected void onUpdate(AjaxRequestTarget target) {
                System.out.println(on change);
        }
 });
 group.add(deliveryAddresses);
 form.add(group);
 add(form);

 /* markup */

 wicket:panel
        form wicket:id=addressform
                table
                        span wicket:id=group
                                tr wicket:id=deliveryaddresses
                                        tdinput type=radio 
 wicket:id=group-choice//td
                                /tr
                        /span
                /table
        /form
 /wicket:panel


 Has anyone an idea what i might be missing ?


 thanks!

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





-- 
Daniele Dellafiore
http://danieledellafiore.net

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



Re: [1.5 RC1] Error serializing object class

2011-02-07 Thread nino martinez wael
Is it close to get released?
On Feb 7, 2011 3:29 PM, Pedro Santos pedros...@gmail.com wrote:

 The next RC should give you an better message:
 https://issues.apache.org/jira/browse/WICKET-3354

 On Mon, Feb 7, 2011 at 9:25 AM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

  I hope it's not this one:
 
 @Inject
 private transient Injector injector;
 
  I have several others, are there any way to discover which resource it's
  talking about, can I step through it?
 
  2011/2/7 Major Péter majorpe...@sch.bme.hu
 
   Hi,
  
   in your DriverSetupPage you have an injected resource, which's equals
   method can not handle null arguments.
  
   Regards,
   Peter
  
  
   On 2011-02-07 12:11, nino martinez wael wrote:
  
   One of my pages fails with this, im a little bit unsure what is
causing
   the
   error im using guice:
  
   2011-02-07 12:07:10,112 ERROR
  [org.apache.wicket.util.lang.WicketObjects]
-
   Error serializing object class
   com.netdesign.wallboard.page.DriverSetupPage
   [object=[Page class = com.netdesign.wallboard.page.DriverSetupPage,
id =
   3,
   render count = 1]]
   java.lang.NullPointerException
   at $Proxy37.equals(Unknown Source)
   at java.util.Vector.indexOf(Vector.java:361)
   at java.util.Vector.contains(Vector.java:320)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:344)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:418)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:633)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.internalCheck(SerializableChecker.java:556)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:352)
   at
  
  
 
org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.java:702)
   at
  java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
  
  
 
org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
   at
  java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
   at
  
  
 
org.apache.wicket.util.lang.WicketObjects.objectToByteArray(WicketObjects.java:482)
   at
  
  
 
org.apache.wicket.pageStore.DefaultPageStore.serializePage(DefaultPageStore.java:364)
   at
  
  
 
org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:153)
   at
  
  
 
org.apache.wicket.page.PersistentPageManager$PersitentRequestAdapter.storeTouchedPages(PersistentPageManager.java:335)
   at
  
  
 
org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:185)
   at
  
  
 
org.apache.wicket.page.AbstractPageManager.commitRequest(AbstractPageManager.java:98)
   at
  
  
 
org.apache.wicket.page.PageManagerDecorator.commitRequest(PageManagerDecorator.java:68)
   at
  
  
 
org.apache.wicket.page.PageAccessSynchronizer$1.commitRequest(PageAccessSynchronizer.java:203)
   at
org.apache.wicket.Application$2.onDetach(Application.java:1507)
   at
  
  
 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:99)
   at
  
  
 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$4.notify(RequestCycleListenerCollection.java:95)
   at
  
  
 
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:79)
   at
  
  
 
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onDetach(RequestCycleListenerCollection.java:93)
   at
  
 
org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:505)
   at
  
  
 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:251)
   at
  
  
 

Re: TextField submit via Ajax

2011-02-07 Thread msj121

If you have multiple html text input elements you can insert the javascript
below in your document etc The only thing new in wicket is that you
simply need to add a callback to your java method, which you can learn about
here (I made a video for this type of issue): 
http://www.youtube.com/watch?v=aqNQShdSOvM
http://www.youtube.com/watch?v=aqNQShdSOvM 

left out of your code post, but you should need an
AjaxFormSubmitBehavior(onkeydown) as Martin pointed out, so for other
users you should post a more complete solution instead of simply script.
But everyone does appreciate you left something for the next person.

function cancelEvent(event){
  event.cancelBubble = true;
  if (event.stopPropagation) event.stopPropagation();
}
if (typeof window.event == 'undefined'){
   document.onkeypress = function(e){
var test_var=e.target.nodeName.toUpperCase();
if (e.target.type) var test_type=e.target.type.toUpperCase();
if ((test_var == 'INPUT'  test_type == 'TEXT') || test_var ==
'TEXTAREA'){
  return e.keyCode;
}else if (e.keyCode == 13){
submit form
  e.preventDefault();
}
   }
 }else{
   document.onkeydown = function(){
var test_var=event.srcElement.tagName.toUpperCase();
if (event.srcElement.type) var
test_type=event.srcElement.type.toUpperCase();
if ((test_var == 'INPUT'  test_type == 'TEXT') || test_var ==
'TEXTAREA'){
  return event.keyCode;
}else if (event.keyCode == 13){
submit value
  event.returnValue=false;
}
   }
 }

Matthew


Altuğ Bilgin Altıntaş wrote:
 
 Hi Martin;
 
 It works thanks; but my condition needs onkeydown anyway  now i am
 posting
 the complete solution for others
 
 Code goal : user enters some char in textfield and press enter, and data
 comes via ajax.
 
 final TextFieldString txtMy= new TextFieldString(txtMy, new
 Model())
 ;
 txtMy.add(new AjaxFormComponentUpdatingBehavior(onkeydown) {
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
 //...
 }
 
 @Override
 protected IAjaxCallDecorator getAjaxCallDecorator() {
 return new AjaxCallDecorator() {
 private static final long serialVersionUID = 1L;
 
 @Override
 public CharSequence decorateScript(CharSequence
 script)
 {
 return if(wicketKeyCode(event) == 13){ + script
 +
  return false;};
 }
 };
 }
 ;
 });
 
 Altug.
 
 2010/10/19 Martin Grigorov mgrigo...@apache.org
 
 1. you need AjaxFormSubmitBehavior(onkeyup)
 2. you'll have to add AjaxCallDecorator to it do fire only when the key
 is
 ENTER, i.e. event.keyCode === 13

 2010/10/19 Altuğ Bilgin Altıntaş alt...@gmail.com

  Hi;
 
  How can i submit a form via Ajax when user hit the enter key on a
 TextField
  ?
 
  I did below but it doesn't work.
 
  myTextField.add(new AjaxFormComponentUpdatingBehavior(onsubmit) {
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
//...
 
 }
 
   });
 
  Thanks.
 

 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-submit-via-Ajax-tp3002094p3264785.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



AjaxCheckBox not Disabling Checkbox on call to onUpdate

2011-02-07 Thread sheadley3228

I have a problem updating my check box on a call to onUpdate of a
AjaxCheckBox component.

Within my PageableListView populateItem call:


AjaxCheckBox ajaxCheck = null;
PageableListView userSearchPageView = new PageableListView(mychanges,
userSearchResults, RECORDS_PER_PAGE) 
  {
@Override
protected void populateItem(ListItem arg0) {
 ...
 ... 
 ... /* I create an AjaxCheckBox */
   ajaxCheck = new AjaxCheckBox(verifyflag, new
PropertyModel(ResultPage.this, checkFalse))
 {
@Override
protected void onUpdate(AjaxRequestTarget arg1) {

ajaxCheck.setOutputMarkupId(true);
  ajaxCheck.setEnabled(false);
  arg1.addComponent(ajaxCheck);
  }
   }
   
   This does not disable my checkbox. Any Help would greatly be appreciated.


Regards,

sheadley  
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxCheckBox-not-Disabling-Checkbox-on-call-to-onUpdate-tp3264816p3264816.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: AjaxCheckBox not Disabling Checkbox on call to onUpdate

2011-02-07 Thread Pedro Santos
Sheadley, ListView re-create its list items every request by default, see
ListView#setReuseItems, RepeatingView and
http://wicketinaction.com/2008/10/building-a-listeditor-form-component/ .
Than you can chose your solution

On Mon, Feb 7, 2011 at 4:57 PM, sheadley3228
steven.head...@cats.usdoj.govwrote:


 I have a problem updating my check box on a call to onUpdate of a
 AjaxCheckBox component.

 Within my PageableListView populateItem call:


 AjaxCheckBox ajaxCheck = null;
 PageableListView userSearchPageView = new PageableListView(mychanges,
 userSearchResults, RECORDS_PER_PAGE)
  {
@Override
protected void populateItem(ListItem arg0) {
 ...
 ...
 ... /* I create an AjaxCheckBox */
   ajaxCheck = new AjaxCheckBox(verifyflag, new
 PropertyModel(ResultPage.this, checkFalse))
 {
@Override
protected void onUpdate(AjaxRequestTarget arg1)
 {

 ajaxCheck.setOutputMarkupId(true);
  ajaxCheck.setEnabled(false);
  arg1.addComponent(ajaxCheck);
  }
   }

   This does not disable my checkbox. Any Help would greatly be appreciated.


 Regards,

 sheadley
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxCheckBox-not-Disabling-Checkbox-on-call-to-onUpdate-tp3264816p3264816.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




-- 
Pedro Henrique Oliveira dos Santos


FOSDEM 2011 presentation online

2011-02-07 Thread Martijn Dashorst
The presentation on Wicket I gave at FOSDEM is online:
http://wicketinaction.com/2011/02/fosdem-wicket-presentation/

Features a short introduction at at about 50% the presentation shifts
to features from 1.5

Martijn

-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: WicketTester and the test of image visibility

2011-02-07 Thread Igor Vaynberg
most of our unit tests check the markup, see there.

-igor

On Fri, Feb 4, 2011 at 1:19 AM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Could you provide me a simple exmaplte how can I do that?

 Thank you!

 On 3 February 2011 18:33, Igor Vaynberg igor.vaynb...@gmail.com wrote:

 visibility can be triggered from a lot of places, isvisible() only
 checks the visibility flag. the best way to test it is to see if the
 image tag appears in the rendered markup.

 -igor

 On Thu, Feb 3, 2011 at 1:16 AM, Dmitriy Neretin
 dmitriy.nere...@googlemail.com wrote:
  Hello everybody!
 
  Is the WicketTester method isVisible() the right solution to test if the
  Image is shown on the webpage?
 
  Thank you!
 

 -
 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: FOSDEM 2011 presentation online

2011-02-07 Thread shetc

Great presentation!

https://cwiki.apache.org/WICKET/migration-to-wicket15.html
https://cwiki.apache.org/WICKET/migration-to-wicket15.html 

doesn't seem to work.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FOSDEM-2011-presentation-online-tp3264941p3265463.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: FOSDEM 2011 presentation online

2011-02-07 Thread Pedro Santos
Amazing Martijn! Thank u for sharing.

On Mon, Feb 7, 2011 at 5:50 PM, Martijn Dashorst martijn.dasho...@gmail.com
 wrote:

 The presentation on Wicket I gave at FOSDEM is online:
 http://wicketinaction.com/2011/02/fosdem-wicket-presentation/

 Features a short introduction at at about 50% the presentation shifts
 to features from 1.5

 Martijn

 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com

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




-- 
Pedro Henrique Oliveira dos Santos


[Announce] wicketstuff-core 1.5-RC1.1 released

2011-02-07 Thread Michael O'Cleirigh

Hello,

I have cut a point release for wicketstuff-core version 1.5-RC1.1.  This 
is the second release against the wicket 1.5-RC1 version.


There were problems with my release process for the wicketstuff-core 
1.5-RC1 version (I promoted incomplete repositories) and the wicket 
trunk 1.5-SNAPSHOT is now different from the 1.5-RC1 version.


The artifacts have been promoted and synced into the maven central 
repository.


They can be retrieved like this:

dependency
groupIdorg.wicketstuff/groupId
artifactIdpush-core/artifactId
version1.5-RC1.1/version
/dependency

The release tag is here: 
https://github.com/wicketstuff/core/tree/wicketstuff-core-1.5-RC1.1


Development on the next release takes place on the master branch here: 
https://github.com/wicketstuff/core


If you find issues they can be recorded here: 
https://github.com/wicketstuff/core/issues


The plan is to wait until the wicket 1.5-RC2 version is released before 
releasing again.  If it takes more than a month for this to happen
I might cherry-pick the patches that will apply with wicket 1.5-RC1 but 
I hope to not have to.


If you commit code and/or want a release sooner let me know as one month 
is the worst case target.


Regards,

Mike

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



Best practices in model classes definitions

2011-02-07 Thread Robson Paniago de Miranda
Hi,

I'm new to Wicket, and, after reading the documentation, there are
still some doubts about the correct usage patterns of
IModel-implementing classes:

For what I could see, In the case of CompoundPropertyModel, it is best
to attach them to a high-level container, such as the page. Also,
since it is detached in the container's detach() method, they can't be
used outside the container In which they are attached. Is my
understanting correct?

I also have a doubt WRT the correct creation of a model used in
Dropdown fields. In my case, the falhes the user can select depends on
the model object, so I use, in it's load() method something like:
Object load() {
  int max= ((ObjectModel)getDefaultObject()).getMaximum();
  ArrayListInteger r = new ArrayListInteger();
  for (int i = 1; i = max; i++)
 r.add(i);
  return r;
}
Is this pattern correct?

Also, it is an acceptable pattern to define the model classes as inner
classes In the page class? If I define them outside, the @SpringBean
annotation will work when used in these classes?

Thanks,
 Robson

-- 
Att,
  Robson Paniago

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



Does anyone have example code using wicketstuff-dojo-api?

2011-02-07 Thread Michael O'Cleirigh

Hello,

In wicket 1.3.x there was a fairly comprehensive dojo integration.  The 
examples are still visible on the wicketstuff.org site.


At some point the wicketstuff-dojo and wicketstuff-dojo-examples were 
archived into the attic in svn. This version used dojo version 0.4


Later there was a wicketstuff-dojo targeting version 1.1 that supported 
a smaller subset of the components.


There were two modules:
1. wicketstuff-dojo-api containing the java api
2. wicketstuff-dojo-resources containing an ant plugin to download the 
dojo files.


A user posted here on wanting to use dojo and being unaware of the 
previous history I pulled the source in from the sandbox repository back 
into core-1.4.x.


I found out how to get rid of the dojo-resources project altogether and 
use the maven-dependency-plugin to bundle the dojo javascript files 
within the dojo-api jar.


I have a branch in my fork of wicketstuff-core that contains:
1. dojo-original (0.4 version api)
2. dojo-original-examples (0.4 version examples)
3. dojo-api (1.4.3 version that bundles the javascript into the 
resultant jar)


Link: 
https://github.com/mocleiri/core/tree/dojo-1.4.x/jdk-1.5-parent/dojo-parent


I'm looking for an example application that is closer to working then 
the dojo-original-examples which is very different.  If I can get 
something that will run with my changes work I would keep the dojo 
version in core-1.4.x otherwise I think I will put it back into the sandbox.


Even an application with a single interface control would let me see if 
the javascript is being exported properly.


Thanks for your help,

Mike








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



Re: How to set Wicket with embedded Jetty?

2011-02-07 Thread Surapol Pairojtanachai

Yes, it is working now. Thank you very much.

Surapol


On 02/07/2011 03:17 PM, Attila Király wrote:

Hi Surapol,

Try adding this before registering the filter:

filterHolder.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, /*);

It seems wicket is not parsing the web.xml if that init parameter is
present.

Attila

2011/2/7 Surapol Pairojtanachaisura...@bridsystems.com


I can easily create embedded jetty project (java web project without
WEB-INF and web.xml), hence a very modular web server for many purposes. No
need to have configuration for a simple/quick fix and small web server. Only
embedded jetty with Wicket that I cannot do. It seems Wicket is really
fixated to web.xml. Can this character be bypassed?

Thanks,
Surapol

On 02/07/2011 11:56 AM, James Carman wrote:


This is not a Wicket question, then.  I'd try the Jetty mailing lists.

On Sun, Feb 6, 2011 at 11:47 PM, Surapol Pairojtanachai
sura...@bridsystems.com   wrote:


It doesn't create wicket project with embedded jetty. By embedded jetty,
I
mean no web.xml file. Is this possible?

Regards,
Surapol

On 02/07/2011 11:28 AM, James Carman wrote:


Why don't you try creating a quickstart
(http://wicket.apache.org/start/quickstart.html) and just copy the
code from the Start class that's provided for you there?


On Sun, Feb 6, 2011 at 8:58 PM, Surapol Pairojtanachai
sura...@bridsystems.com wrote:


Please guide me on how to set Wicket to run with embedded Jetty. I run
the code below and keep getting java.lang.IllegalStateException:
filter
path was not configured.

Thanks in Advance,
Surapol Pairojtanachai

   Server server = new Server();
   SelectChannelConnector connector = new SelectChannelConnector();
   connector.setHost(localhost);
   connector.setPort(8080);
   server.setConnectors(new Connector[] { connector });
   Context root = new Context(server, /, Context.SESSIONS);
 ServletHolder serverHolder = new ServletHolder(new
DefaultServlet());
   root.addServlet(serverHolder, /*);
   FilterHolder filterHolder = new FilterHolder(WicketFilter.class);



filterHolder.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM,
MyWebServer.class.getName());
   root.addFilter(filterHolder, /*, Handler.DEFAULT);
   server.start();
   server.join();



ubuntu 10.10 amd64
JDK 1.6.0.23 amd64
Jetty 6.1.26



-
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


  -

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: [1.5 MIGRATION] - Where did StringHeaderContributor / TextTemplateHeaderContributor go?

2011-02-07 Thread Igor Vaynberg
now every component and behavior implement iheadercontributor (have a
renderhead method) and the response has the same methods that the old
contributors had. you want to contribute something, just override
renderhead().

you can contribute the template using
response.renderjavascript(template.tostring())

-igor



On Mon, Feb 7, 2011 at 3:28 AM, Daniel Soneira
daniel.sone...@joyn-it.at wrote:
 The migration wiki does not contain information on renamed / substitution
 classes.
 I know AbstractHeaderContributor is a thing of the past but those classes
 could be converted into Behaviors quite easily.
 Was there a reason to get rid of them in 1.5?
 TextTemplate still exists but there is no easy (read: already in core) way
 to use them as header contributors.

 Cheers,
 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



Re: Question about Unit Testing with custom Session

2011-02-07 Thread Igor Vaynberg
make sure your setup() code runs before wicket tester instance is created.

-igor

On Mon, Feb 7, 2011 at 7:41 AM, Dmitriy Neretin
dmitriy.nere...@googlemail.com wrote:
 Hi,

 of course. The point is if I delete this:

 InjectorHolder.getInjector().inject(this);

 from my session class everything works fine :(

 On 7 February 2011 15:27, Martijn Dashorst martijn.dasho...@gmail.comwrote:

 Did you provide the application to the wicket tester?

 WicketTester tester = new WicketTester(myapp);

 Martijn

 On Mon, Feb 7, 2011 at 2:10 PM, Dmitriy Neretin
 dmitriy.nere...@googlemail.com wrote:
  Hello everybody,
 
  After integration with spring I have following problem:
 
  if I add following to my CustomSession:
 
  InjectorHolder.getInjector().inject(this); (because I store some spring
  beans in the custom session)
 
  My WicketTester doesn't work anymore. I get this exception:
  BeanFactory not initialized or already closed - call 'refresh' before
  accessing beans via the ApplicationContext
 
  What I have done in my Unit Tests:
 
  @Before
     public void setUp() {
         MworldWicketApplication wicketWebApp = new
 MworldWicketApplication()
  {
 
             ApplicationContext ctx = new XmlWebApplicationContext();
 
             @Override
             public void init() {
                 addComponentInstantiationListener(new
  SpringComponentInjector(this, ctx, true));
             }
         };
 
  And I don't really understand what to do now :)
 
  Can somebody help me?
 
  P. S. The Application works. Affected are only unit tests
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.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