A lesson learned about wicket

2011-12-14 Thread Martin Makundi
Hi! Today I have learned about a huge misconception I have had about wicket 1.4. I have actually been thinking that it is an MVC framework. But it is practically not. Why? Wicket's request cycle and serialization process makes effortless MVC design almost impossible. It seems like wicket is

Re: A lesson learned about wicket

2011-12-14 Thread Sven Meier
Hi Martin, I have actually been thinking that [Wicket] is an MVC framework. Looking at all the other MVC web frameworks I'm glad it isn't. What issues are you trying to solve actually? Sven Am 14.12.2011 09:12, schrieb Martin Makundi: Hi! Today I have learned about a huge misconception I

Google map without GMap2

2011-12-14 Thread toytown
Currently I am using GMap2 but my app needs a Stateless page. So wheneever I add GMap2 panel the page becomes Stateful since GMap2 is a stateful component. I tried to refactor the GMap2 but it seems not to be designed for extensibility as most methods and fields are privat. All I need is a

Re: display artifact version in webpage

2011-12-14 Thread Ernesto Reinaldo Barreiro
Application.getFrameworkSettings().getVersion()? On Wed, Dec 14, 2011 at 11:33 AM, Sjoerd Schunselaar s.schunsel...@gmail.com wrote: Hi all, Is there a easy way to display the artifact version which can be set in de maven pom.xml file? I would like to display that artifact version in the

Re: display artifact version in webpage

2011-12-14 Thread Sjoerd Schunselaar
That is the Wicket version, I mean the version of my project which can be set in the pom file. modelVersion4.0.0/modelVersion groupIdnl.sjoerd.test/groupId artifactIdprojectx/artifactId version0.0.6/version packagingwar/packaging nameprojectx/name Kind regards, Sjoerd

Re: Google map without GMap2

2011-12-14 Thread Sven Meier
Hi, with a small tweak GMap2 can be made stateless when no markers are present: --- a/jdk-1.5-parent/gmap2-parent/gmap2/src/main/java/wicket/contrib/gmap/GMap2.java +++ b/jdk-1.5-parent/gmap2-parent/gmap2/src/main/java/wicket/contrib/gmap/GMap2.java @@ -823,6 +823,11 @@ public class GMap2

Re: display artifact version in webpage

2011-12-14 Thread Ernesto Reinaldo Barreiro
Oops... This is what wicket does public String getVersion() { String implVersion = null; Package pkg = getClass().getPackage(); if (pkg != null) { implVersion = pkg.getImplementationVersion(); } return Strings.isEmpty(implVersion) ? n/a : implVersion; } Maybe you can do the same for one of your

Re: display artifact version in webpage

2011-12-14 Thread Martin Schayna
It has nothing to do with Wicket but Maven. Anyway, I use this config on maven-jar-plugin which inserts Implementation-Version attribute into manifest: plugin artifactIdmaven-jar-plugin/artifactId version2.3/version configuration archive manifest

Re: A lesson learned about wicket

2011-12-14 Thread Martin Makundi
Hi! I have actually been thinking that [Wicket] is an MVC framework. Looking at all the other MVC web frameworks I'm glad it isn't. What issues are you trying to solve actually? That's a long story. We have complex business logic in complex multidimensional forms... yeah, don't try handling

Visiting children and adding updatingBehavior

2011-12-14 Thread Daniele Dellafiore
Hi. I'm using this code http://pastebin.com/xezKCjPS to add a specific behavior to all the FormComponent that are contained in the WebMarkupContainer container. It seems to me that it does not really add to all the formComponent for two reason: I never see the system out in the onUpdate method

Re: display artifact version in webpage

