Re: [Wicket-user] Good Tutorial on core wicket
I'm not new to Wicket, I'm using it for about a year, but there still a lot aspects obscure to me like PageMap, page versioning, details of page request cycle and so on. me too, I also think some more core concept needs more documentation, pro wicket is nice and can get you going with tables, ajax, pages, tabbedpanel etc, but 300pages does not reach to the point of explaining tons of stuffs, especially with new 1.3 features. I was waiting Wicket in action, any news still after the constructor changes drop? Matthew Paolo Di Tommaso wrote: Anyway Francisco is right, I'm also thinking that Wicket is really missing a good tutorial about core concepts. I'm not new to Wicket, I'm using it for about a year, but there still a lot aspects obscure to me like PageMap, page versioning, details of page request cycle and so on. Wicket is really a good framework that covers every details of the web application stack (and they are many and many not just web page rendering ..), but I'm thinking that a good tutorial about Wicket core concepts would be very useful to novice users as well as experts. Thank you. - Paolo On 5/3/07, Igor Vaynberg [EMAIL PROTECTED] wrote: as far as models go http://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models -igor On 5/3/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: I will be glad to help out in any way. Here are my thoughts to the community. If we could talk about core wiket ideas and implementations, for instance: Models (Concept, interfaces, implementations) Session Application Pages Listeners Versioning Request and Response Cycles Page Life Cycle. The thing is, it is not the same (AT ALL) to build a wicket application than it is to build a struts application (Other than struts sucks :P) which are the concepts and design guidelines we should have? That is what I am trying to address. Because of my current infinite ignorance, I might not be the right person to build this type of document. Although I could write some docs after I get an Idea from the Book Pro-Wicket or Wicket-Pro (don't remember just know) and migrate to 1.3, and do some other demos. I think I could start writing in about a month or so. Other than that any thing else I could do would be nice to help out. Regards, f(t) On 5/3/07, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think we have something that is focused on the core architecture. if you have specific questions we will be happy to answer them and maybe you can compile them into a document. it is hard to find time to work specifically on high level documentation because this list, coding, jira, javadoc, etc take up a lot of time. by the time someone gets to a point where they have enough knowledge to write such docs they are usually buried in fixing bugs :) -igor On 5/3/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: H igor, thanks, but could you be more specific. I do think I browsed the wiki but couldn't find what I was looking for. For instance: http://cwiki.apache.org/WICKET/documentation-index.html appears to list many referential How to's but not core framework architecture. I know there is a little bit in many of the reference samples. But is there a paper on module architecture and core objects. Other than the javadoc I mean. francisco On 5/3/07, Igor Vaynberg [EMAIL PROTECTED] wrote: our wiki has links to various articles that might be of help to you. browsing the wiki is usually also good. -igor On 5/3/07, Francisco Diaz Trepat - gmail [EMAIL PROTECTED] wrote: Hello everyone, I am about to buy this book called pro wicket http://www.amazon.com/Pro-Wicket-Experts-Voice-Java/dp/1590597222/ref=pd_bbs_sr_1/103-4798570-8657439?ie=UTF8s=booksqid=1178205890sr=8-1 . But until it gets here (Argentina) would anyone point me in the right direction to read something on-line. What I am looking for is a tutorial / reference / on-line book / etc. covering the CORE, architecture, vision, a guide on how to structure your design. I have very successfully built a good enough demo, so I got around the reference samples, some docs, and this mailing list. But I cannot say at all that I know wicket. I would very much like to learn more about its internals 'cause I think that will also guide me to better designs by knowing more of wicket potentials. Thanks in advance, f(t) PS: Does the name wicket comes from being a real wicked as in cool or awsome framework or from the name of the cutest EWOK on Episode 6? XD.
Re: [Wicket-user] StatelessForm and setRedirect(true) in the onSubmit method
Issue created. https://issues.apache.org/jira/browse/WICKET-405 Thank you. Matthew Eelco Hillenius wrote: Do you mind if I send you that application through Email attachment? Since I am afraid I can't explain well in English. The expiration problem still exists after logging into the application from a stateless form with a redirect(true). In that case, the best way is to open up an issue in JIRA and attach your zip to that issue. And do you guys know why CompoundRequestCycleProcessor disappear in the wicket-1.3.0-incubating-SNAPSHOT.jar (Mar 18), I am using it for URL encryption. Yep, see http://cwiki.apache.org/WICKET/migrate-13.html#Migrate-1.3-IRequestCycleProcessorgotsimplified For the crypted url variant, put: /** * @see wicket.protocol.http.WebApplication#newRequestCycleProcessor() */ protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor() { protected IRequestCodingStrategy newRequestCodingStrategy() { return new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy()); } }; } in your application. Regards, Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/StatelessForm-and-setRedirect%28true%29-in-the-onSubmit-method-tf3347688.html#a9548433 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] StatelessForm and setRedirect(true) in the onSubmit method
Hi Johan, sorry to reply you this late, my colleague told me you guys have replied my message, and I also need the time to create a very simple quickstart application to reproduce this stateless and redirect(true) problem. Do you mind if I send you that application through Email attachment? Since I am afraid I can't explain well in English. The expiration problem still exists after logging into the application from a stateless form with a redirect(true). And do you guys know why CompoundRequestCycleProcessor disappear in the wicket-1.3.0-incubating-SNAPSHOT.jar (Mar 18), I am using it for URL encryption. Matthew Johan Compagner wrote: yes a submit will always be redirected so what happens if you don't do setRedirect(true) are you then not getting that expired page?? does the onSubmit really be called? Or is that already the expired page? johan On 3/5/07, Igor Vaynberg [EMAIL PROTECTED] wrote: dont know if there is a problem with stateless pages and redirects, but wicket's default redirect-to-buffer render strategy should already eliminate that popup by performing a redirect -igor On 3/5/07, Matthew Kwong [EMAIL PROTECTED] wrote: Hi guys, I encountered a problem in the stateless form, which is in my login page. The form code is as below: public final void onSubmit() { // Get session info DataStoreSession session = (DataStoreSession)getSession(); // Sign the user in if (session.authenticate(username, password)) { if (!continueToOriginalDestination()) { setRedirect(true); setResponsePage(new DataStoreTabbedPanelPage()); } } else { error(getLocalizer().getString(loginError, this, Unable to sign you in)); } } DataStoreTabbedPanelPage is a stateful page with all the components and panels. The session is also created after submit. However, when I click other pages, it gives me Expired Page. The reason I want to redirect because when the user successfully login, and press F5, firefox gives them a popup for them to resubmit the form and create another session. Is there any problem with the setRedirect(true) in stateless form? Matthew Kwong -- View this message in context: http://www.nabble.com/StatelessForm-and-setRedirect%28true%29-in-the-onSubmit-method-tf3347688.html#a9308281 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/StatelessForm-and-setRedirect%28true%29-in-the-onSubmit-method-tf3347688.html#a9545838 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] StatelessForm and setRedirect(true) in the onSubmit method
Hi guys, I encountered a problem in the stateless form, which is in my login page. The form code is as below: public final void onSubmit() { // Get session info DataStoreSession session = (DataStoreSession)getSession(); // Sign the user in if (session.authenticate(username, password)) { if (!continueToOriginalDestination()) { setRedirect(true); setResponsePage(new DataStoreTabbedPanelPage()); } } else { error(getLocalizer().getString(loginError, this, Unable to sign you in)); } } DataStoreTabbedPanelPage is a stateful page with all the components and panels. The session is also created after submit. However, when I click other pages, it gives me Expired Page. The reason I want to redirect because when the user successfully login, and press F5, firefox gives them a popup for them to resubmit the form and create another session. Is there any problem with the setRedirect(true) in stateless form? Matthew Kwong -- View this message in context: http://www.nabble.com/StatelessForm-and-setRedirect%28true%29-in-the-onSubmit-method-tf3347688.html#a9308281 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] LoadableDetachableModel in form processing
Sorry guys, I was in Chinese new year vacation and out of the town without any internet connection. Anyway, Iman is right, it is the model in palette that's causing this exception. Thank you so much :) Matthew Iman Rahmatizadeh wrote: Matthew, the line where you create a palette object, I see you're using Model instead of a Loadable model, what does the getDataStoreRoles() do ? Does it load the DataStoreUser object ? Models are normally dangerous to use with persistent objects, as they usually hold on to the instance during sessions instead of loading them again. Maybe that's causing the DataStoreUser object to live outside the previous session and cause the problem. Replace the Model with a LoadableDetachableModel and see if the problem goes away. And karthik, I create and release the hibernate session in the request cycle, which is just some variant of OpenSessionInViewFilter pattern, and haven't had any problems with it. You just have to remember to always get the object from the underlying model, and pass around the model. However the only problem is the code gets really ugly with all the casts and getObject() methods. I cant wait to move on to wicket 2.0 ! Iman On 2/19/07, karthik Guru [EMAIL PROTECTED] wrote: Personally I have have run into lot of issues with OpenSessionInViewFilter pattern, so much so that I decided to take it off - At least the app now works as 'I expect'. But then am not an hibernate expert. The standard solution is to use Session.merge() Doesn't merge recreate the entity if its say deleted by another user-session?. May be one can do a load before doing a merge just to make sure that the entry actually exists in the DB at that point in time. On 2/18/07, Ryan Holmes [EMAIL PROTECTED] wrote: org.hibernate.NonUniqueObjectException is a really common problem. My guess is that the DataStoreUser is being loaded once to pass it into the page constructor and again by the LoadableDetachableModel within the same Hibernate session. Same persistent object loaded into two separate instance variables in the same (Hibernate) session -- boom, NonUniqueObjectException. There are a couple of ways to fix this. The correct solution is to avd'oid loading the object more than once in the first place. For instance, maybe you could take a user id instead of a user object into your page constructor to remove one of the load operations. The standard solution is to use Session.merge() instead of, say, Session.saveOrUpdate () (I assume you're getting this exception when the Hibernate session flushes). In any event, this is happening because LoadableDetachableModel is working as intended and thereby revealing one of Hibernate's many quirks -- not because of a problem in Wicket. -Ryan On Feb 10, 2007, at 2:31 AM, Matthew Kwong wrote: Hi fellows, Last time I asked how to use chain in CompoundPropertyModel with LoadableDetachableModel, it worked since my page has no form (no submit). This time, I make another page and try to use the chain again, and hibernate throws org.hibernate.NonUniqueObjectException when I submit the form. Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [datastore2.model.DataStoreRole#1 ] My Panel: public UserDetail(String id, DataStoreUser user, final Panel prevPanel) { super(id); add(new FeedbackPanel(feedback)); add(new Link(back) { public void onClick() { getParent().replaceWith(prevPanel); } }); Form form = new Form(form) { protected void onSubmit() { DataStoreUser user = (DataStoreUser) this.getModelObject(); try { getDelegate().saveUser(user); info(You have saved the user profile: + user.getFullname() + .); } catch (Exception e) { e.printStackTrace(); error(Your user profile state is stale (someone has updated the same user profile while you are on this page). Please press BACK and come back.); } } }; form.setModel(new CompoundPropertyModel(new LoadableDataStoreUserModel(getDelegate().getDataStoreUser(user.getId (); form.add(new Label(id)); form.add(new Label(username)); form.add(new RequiredTextField(firstname)); form.add(new TextField(lastname).setConvertEmptyInputStringToNull(false)); form.add(new Label(email)); form.add(new Palette(roles, new Model((Serializable)getDelegate().getDataStoreRoles()), new RoleChoiceRenderer(), 10, true)); add(form); } Is LoadableDetachableModel working
[Wicket-user] LoadableDetachableModel in form processing
Hi fellows, Last time I asked how to use chain in CompoundPropertyModel with LoadableDetachableModel, it worked since my page has no form (no submit). This time, I make another page and try to use the chain again, and hibernate throws org.hibernate.NonUniqueObjectException when I submit the form. Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [datastore2.model.DataStoreRole#1] My Panel: public UserDetail(String id, DataStoreUser user, final Panel prevPanel) { super(id); add(new FeedbackPanel(feedback)); add(new Link(back) { public void onClick() { getParent().replaceWith(prevPanel); } }); Form form = new Form(form) { protected void onSubmit() { DataStoreUser user = (DataStoreUser)this.getModelObject(); try { getDelegate().saveUser(user); info(You have saved the user profile: + user.getFullname() + .); } catch (Exception e) { e.printStackTrace(); error(Your user profile state is stale (someone has updated the same user profile while you are on this page). Please press BACK and come back.); } } }; form.setModel(new CompoundPropertyModel(new LoadableDataStoreUserModel(getDelegate().getDataStoreUser(user.getId(); form.add(new Label(id)); form.add(new Label(username)); form.add(new RequiredTextField(firstname)); form.add(new TextField(lastname).setConvertEmptyInputStringToNull(false)); form.add(new Label(email)); form.add(new Palette(roles, new Model((Serializable)getDelegate().getDataStoreRoles()), new RoleChoiceRenderer(), 10, true)); add(form); } Is LoadableDetachableModel working for form processing? Because it is working if I only have form.setModel(new CompoundPropertyModel(getDelegate().getDataStoreUser(user.getId(; The reason why i want this loadable since I want to update the page with F5 refresh button again if someone has changed the same user in another computer. Thank you :) Matthew Kwong -- View this message in context: http://www.nabble.com/LoadableDetachableModel-in-form-processing-tf3204839.html#a8899449 Sent from the Wicket - User mailing list archive at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] obfuscate/encrypt a wicket url in 1.3
Hi fellows, I have just upgraded 1.2.4 to 1.3 branch because of the Palette compoundPropertyModel fix, and find out protected IRequestCycleProcessor newRequestCycleProcessor() { return new CompoundRequestCycleProcessor(new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy())); } is not working, the URL still shows ?wicket:interface=:1::: is it working for you? It was working in 1.2.4 Matthew Kwong -- View this message in context: http://www.nabble.com/obfuscate-encrypt-a-wicket-url-in-1.3-tf3199812.html#a8884030 Sent from the Wicket - User mailing list archive at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] obfuscate/encrypt a wicket url in 1.3
yea it is working now :) Matthew Eelco Hillenius wrote: Seems that was causes by the new way of handling URLs we introduced last week. I just committed a fix for 1.3 and 2.0. Cheers, Eelco On 2/9/07, Matthew Kwong [EMAIL PROTECTED] wrote: Hi fellows, I have just upgraded 1.2.4 to 1.3 branch because of the Palette compoundPropertyModel fix, and find out protected IRequestCycleProcessor newRequestCycleProcessor() { return new CompoundRequestCycleProcessor(new CryptedUrlWebRequestCodingStrategy(new WebRequestCodingStrategy())); } is not working, the URL still shows ?wicket:interface=:1::: is it working for you? It was working in 1.2.4 Matthew Kwong -- View this message in context: http://www.nabble.com/obfuscate-encrypt-a-wicket-url-in-1.3-tf3199812.html#a8884030 Sent from the Wicket - User mailing list archive at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/obfuscate-encrypt-a-wicket-url-in-1.3-tf3199812.html#a8896689 Sent from the Wicket - User mailing list archive at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] 1.3 and 2.0 schedules
Hi, is there a list on 1.3 new features and any more user guide target on 1.3, since I just upgraded from 1.2.4, I keep hearing stateless page, delayed session creation etc. (constructor changes only in 2.0?), of course I have read migrate-1.3 wiki page. Matthew Eelco Hillenius wrote: On 2/9/07, Scott Swank [EMAIL PROTECTED] wrote: Good morning all. We are just gearing up for our development effort with Wicket. We are looking at completing development mid-to-late March. Should we target Wicket 1.3 for the effort? Is 1.3 stable enough for us to work against it, or should we just stay with 1.2.x for now? You should definitively go for 1.3. Imo, there's enough good stuff in there to warrant using it, and we have several members (including me) who work on 1.3's head for their production systems. If you're afraid of breaks you can fix on dated snapshots and upgrade once a week or so. You can even ask us beforehand whether we think it is wise to upgrade. And... I'm still hopeful we'll get a release for 1.3 very very soon. Eelco - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/1.3-and-2.0-schedules-tf3201851.html#a8896723 Sent from the Wicket - User mailing list archive at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to download Wicket Javadoc ?
If it is 1.2.4, the apidoc is in wicket-1.2.4.zip\docs\apidocs folder. Matthew Kwong ZedroS Schwart wrote: Hi all Where could I download the Wicket Javadoc ? Thanks in advance ZedroS - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/-Wicket-user--How-to-download-Wicket-Javadoc---tf3167834.html#a8788429 Sent from the Wicket - User mailing list archive at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Question about LoadableDetachableModel and refresh button
Hi everyone, I want to let user to press F5/refresh button, and the page will get the latest info from the database and show to the user again without click another link (like refresh link to setResponsePage()). I have searched thru the mail list and find some info on the refresh button, bookmarkablePageLink and detachableModels... however, I still cannot make it work without doing the following: Basically I have a table of rows (Files) and user can click the link to enter FileDetail page. =FileDetail.java== public class FileDetail extends DataStorePage implements DataStoreSecuredPage { public FileDetail(final DataStoreFile file) { this.setModel(new LoadableDataStoreFileModel(file)); add(new Label(id, new AbstractReadOnlyModel() { public Object getObject(Component component) { return ((DataStoreFile)component.getParent().getModelObject()).getId(); } })); add(new Label(status, new AbstractReadOnlyModel() { public Object getObject(Component component) { return ((DataStoreFile)component.getParent().getModelObject()).getStatus(); } })); add(new Label(uniqueKey, new AbstractReadOnlyModel() { public Object getObject(Component component) { return ((DataStoreFile)component.getParent().getModelObject()).getUniqueKey(); } })); } } =LoadableDataStoreFileModel.java (I read Apress Pro Wicket and wrote this java) public class LoadableDataStoreFileModel extends LoadableDetachableModel { private final Long id; public LoadableDataStoreFileModel(Long id) { super(); this.id = id; } public LoadableDataStoreFileModel(DataStoreFile file) { this(file, file.getId()); } public LoadableDataStoreFileModel(DataStoreFile file, Long id) { super(file); if (id == null || id == new Long(0)) { throw new IllegalArgumentException(); } this.id = id; } protected Object load() { return getDelegate().getDataStoreFile(id); } private BusinessDelegate getDelegate() { return ((DataStoreWebApplication)Application.get()).getDelegate(); } } is there any better way to do this? or the LoadableDataStoreFileModel can perform like CompoundPropertyModel? I tried ICompoundProperty and no luck. I don't want to have a bookmarkablePage also. Thank you, this is my first post in this list, if there is anything wrong, please tell me too. Matthew Kwong -- View this message in context: http://www.nabble.com/Question-about-LoadableDetachableModel-and-refresh-button-tf2933650.html#a8201987 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Question about LoadableDetachableModel and refresh button
WOW, it really works, I didn't know that we can chain the models... I should have asked this 12 hours ago, and saved my time. However, I am getting better with the model thing. Thank you very much, Igor. Matthew Kwong igor.vaynberg wrote: you can chain the models public class FileDetail extends DataStorePage implements DataStoreSecuredPage { public FileDetail(final DataStoreFile file) { this.setModel(new ComoundPropertyModel(new LoadableDataStoreFileModel(file)));add(new Label(id)); add(new Label(status));add(new Label(uniqueKey));}} -igor On 1/6/07, Matthew Kwong [EMAIL PROTECTED] wrote: Hi everyone, I want to let user to press F5/refresh button, and the page will get the latest info from the database and show to the user again without click another link (like refresh link to setResponsePage()). I have searched thru the mail list and find some info on the refresh button, bookmarkablePageLink and detachableModels... however, I still cannot make it work without doing the following: Basically I have a table of rows (Files) and user can click the link to enter FileDetail page. =FileDetail.java== public class FileDetail extends DataStorePage implements DataStoreSecuredPage { public FileDetail(final DataStoreFile file) { this.setModel(new LoadableDataStoreFileModel(file)); add(new Label(id, new AbstractReadOnlyModel() { public Object getObject(Component component) { return ((DataStoreFile)component.getParent().getModelObject()).getId(); } })); add(new Label(status, new AbstractReadOnlyModel() { public Object getObject(Component component) { return ((DataStoreFile)component.getParent().getModelObject()).getStatus(); } })); add(new Label(uniqueKey, new AbstractReadOnlyModel() { public Object getObject(Component component) { return ((DataStoreFile)component.getParent().getModelObject()).getUniqueKey(); } })); } } =LoadableDataStoreFileModel.java (I read Apress Pro Wicket and wrote this java) public class LoadableDataStoreFileModel extends LoadableDetachableModel { private final Long id; public LoadableDataStoreFileModel(Long id) { super(); this.id = id; } public LoadableDataStoreFileModel(DataStoreFile file) { this(file, file.getId()); } public LoadableDataStoreFileModel(DataStoreFile file, Long id) { super(file); if (id == null || id == new Long(0)) { throw new IllegalArgumentException(); } this.id = id; } protected Object load() { return getDelegate().getDataStoreFile(id); } private BusinessDelegate getDelegate() { return ((DataStoreWebApplication)Application.get()).getDelegate(); } } is there any better way to do this? or the LoadableDataStoreFileModel can perform like CompoundPropertyModel? I tried ICompoundProperty and no luck. I don't want to have a bookmarkablePage also. Thank you, this is my first post in this list, if there is anything wrong, please tell me too. Matthew Kwong -- View this message in context: http://www.nabble.com/Question-about-LoadableDetachableModel-and-refresh-button-tf2933650.html#a8201987 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/Question-about-LoadableDetachableModel-and-refresh-button-tf2933650.html#a8202249 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance