Group Select with Beans
I have 2 JavaBeans A & B. A has 2 fields: String name, Integer b_id. B has 2 fields: Integer id, String display. I have a list of beans for B: 1, "foo" 2, "bar" I have a single A bean, where its b_id corresponds to an id in bean B (basically the beans represent 2 tables in a DB with the ids as references to each other). I want to create a form to edit bean A which includes a drop-down for all the possible options for bean B. The one hitch is that I want groups for my drop-down, so I believe I'm forced to use Select & SelectOption with the appropriate mark-up in HTML. I have the form completed and working for changing A's name field, but I cannot figure out how to link the drop-down which displays all my options for bean B to A's b_id field. I'm using a PropertyModel to modify A's name field, and but I missing how to link A's b_id to the id from B. Also, my has values like option3, option4, option5... I would think I'd need these to be B's id field values for this to work. Any help in the right direction would be greatly appreciated. I'm very close, just missing this one link between my two models. Thanks in advance... Bill-
Re: IDataProvider#size()
On Wed, Apr 11, 2012 at 9:59 PM, Dan Retzlaff wrote: > For SQL-based views, the application complexity comes from the need to > construct a count(*) query with exactly the same criteria as the subsequent > result query. In my experience, this pollutes DAO interfaces and > IDataProvider implementation non-trivially. We initially had separate > methods for counting and querying (same args), but eventually moved to a > single method that returns a -tuple with both the results and > total size which our IDataProvider caches. This lets us do some Hibernate > trickery to introduce a MySQL SQL_CALC_FOUND_ROWS query hint, avoiding > separate count/results queries in most cases. It's still not simple, and > for large counts is still expensive. > > I faced something similar on an earlier project, just using straight JDBC (in Spring), and I ended up taking advice from a book; I made my query SELECT ..., COUNT(*) AS ct FROM ... WHERE ... and I added a ct variable to the class I was mapping to. A lot of extra data was returned, but it didn't slow things too much. I dout this would work well with a NoSQL database, and it is clumsy. Eric
Re: Same versioned link opens different pages on different machines
in that case a bit of logic in the page that checks the product id in onconfigure() against one in the model, and if they are different redirects to the correct page... -igor On Thu, Apr 12, 2012 at 1:56 PM, Bertrand Guay-Paquet wrote: >> you simply need to check what page class is mounted, and if the page >> retrieved by id is not of that class then dont render it but redirect >> to the bookmarkable url instead. >> >> -igor > > Both pages actually use the same MyPage.java class in this case. The only > difference is the page parameter encoded in the URL which presumably drives > a model. > > > - > 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: Same versioned link opens different pages on different machines
you simply need to check what page class is mounted, and if the page retrieved by id is not of that class then dont render it but redirect to the bookmarkable url instead. -igor Both pages actually use the same MyPage.java class in this case. The only difference is the page parameter encoded in the URL which presumably drives a model. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same versioned link opens different pages on different machines
On Thu, Apr 12, 2012 at 10:39 AM, Martin Grigorov wrote: > On Thu, Apr 12, 2012 at 7:47 PM, Bertrand Guay-Paquet > wrote: >> I don't know much about HybridUrlCodingStrategy since I use Wicket 1.5, but >> based on what you observed (.x changes on every render), I would say the x >> is the page version. >> >> I re-read your emails and if I understand correctly, both product 379 and >> 123 use the same page class. If that is the case, I don't think WICKET-4488 >> is the same problem. That issue concerns rendering a different *Page* class >> because of a page version id. In your case, the MyPage page class is the >> single page involved in both the wrong and right pages you see rendered. > > ^^This is what I tried to explain in my earlier mail. > > user1 visits /product/10.8 then goes to /product/20.9 > later user2 sends /product/30.8 to user1 > user1 opens /product/30.8 but actually sees product/10 because Wicket > loads page with id = 8 from the store ignoring the current request > parameter (10) > > So this is *not* covered by 4488! > And I see no way to detect such problem by having just the information > encoded in the url you simply need to check what page class is mounted, and if the page retrieved by id is not of that class then dont render it but redirect to the bookmarkable url instead. -igor > > >> >> I suggest putting a break point or logging code in your page's constructor >> to check 1) if a new page is created or an old version is displayed and 2) >> if the page parameters are properly decoded. >> >> >> On 12/04/2012 12:32 PM, Alec Swan wrote: >>> >>> "but because of the existence of a page with pageId 0 in the page >>> store user sees page1, not page2 as user2 intended" >>> >>> So, what is the page id in ../mp/oid/123.9 url? >>> >>> >>> On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynberg >>> wrote: On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov wrote: > > On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg > wrote: >> >> On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: >>> >>> Igor, >>> >>> The link I click ends with /mp/oid/123.9, where 123 is a product id. >>> However, when the page is rendered its URL changes to end with >>> /mp/oid/123.x where x is different every time. Moreover, the page is >>> displaying the wrong product 379! >>> >>> So, it's not the wrong version of the page, but the wrong product that >>> worries me. >>> >>> Can you explain this? >> >> i never once said the word "version" in my response :) i was, in fact, >> talking about page ids. i dont think the old hybrid url coding >> strategy checks the page id in its url against the mount. so in your >> session page 9 can be something entirely different. i believe this is >> what was fixed by WICKET-4488. > > Not exactly. > 4488 fixes the problem when user1 has opened page1?0. Then user2 sends > a url page2?0 to user1. > user1 opens this url but because of the existence of a page with > pageId 0 in the page store user sees page1, not page2 as user2 > intended. > > After 4488 Wicket will load page with id == 0 then it will check its > class against the class of the mountPoint and ignore the stored page > if they don't match. And will create a completely new instance of > mountPoint and show it to user1. I.e. a new instance of page2 > > I hope I described it clearly. i think thats *exactly* what i said... > >> -igor >> >> >>> Thanks, >>> >>> Alec >>> >>> On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet >>> wrote: Hi, A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From the work log: "There was code for this situation but it didn't cover the case 100%. Now if a request to page2?0 is made and the type of the found page with id=0 is not Page2 then a new instance of Page2 is instantiated." On 11/04/2012 5:56 PM, Igor Vaynberg wrote: > > page 5 in your session can be completely different then page 5 in > user's session. > > non-bookmarkable urls cannot be emailed...thats kind of the point. > > -igor > > On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan > wrote: >> >> Hello, >> >> I received a link from a customer to a versioned page (.version at >> the >> end of the URL). However, when I click on the link I see a >> completely >> different page. >> >> We are using Wicket 1.4.17 and the page is mounted as: >> >> mount(new HybridUrlCodingStrategy("mp", MyPage.class)); >> >> Why is this happening and how can I fix this? >> >> Thanks, >> >> Alec >
Re: Same versioned link opens different pages on different machines
When re-rendering a page, can you parse the new request URL and make sure all the parameters are the same as those used at construction? I don't think Wicket saves the original parameters now, but maybe it should. On Thu, Apr 12, 2012 at 12:15 PM, Alec Swan wrote: > "And I see no way to detect such problem by having just the > information encoded in the url" > This is VERY scary! > > How do I fix this? > > On Thu, Apr 12, 2012 at 11:39 AM, Martin Grigorov > wrote: > > On Thu, Apr 12, 2012 at 7:47 PM, Bertrand Guay-Paquet > > wrote: > >> I don't know much about HybridUrlCodingStrategy since I use Wicket 1.5, > but > >> based on what you observed (.x changes on every render), I would say > the x > >> is the page version. > >> > >> I re-read your emails and if I understand correctly, both product 379 > and > >> 123 use the same page class. If that is the case, I don't think > WICKET-4488 > >> is the same problem. That issue concerns rendering a different *Page* > class > >> because of a page version id. In your case, the MyPage page class is the > >> single page involved in both the wrong and right pages you see rendered. > > > > ^^This is what I tried to explain in my earlier mail. > > > > user1 visits /product/10.8 then goes to /product/20.9 > > later user2 sends /product/30.8 to user1 > > user1 opens /product/30.8 but actually sees product/10 because Wicket > > loads page with id = 8 from the store ignoring the current request > > parameter (10) > > > > So this is *not* covered by 4488! > > And I see no way to detect such problem by having just the information > > encoded in the url > > > > > >> > >> I suggest putting a break point or logging code in your page's > constructor > >> to check 1) if a new page is created or an old version is displayed and > 2) > >> if the page parameters are properly decoded. > >> > >> > >> On 12/04/2012 12:32 PM, Alec Swan wrote: > >>> > >>> "but because of the existence of a page with pageId 0 in the page > >>> store user sees page1, not page2 as user2 intended" > >>> > >>> So, what is the page id in ../mp/oid/123.9 url? > >>> > >>> > >>> On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynberg > > >>> wrote: > > On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov > > wrote: > > > > On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg< > igor.vaynb...@gmail.com> > > wrote: > >> > >> On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan > wrote: > >>> > >>> Igor, > >>> > >>> The link I click ends with /mp/oid/123.9, where 123 is a product > id. > >>> However, when the page is rendered its URL changes to end with > >>> /mp/oid/123.x where x is different every time. Moreover, the page > is > >>> displaying the wrong product 379! > >>> > >>> So, it's not the wrong version of the page, but the wrong product > that > >>> worries me. > >>> > >>> Can you explain this? > >> > >> i never once said the word "version" in my response :) i was, in > fact, > >> talking about page ids. i dont think the old hybrid url coding > >> strategy checks the page id in its url against the mount. so in your > >> session page 9 can be something entirely different. i believe this > is > >> what was fixed by WICKET-4488. > > > > Not exactly. > > 4488 fixes the problem when user1 has opened page1?0. Then user2 > sends > > a url page2?0 to user1. > > user1 opens this url but because of the existence of a page with > > pageId 0 in the page store user sees page1, not page2 as user2 > > intended. > > > > After 4488 Wicket will load page with id == 0 then it will check its > > class against the class of the mountPoint and ignore the stored page > > if they don't match. And will create a completely new instance of > > mountPoint and show it to user1. I.e. a new instance of page2 > > > > I hope I described it clearly. > > i think thats *exactly* what i said... > > > > >> -igor > >> > >> > >>> Thanks, > >>> > >>> Alec > >>> > >>> On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet > >>> wrote: > > Hi, > > A ticket regarding this was created and resolved in 1.5 > (WICKET-4488). From > the work log: > "There was code for this situation but it didn't cover the case > 100%. > Now if a request to page2?0 is made and the type of the found page > with id=0 > is not Page2 then a new instance of Page2 is instantiated." > > > > > On 11/04/2012 5:56 PM, Igor Vaynberg wrote: > > > > page 5 in your session can be completely different then page 5 in > > user's session. > > > > non-bookmarkable urls cannot be emailed...thats kind of the > point. > > > > -igor > > > > On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan > > wrote
Re: Same versioned link opens different pages on different machines
"And I see no way to detect such problem by having just the information encoded in the url" This is VERY scary! How do I fix this? On Thu, Apr 12, 2012 at 11:39 AM, Martin Grigorov wrote: > On Thu, Apr 12, 2012 at 7:47 PM, Bertrand Guay-Paquet > wrote: >> I don't know much about HybridUrlCodingStrategy since I use Wicket 1.5, but >> based on what you observed (.x changes on every render), I would say the x >> is the page version. >> >> I re-read your emails and if I understand correctly, both product 379 and >> 123 use the same page class. If that is the case, I don't think WICKET-4488 >> is the same problem. That issue concerns rendering a different *Page* class >> because of a page version id. In your case, the MyPage page class is the >> single page involved in both the wrong and right pages you see rendered. > > ^^This is what I tried to explain in my earlier mail. > > user1 visits /product/10.8 then goes to /product/20.9 > later user2 sends /product/30.8 to user1 > user1 opens /product/30.8 but actually sees product/10 because Wicket > loads page with id = 8 from the store ignoring the current request > parameter (10) > > So this is *not* covered by 4488! > And I see no way to detect such problem by having just the information > encoded in the url > > >> >> I suggest putting a break point or logging code in your page's constructor >> to check 1) if a new page is created or an old version is displayed and 2) >> if the page parameters are properly decoded. >> >> >> On 12/04/2012 12:32 PM, Alec Swan wrote: >>> >>> "but because of the existence of a page with pageId 0 in the page >>> store user sees page1, not page2 as user2 intended" >>> >>> So, what is the page id in ../mp/oid/123.9 url? >>> >>> >>> On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynberg >>> wrote: On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov wrote: > > On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg > wrote: >> >> On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: >>> >>> Igor, >>> >>> The link I click ends with /mp/oid/123.9, where 123 is a product id. >>> However, when the page is rendered its URL changes to end with >>> /mp/oid/123.x where x is different every time. Moreover, the page is >>> displaying the wrong product 379! >>> >>> So, it's not the wrong version of the page, but the wrong product that >>> worries me. >>> >>> Can you explain this? >> >> i never once said the word "version" in my response :) i was, in fact, >> talking about page ids. i dont think the old hybrid url coding >> strategy checks the page id in its url against the mount. so in your >> session page 9 can be something entirely different. i believe this is >> what was fixed by WICKET-4488. > > Not exactly. > 4488 fixes the problem when user1 has opened page1?0. Then user2 sends > a url page2?0 to user1. > user1 opens this url but because of the existence of a page with > pageId 0 in the page store user sees page1, not page2 as user2 > intended. > > After 4488 Wicket will load page with id == 0 then it will check its > class against the class of the mountPoint and ignore the stored page > if they don't match. And will create a completely new instance of > mountPoint and show it to user1. I.e. a new instance of page2 > > I hope I described it clearly. i think thats *exactly* what i said... > >> -igor >> >> >>> Thanks, >>> >>> Alec >>> >>> On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet >>> wrote: Hi, A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From the work log: "There was code for this situation but it didn't cover the case 100%. Now if a request to page2?0 is made and the type of the found page with id=0 is not Page2 then a new instance of Page2 is instantiated." On 11/04/2012 5:56 PM, Igor Vaynberg wrote: > > page 5 in your session can be completely different then page 5 in > user's session. > > non-bookmarkable urls cannot be emailed...thats kind of the point. > > -igor > > On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan > wrote: >> >> Hello, >> >> I received a link from a customer to a versioned page (.version at >> the >> end of the URL). However, when I click on the link I see a >> completely >> different page. >> >> We are using Wicket 1.4.17 and the page is mounted as: >> >> mount(new HybridUrlCodingStrategy("mp", MyPage.class)); >> >> Why is this happening and how can I fix this? >> >> Thanks, >> >> Alec >> >> >>
Re: Wicket 1.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
I looked into wicket-jee but this won't do for me. I don't think this problem is Wicket related in any event. Here are some links I came across. - https://community.jboss.org/thread/179757 - http://java.net/jira/browse/GLASSFISH-12599 - https://community.jboss.org/thread/179324#comment105426 - https://issues.jboss.org/browse/WELD-290 For now I have a workaround. I can i@Inject a SLSB into an @ApplicationScoped component, and @Inject this into Wicket Pages. These make it through serialization intact. It's not pretty, but it works for now and will buy me some time to get to the bottom of this. On Thu, Apr 12, 2012 at 11:56 AM, Jonathan Tougas wrote: > I'll check it out thanks! > > > On Thu, Apr 12, 2012 at 11:33 AM, Igor Vaynberg > wrote: > >> weld doesnt wrap ejbs in serializable proxies. if you want to inject >> ejbs you should do it with wicket-jee module found in wicketstuff. >> >> -igor >> >> On Thu, Apr 12, 2012 at 5:55 AM, Jonathan Tougas >> wrote: >> > @Override >> >protected void onBeforeRender() { >> >System.out.println( foo ); >> >System.out.println( foo.getClass() ); >> >super.onBeforeRender(); >> >} >> > >> > When using @Stateless, the output is : >> > >> > 08:52:35,027 INFO [stdout] (http--127.0.0.1-8080-1) Proxy for view >> class: >> > com.foo.FooStateless of EJB: FooStateless >> > 08:52:35,028 INFO [stdout] (http--127.0.0.1-8080-1) class >> > com.foo.FooStateless$Proxy$_$$_Weld$Proxy$ >> > >> > when using @ApplicationScoped, the output is: >> > >> > 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) >> > com.foo.FooStateless@201a6e9 >> > 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) class >> > com.foo.FooStateless$Proxy$_$$_WeldClientProxy >> > >> > >> > On Thu, Apr 12, 2012 at 8:46 AM, Martin Grigorov > >wrote: >> > >> >> The difference is that scoped beans are represented by proxy. >> >> I guess there is no proxy for the stateless EJB. You can verify this >> >> by putting a breakpoint in your page's #onBeforeRender() and checking >> >> the type of the injected value. >> >> >> >> Later during deserialization the current class loader cannot load >> >> class org.jboss.msc.service.ServiceName. >> >> In the case with scoped bean the proxy is loaded without problems and >> >> it seems the proxy itself deals with the class loading of the >> >> underlying bean. >> >> >> >> On Thu, Apr 12, 2012 at 3:40 PM, Jonathan Tougas >> >> wrote: >> >> > I'm not familiar with the Wicketopia source, but doing a quick scan I >> >> can't >> >> > find any EJBs in there. The problem in this case occurs if the >> >> FooStateless >> >> > class is @Stateless. Changing this to @ApplicationScoped, the problem >> >> goes >> >> > away. >> >> > >> >> > On Thu, Apr 12, 2012 at 8:28 AM, Jonathan Tougas >> >> wrote: >> >> > >> >> >> A stateless bean is injected into the home page class. Load the >> page in >> >> >> two tabs (so twice in the same session), then on the first tab, >> press >> >> the >> >> >> button. The error occurs every time in this scenario. >> >> >> >> >> >> On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov < >> mgrigo...@apache.org >> >> >wrote: >> >> >> >> >> >>> Hi, >> >> >>> >> >> >>> On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas < >> jtou...@gmail.com> >> >> >>> wrote: >> >> >>> > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to >> the >> >> >>> mix. >> >> >>> > In certain cases when Wicket deserializes a Page containing a >> >> reference >> >> >>> to >> >> >>> > a CDI bean, I get this exception: >> >> >>> >> >> >>> In what cases exactly ? >> >> >>> Because the problem is >> >> >>> >> >> >>> Caused by: java.lang.ClassNotFoundException: >> >> >>> org.jboss.msc.service.ServiceName from [Module >> >> >>> "deployment.wicket.war:main" >> >> >>> from Service Module Loader] >> >> >>> >> >> >>> In what cases this class is no more loadable by the current class >> >> loader ? >> >> >>> >> >> >>> > >> >> >>> > 15:10:30,841 ERROR >> [org.apache.wicket.request.RequestHandlerStack] >> >> >>> > (http--127.0.0.1-8080-1) Error detaching RequestHandler: >> >> >>> > java.lang.RuntimeException: Could not deserialize object using: >> class >> >> >>> > >> >> >>> >> >> >> org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream >> >> >>> > at >> >> >>> > >> >> >>> >> >> >> org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) >> >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >> >>> > at >> >> >>> > >> >> >>> >> >> >> org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) >> >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >> >>> > at >> >> >>> > >> >> >>> >> >> >> org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) >> >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >> >>> > at >> >> >>> > >> >> >>> >> >> >> org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) >> >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >> >>> > at >> >> >>> >
Re: Same versioned link opens different pages on different machines
On Thu, Apr 12, 2012 at 7:47 PM, Bertrand Guay-Paquet wrote: > I don't know much about HybridUrlCodingStrategy since I use Wicket 1.5, but > based on what you observed (.x changes on every render), I would say the x > is the page version. > > I re-read your emails and if I understand correctly, both product 379 and > 123 use the same page class. If that is the case, I don't think WICKET-4488 > is the same problem. That issue concerns rendering a different *Page* class > because of a page version id. In your case, the MyPage page class is the > single page involved in both the wrong and right pages you see rendered. ^^This is what I tried to explain in my earlier mail. user1 visits /product/10.8 then goes to /product/20.9 later user2 sends /product/30.8 to user1 user1 opens /product/30.8 but actually sees product/10 because Wicket loads page with id = 8 from the store ignoring the current request parameter (10) So this is *not* covered by 4488! And I see no way to detect such problem by having just the information encoded in the url > > I suggest putting a break point or logging code in your page's constructor > to check 1) if a new page is created or an old version is displayed and 2) > if the page parameters are properly decoded. > > > On 12/04/2012 12:32 PM, Alec Swan wrote: >> >> "but because of the existence of a page with pageId 0 in the page >> store user sees page1, not page2 as user2 intended" >> >> So, what is the page id in ../mp/oid/123.9 url? >> >> >> On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynberg >> wrote: >>> >>> On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov >>> wrote: On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg wrote: > > On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: >> >> Igor, >> >> The link I click ends with /mp/oid/123.9, where 123 is a product id. >> However, when the page is rendered its URL changes to end with >> /mp/oid/123.x where x is different every time. Moreover, the page is >> displaying the wrong product 379! >> >> So, it's not the wrong version of the page, but the wrong product that >> worries me. >> >> Can you explain this? > > i never once said the word "version" in my response :) i was, in fact, > talking about page ids. i dont think the old hybrid url coding > strategy checks the page id in its url against the mount. so in your > session page 9 can be something entirely different. i believe this is > what was fixed by WICKET-4488. Not exactly. 4488 fixes the problem when user1 has opened page1?0. Then user2 sends a url page2?0 to user1. user1 opens this url but because of the existence of a page with pageId 0 in the page store user sees page1, not page2 as user2 intended. After 4488 Wicket will load page with id == 0 then it will check its class against the class of the mountPoint and ignore the stored page if they don't match. And will create a completely new instance of mountPoint and show it to user1. I.e. a new instance of page2 I hope I described it clearly. >>> >>> i think thats *exactly* what i said... >>> > -igor > > >> Thanks, >> >> Alec >> >> On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet >> wrote: >>> >>> Hi, >>> >>> A ticket regarding this was created and resolved in 1.5 >>> (WICKET-4488). From >>> the work log: >>> "There was code for this situation but it didn't cover the case 100%. >>> Now if a request to page2?0 is made and the type of the found page >>> with id=0 >>> is not Page2 then a new instance of Page2 is instantiated." >>> >>> >>> >>> >>> On 11/04/2012 5:56 PM, Igor Vaynberg wrote: page 5 in your session can be completely different then page 5 in user's session. non-bookmarkable urls cannot be emailed...thats kind of the point. -igor On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan wrote: > > Hello, > > I received a link from a customer to a versioned page (.version at > the > end of the URL). However, when I click on the link I see a > completely > different page. > > We are using Wicket 1.4.17 and the page is mounted as: > > mount(new HybridUrlCodingStrategy("mp", MyPage.class)); > > Why is this happening and how can I fix this? > > Thanks, > > Alec > > > - > 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.
Markup parsing and caching
In our case Markup for the component comes from CMS. We want to parse the markup and cache Markup object in memory. Parsing happens asynchronously (depending on the content change in CMS) in a separate thread from the request thread. We have custom MarkupParser that extends AbstractMarkupParser but AbstractMarkupParser has dependency on Application (In the constructor it is getting MarkupSettings from application). Since we are doing parsing in a different thread which doesn't have application set in the thread context., Is there any other way to parse without setting dummy application object in the thread context? Regards, Ashoka Upadhya Art.com
Re: Same versioned link opens different pages on different machines
I don't know much about HybridUrlCodingStrategy since I use Wicket 1.5, but based on what you observed (.x changes on every render), I would say the x is the page version. I re-read your emails and if I understand correctly, both product 379 and 123 use the same page class. If that is the case, I don't think WICKET-4488 is the same problem. That issue concerns rendering a different *Page* class because of a page version id. In your case, the MyPage page class is the single page involved in both the wrong and right pages you see rendered. I suggest putting a break point or logging code in your page's constructor to check 1) if a new page is created or an old version is displayed and 2) if the page parameters are properly decoded. On 12/04/2012 12:32 PM, Alec Swan wrote: "but because of the existence of a page with pageId 0 in the page store user sees page1, not page2 as user2 intended" So, what is the page id in ../mp/oid/123.9 url? On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynberg wrote: On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov wrote: On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg wrote: On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: Igor, The link I click ends with /mp/oid/123.9, where 123 is a product id. However, when the page is rendered its URL changes to end with /mp/oid/123.x where x is different every time. Moreover, the page is displaying the wrong product 379! So, it's not the wrong version of the page, but the wrong product that worries me. Can you explain this? i never once said the word "version" in my response :) i was, in fact, talking about page ids. i dont think the old hybrid url coding strategy checks the page id in its url against the mount. so in your session page 9 can be something entirely different. i believe this is what was fixed by WICKET-4488. Not exactly. 4488 fixes the problem when user1 has opened page1?0. Then user2 sends a url page2?0 to user1. user1 opens this url but because of the existence of a page with pageId 0 in the page store user sees page1, not page2 as user2 intended. After 4488 Wicket will load page with id == 0 then it will check its class against the class of the mountPoint and ignore the stored page if they don't match. And will create a completely new instance of mountPoint and show it to user1. I.e. a new instance of page2 I hope I described it clearly. i think thats *exactly* what i said... -igor Thanks, Alec On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet wrote: Hi, A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From the work log: "There was code for this situation but it didn't cover the case 100%. Now if a request to page2?0 is made and the type of the found page with id=0 is not Page2 then a new instance of Page2 is instantiated." On 11/04/2012 5:56 PM, Igor Vaynberg wrote: page 5 in your session can be completely different then page 5 in user's session. non-bookmarkable urls cannot be emailed...thats kind of the point. -igor On Wed, Apr 11, 2012 at 2:37 PM, Alec Swanwrote: Hello, I received a link from a customer to a versioned page (.version at the end of the URL). However, when I click on the link I see a completely different page. We are using Wicket 1.4.17 and the page is mounted as: mount(new HybridUrlCodingStrategy("mp", MyPage.class)); Why is this happening and how can I fix this? Thanks, Alec - 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org F
Re: Page Map versions and Ajax Requests
I was thinking the same "freeze" pattern could be applied in the other repeaters configured to throw away their content. But the "no action phase => no version increment" rule is simpler to explain, and probably more fool-proof. On Thu, Apr 12, 2012 at 8:38 AM, Igor Vaynberg wrote: > On Thu, Apr 12, 2012 at 7:26 AM, Dan Retzlaff wrote: > > Your second suggestion seems pretty solid, but I think people do make > > non-trivial component hierarchy changes in onBeforeRender. > > my point was that such changes are not worthy of a page version > increment because they can be safely thrown away since they are > regenerated every render. > > > Why not just > > freeze the page version during rendering of reuseItems=false ListViews? > You > > know the content will be thrown away so a new page version doesn't seem > > appropriate. > > because that is not enough. what about RefreshingViews? what about > DataViews? what about custom repeaters that users wrote by extending > RepeatingView? what about other code that changes hierarchy in > onBeforeRender(). > > even code like this would cause the same break: > > onBeforeRender() { > addOrReplace(new Label("time", new Date())); > } > > this needs to be handled at a higher level... > > -igor > > > > > > On Wed, Apr 11, 2012 at 11:47 PM, Igor Vaynberg >wrote: > > > >> whats happening is this > >> > >> user hits the page /foo > >> goes to /foo?1 > >> does a bunch of ajax stuff, staying on /foo?1 > >> clicks refresh, so hits /foo?1 > >> listview refreshes, changing hierarchy, creating page version 2 > >> the ajax behavior's url is rendered as /foo?2:... > >> the page is rendered, but not redirected to /foo?2 > >> > >> so what we have now is a browser pointing to /foo?1 and ajax (and > >> non-ajax) urls pointing to /foo?2 > >> > >> further clicks work only because the component they repaint has the > >> same markup id on page 1 and page 2. however, all model changes are > >> stored in page 2. this is why when the browser is refreshed the > >> counter reverts to a previous value - because it is page 1 that is > >> rerendered. > >> > >> there are two ways to fix this: > >> > >> 1) redirect to correct version. so when the browser is refreshed for > >> the first time on /foo?1 the browser would redirect to /foo?2 and it > >> would keep doing that for every refresh. not ideal. > >> > >> 2) freeze the page version when we are accessing a url that we know > >> will not mutate the state of the page - meaning urls that just render > >> the page and do not invoke any listeners. the only state we will lose > >> is noise from component replacement in listviews and user's > >> onbeforerender() overrides which i think is acceptable since they do > >> not represent true state mutation that comes from intentional > >> callbacks. > >> > >> -igor > >> > >> > >> On Wed, Apr 11, 2012 at 6:40 PM, Dan Retzlaff > wrote: > >> >> I don't know exactly what is making the page dirty in this case. > >> > > >> > The AJAX debug window has a ListView in it. > >> > > >> > On Wed, Apr 11, 2012 at 7:09 PM, Nelson Segura > >> wrote: > >> > > >> >> Sorry, you dont have to refresh 4 times, just once :p > >> >> -Nelson > >> >> > >> >> On Wed, Apr 11, 2012 at 6:08 PM, Nelson Segura > >> wrote: > >> >> > This is easily reproduceable in the wicket sample pages: > >> >> > > >> >> > http://www.wicket-library.com/wicket-examples/ajax/links > >> >> > > >> >> > 1. Click on the increment link for Counter 2 for times. Counter > shows > >> 4. > >> >> > 2. CTRL-R/refresh 4 times, the counter still shows 4. > >> >> > 3. Click on link 4 more times. Counter shows 8 > >> >> > 4.CTRL-R/refresh once more, the counter shows 4! > >> >> > > >> >> > I don't know exactly what is making the page dirty in this case. > >> >> > > >> >> > Can you confirm this behavior in the sample page? > >> >> > > >> >> > -Nelson > >> >> > >> >> - > >> >> 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: Same versioned link opens different pages on different machines
"but because of the existence of a page with pageId 0 in the page store user sees page1, not page2 as user2 intended" So, what is the page id in ../mp/oid/123.9 url? On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynberg wrote: > On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov wrote: >> On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg >> wrote: >>> On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: Igor, The link I click ends with /mp/oid/123.9, where 123 is a product id. However, when the page is rendered its URL changes to end with /mp/oid/123.x where x is different every time. Moreover, the page is displaying the wrong product 379! So, it's not the wrong version of the page, but the wrong product that worries me. Can you explain this? >>> >>> i never once said the word "version" in my response :) i was, in fact, >>> talking about page ids. i dont think the old hybrid url coding >>> strategy checks the page id in its url against the mount. so in your >>> session page 9 can be something entirely different. i believe this is >>> what was fixed by WICKET-4488. >> >> Not exactly. >> 4488 fixes the problem when user1 has opened page1?0. Then user2 sends >> a url page2?0 to user1. >> user1 opens this url but because of the existence of a page with >> pageId 0 in the page store user sees page1, not page2 as user2 >> intended. >> >> After 4488 Wicket will load page with id == 0 then it will check its >> class against the class of the mountPoint and ignore the stored page >> if they don't match. And will create a completely new instance of >> mountPoint and show it to user1. I.e. a new instance of page2 >> >> I hope I described it clearly. > > i think thats *exactly* what i said... > >> >> >>> >>> -igor >>> >>> Thanks, Alec On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet wrote: > Hi, > > A ticket regarding this was created and resolved in 1.5 (WICKET-4488). > From > the work log: > "There was code for this situation but it didn't cover the case 100%. > Now if a request to page2?0 is made and the type of the found page with > id=0 > is not Page2 then a new instance of Page2 is instantiated." > > > > > On 11/04/2012 5:56 PM, Igor Vaynberg wrote: >> >> page 5 in your session can be completely different then page 5 in >> user's session. >> >> non-bookmarkable urls cannot be emailed...thats kind of the point. >> >> -igor >> >> On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan wrote: >>> >>> Hello, >>> >>> I received a link from a customer to a versioned page (.version at the >>> end of the URL). However, when I click on the link I see a completely >>> different page. >>> >>> We are using Wicket 1.4.17 and the page is mounted as: >>> >>> mount(new HybridUrlCodingStrategy("mp", MyPage.class)); >>> >>> Why is this happening and how can I fix this? >>> >>> Thanks, >>> >>> Alec >>> >>> - >>> 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 >>> >> >> >> >> -- >> Martin Grigorov >> jWeekend >> Training, Consulting, Development >> http://jWeekend.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 > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same versioned link opens different pages on different machines
On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorov wrote: > On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg > wrote: >> On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: >>> Igor, >>> >>> The link I click ends with /mp/oid/123.9, where 123 is a product id. >>> However, when the page is rendered its URL changes to end with >>> /mp/oid/123.x where x is different every time. Moreover, the page is >>> displaying the wrong product 379! >>> >>> So, it's not the wrong version of the page, but the wrong product that >>> worries me. >>> >>> Can you explain this? >> >> i never once said the word "version" in my response :) i was, in fact, >> talking about page ids. i dont think the old hybrid url coding >> strategy checks the page id in its url against the mount. so in your >> session page 9 can be something entirely different. i believe this is >> what was fixed by WICKET-4488. > > Not exactly. > 4488 fixes the problem when user1 has opened page1?0. Then user2 sends > a url page2?0 to user1. > user1 opens this url but because of the existence of a page with > pageId 0 in the page store user sees page1, not page2 as user2 > intended. > > After 4488 Wicket will load page with id == 0 then it will check its > class against the class of the mountPoint and ignore the stored page > if they don't match. And will create a completely new instance of > mountPoint and show it to user1. I.e. a new instance of page2 > > I hope I described it clearly. i think thats *exactly* what i said... > > >> >> -igor >> >> >>> >>> Thanks, >>> >>> Alec >>> >>> On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet >>> wrote: Hi, A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From the work log: "There was code for this situation but it didn't cover the case 100%. Now if a request to page2?0 is made and the type of the found page with id=0 is not Page2 then a new instance of Page2 is instantiated." On 11/04/2012 5:56 PM, Igor Vaynberg wrote: > > page 5 in your session can be completely different then page 5 in > user's session. > > non-bookmarkable urls cannot be emailed...thats kind of the point. > > -igor > > On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan wrote: >> >> Hello, >> >> I received a link from a customer to a versioned page (.version at the >> end of the URL). However, when I click on the link I see a completely >> different page. >> >> We are using Wicket 1.4.17 and the page is mounted as: >> >> mount(new HybridUrlCodingStrategy("mp", MyPage.class)); >> >> Why is this happening and how can I fix this? >> >> Thanks, >> >> Alec >> >> - >> 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 >> > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.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 1.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
I'll check it out thanks! On Thu, Apr 12, 2012 at 11:33 AM, Igor Vaynberg wrote: > weld doesnt wrap ejbs in serializable proxies. if you want to inject > ejbs you should do it with wicket-jee module found in wicketstuff. > > -igor > > On Thu, Apr 12, 2012 at 5:55 AM, Jonathan Tougas > wrote: > > @Override > >protected void onBeforeRender() { > >System.out.println( foo ); > >System.out.println( foo.getClass() ); > >super.onBeforeRender(); > >} > > > > When using @Stateless, the output is : > > > > 08:52:35,027 INFO [stdout] (http--127.0.0.1-8080-1) Proxy for view > class: > > com.foo.FooStateless of EJB: FooStateless > > 08:52:35,028 INFO [stdout] (http--127.0.0.1-8080-1) class > > com.foo.FooStateless$Proxy$_$$_Weld$Proxy$ > > > > when using @ApplicationScoped, the output is: > > > > 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) > > com.foo.FooStateless@201a6e9 > > 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) class > > com.foo.FooStateless$Proxy$_$$_WeldClientProxy > > > > > > On Thu, Apr 12, 2012 at 8:46 AM, Martin Grigorov >wrote: > > > >> The difference is that scoped beans are represented by proxy. > >> I guess there is no proxy for the stateless EJB. You can verify this > >> by putting a breakpoint in your page's #onBeforeRender() and checking > >> the type of the injected value. > >> > >> Later during deserialization the current class loader cannot load > >> class org.jboss.msc.service.ServiceName. > >> In the case with scoped bean the proxy is loaded without problems and > >> it seems the proxy itself deals with the class loading of the > >> underlying bean. > >> > >> On Thu, Apr 12, 2012 at 3:40 PM, Jonathan Tougas > >> wrote: > >> > I'm not familiar with the Wicketopia source, but doing a quick scan I > >> can't > >> > find any EJBs in there. The problem in this case occurs if the > >> FooStateless > >> > class is @Stateless. Changing this to @ApplicationScoped, the problem > >> goes > >> > away. > >> > > >> > On Thu, Apr 12, 2012 at 8:28 AM, Jonathan Tougas > >> wrote: > >> > > >> >> A stateless bean is injected into the home page class. Load the page > in > >> >> two tabs (so twice in the same session), then on the first tab, press > >> the > >> >> button. The error occurs every time in this scenario. > >> >> > >> >> On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov < > mgrigo...@apache.org > >> >wrote: > >> >> > >> >>> Hi, > >> >>> > >> >>> On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas < > jtou...@gmail.com> > >> >>> wrote: > >> >>> > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to > the > >> >>> mix. > >> >>> > In certain cases when Wicket deserializes a Page containing a > >> reference > >> >>> to > >> >>> > a CDI bean, I get this exception: > >> >>> > >> >>> In what cases exactly ? > >> >>> Because the problem is > >> >>> > >> >>> Caused by: java.lang.ClassNotFoundException: > >> >>> org.jboss.msc.service.ServiceName from [Module > >> >>> "deployment.wicket.war:main" > >> >>> from Service Module Loader] > >> >>> > >> >>> In what cases this class is no more loadable by the current class > >> loader ? > >> >>> > >> >>> > > >> >>> > 15:10:30,841 ERROR [org.apache.wicket.request.RequestHandlerStack] > >> >>> > (http--127.0.0.1-8080-1) Error detaching RequestHandler: > >> >>> > java.lang.RuntimeException: Could not deserialize object using: > class > >> >>> > > >> >>> > >> > org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257) > >> >>> > [wicket-core-1.5.5.jar:1.5.5] > >> >>> > at > >> >>> > > >> >>> > >> > org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117) > >> >>> > [wicket-core-1.5.5.jar:1
Re: Same versioned link opens different pages on different machines
On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynberg wrote: > On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: >> Igor, >> >> The link I click ends with /mp/oid/123.9, where 123 is a product id. >> However, when the page is rendered its URL changes to end with >> /mp/oid/123.x where x is different every time. Moreover, the page is >> displaying the wrong product 379! >> >> So, it's not the wrong version of the page, but the wrong product that >> worries me. >> >> Can you explain this? > > i never once said the word "version" in my response :) i was, in fact, > talking about page ids. i dont think the old hybrid url coding > strategy checks the page id in its url against the mount. so in your > session page 9 can be something entirely different. i believe this is > what was fixed by WICKET-4488. Not exactly. 4488 fixes the problem when user1 has opened page1?0. Then user2 sends a url page2?0 to user1. user1 opens this url but because of the existence of a page with pageId 0 in the page store user sees page1, not page2 as user2 intended. After 4488 Wicket will load page with id == 0 then it will check its class against the class of the mountPoint and ignore the stored page if they don't match. And will create a completely new instance of mountPoint and show it to user1. I.e. a new instance of page2 I hope I described it clearly. > > -igor > > >> >> Thanks, >> >> Alec >> >> On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet >> wrote: >>> Hi, >>> >>> A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From >>> the work log: >>> "There was code for this situation but it didn't cover the case 100%. >>> Now if a request to page2?0 is made and the type of the found page with id=0 >>> is not Page2 then a new instance of Page2 is instantiated." >>> >>> >>> >>> >>> On 11/04/2012 5:56 PM, Igor Vaynberg wrote: page 5 in your session can be completely different then page 5 in user's session. non-bookmarkable urls cannot be emailed...thats kind of the point. -igor On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan wrote: > > Hello, > > I received a link from a customer to a versioned page (.version at the > end of the URL). However, when I click on the link I see a completely > different page. > > We are using Wicket 1.4.17 and the page is mounted as: > > mount(new HybridUrlCodingStrategy("mp", MyPage.class)); > > Why is this happening and how can I fix this? > > Thanks, > > Alec > > - > 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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEditableLabel Missing setConvertEmptyInputStringToNull(...)?
I am wondering if AjaxEditableLabel is intentionally missing a setConvertEmptyInputStringToNull(...) method? I have a use case for it, and it seems like it would be reasonable to implement. For now, I have a work-around for this by overriding AjaxEditableLabel's newEditor(...) method. However, I don't like this solution because I need to cast the returned FormComponent into a TextField in order to get access to the setConvertEmptyInputStringToNull(...) method. If the underlying newEditor implementation is changed at some point, my code won't work. Can this functionality be added to AjaxEditableLabel? If so, how would I go about requesting it? Thanks a lot for your help. Regards, Aaron J. Garcia - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Same versioned link opens different pages on different machines
On Thu, Apr 12, 2012 at 8:22 AM, Alec Swan wrote: > Igor, > > The link I click ends with /mp/oid/123.9, where 123 is a product id. > However, when the page is rendered its URL changes to end with > /mp/oid/123.x where x is different every time. Moreover, the page is > displaying the wrong product 379! > > So, it's not the wrong version of the page, but the wrong product that > worries me. > > Can you explain this? i never once said the word "version" in my response :) i was, in fact, talking about page ids. i dont think the old hybrid url coding strategy checks the page id in its url against the mount. so in your session page 9 can be something entirely different. i believe this is what was fixed by WICKET-4488. -igor > > Thanks, > > Alec > > On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet > wrote: >> Hi, >> >> A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From >> the work log: >> "There was code for this situation but it didn't cover the case 100%. >> Now if a request to page2?0 is made and the type of the found page with id=0 >> is not Page2 then a new instance of Page2 is instantiated." >> >> >> >> >> On 11/04/2012 5:56 PM, Igor Vaynberg wrote: >>> >>> page 5 in your session can be completely different then page 5 in >>> user's session. >>> >>> non-bookmarkable urls cannot be emailed...thats kind of the point. >>> >>> -igor >>> >>> On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan wrote: Hello, I received a link from a customer to a versioned page (.version at the end of the URL). However, when I click on the link I see a completely different page. We are using Wicket 1.4.17 and the page is mounted as: mount(new HybridUrlCodingStrategy("mp", MyPage.class)); Why is this happening and how can I fix this? Thanks, Alec - 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: [Conception] question about mixed entities and model
This is just an idea public class UserDetails { public UserDetails( Person person, Event event, Mail mail ) { // here you use the properties you need this.firstName = person.getFirstName(); this.xxx = event.getXXX(); . } } And by the way you keep the bean population in you business layer. François Le 12 avr. 2012 à 17:33, myrz a écrit : > Thanks François for your reply. > > But my real question is. "UserDetails" is it a bean that you created "by > hand"? > How do you populate it? > > Thanks again > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Conception-question-about-mixed-entities-and-model-tp4551789p4552250.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: Page Map versions and Ajax Requests
On Thu, Apr 12, 2012 at 7:26 AM, Dan Retzlaff wrote: > Your second suggestion seems pretty solid, but I think people do make > non-trivial component hierarchy changes in onBeforeRender. my point was that such changes are not worthy of a page version increment because they can be safely thrown away since they are regenerated every render. > Why not just > freeze the page version during rendering of reuseItems=false ListViews? You > know the content will be thrown away so a new page version doesn't seem > appropriate. because that is not enough. what about RefreshingViews? what about DataViews? what about custom repeaters that users wrote by extending RepeatingView? what about other code that changes hierarchy in onBeforeRender(). even code like this would cause the same break: onBeforeRender() { addOrReplace(new Label("time", new Date())); } this needs to be handled at a higher level... -igor > > On Wed, Apr 11, 2012 at 11:47 PM, Igor Vaynberg > wrote: > >> whats happening is this >> >> user hits the page /foo >> goes to /foo?1 >> does a bunch of ajax stuff, staying on /foo?1 >> clicks refresh, so hits /foo?1 >> listview refreshes, changing hierarchy, creating page version 2 >> the ajax behavior's url is rendered as /foo?2:... >> the page is rendered, but not redirected to /foo?2 >> >> so what we have now is a browser pointing to /foo?1 and ajax (and >> non-ajax) urls pointing to /foo?2 >> >> further clicks work only because the component they repaint has the >> same markup id on page 1 and page 2. however, all model changes are >> stored in page 2. this is why when the browser is refreshed the >> counter reverts to a previous value - because it is page 1 that is >> rerendered. >> >> there are two ways to fix this: >> >> 1) redirect to correct version. so when the browser is refreshed for >> the first time on /foo?1 the browser would redirect to /foo?2 and it >> would keep doing that for every refresh. not ideal. >> >> 2) freeze the page version when we are accessing a url that we know >> will not mutate the state of the page - meaning urls that just render >> the page and do not invoke any listeners. the only state we will lose >> is noise from component replacement in listviews and user's >> onbeforerender() overrides which i think is acceptable since they do >> not represent true state mutation that comes from intentional >> callbacks. >> >> -igor >> >> >> On Wed, Apr 11, 2012 at 6:40 PM, Dan Retzlaff wrote: >> >> I don't know exactly what is making the page dirty in this case. >> > >> > The AJAX debug window has a ListView in it. >> > >> > On Wed, Apr 11, 2012 at 7:09 PM, Nelson Segura >> wrote: >> > >> >> Sorry, you dont have to refresh 4 times, just once :p >> >> -Nelson >> >> >> >> On Wed, Apr 11, 2012 at 6:08 PM, Nelson Segura >> wrote: >> >> > This is easily reproduceable in the wicket sample pages: >> >> > >> >> > http://www.wicket-library.com/wicket-examples/ajax/links >> >> > >> >> > 1. Click on the increment link for Counter 2 for times. Counter shows >> 4. >> >> > 2. CTRL-R/refresh 4 times, the counter still shows 4. >> >> > 3. Click on link 4 more times. Counter shows 8 >> >> > 4.CTRL-R/refresh once more, the counter shows 4! >> >> > >> >> > I don't know exactly what is making the page dirty in this case. >> >> > >> >> > Can you confirm this behavior in the sample page? >> >> > >> >> > -Nelson >> >> >> >> - >> >> 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: Wicket 1.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
weld doesnt wrap ejbs in serializable proxies. if you want to inject ejbs you should do it with wicket-jee module found in wicketstuff. -igor On Thu, Apr 12, 2012 at 5:55 AM, Jonathan Tougas wrote: > @Override > protected void onBeforeRender() { > System.out.println( foo ); > System.out.println( foo.getClass() ); > super.onBeforeRender(); > } > > When using @Stateless, the output is : > > 08:52:35,027 INFO [stdout] (http--127.0.0.1-8080-1) Proxy for view class: > com.foo.FooStateless of EJB: FooStateless > 08:52:35,028 INFO [stdout] (http--127.0.0.1-8080-1) class > com.foo.FooStateless$Proxy$_$$_Weld$Proxy$ > > when using @ApplicationScoped, the output is: > > 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) > com.foo.FooStateless@201a6e9 > 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) class > com.foo.FooStateless$Proxy$_$$_WeldClientProxy > > > On Thu, Apr 12, 2012 at 8:46 AM, Martin Grigorov wrote: > >> The difference is that scoped beans are represented by proxy. >> I guess there is no proxy for the stateless EJB. You can verify this >> by putting a breakpoint in your page's #onBeforeRender() and checking >> the type of the injected value. >> >> Later during deserialization the current class loader cannot load >> class org.jboss.msc.service.ServiceName. >> In the case with scoped bean the proxy is loaded without problems and >> it seems the proxy itself deals with the class loading of the >> underlying bean. >> >> On Thu, Apr 12, 2012 at 3:40 PM, Jonathan Tougas >> wrote: >> > I'm not familiar with the Wicketopia source, but doing a quick scan I >> can't >> > find any EJBs in there. The problem in this case occurs if the >> FooStateless >> > class is @Stateless. Changing this to @ApplicationScoped, the problem >> goes >> > away. >> > >> > On Thu, Apr 12, 2012 at 8:28 AM, Jonathan Tougas >> wrote: >> > >> >> A stateless bean is injected into the home page class. Load the page in >> >> two tabs (so twice in the same session), then on the first tab, press >> the >> >> button. The error occurs every time in this scenario. >> >> >> >> On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov > >wrote: >> >> >> >>> Hi, >> >>> >> >>> On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas >> >>> wrote: >> >>> > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to the >> >>> mix. >> >>> > In certain cases when Wicket deserializes a Page containing a >> reference >> >>> to >> >>> > a CDI bean, I get this exception: >> >>> >> >>> In what cases exactly ? >> >>> Because the problem is >> >>> >> >>> Caused by: java.lang.ClassNotFoundException: >> >>> org.jboss.msc.service.ServiceName from [Module >> >>> "deployment.wicket.war:main" >> >>> from Service Module Loader] >> >>> >> >>> In what cases this class is no more loadable by the current class >> loader ? >> >>> >> >>> > >> >>> > 15:10:30,841 ERROR [org.apache.wicket.request.RequestHandlerStack] >> >>> > (http--127.0.0.1-8080-1) Error detaching RequestHandler: >> >>> > java.lang.RuntimeException: Could not deserialize object using: class >> >>> > >> >>> >> org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream >> >>> > at >> >>> > >> >>> >> org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205) >> >>> > [wicket-core-1.5.5.jar:1.5.5] >> >>> > at >> >>> > >> >>> >> org.apache.wicket.request.handler.PageProvider.getPageParameters(PageProvider.java:1
Re: [Conception] question about mixed entities and model
Thanks François for your reply. But my real question is. "UserDetails" is it a bean that you created "by hand"? How do you populate it? Thanks again -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Conception-question-about-mixed-entities-and-model-tp4551789p4552250.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: IDataProvider#size()
but if you do not know how many results you have then that can happen using any approach... -igor On Thu, Apr 12, 2012 at 2:36 AM, Michal Wegrzyn wrote: > That's the solution which I have used for the case, where count is not > possible. > It has only one slight disadvantage - if count == n*pageSize then the last > page will be blank. > > Best regards, > Michal Wegrzyn > >> -Original Message- >> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] >> Sent: Thursday, April 12, 2012 6:06 >> To: users@wicket.apache.org >> Subject: Re: IDataProvider#size() >> >> why not just fake the size to current page+1? that way you always have >> a "next" link and once you receive the current page you should know if >> you have more or not so you dont have to add the one on the last >> page >> >> -igor >> >> On Wed, Apr 11, 2012 at 6:59 PM, Dan Retzlaff >> wrote: >> > Hi all. Time to start a thread of my own. :) >> > >> > Many of Wicket's powerful repeaters depend on IDataProvider. This >> > interface has a size() method which returns a non-null integer. This >> > makes it easy to determine the total number of pages in a pageable >> > view, but IMO the required computation and application complexity are >> not always called for. >> > In many cases, a pageable but open-ended data view is adequate. Have >> > you experienced this impedance mismatch yourselves? What was your >> solution? >> > >> > To elaborate on my experience: >> > >> > For SQL-based views, the application complexity comes from the need >> to >> > construct a count(*) query with exactly the same criteria as the >> > subsequent result query. In my experience, this pollutes DAO >> > interfaces and IDataProvider implementation non-trivially. We >> > initially had separate methods for counting and querying (same args), >> > but eventually moved to a single method that returns a >> > -tuple with both the results and total size which our >> > IDataProvider caches. This lets us do some Hibernate trickery to >> > introduce a MySQL SQL_CALC_FOUND_ROWS query hint, avoiding separate >> > count/results queries in most cases. It's still not simple, and for >> large counts is still expensive. >> > >> > The situation is worse for non-SQL data stores which don't have a >> > fully-functional count(*) capability. We use Cassandra whose native >> > "where clause" support is limited, requiring significant client-side >> filtering. >> > Paging through an entire column (or CF) in this way is prohibitively >> > expensive, especially considering our users rarely even go to page 2. >> > To solve this, we've created a parallel set of view/paging classes >> > that define windows using previously discovered result keys instead >> of >> > start indices (tokens and column names in Cassandra). But having a >> > full suite of IUnsizedDataProvider-based classes smells. I love that >> > Wicket devs have solved some tough/tedious problems with DataViewBase >> > and friends, and I want to make use of them! >> > >> > Comments or suggestions? >> > >> > Cheers, >> > Dan >> >> - >> 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: Same versioned link opens different pages on different machines
Igor, The link I click ends with /mp/oid/123.9, where 123 is a product id. However, when the page is rendered its URL changes to end with /mp/oid/123.x where x is different every time. Moreover, the page is displaying the wrong product 379! So, it's not the wrong version of the page, but the wrong product that worries me. Can you explain this? Thanks, Alec On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet wrote: > Hi, > > A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From > the work log: > "There was code for this situation but it didn't cover the case 100%. > Now if a request to page2?0 is made and the type of the found page with id=0 > is not Page2 then a new instance of Page2 is instantiated." > > > > > On 11/04/2012 5:56 PM, Igor Vaynberg wrote: >> >> page 5 in your session can be completely different then page 5 in >> user's session. >> >> non-bookmarkable urls cannot be emailed...thats kind of the point. >> >> -igor >> >> On Wed, Apr 11, 2012 at 2:37 PM, Alec Swan wrote: >>> >>> Hello, >>> >>> I received a link from a customer to a versioned page (.version at the >>> end of the URL). However, when I click on the link I see a completely >>> different page. >>> >>> We are using Wicket 1.4.17 and the page is mounted as: >>> >>> mount(new HybridUrlCodingStrategy("mp", MyPage.class)); >>> >>> Why is this happening and how can I fix this? >>> >>> Thanks, >>> >>> Alec >>> >>> - >>> 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: Running thread + AJAX + page serialization
Hi, You can avoid this problem by using copy-on-write collections but this will just postpone seeing the bigger problem: showing stale data. Here is the scenario: - wicket serializes the page in the disk - your thread pushes data which is stored somehow in the page - a new ajax request comes and Wicket deserializes the page (with an old copy of the data!) - thread says "I'm done" and Wicket shows the data Better move the data in some global scoped manager/service and load it on demand in the view (Wicket) when fully available On Thu, Apr 12, 2012 at 5:39 PM, Martin Schayna wrote: > Hi, > > I have this scenario: > > - browser requests some time-expensive page > - page renders lazy component (instead of regular component) and starts > thread for computation data > - lazy component use Behavior with AJAX callback, timed in seconds > - user sees in browser indicator > - when Behavior fires, checks thread is done > - if thread is done, renders proper component via AJAX with fresh data > - if thread is pending, renders javascript to postpone AJAX callback again > > My problem: > > There are some serializable fields in page, which are accessed from thread. > These fields are properly synchronized. Each AJAX response from > Behavior causes page serialization -- this runs in context of AJAX request > in the end. But in same time, thread can also access these fields in page > (typically add/remove items from collections) and serialization can throw > ConcurrentModificationException. Again, access to fields is synchronized, > but during serialization there are no chance to synchronizing access to > fields. > > Are there some techniques/patterns how to solve this? > > For example, can I inject Wicket page serialization to block access to > fields for my thread? > > Thanks > > Martin -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Running thread + AJAX + page serialization
Hi, Martin. I don't think it's appropriate to have your background thread referencing page objects, especially not modifying them. In general, pages get deserialized from the page store, in which case the thread's changes won't even be seen. Maybe you are saved by an optimization that leaves the most recent page deserialized for each session. I suggest putting your shared state somewhere else. Session is next candidate, but the same serialization challenges exist there. Without resorting to an external store, I think that leaves servlet context attributes. I think the only challenge there is developing a strategy for removing content so it doesn't grow unbounded. (It is not tied to session lifecycle.) On Thu, Apr 12, 2012 at 7:39 AM, Martin Schayna wrote: > Hi, > > I have this scenario: > > - browser requests some time-expensive page > - page renders lazy component (instead of regular component) and starts > thread for computation data > - lazy component use Behavior with AJAX callback, timed in seconds > - user sees in browser indicator > - when Behavior fires, checks thread is done > - if thread is done, renders proper component via AJAX with fresh data > - if thread is pending, renders javascript to postpone AJAX callback again > > My problem: > > There are some serializable fields in page, which are accessed from thread. > These fields are properly synchronized. Each AJAX response from > Behavior causes page serialization -- this runs in context of AJAX request > in the end. But in same time, thread can also access these fields in page > (typically add/remove items from collections) and serialization can throw > ConcurrentModificationException. Again, access to fields is synchronized, > but during serialization there are no chance to synchronizing access to > fields. > > Are there some techniques/patterns how to solve this? > > For example, can I inject Wicket page serialization to block access to > fields for my thread? > > Thanks > > Martin >
Re: component.isAuto - was: Wicket 1.5: The component(s) below failed to render (revisited)
Hi, On Thu, Apr 12, 2012 at 5:48 PM, Adrian Wiesmann wrote: > Hi > > Me again with a follow up to my isAuto() problem. > > Setting component.setAuto(true) is quite bad, since Wicket will remove all > components in the detachChildren() method which have the Auto Flag and which > are not an instance of InlineEnclosure. Which all of my components obviously > are not... > > While the isAuto(true) results in a nicely rendered component tree, when you > try to click on - say a row in a list - then Wicket throws an error because > the component in question was removed. > > Well here we are again. How can I port my renderer which adds components to > the component tree on the fly as I was able to do in Wicket < 1.5? What was > the intention to change the behaviour there? It is not clear to me which behavior exactly has changed and now causes you troubles. Create a minimal quickstart that works on 1.4 and attach it to a ticket in Jira. > > Regards, > Adrian > > > > On 2/12/12 7:27 PM, Adrian Wiesmann wrote: >> >> Hello list >> >> Some while ago I posted a few messages to this list where I asked for >> help in finding a problem with Wicket 1.5. I was not able to find the >> bug back then. Now I downloaded the bleeding edge version 1.5.4 and >> tried again. And now I am a step further. >> >> I have that rendering engine where I take an XML file, build an object >> tree from that and have a renderer rendering a Wicket object tree and >> finally Wicket which renders the HTML UI from that. >> >> Now I noticed with version 1.5 of Wicket, that this line in the >> org.apache.wicket.Page.class are the key to my problem (lines 611, 612): >> >> // If not an auto component ... >> if (!component.isAuto() && component.isVisibleInHierarchy()) >> >> I noticed that many of my components I add in my renderer on the fly are >> returning isAuto = false on that line (and of course they are visible, >> which adds them to unrenderedComponents and ultimately provokes the >> error). >> >> I then added this.setAuto(true); in one of my components. And voila, it >> was not in the list of components which failed to render. >> >> So here are my questions: >> >> - What did change from version 1.4.x to version 1.5.x that results in >> this error? >> - Is that a bug in Wicket or do I need to fix my renderer somehow? >> - What side effects does it have if I just add a setAuto(true) to all of >> my components? >> >> Thanks for your help! >> >> Cheers, >> Adrian >> >> - >> 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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Built with Wicket: showcases for Wicket applications
I built zipgrocery ... my client is still pointing the domain to the test server... will be fixed soon. Josh. On Thu, Apr 12, 2012 at 4:55 PM, Jeffrey Schneller < jeffrey.schnel...@envisa.com> wrote: > Thanks for the reminder. > > FYI... whoever built ZipGrocery - you are running your site with the ajax > debugger still on. > > > > -Original Message- > From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] > Sent: Thursday, April 12, 2012 5:49 AM > To: users@wicket.apache.org > Subject: Built with Wicket: showcases for Wicket applications > > "Built with Wicket" is Apache Wicket's portfolio blog showcasing what our > community has created with your favorite web framework. > > But why only see what others are building when you can share your own > creation? Submit your application to "Built with Wicket". Your application > doesn't necessarily need to be publicly accessible, but we do want a > description of what your application does and a screenshot. > >http://builtwithwicket.tumblr.com > > Share the love, share your application at Built with Wicket! > > - > 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: [Conception] question about mixed entities and model
Hi, using a fragment or a panel will help you public class MyMixedEntitiesPane extends Panel { public MyMixedEntitiesPanel(IModel userDetails) { myMixedEntitiesPanel.add( new Label("x", ); myMixedEntitiesPanel.add( new Label("y", ); myMixedEntitiesPanel.add( new Label("z", ); } } and you populate the table like this : public void populateItem(final ListItem item) { item.add(new MyMixedEntitiesPanel("id", item.getDefaultModel()); } François Le 12 avr. 2012 à 15:06, myrz a écrit : > hi everybody,, > > I'm new into the forum and i'm french so i'm begging you to excuse my > english. > > I have to create a panel which contains a ListView of a mixed entity object. > > A little example: > > public Person implements Serializable{ > getName() > } > > public Event implements Serializable{ > getType() > } > > public Mail implements Serializable{ > getText() > } > > These objects are generated by wsdl2java because my IHM layer communicate > with my business layer by web service. It's like that and I can't change the > architecture. > > I would like to print something like that: > > "There are 3 lines" > > colomn "Name"--colomn "value" > person1.getName() -- event1.getType() > person2.getName() -- mail2.getText() > person3.getName() -- event3.getType() > > But every examples found are about somethings like that > > ListView new Listview("id",listModel); > > with Book is a persisted object from Hibernate. > > My question is: Is it a good or bad practice to do that > > MyPanel extends Panel{ > > @SpringBean > public TableService tableService > > public MyPanel(String id){ > super(id); > > IModel> listModel = new AbstractReadOnlyModel(){ >getObject(){ tableService.getLines();} > } > > > List lines = (List) listModel.getObject(); > int current; > if(lines.size() > 2){ > current = lines.size(); > }else{ > current = 0; > } > > add(new Label("count", current); > > > add(new ListView("list", listModel){ > populateItems(){ >Item item = (Line) getModel(); >add(new Label("name",item.getName()); >add(new Label("value",item..getValue()); > } >};); > } > > } > > public TableauServiceImpl implements TableauService{ > public List getLines(){ > List lines = new ArrayList(); > Line line1 = new Line(); > // person and event are retrieve by others services > line1.setName(person1.getName()); > line1.setValue(event1.getType()); > lines.add(line1); > line2.setName(person1.getName()); > line2.setValue(mail1.gettext()); > lines.add(line2); > return lines; >} > } > > > It's a stupid example but i have to do something like this. And i'm afraid > not to respect good practices presents here > (http://www.devproof.org/wicket_best_practice) and not understand something. > > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Conception-question-about-mixed-entities-and-model-tp4551789p4551789.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: DateField and AjaxFormComponentUpdatingBehavior in wicket 1.5.5
Show me your code. full file class. Le 12 avr. 2012 à 16:41, dpmihai a écrit : > It does not matter. Your code (DateTextField instead DateField) does not work > either in Wicket 1.5.5 It prints just the current date no matter what date I > choose. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DateField-and-AjaxFormComponentUpdatingBehavior-in-wicket-1-5-5-tp4551607p4552082.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: component.isAuto - was: Wicket 1.5: The component(s) below failed to render (revisited)
Hi Me again with a follow up to my isAuto() problem. Setting component.setAuto(true) is quite bad, since Wicket will remove all components in the detachChildren() method which have the Auto Flag and which are not an instance of InlineEnclosure. Which all of my components obviously are not... While the isAuto(true) results in a nicely rendered component tree, when you try to click on - say a row in a list - then Wicket throws an error because the component in question was removed. Well here we are again. How can I port my renderer which adds components to the component tree on the fly as I was able to do in Wicket < 1.5? What was the intention to change the behaviour there? Regards, Adrian On 2/12/12 7:27 PM, Adrian Wiesmann wrote: Hello list Some while ago I posted a few messages to this list where I asked for help in finding a problem with Wicket 1.5. I was not able to find the bug back then. Now I downloaded the bleeding edge version 1.5.4 and tried again. And now I am a step further. I have that rendering engine where I take an XML file, build an object tree from that and have a renderer rendering a Wicket object tree and finally Wicket which renders the HTML UI from that. Now I noticed with version 1.5 of Wicket, that this line in the org.apache.wicket.Page.class are the key to my problem (lines 611, 612): // If not an auto component ... if (!component.isAuto() && component.isVisibleInHierarchy()) I noticed that many of my components I add in my renderer on the fly are returning isAuto = false on that line (and of course they are visible, which adds them to unrenderedComponents and ultimately provokes the error). I then added this.setAuto(true); in one of my components. And voila, it was not in the list of components which failed to render. So here are my questions: - What did change from version 1.4.x to version 1.5.x that results in this error? - Is that a bug in Wicket or do I need to fix my renderer somehow? - What side effects does it have if I just add a setAuto(true) to all of my components? Thanks for your help! Cheers, Adrian - 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: DateField and AjaxFormComponentUpdatingBehavior in wicket 1.5.5
It does not matter. Your code (DateTextField instead DateField) does not work either in Wicket 1.5.5 It prints just the current date no matter what date I choose. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DateField-and-AjaxFormComponentUpdatingBehavior-in-wicket-1-5-5-tp4551607p4552082.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
Running thread + AJAX + page serialization
Hi, I have this scenario: - browser requests some time-expensive page - page renders lazy component (instead of regular component) and starts thread for computation data - lazy component use Behavior with AJAX callback, timed in seconds - user sees in browser indicator - when Behavior fires, checks thread is done - if thread is done, renders proper component via AJAX with fresh data - if thread is pending, renders javascript to postpone AJAX callback again My problem: There are some serializable fields in page, which are accessed from thread. These fields are properly synchronized. Each AJAX response from Behavior causes page serialization -- this runs in context of AJAX request in the end. But in same time, thread can also access these fields in page (typically add/remove items from collections) and serialization can throw ConcurrentModificationException. Again, access to fields is synchronized, but during serialization there are no chance to synchronizing access to fields. Are there some techniques/patterns how to solve this? For example, can I inject Wicket page serialization to block access to fields for my thread? Thanks Martin
Re: Wicket 1.5.5, HtmlHandler & markup without "base" tag problem
Done: https://issues.apache.org/jira/browse/WICKET-4494 Michal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-5-HtmlHandler-markup-without-base-tag-problem-tp4551420p4552044.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: Page Map versions and Ajax Requests
Your second suggestion seems pretty solid, but I think people do make non-trivial component hierarchy changes in onBeforeRender. Why not just freeze the page version during rendering of reuseItems=false ListViews? You know the content will be thrown away so a new page version doesn't seem appropriate. On Wed, Apr 11, 2012 at 11:47 PM, Igor Vaynberg wrote: > whats happening is this > > user hits the page /foo > goes to /foo?1 > does a bunch of ajax stuff, staying on /foo?1 > clicks refresh, so hits /foo?1 > listview refreshes, changing hierarchy, creating page version 2 > the ajax behavior's url is rendered as /foo?2:... > the page is rendered, but not redirected to /foo?2 > > so what we have now is a browser pointing to /foo?1 and ajax (and > non-ajax) urls pointing to /foo?2 > > further clicks work only because the component they repaint has the > same markup id on page 1 and page 2. however, all model changes are > stored in page 2. this is why when the browser is refreshed the > counter reverts to a previous value - because it is page 1 that is > rerendered. > > there are two ways to fix this: > > 1) redirect to correct version. so when the browser is refreshed for > the first time on /foo?1 the browser would redirect to /foo?2 and it > would keep doing that for every refresh. not ideal. > > 2) freeze the page version when we are accessing a url that we know > will not mutate the state of the page - meaning urls that just render > the page and do not invoke any listeners. the only state we will lose > is noise from component replacement in listviews and user's > onbeforerender() overrides which i think is acceptable since they do > not represent true state mutation that comes from intentional > callbacks. > > -igor > > > On Wed, Apr 11, 2012 at 6:40 PM, Dan Retzlaff wrote: > >> I don't know exactly what is making the page dirty in this case. > > > > The AJAX debug window has a ListView in it. > > > > On Wed, Apr 11, 2012 at 7:09 PM, Nelson Segura > wrote: > > > >> Sorry, you dont have to refresh 4 times, just once :p > >> -Nelson > >> > >> On Wed, Apr 11, 2012 at 6:08 PM, Nelson Segura > wrote: > >> > This is easily reproduceable in the wicket sample pages: > >> > > >> > http://www.wicket-library.com/wicket-examples/ajax/links > >> > > >> > 1. Click on the increment link for Counter 2 for times. Counter shows > 4. > >> > 2. CTRL-R/refresh 4 times, the counter still shows 4. > >> > 3. Click on link 4 more times. Counter shows 8 > >> > 4.CTRL-R/refresh once more, the counter shows 4! > >> > > >> > I don't know exactly what is making the page dirty in this case. > >> > > >> > Can you confirm this behavior in the sample page? > >> > > >> > -Nelson > >> > >> - > >> 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: DateField and AjaxFormComponentUpdatingBehavior in wicket 1.5.5
Hi, Should be better with a form private IModel date; public Test() { super(); add(new TestForm("form", date = new Model(new Date(; } private class TestForm extends Form { public TestForm(String form, final IModel dateModel) { super(form, dateModel); DateField txtDate = new DateField("txtDate", dateModel) { @Override protected DateTextField newDateTextField(java.lang.String id, PropertyModel dateFieldModel) { DateTextField dateTextField = super.newDateTextField(id, dateFieldModel); AjaxFormComponentUpdatingBehavior ajaxFormComponentUpdatingBehavior = new AjaxFormComponentUpdatingBehavior("onChange") { @Override protected void onUpdate(AjaxRequestTarget target) { System.out.println("dateModel :[" + dateModel + "]"); } }; dateTextField.add(ajaxFormComponentUpdatingBehavior); return dateTextField; } }; add( txtDate ); } } François Le 12 avr. 2012 à 13:35, dpmihai a écrit : > I created a simple page with a DateField and an > AjaxFormComponentUpdatingBehavior where I want to read the model. The > following code does work in Wicket 1.4.16 (prints the selected date), but > does not in Wicket 1.5.5 (prints null): > > public class DatePage extends WebPage { > > private Date date; > > public DatePage() { > super(); > > final DateField txtDate = new DateField("txtDate", new > PropertyModel(this, > "date")) { > @Override > protected DateTextField > newDateTextField(java.lang.String id, > PropertyModel dateFieldModel) { > DateTextField f = super.newDateTextField(id, > dateFieldModel); > f.add(createAjaxBehavior()); > return f; > } > }; > add(txtDate); > } > > private AjaxFormComponentUpdatingBehavior createAjaxBehavior() { > return new AjaxFormComponentUpdatingBehavior("onchange") { > @Override > protected void onUpdate(AjaxRequestTarget target) { > System.out.println("*** date=" + date); > } > > }; > } > > } > > Does anyone know something about this? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DateField-and-AjaxFormComponentUpdatingBehavior-in-wicket-1-5-5-tp4551607p4551607.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: How to enable SSI in wicket framework.
See org.apache.wicket.markup.html.include.Include Maybe it will do the job On Thu, Apr 12, 2012 at 5:17 PM, Dan Retzlaff wrote: > I think the challenge is getting content from a /ssi/footer request > integrated into a Wicket-rendered page. AFAIK Wicket doesn't provide any > component for that. It might be possible using servlet's "forward" > capability from a custom Wicket component's onComponentTagBody. It seems to > be used for generating internal requests, but I'm not familiar with the > details. > > On Wed, Apr 11, 2012 at 11:35 PM, Martin Grigorov wrote: > >> See filter-mapping and servlet-mapping elements in web.xsd >> >> On Thu, Apr 12, 2012 at 9:20 AM, vaibhav228 wrote: >> > Hi Martin, >> > Thanks for the reply. I am new to wicket framework. Can you >> > please elaborate more on how to do the setting that you have provided. It >> > would be very helpful. >> > My app is running at ROOT level. SSI is already enabled in the >> > web.xml file by removing the SSI servlet tags comments. >> > >> > -- >> > View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/How-to-enable-SSI-in-wicket-framework-tp4548962p4551039.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 >> > >> >> >> >> -- >> Martin Grigorov >> jWeekend >> Training, Consulting, Development >> http://jWeekend.com >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to enable SSI in wicket framework.
I think the challenge is getting content from a /ssi/footer request integrated into a Wicket-rendered page. AFAIK Wicket doesn't provide any component for that. It might be possible using servlet's "forward" capability from a custom Wicket component's onComponentTagBody. It seems to be used for generating internal requests, but I'm not familiar with the details. On Wed, Apr 11, 2012 at 11:35 PM, Martin Grigorov wrote: > See filter-mapping and servlet-mapping elements in web.xsd > > On Thu, Apr 12, 2012 at 9:20 AM, vaibhav228 wrote: > > Hi Martin, > > Thanks for the reply. I am new to wicket framework. Can you > > please elaborate more on how to do the setting that you have provided. It > > would be very helpful. > > My app is running at ROOT level. SSI is already enabled in the > > web.xml file by removing the SSI servlet tags comments. > > > > -- > > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/How-to-enable-SSI-in-wicket-framework-tp4548962p4551039.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 > > > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
RE: Built with Wicket: showcases for Wicket applications
Thanks for the reminder. FYI... whoever built ZipGrocery - you are running your site with the ajax debugger still on. -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Thursday, April 12, 2012 5:49 AM To: users@wicket.apache.org Subject: Built with Wicket: showcases for Wicket applications "Built with Wicket" is Apache Wicket's portfolio blog showcasing what our community has created with your favorite web framework. But why only see what others are building when you can share your own creation? Submit your application to "Built with Wicket". Your application doesn't necessarily need to be publicly accessible, but we do want a description of what your application does and a screenshot. http://builtwithwicket.tumblr.com Share the love, share your application at Built with Wicket! - 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 1.5 - Generic JSON Response
If you have a number of JSON end-points, the best architecture would probably be to use Spring MVC to do the JSON handling, and then map the Spring MVC paths into your web app using the Wicket filter ignore paths option ( https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html#BestPracticesandGotchas- ). Thanks Andrew On Thu, Apr 12, 2012 at 8:47 AM, Ahijah wrote: > > Martin Grigorov-4 wrote > > > > On Thu, Apr 12, 2012 at 7:38 AM, Ahijahwrote: > > > > mountResource("/Feed2", new MyResourceReference()); > > > > class MyResourceReference extends ResourceReference { > > public IResource getResource() { return new MyResource(); } > > } > > > > Thanks Martin! For everyone else's reference, the final code that is > working looks like this: > > --Feed.class > public class Feed extends AbstractResource { > >private static final long serialVersionUID = 1L; > > protected ResourceResponse newResourceResponse(Attributes a) { > ResourceResponse r = new ResourceResponse(); >r.setContentType("application/json"); >r.setWriteCallback(new WriteCallback() { >public void writeData(Attributes a) { > > > a.getResponse().write("[{\"id\":111,\"title\":\"MainEvent\",\"start\":\"2012-04-10T07:00:00\",\"end\":\"2012-04-10T09:30:00\",\"url\":\"?EventID=111\",\"allDay\":false}]"); > } >}); >return r; >} > > } > ---End Feed.class-- > > --Application.class >@Override >protected void init() { >super.init(); >mountResource("/Feed", new FeedReference()); >} > >public class FeedReference extends ResourceReference { >public FeedReference() { >super(FeedReference.class, "feed"); >} >public IResource getResource() { return new Feed(); } >} > ---End Application.class- > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Generic-JSON-Response-tp4550807p4551752.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 > >
[Conception] question about mixed entities and model
hi everybody,, I'm new into the forum and i'm french so i'm begging you to excuse my english. I have to create a panel which contains a ListView of a mixed entity object. A little example: public Person implements Serializable{ getName() } public Event implements Serializable{ getType() } public Mail implements Serializable{ getText() } These objects are generated by wsdl2java because my IHM layer communicate with my business layer by web service. It's like that and I can't change the architecture. I would like to print something like that: "There are 3 lines" colomn "Name"--colomn "value" person1.getName() -- event1.getType() person2.getName() -- mail2.getText() person3.getName() -- event3.getType() But every examples found are about somethings like that ListView new Listview("id",listModel); with Book is a persisted object from Hibernate. My question is: Is it a good or bad practice to do that MyPanel extends Panel{ @SpringBean public TableService tableService public MyPanel(String id){ super(id); IModel> listModel = new AbstractReadOnlyModel(){ getObject(){ tableService.getLines();} } List lines = (List) listModel.getObject(); int current; if(lines.size() > 2){ current = lines.size(); }else{ current = 0; } add(new Label("count", current); add(new ListView("list", listModel){ populateItems(){ Item item = (Line) getModel(); add(new Label("name",item.getName()); add(new Label("value",item..getValue()); } };); } } public TableauServiceImpl implements TableauService{ public List getLines(){ List lines = new ArrayList(); Line line1 = new Line(); // person and event are retrieve by others services line1.setName(person1.getName()); line1.setValue(event1.getType()); lines.add(line1); line2.setName(person1.getName()); line2.setValue(mail1.gettext()); lines.add(line2); return lines; } } It's a stupid example but i have to do something like this. And i'm afraid not to respect good practices presents here (http://www.devproof.org/wicket_best_practice) and not understand something. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Conception-question-about-mixed-entities-and-model-tp4551789p4551789.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.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
@Override protected void onBeforeRender() { System.out.println( foo ); System.out.println( foo.getClass() ); super.onBeforeRender(); } When using @Stateless, the output is : 08:52:35,027 INFO [stdout] (http--127.0.0.1-8080-1) Proxy for view class: com.foo.FooStateless of EJB: FooStateless 08:52:35,028 INFO [stdout] (http--127.0.0.1-8080-1) class com.foo.FooStateless$Proxy$_$$_Weld$Proxy$ when using @ApplicationScoped, the output is: 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) com.foo.FooStateless@201a6e9 08:54:00,831 INFO [stdout] (http--127.0.0.1-8080-4) class com.foo.FooStateless$Proxy$_$$_WeldClientProxy On Thu, Apr 12, 2012 at 8:46 AM, Martin Grigorov wrote: > The difference is that scoped beans are represented by proxy. > I guess there is no proxy for the stateless EJB. You can verify this > by putting a breakpoint in your page's #onBeforeRender() and checking > the type of the injected value. > > Later during deserialization the current class loader cannot load > class org.jboss.msc.service.ServiceName. > In the case with scoped bean the proxy is loaded without problems and > it seems the proxy itself deals with the class loading of the > underlying bean. > > On Thu, Apr 12, 2012 at 3:40 PM, Jonathan Tougas > wrote: > > I'm not familiar with the Wicketopia source, but doing a quick scan I > can't > > find any EJBs in there. The problem in this case occurs if the > FooStateless > > class is @Stateless. Changing this to @ApplicationScoped, the problem > goes > > away. > > > > On Thu, Apr 12, 2012 at 8:28 AM, Jonathan Tougas > wrote: > > > >> A stateless bean is injected into the home page class. Load the page in > >> two tabs (so twice in the same session), then on the first tab, press > the > >> button. The error occurs every time in this scenario. > >> > >> On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov >wrote: > >> > >>> Hi, > >>> > >>> On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas > >>> wrote: > >>> > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to the > >>> mix. > >>> > In certain cases when Wicket deserializes a Page containing a > reference > >>> to > >>> > a CDI bean, I get this exception: > >>> > >>> In what cases exactly ? > >>> Because the problem is > >>> > >>> Caused by: java.lang.ClassNotFoundException: > >>> org.jboss.msc.service.ServiceName from [Module > >>> "deployment.wicket.war:main" > >>> from Service Module Loader] > >>> > >>> In what cases this class is no more loadable by the current class > loader ? > >>> > >>> > > >>> > 15:10:30,841 ERROR [org.apache.wicket.request.RequestHandlerStack] > >>> > (http--127.0.0.1-8080-1) Error detaching RequestHandler: > >>> > java.lang.RuntimeException: Could not deserialize object using: class > >>> > > >>> > org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream > >>> > at > >>> > > >>> > org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.request.handler.PageProvider.getPageParameters(PageProvider.java:184) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.request.handler.logger.PageLogData.(PageLogData.java:51) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > at > >>> > > >>> > org.apache.wicket.request.handler.logger.ListenerInterfaceLogData.(ListenerInterfaceLogData.java:56) > >>> > [wicket-core-1.5.5.jar:1.5.5] > >>> > a
Re: Wicket 1.5 - Generic JSON Response
Martin Grigorov-4 wrote > > On Thu, Apr 12, 2012 at 7:38 AM, Ahijahwrote: > > mountResource("/Feed2", new MyResourceReference()); > > class MyResourceReference extends ResourceReference { > public IResource getResource() { return new MyResource(); } > } > Thanks Martin! For everyone else's reference, the final code that is working looks like this: --Feed.class public class Feed extends AbstractResource { private static final long serialVersionUID = 1L; protected ResourceResponse newResourceResponse(Attributes a) { ResourceResponse r = new ResourceResponse(); r.setContentType("application/json"); r.setWriteCallback(new WriteCallback() { public void writeData(Attributes a) { a.getResponse().write("[{\"id\":111,\"title\":\"MainEvent\",\"start\":\"2012-04-10T07:00:00\",\"end\":\"2012-04-10T09:30:00\",\"url\":\"?EventID=111\",\"allDay\":false}]"); } }); return r; } } ---End Feed.class-- --Application.class @Override protected void init() { super.init(); mountResource("/Feed", new FeedReference()); } public class FeedReference extends ResourceReference { public FeedReference() { super(FeedReference.class, "feed"); } public IResource getResource() { return new Feed(); } } ---End Application.class- -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-Generic-JSON-Response-tp4550807p4551752.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.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
The difference is that scoped beans are represented by proxy. I guess there is no proxy for the stateless EJB. You can verify this by putting a breakpoint in your page's #onBeforeRender() and checking the type of the injected value. Later during deserialization the current class loader cannot load class org.jboss.msc.service.ServiceName. In the case with scoped bean the proxy is loaded without problems and it seems the proxy itself deals with the class loading of the underlying bean. On Thu, Apr 12, 2012 at 3:40 PM, Jonathan Tougas wrote: > I'm not familiar with the Wicketopia source, but doing a quick scan I can't > find any EJBs in there. The problem in this case occurs if the FooStateless > class is @Stateless. Changing this to @ApplicationScoped, the problem goes > away. > > On Thu, Apr 12, 2012 at 8:28 AM, Jonathan Tougas wrote: > >> A stateless bean is injected into the home page class. Load the page in >> two tabs (so twice in the same session), then on the first tab, press the >> button. The error occurs every time in this scenario. >> >> On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov wrote: >> >>> Hi, >>> >>> On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas >>> wrote: >>> > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to the >>> mix. >>> > In certain cases when Wicket deserializes a Page containing a reference >>> to >>> > a CDI bean, I get this exception: >>> >>> In what cases exactly ? >>> Because the problem is >>> >>> Caused by: java.lang.ClassNotFoundException: >>> org.jboss.msc.service.ServiceName from [Module >>> "deployment.wicket.war:main" >>> from Service Module Loader] >>> >>> In what cases this class is no more loadable by the current class loader ? >>> >>> > >>> > 15:10:30,841 ERROR [org.apache.wicket.request.RequestHandlerStack] >>> > (http--127.0.0.1-8080-1) Error detaching RequestHandler: >>> > java.lang.RuntimeException: Could not deserialize object using: class >>> > >>> org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream >>> > at >>> > >>> org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.handler.PageProvider.getPageParameters(PageProvider.java:184) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.handler.logger.PageLogData.(PageLogData.java:51) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.handler.logger.ListenerInterfaceLogData.(ListenerInterfaceLogData.java:56) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.detach(ListenerInterfaceRequestHandler.java:134) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.detach(RequestCycle.java:792) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.RequestHandlerStack.detach(RequestHandlerStack.java:180) >>> > [wicket-request-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:596) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:539) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:287) >>> > [wicket-core-1.5.5.jar:1.5.5] >>> > at >>> > >>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:185) >>> > [wick
Re: Wicket 1.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
I'm not familiar with the Wicketopia source, but doing a quick scan I can't find any EJBs in there. The problem in this case occurs if the FooStateless class is @Stateless. Changing this to @ApplicationScoped, the problem goes away. On Thu, Apr 12, 2012 at 8:28 AM, Jonathan Tougas wrote: > A stateless bean is injected into the home page class. Load the page in > two tabs (so twice in the same session), then on the first tab, press the > button. The error occurs every time in this scenario. > > On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov wrote: > >> Hi, >> >> On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas >> wrote: >> > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to the >> mix. >> > In certain cases when Wicket deserializes a Page containing a reference >> to >> > a CDI bean, I get this exception: >> >> In what cases exactly ? >> Because the problem is >> >> Caused by: java.lang.ClassNotFoundException: >> org.jboss.msc.service.ServiceName from [Module >> "deployment.wicket.war:main" >> from Service Module Loader] >> >> In what cases this class is no more loadable by the current class loader ? >> >> > >> > 15:10:30,841 ERROR [org.apache.wicket.request.RequestHandlerStack] >> > (http--127.0.0.1-8080-1) Error detaching RequestHandler: >> > java.lang.RuntimeException: Could not deserialize object using: class >> > >> org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream >> > at >> > >> org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.handler.PageProvider.getPageParameters(PageProvider.java:184) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.handler.logger.PageLogData.(PageLogData.java:51) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.handler.logger.ListenerInterfaceLogData.(ListenerInterfaceLogData.java:56) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.detach(ListenerInterfaceRequestHandler.java:134) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.detach(RequestCycle.java:792) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.RequestHandlerStack.detach(RequestHandlerStack.java:180) >> > [wicket-request-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:596) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:539) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:287) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:185) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:241) >> > [wicket-core-1.5.5.jar:1.5.5] >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) >> > [jbossweb-7.0.10.Final.jar:] >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) >> > [jbossweb-7.0.10.Final.jar:] >> > at >> > >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) >> > [jbossweb-7.0.10.Final.jar:] >> > at >> > >> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) >
Re: Wicket 1.5.5 + JBoss 7.1.1 + CDI - ClassNotFoundException
A stateless bean is injected into the home page class. Load the page in two tabs (so twice in the same session), then on the first tab, press the button. The error occurs every time in this scenario. On Thu, Apr 12, 2012 at 2:41 AM, Martin Grigorov wrote: > Hi, > > On Wed, Apr 11, 2012 at 10:54 PM, Jonathan Tougas > wrote: > > I'm running Wicket 1.5 on JBoss 7.1.1 with some CDI thrown in to the mix. > > In certain cases when Wicket deserializes a Page containing a reference > to > > a CDI bean, I get this exception: > > In what cases exactly ? > Because the problem is > > Caused by: java.lang.ClassNotFoundException: > org.jboss.msc.service.ServiceName from [Module "deployment.wicket.war:main" > from Service Module Loader] > > In what cases this class is no more loadable by the current class loader ? > > > > > 15:10:30,841 ERROR [org.apache.wicket.request.RequestHandlerStack] > > (http--127.0.0.1-8080-1) Error detaching RequestHandler: > > java.lang.RuntimeException: Could not deserialize object using: class > > > org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream > > at > > > org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.handler.PageProvider.getPageParameters(PageProvider.java:184) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.handler.logger.PageLogData.(PageLogData.java:51) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.handler.logger.ListenerInterfaceLogData.(ListenerInterfaceLogData.java:56) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.detach(ListenerInterfaceRequestHandler.java:134) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.detach(RequestCycle.java:792) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.RequestHandlerStack.detach(RequestHandlerStack.java:180) > > [wicket-request-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.cycle.RequestCycle.onDetach(RequestCycle.java:596) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:539) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:287) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:185) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:241) > > [wicket-core-1.5.5.jar:1.5.5] > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) > > [jbossweb-7.0.10.Final.jar:] > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) > > [jbossweb-7.0.10.Final.jar:] > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) > > [jbossweb-7.0.10.Final.jar:] > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) > > [jbossweb-7.0.10.Final.jar:] > > at > > > org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) > > [jboss-as-web-7.1.0.Final.jar:7.1.0.Final] > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) > > [jbossweb-7.0.10.Final.jar:] > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > > [jbossweb-7.0.10.
DateField and AjaxFormComponentUpdatingBehavior in wicket 1.5.5
I created a simple page with a DateField and an AjaxFormComponentUpdatingBehavior where I want to read the model. The following code does work in Wicket 1.4.16 (prints the selected date), but does not in Wicket 1.5.5 (prints null): public class DatePage extends WebPage { private Date date; public DatePage() { super(); final DateField txtDate = new DateField("txtDate", new PropertyModel(this, "date")) { @Override protected DateTextField newDateTextField(java.lang.String id, PropertyModel dateFieldModel) { DateTextField f = super.newDateTextField(id, dateFieldModel); f.add(createAjaxBehavior()); return f; } }; add(txtDate); } private AjaxFormComponentUpdatingBehavior createAjaxBehavior() { return new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { System.out.println("*** date=" + date); } }; } } Does anyone know something about this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DateField-and-AjaxFormComponentUpdatingBehavior-in-wicket-1-5-5-tp4551607p4551607.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.5.5, HtmlHandler & markup without "base" tag problem
Hi, Please create a ticket with a simple quickstart app that demonstrates the problem. Thanks! On Thu, Apr 12, 2012 at 12:55 PM, mjirkovsky wrote: > Hi, > > I have custom component (extends MarkupContainer implements > IMarkupCacheKeyProvider, IMarkupResourceStreamProvider) which fetches its > HTML markup from database. > Following HTML markup: > > >
Some text >
Some more text > > causes following error: > > 2012-04-12 10:52:53,012 [http-8080-6] ERROR: Unexpected error occurred > Unable to find close tag for: ' src="img/supplier/supplier1.png">' in > org.apache.wicket.util.resource.StringBufferResourceStream@3d7e16fc > MarkupStream: [unknown] > at > org.apache.wicket.markup.MarkupFragment.(MarkupFragment.java:127) > at > org.apache.wicket.markup.MarkupStream.getMarkupFragment(MarkupStream.java:485) > at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:244) > at > org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1421) > at > org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1596) > at > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1571) > at > org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525) > > I think the problem is that > org.apache.wicket.markup.parser.filter.HtmlHandler does not handle such > markup correctly. It does not call ComponentTag.setHasNoCloseTag(true) for > the img tag. Such call is missing in postProcess() method. I think that this > problem can be fixed by inserting: > > top.setHasNoCloseTag(true); > > after line 80 in HtmlHandler.java file. > > > Michal > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-5-HtmlHandler-markup-without-base-tag-problem-tp4551420p4551420.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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket 1.5.5, HtmlHandler & markup without "base" tag problem
Hi, I have custom component (extends MarkupContainer implements IMarkupCacheKeyProvider, IMarkupResourceStreamProvider) which fetches its HTML markup from database. Following HTML markup:
Some text
Some more text causes following error: 2012-04-12 10:52:53,012 [http-8080-6] ERROR: Unexpected error occurred Unable to find close tag for: '' in org.apache.wicket.util.resource.StringBufferResourceStream@3d7e16fc MarkupStream: [unknown] at org.apache.wicket.markup.MarkupFragment.(MarkupFragment.java:127) at org.apache.wicket.markup.MarkupStream.getMarkupFragment(MarkupStream.java:485) at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:244) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1421) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1596) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1571) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525) I think the problem is that org.apache.wicket.markup.parser.filter.HtmlHandler does not handle such markup correctly. It does not call ComponentTag.setHasNoCloseTag(true) for the img tag. Such call is missing in postProcess() method. I think that this problem can be fixed by inserting: top.setHasNoCloseTag(true); after line 80 in HtmlHandler.java file. Michal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-5-HtmlHandler-markup-without-base-tag-problem-tp4551420p4551420.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: IDataProvider#size()
That's the solution which I have used for the case, where count is not possible. It has only one slight disadvantage - if count == n*pageSize then the last page will be blank. Best regards, Michal Wegrzyn > -Original Message- > From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] > Sent: Thursday, April 12, 2012 6:06 > To: users@wicket.apache.org > Subject: Re: IDataProvider#size() > > why not just fake the size to current page+1? that way you always have > a "next" link and once you receive the current page you should know if > you have more or not so you dont have to add the one on the last > page > > -igor > > On Wed, Apr 11, 2012 at 6:59 PM, Dan Retzlaff > wrote: > > Hi all. Time to start a thread of my own. :) > > > > Many of Wicket's powerful repeaters depend on IDataProvider. This > > interface has a size() method which returns a non-null integer. This > > makes it easy to determine the total number of pages in a pageable > > view, but IMO the required computation and application complexity are > not always called for. > > In many cases, a pageable but open-ended data view is adequate. Have > > you experienced this impedance mismatch yourselves? What was your > solution? > > > > To elaborate on my experience: > > > > For SQL-based views, the application complexity comes from the need > to > > construct a count(*) query with exactly the same criteria as the > > subsequent result query. In my experience, this pollutes DAO > > interfaces and IDataProvider implementation non-trivially. We > > initially had separate methods for counting and querying (same args), > > but eventually moved to a single method that returns a > > -tuple with both the results and total size which our > > IDataProvider caches. This lets us do some Hibernate trickery to > > introduce a MySQL SQL_CALC_FOUND_ROWS query hint, avoiding separate > > count/results queries in most cases. It's still not simple, and for > large counts is still expensive. > > > > The situation is worse for non-SQL data stores which don't have a > > fully-functional count(*) capability. We use Cassandra whose native > > "where clause" support is limited, requiring significant client-side > filtering. > > Paging through an entire column (or CF) in this way is prohibitively > > expensive, especially considering our users rarely even go to page 2. > > To solve this, we've created a parallel set of view/paging classes > > that define windows using previously discovered result keys instead > of > > start indices (tokens and column names in Cassandra). But having a > > full suite of IUnsizedDataProvider-based classes smells. I love that > > Wicket devs have solved some tough/tedious problems with DataViewBase > > and friends, and I want to make use of them! > > > > Comments or suggestions? > > > > Cheers, > > Dan > > - > 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: IDataProvider#size()
On Thu, Apr 12, 2012 at 9:12 AM, Martin Grigorov wrote: > On Thu, Apr 12, 2012 at 4:59 AM, Dan Retzlaff wrote: >> Hi all. Time to start a thread of my own. :) >> >> Many of Wicket's powerful repeaters depend on IDataProvider. This interface >> has a size() method which returns a non-null integer. This makes it easy to >> determine the total number of pages in a pageable view, but IMO the >> required computation and application complexity are not always called for. >> In many cases, a pageable but open-ended data view is adequate. Have you >> experienced this impedance mismatch yourselves? What was your solution? > > Wicketstuff InMethod Grid supports this use case. > One of its examples shows it. > I'll deploy the examples at wicket-library.com soon. http://www.wicket-library.com/inmethod-grid/data-grid/unknown-count > >> >> To elaborate on my experience: >> >> For SQL-based views, the application complexity comes from the need to >> construct a count(*) query with exactly the same criteria as the subsequent >> result query. In my experience, this pollutes DAO interfaces and >> IDataProvider implementation non-trivially. We initially had separate >> methods for counting and querying (same args), but eventually moved to a >> single method that returns a -tuple with both the results and >> total size which our IDataProvider caches. This lets us do some Hibernate >> trickery to introduce a MySQL SQL_CALC_FOUND_ROWS query hint, avoiding >> separate count/results queries in most cases. It's still not simple, and >> for large counts is still expensive. >> >> The situation is worse for non-SQL data stores which don't have a >> fully-functional count(*) capability. We use Cassandra whose native "where >> clause" support is limited, requiring significant client-side filtering. >> Paging through an entire column (or CF) in this way is prohibitively >> expensive, especially considering our users rarely even go to page 2. To >> solve this, we've created a parallel set of view/paging classes that define >> windows using previously discovered result keys instead of start indices >> (tokens and column names in Cassandra). But having a full suite of >> IUnsizedDataProvider-based classes smells. I love that Wicket devs have >> solved some tough/tedious problems with DataViewBase and friends, and I >> want to make use of them! >> >> Comments or suggestions? >> >> Cheers, >> Dan > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxFormComponentUpdatingBehavior to enable/disable a component
Thanks a lot. I did not see it. Also my first error in Wicket Ajax Debug was because I had some invisible components in my ListItem. So after I checked also for visibility everything was ok. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-to-enable-disable-a-component-tp4551288p4551309.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: AjaxFormComponentUpdatingBehavior to enable/disable a component
On Thu, Apr 12, 2012 at 11:52 AM, dpmihai wrote: > Hi. > > I have a set of components C (anything you want Label, DateField, > TextField, DropDownChoice ...) > and another ChechBox inside a ListItem. I want to use the checkbox for > enabling / disabling of all components C (when checkbox is selected I want > to disable all C components): > > final CheckBox dynamicChkBox = new CheckBox("dynamicChkBox", > dynamicModel); > dynamicChkBox.add(new AjaxFormComponentUpdatingBehavior("onchange") > { > protected void onUpdate(AjaxRequestTarget target) { > Iterator it = item.iterator(); // item is my ListItem > while (it.hasNext()) { > Component component = (Component) it.next(); here do not disable the checkbox itself > component.setEnabled(!(Boolean) > dynamicModel.getObject()); > if ((target != null) && > !component.getId().startsWith("dynamic")) { > target.add(component); > } > } > } > }); > > Initially dynamic check box is not selected. I select the checkbox and my > set of components C becomes disabled as desired, but then if I deselect the > chechbox I get an error: > > org.apache.wicket.request.handler.ListenerInvocationNotAllowedException: > Behavior rejected interface invocation. Component: [CheckBox [Component id = > dynamicChkBox]] Behavior: com.asf.nextserver.web.report.NextRuntimePanel$1 > {event='onchange'} Listener: [RequestListenerInterface > name=IBehaviorListener, method=public abstract void > org.apache.wicket.behavior.IBehaviorListener.onRequest()] > at > org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237) > . > > I noticed that when I first select the checkbox even if the components are > disabled Wicket Ajax Debug shows an error like : > ERROR: Wicket.Ajax.Call.processComponent: Component with id [[txtTime145]] > was not found while trying to perform markup update. Make sure you called > component.setOutputMarkupId(true) on the component whose markup you are > trying to update. > > I do not know why, because I put setOutputMarkupId(true) on all my > components C. > > Is there somtehing I can do? > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-to-enable-disable-a-component-tp4551288p4551288.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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxFormComponentUpdatingBehavior to enable/disable a component
Hi. I have a set of components C (anything you want Label, DateField, TextField, DropDownChoice ...) and another ChechBox inside a ListItem. I want to use the checkbox for enabling / disabling of all components C (when checkbox is selected I want to disable all C components): final CheckBox dynamicChkBox = new CheckBox("dynamicChkBox", dynamicModel); dynamicChkBox.add(new AjaxFormComponentUpdatingBehavior("onchange") { protected void onUpdate(AjaxRequestTarget target) { Iterator it = item.iterator(); // item is my ListItem while (it.hasNext()) { Component component = (Component) it.next(); component.setEnabled(!(Boolean) dynamicModel.getObject()); if ((target != null) && !component.getId().startsWith("dynamic")) { target.add(component); } } } }); Initially dynamic check box is not selected. I select the checkbox and my set of components C becomes disabled as desired, but then if I deselect the chechbox I get an error: org.apache.wicket.request.handler.ListenerInvocationNotAllowedException: Behavior rejected interface invocation. Component: [CheckBox [Component id = dynamicChkBox]] Behavior: com.asf.nextserver.web.report.NextRuntimePanel$1 {event='onchange'} Listener: [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237) . I noticed that when I first select the checkbox even if the components are disabled Wicket Ajax Debug shows an error like : ERROR: Wicket.Ajax.Call.processComponent: Component with id [[txtTime145]] was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update. I do not know why, because I put setOutputMarkupId(true) on all my components C. Is there somtehing I can do? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-to-enable-disable-a-component-tp4551288p4551288.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: tomcat deployment issues
Hi, Can you put a breakpoint in WicketServlet#init() ? The only reason for that I see is this servlet to be initialized twice ... Even better set the breakpoint in Application#setName() and see who is calling it and how many times On Thu, Apr 12, 2012 at 4:41 AM, Alex Rass wrote: > If someone could help me out with this issue, that would be awesome. > > Currently: > Deploying on Tomcat 6. > > Default deploy folder is webapps > webapps/ROOT is where my 1st wicket app is (lets call it App1) > webapps.web2 is another Host record for a different URL. > webapps.web2/app2 is my wicket app #2 > > No matter what I tried, app#2 doesn't get started (but servlets from same > context work fine). > When I go to the url, it says: > > java.lang.IllegalStateException: Application with name 'App2' already exists.' > org.apache.wicket.Application.setName(Application.java:854) > > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:337) > > org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:271) > javax.servlet.GenericServlet.init(GenericServlet.java:212) > ... > > I tried renaming it to App3 (in web.xml and I get same message except it says > App3). > I checked all the web.xml files on the server, no other one has App2 in it. > > I have lib folders under each app. I don't share anything beside DB drivers > in Tomcat's lib folder. > I have Wicket 1.5.4 for App1 and 1.5.5 for App2 (donno if that makes a diff). > > Any ideas? > > Regards, > - Alex. > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: IE9 Memory leak when updating component with Ajax (Wicket 1.5.5)
Ok, it seems that time takes care of this problem and leak is not wicket-ajax problem: Tests with IE 10 (consumer preview) shows no leaking, gc seems to work and browser refresh clears the memory. There were no leaking with Opera, Firefox and Chrome. Furthermore previous JS debugging did not show that anything was piling in dom, so it must be IE9 inner problem. Only leaking is this IE9 in IE9 document mode, can't see any point filing a ticket. Anyway quickstart is available at http://uploading.com/files/51fc2bcb/ie9memory.zip/ Easy way to check Process Explorer -> "select iexplore.exe"-> Properties..-> Performance Graph -> Private bytes -Original Message- From: Heikki Uotinen [mailto:heikki.uoti...@syncrontech.com] Sent: 11. huhtikuuta 2012 14:38 To: users@wicket.apache.org Subject: RE: IE9 Memory leak when updating component with Ajax (Wicket 1.5.5) Hi, 1) Process Explorer and IE developer tools 2) ok -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: 11. huhtikuuta 2012 14:14 To: users@wicket.apache.org Subject: Re: IE9 Memory leak when updating component with Ajax (Wicket 1.5.5) Hi, From your mails I still don't understand how exactly you measure the memory consumption. You have two options: 1) google for "javascript memory leak". You can add "Internet explorer" in the search term too I'm not sure whether IE has tools to deal with that but you can use and see whether it helps somehow 2) create a ticket in Wicket Jira with a quickstart and detailed description how to reproduce and how to measure and let someone else to debug it for you. On Wed, Apr 11, 2012 at 1:50 PM, Heikki Uotinen wrote: > Hi, > > I tested against apache-wicket-6.0.0-beta1 with that simple example in the > first mail. > > Application still leaked memory on IE9 document mode, same behavior as with > 1.5.5. > > Confirmed that it is using jQuery: > > src="../resource/org.apache.wicket.resource.JQueryResourceReference/jq > uery/jquery-ver-1334139767559.js"> > > src="../resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/re > s/js/wicket-event-jquery-ver-1334139767559.js"> > > src="../resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/re > s/js/wicket-ajax-jquery-ver-1334139767559.js"> > > Suggestions ? > > > -Original Message- > From: Chris Colman [mailto:chr...@stepaheadsoftware.com] > Sent: 11. huhtikuuta 2012 11:47 > To: users@wicket.apache.org > Subject: RE: IE9 Memory leak when updating component with Ajax (Wicket > 1.5.5) > >>> how exactly did you solve it with jQuery ? >> >>Since this leak seems to be caused by wicket-ajax calls then solution > would >>be bypassing >>those, this would be the last resort. > > Wicket 6 uses jQuery for its AJAX backhauling. I wonder if, therefore, if > your app were ported to Wicket 6 if the IE9 problem goes away. > > > - > 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 > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org