2011-12-14 Thread Chantal Ackermann
Hi Sjoerd, my way of doing this is directly from pom to html using filtering. Add ${project.version} into the markup (for me, I add it into a top bar shared by all pages). Change the pom.xml resources configuration to filter either all html files or only that specific one. (I've simply changed

Re: A lesson learned about wicket

2011-12-14 Thread Peter Ertl
Hi Martin, trying to give you a qualified opinion on your post... Am 14.12.2011 um 09:12 schrieb Martin Makundi: Hi! Today I have learned about a huge misconception I have had about wicket 1.4. I have actually been thinking that it is an MVC framework. But it is practically not. Why?

Re: PagingNavigator container instead of link for previous and next

2011-12-14 Thread infiniter
That won't work... That's why I took the time to explain that the class name has to be applied to to li and not to the actual link. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PagingNavigator-container-instead-of-link-for-previous-and-next-tp4192293p4194721.html

Suppress page serialization

2011-12-14 Thread Stefan Lindner
Given is a Page 0 with an object. The object has a given value X; On the Page 0 resides an AjaxLink that opens a new Page 1 in a Wicket ModalWindow. The Content is a Page, not a Panel. Page 1 knows the object, the object is a parameter in page constructor. Modifying object to Y and closing page

Re: Google map without GMap2

2011-12-14 Thread toytown
Thanks for a quick reply. To correct a little bit - the method signature should be protected. Also the component are by default stateless . I also refactored getJSinit() method to remove some listeners or behaviours which case the statless nature to change to stateful. This is because the class

JavaScript noJavaScript Navigation

2011-12-14 Thread daslicht
Hello, is it possible that I could create a website which consists of multiple pages with dynamic content, such as tables/lists of products. This would ensure that the website could be easily crawled by a Search Engine without any extra efford. If a visitor has JavaScript enabled I just like to

Re: Throwing RestartResponseException within RequestCycleListener [1.5 - incl. quickstart]

2011-12-14 Thread Martin Grigorov
Hi, No need to throw exceptions. You just need to return IRequestHandler impl that should be used to handle the error (I assume you talk about IRequestCycleListener#onException()) Try with: return new RenderPageRequestHandler(new PageProvider(SomePage.class)) On Wed, Dec 14, 2011 at 4:20 PM,

Re: PagingNavigator container instead of link for previous and next

2011-12-14 Thread infiniter
I decided to remove the link component from the Paginator and attach it to a container and then add the container to the Paginator... Maybe the least worst option. -- View this message in context:

Re: Throwing RestartResponseException within RequestCycleListener [1.5 - incl. quickstart]

2011-12-14 Thread Daniel Soneira
The code doing the redirect implements IRequestCycleListener#onBeginRequest - which returns void. Here's the code snippet: @Override public void onBeginRequest(RequestCycle cycle) { Session session = Session.get(); if (session.getMetaData(REDIRECTED_JSESSIONID) == null)

Re: A lesson learned about wicket

2011-12-14 Thread Martin Makundi
Hi! Wicket (View) - Facade - (Model, Controller) Wicket (View) - Controller - Facade (using interface IModel) + direct model access - Model (Data) No. If contorller is touched by Wicket, it spoils the state. I know your proposal works in simple situations, but when you have lots of players,

Re: JavaScript noJavaScript Navigation

2011-12-14 Thread Pedro Santos
Hi, you can add the body as a WebMarkupContainer, set it to output its markup id, and replace it by decorating the AJAX response with the transition effect JS. If the client is using IE you just redirect it him to the target page. Pedro Henrique Oliveira dos Santos 2011/12/14 daslicht

AW: JavaScript noJavaScript Navigation

2011-12-14 Thread daslicht
Hi, Thank you for your answer! I am going to try Wicket now. Cheers Marc Von: Pedro Santos [via Apache Wicket] [mailto:ml-node+s1842946n419546...@n4.nabble.com] Gesendet: Mittwoch, 14. Dezember 2011 16:47 An: daslicht Betreff: Re: JavaScript noJavaScript Navigation Hi, you can add

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
Hi Thomas, encoding the page ID in the URL would respond an expired page. Pedro Henrique Oliveira dos Santos 2011/12/14 Thomas Götz t...@decoded.de The situation: I have a mounted page containing several AJAX components. Whenever the session expires and an AJAX request is triggered

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Thomas Götz
Can you give an example? AFAIK the pageId *is* already encoded in the URL bei Wicket, i.e. the URL changes to http://my.domain/foobar?0 when the page is rendered. Doing AJAX requests on the page does not change the URL though … Cheers, -Tom Pedro Santos wrote: Hi Thomas, encoding the

Re: Suppress page serialization

2011-12-14 Thread Pedro Santos
Hi Stefan, does it makes sense to move this object to the session? Make sure you make your page instance manager touching each affected page after to change the object. e.g. Session.get().touch(affectedPage); Pedro Henrique Oliveira dos Santos 2011/12/14 Stefan Lindner lind...@visionet.de

Re: A lesson learned about wicket

2011-12-14 Thread Igor Vaynberg
a simpler approach: https://www.42lines.net/2011/12/01/simplifying-non-trivial-user-workflows-with-conversations/ -igor On Wed, Dec 14, 2011 at 12:12 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Today I have learned about a huge misconception I have had about wicket 1.4.

Re: Visiting children and adding updatingBehavior

2011-12-14 Thread Igor Vaynberg
where are you calling that code from? -igor On Wed, Dec 14, 2011 at 3:34 AM, Daniele Dellafiore ilde...@gmail.com wrote: Hi. I'm using this code http://pastebin.com/xezKCjPS to add a specific behavior to all the FormComponent that are contained in the WebMarkupContainer container. It

Re: Throwing RestartResponseException within RequestCycleListener [1.5 - incl. quickstart]

2011-12-14 Thread Daniel Soneira
OK, I've managed to get rid of all exceptions that were logged. Here's the working code: @Override public void onBeginRequest(RequestCycle cycle) { Session session = Session.get(); if (session.getMetaData(REDIRECTED_JSESSIONID) == null) { logger.debug(first

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
Bleh, my bad, PageProvider will give you a fresh page since the MountedMapper were able to resolve the target page class. You can customize PageProvider to throw a StalePageException based on custom rules. Don't know if it's the best option. Pedro Henrique Oliveira dos Santos 2011/12/14 Thomas

YUI sub menu not showing until refresh

2011-12-14 Thread jchappelle
Hi, We have been using the wicket-yui menu for some time now and I recently updated our jar file to the 1.4.15 version because of a problem we were hitting with the 1.4.2 version. Well it seems that we have traded one problem for another. The 1.4.15 version will not show the drop down icons for

pageMap locking issue

2011-12-14 Thread Karen Schaper
Hi, A user was testing a web application. Apparently they clicked on a link that opened a report and quickly clicked the link again. The web application became unusable and tomcat had to be restarted. If the issue was a long request time ( perhaps something was going on with the database at

Re: pageMap locking issue

2011-12-14 Thread Igor Vaynberg
this has been discussed many times on the list, search the archives... -igor On Wed, Dec 14, 2011 at 9:20 AM, Karen Schaper karen.scha...@gmail.com wrote: Hi, A user was testing a web application. Apparently they clicked on a link that opened a report and quickly clicked the link again.

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Thomas Götz
Don't know either, but since I don't have any other idea at the moment: how would I do this? Cheers, -Tom Pedro Santos wrote: Bleh, my bad, PageProvider will give you a fresh page since the MountedMapper were able to resolve the target page class. You can customize PageProvider to throw

Re: A lesson learned about wicket

2011-12-14 Thread Martin Makundi
a simpler approach: https://www.42lines.net/2011/12/01/simplifying-non-trivial-user-workflows-with-conversations/ Maybe yeah, but in our situation our model/controller complexity is almost like a relational db, so it will reside completely in its own layer facaded by entitymanager. Yeah,

Mapped resource reference and urlFor()

2011-12-14 Thread Bertrand Guay-Paquet
Hi, I am using resource references for the first time to implement fetching images from a DB. The URLs will be of the following form: /resources/dbImages/DB_ID.png where DB_ID is an identifier to retrieve the image from the DB. I'm using the article at

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
You can override the PageProvider#getPageInstance method and test for the target page class. If there are no instance for its page id and it is one of those pages you want to reply to user a page expired message rather than reply a fresh instance you throw a PageExpiredException exception (not a

RE: Suppress page versioning [was: Suppress page serialization]

2011-12-14 Thread Stefan Lindner
Yes, Pedro, putting things into Session would would work around this. But I would need to put everything into Session manually. Isn't there any trick that prohibits Components from being versioned? We don't need any backbutton support at all. We jut want to keep the page the same unchanged

Re: Mapped resource reference and urlFor()

2011-12-14 Thread Martin Grigorov
HI, On Wed, Dec 14, 2011 at 7:59 PM, Bertrand Guay-Paquet ber...@step.polymtl.ca wrote: Hi, I am using resource references for the first time to implement fetching images from a DB. The URLs will be of the following form: /resources/dbImages/DB_ID.png where DB_ID is an identifier to retrieve

Re: Mapped resource reference and urlFor()

2011-12-14 Thread Peter Ertl
Try to do the real work in the IResource#respond() (accessing the database and retrieving the image) and make calling the constructor cheap, then you should not have any bottlenecks at all. Am 14.12.2011 um 18:59 schrieb Bertrand Guay-Paquet: Hi, I am using resource references for the

Re: Suppress page versioning [was: Suppress page serialization]

2011-12-14 Thread Dan Retzlaff
Hi, Stefan. It might help to understand what you expect of Wicket: When the object in Page 2 is updated and serialized into the page map, you expect Wicket to know that it must also re-serialize Page 1 and Page 0 with the new object state. The way this happens is simple: if the Page 2 object

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Thomas Götz
Yes, that was what I had in mind. But where can I configure my custom PageProvider (i.e. that Wicket knows that my PageProvider implementation should be used)? Cheers, -Tom Pedro Santos wrote: You can override the PageProvider#getPageInstance method and test for the target page class.

Re: Mapped resource reference and urlFor()

2011-12-14 Thread Bertrand Guay-Paquet
@Peter: This is actually what I was doing already via the ByteArrayResource class! I just didn't notice that only the constructor was called... Thanks for opening my eyes! @Martin: In 1.5.3, I think the code you referenced is : // see if request handler addresses the resource we serve

Re: AJAX requests on a mounted page with expired session

2011-12-14 Thread Pedro Santos
Hi Thomas, I was looking at the code, there isn't a central place creating a PageProvider, which makes sense since it is designed to be created in multiple ways. I had another idea and I think it is best to create a custom MountedMapper that overrides the mapRequest method to implement your

Re: Spring + MongoDb

2011-12-14 Thread Uwe Schäfer
On 12/14/2011 06:51 AM, Jeff Schneller wrote: How stable is morphia? it did not change much for about a year now. it has its warts, but it works. (just like mongodb) it has 10gen backing, as scott is a 10gen employee. yes, we´re using it with wicket for almost 2 years now.

Re: POST parameters to a URL using wicket

2011-12-14 Thread Martin Grigorov
Hi, You can use java.net.HttpUrlConnection to do that if you want to avoid using additional library, like HttpClient. Otherwise the only similar functionality in Wicket is wicketAjaxPost(), part of wicket-ajax.js. On Thu, Dec 15, 2011 at 8:50 AM, raju.ch raju.challagun...@gmail.com wrote: Hi,