Re: Forums tools ready-to-use?
Hi, it's on top of JPA 2, Spring 3, wicket 1.4.9. info is stored in database. Emails are not shown to end user. Comment form supports recaptcha. Short demo might be generated using such maven command (this will give you all features of xaloon components): mvn archetype:generate -DarchetypeCatalog=http://xaloon.googlecode.com/svn/trunk/archetypes/archetype-catalog.xml later: mvn jetty:run On 07/27/2010 03:07 AM, Paolo wrote: very good. I could use comments panel to let users to let messages on my web site. Does it need Spring integration? Where is stored comments info: texts,emails,authors? I need a database suppport? I saw also a interesting ReCaptcha plugin. But now I am interesting in ReCaptcha Mailhide ( http://www.google.com/recaptcha/mailhide/) wicket support. I saw that Recaptha plugin doesn't supportt Mailhide function. I need Mailhide, to hide email address of who write a comment on my web site to spammers. 2010/7/26 Vytautas Racelisturi...@gmail.com Thanks Josh;) Forum support is in feature plans, but it is not currently implemented. Thank you! -- Regards, Vytautas Racelis --- phone:+370-600-34389 www.xaloon.org www.leenle.com www.allcarindex.com On 07/26/2010 04:46 PM, Josh Kamau wrote: Please check www.xaloon.org. This project contains some nice ready to use components for wicket including: - blog; - comments panel; - sports component; - plugin administration console; - registration and activation panel; Regards. Josh On Sun, Jul 25, 2010 at 7:30 PM, Paoloirresistible...@gmail.com wrote: I need a tool for a Forum in my web site. I don't want use the classic php based tools, like phpForum, bbCode ecc. But I would use WICKET! Do you suggest me some wicket examples o ready-to-use forum tool? Or if it doesn't exist, please suggest some guestbook or similar way to posting message in a webpage. thank you. Paolo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Regards, Vytautas Racelis --- phone:+370-600-34389 www.xaloon.org www.leenle.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListMultipleChoice Update Model from Choices
Just wanted to update, I have checked out the Palette too and looks cool. However wanted to share this bit. Adding the following componentInstance.modelChanged(); componentInstance.setModelObject(selectedChoice); ie, I get the choices selected and add it to the Model. By invoking modelChanged() I noticed that the changes are pushed into the Model. Which is what I was looking for The other usage of the modelChanged() I noticed was when 1. On the Form the user types in some information and then hits Save. 2. The form comes back with validation error messages. 3. The user now clicks on Cancel button to discard the form 4. The user clicks the New button and a form is loaded with the old data( I had the data typed in the previous form repeated even though I cleared the input form.clearInput.) 5. I add the form.modelChanged() and now it clears completely or takes into account that its a fresh form. Is this a valid approach? Any thoughts on it for similar scenario? Thanks Niv On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.comwrote: Cheers mate thanks for that. Only I thought it was one step closer to building my own component and know the details of it. But yeah point taken. Cheers Nive On Fri, Jul 23, 2010 at 5:43 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Yeah, if you look at the Palette you can se it is not trivial so it will save you a lot of time ;) ** Martin 2010/7/23 Nivedan Nadaraj shravann...@gmail.com: Hey Mate!!, That is classic. Will check it out, great. Again if you do know how I can address the issue I had will be good to know even if I dont use it since the Pallete offers it. Thanks !! Niv On Fri, Jul 23, 2010 at 5:31 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Did you notice wicket has a built-in component called palette that can do this for you? http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.PalettePage ** Martin 2010/7/23 Nivedan Nadaraj shravann...@gmail.com: Hi All, I use the ListMultipleChoice(LMC) in a different way. I have one control (LMC) on the left representing a list of items Available (roles for example) I have another LMC to represent Selected items(roles) The ADD and ADD ALL buttons move the selected items' from Available LMC to Selected LMC. Now when I hit Save, the Selected LMC's Choices are not pushed into the Model and is empty. However, when I literally selected few items in the Selected LMC choice list and hit save then I have the items in the Model.Which is fine, but as a user he has done that act already so ...guess am missing something here. What I would like is for the Select LMC Model to be updated (either I do it or automatically) from the choices list. Has anyone used this in the way I am using it? How do we get around this? Thanks in advance. Cheers - 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: ListMultipleChoice Update Model from Choices
Hi! componentInstance.modelChanged(); componentInstance.setModelObject(selectedChoice); Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed 1. On the Form the user types in some information and then hits Save. 2. The form comes back with validation error messages. 3. The user now clicks on Cancel button to discard the form 4. The user clicks the New button and a form is loaded with the old data( I had the data typed in the previous form repeated even though I cleared the input form.clearInput.) 5. I add the form.modelChanged() and now it clears completely or takes into account that its a fresh form. I could comment more if I saw the code. ** Martin On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.comwrote: Cheers mate thanks for that. Only I thought it was one step closer to building my own component and know the details of it. But yeah point taken. Cheers Nive - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListMultipleChoice Update Model from Choices
Hi Yeah I did have only the setModelObject() but it did not clear it that is why I added this. Maybe I have not used it correctly.Since you mentioned 'Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed' If the model is actually changed. That is what I am not sure, when does it get notified that a change has happened.?Setting of an entirely new instance in the model should do that isn't it. Please see code below. FYI: StudyModel is the bean that contains other objects. It is bound to a form using CPM. onNew(){ StudyModel studyModel; if(form != null form.getModelObject() != null){ studyModel = form.getModelObject(); studyModel.setStudy(new Study());//a hibernate entity form.setModelObject(studyModel); form.modelChanged();//-- added this one to clear the data. form.clearInput(); } Thanks again Niv On Tue, Jul 27, 2010 at 3:05 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! componentInstance.modelChanged(); componentInstance.setModelObject(selectedChoice); Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed 1. On the Form the user types in some information and then hits Save. 2. The form comes back with validation error messages. 3. The user now clicks on Cancel button to discard the form 4. The user clicks the New button and a form is loaded with the old data( I had the data typed in the previous form repeated even though I cleared the input form.clearInput.) 5. I add the form.modelChanged() and now it clears completely or takes into account that its a fresh form. I could comment more if I saw the code. ** Martin On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.com wrote: Cheers mate thanks for that. Only I thought it was one step closer to building my own component and know the details of it. But yeah point taken. Cheers Nive - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How do I run Wicket 1.4.9 examples with NetBeans 6.9 and Glassfish 3?
Remove wicket-jmx.jar from the classpath On Mon, Jul 26, 2010 at 6:06 PM, Alessandro Bottoni alexbott...@gmail.comwrote: Hi all, I'm trying to run the examples included in the Wicket 1.4.9 distribution on my NetBeans 6.9 with Glassfish and I'm getting the following error message. ERROR - Initializer- org.apache.wicket.app.WicketTester$DummyWebApplication:type=RequestLogger javax.management.InstanceNotFoundException: org.apache.wicket.app.WicketTester$DummyWebApplication:type=RequestLogger at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:415) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403) at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506) at org.apache.wicket.jmx.Initializer.destroy(Initializer.java:75) at org.apache.wicket.Application.callDestroyers(Application.java:829) at org.apache.wicket.Application.internalDestroy(Application.java:956) at org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:527) at org.apache.wicket.protocol.http.MockWebApplication.destroy(MockWebApplication.java:738) at org.apache.wicket.examples.hangman.WordGeneratorTest.tearDown(WordGeneratorTest.java:60) at junit.framework.TestCase.runBare(TestCase.java:140) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980) Any suggestion? -- Alessandro Bottoni Website: http://www.alessandrobottoni.it/ Filesharing Is Killing Music Industry - Home Cooking Is Killing Restaurants - Home Fucking Is Killing Prostitution -- Unknown - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Expiring pages in form submit and onAfterRender...
Did you already look at StatelessForm? Regards, Erik. Op 26-07-10 23:14, Erik Brakkee wrote: Hi, I am experimenting a bit with page expiry. One solution that works is to remove the page from the pagemap in the submit of a form. However, removing the page from the pagemap in the onAfterRender() of a page does not seem to work. In fact, I see the same page id and version being rendered every time. Is this the way it should be? Is there another generic callback in a wicket page in which I could remove the page from the pagemap to expire it? What makes the form's onSubmit() special? Alternatively, I am considering to use a strategy whereby I set an expired flag on form submit and then in the onBeforeRender() use setResponsePage() to delegate to a specific page providing also a specific message. That would allow total control on form submit. Would that strategy work? Cheers Erik -- Sent from my SMTP compliant software Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Expiring pages in form submit and onAfterRender...
I have added a configuration in the application to redirect the user to a particular page. I guess page expires due to a timeout? In the base application's init() IApplicationSettings settings = getApplicationSettings(); settings.setPageExpiredErrorPage(LoginPage.class); If that helps in anways. Cheers Niv On Tue, Jul 27, 2010 at 3:18 PM, Erik van Oosten e.vanoos...@grons.nlwrote: Did you already look at StatelessForm? Regards, Erik. Op 26-07-10 23:14, Erik Brakkee wrote: Hi, I am experimenting a bit with page expiry. One solution that works is to remove the page from the pagemap in the submit of a form. However, removing the page from the pagemap in the onAfterRender() of a page does not seem to work. In fact, I see the same page id and version being rendered every time. Is this the way it should be? Is there another generic callback in a wicket page in which I could remove the page from the pagemap to expire it? What makes the form's onSubmit() special? Alternatively, I am considering to use a strategy whereby I set an expired flag on form submit and then in the onBeforeRender() use setResponsePage() to delegate to a specific page providing also a specific message. That would allow total control on form submit. Would that strategy work? Cheers Erik -- Sent from my SMTP compliant software Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListMultipleChoice Update Model from Choices
Hi! 'Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed' If the model is actually changed. That is what I am not sure, when does it get notified that a change has happened.?Setting of an entirely new instance in the model should do that isn't it. Please see code below. Not necessarily. Look at setmodelobject implementation: public final Component setDefaultModelObject(final Object object) ... if (!getModelComparator().compare(this, object)) { modelChanging(); model.setObject(object); modelChanged(); } ** Martin On Tue, Jul 27, 2010 at 3:05 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! componentInstance.modelChanged(); componentInstance.setModelObject(selectedChoice); Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed 1. On the Form the user types in some information and then hits Save. 2. The form comes back with validation error messages. 3. The user now clicks on Cancel button to discard the form 4. The user clicks the New button and a form is loaded with the old data( I had the data typed in the previous form repeated even though I cleared the input form.clearInput.) 5. I add the form.modelChanged() and now it clears completely or takes into account that its a fresh form. I could comment more if I saw the code. ** Martin On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.com wrote: Cheers mate thanks for that. Only I thought it was one step closer to building my own component and know the details of it. But yeah point taken. Cheers Nive - 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: [OT] CSS 3 border radius fallback script
thanks.. 2010/7/27 Witold Czaplewski witold-mail...@cts-media.eu Hi Nino, take a look at curved-corner: http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser http://code.google.com/p/curved-corner/ cheers, Witold Am Tue, 27 Jul 2010 07:27:36 +0200 schrieb nino martinez wael nino.martinez.w...@gmail.com: Hi I know this is off topic. But has anyone knowledge of a javascript that will detect if the browser has support for css 3 border radius and if it does not, put in borders on appropriate elements? I might be able todo something with together with jquery and liquid canvas if such a script does not exist... regards Nino - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ListMultipleChoice Update Model from Choices
Hi Yep, I got it now. Thanks. I now create a new instance of the Model itself. This satisfies the comparison. if (!getModelComparator().compare(this, object)){ ... } Earlier I was only resetting the contained object within the Model. Thank You ! Niv On Tue, Jul 27, 2010 at 3:27 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! 'Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed' If the model is actually changed. That is what I am not sure, when does it get notified that a change has happened.?Setting of an entirely new instance in the model should do that isn't it. Please see code below. Not necessarily. Look at setmodelobject implementation: public final Component setDefaultModelObject(final Object object) ... if (!getModelComparator().compare(this, object)) { modelChanging(); model.setObject(object); modelChanged(); } ** Martin On Tue, Jul 27, 2010 at 3:05 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! componentInstance.modelChanged(); componentInstance.setModelObject(selectedChoice); Note: componentInstance.setModelObject will call modelChanged from within if the model is actually changed 1. On the Form the user types in some information and then hits Save. 2. The form comes back with validation error messages. 3. The user now clicks on Cancel button to discard the form 4. The user clicks the New button and a form is loaded with the old data( I had the data typed in the previous form repeated even though I cleared the input form.clearInput.) 5. I add the form.modelChanged() and now it clears completely or takes into account that its a fresh form. I could comment more if I saw the code. ** Martin On Sat, Jul 24, 2010 at 2:42 AM, Nivedan Nadaraj shravann...@gmail.com wrote: Cheers mate thanks for that. Only I thought it was one step closer to building my own component and know the details of it. But yeah point taken. Cheers Nive - 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: Expiring pages in form submit and onAfterRender...
Hi Saw a related link to force page expiry probably might throw some light http://apache-wicket.1842946.n4.nabble.com/Force-page-expiration-td1844190.html#a1844190 cheers On Tue, Jul 27, 2010 at 3:23 PM, Nivedan Nadaraj shravann...@gmail.comwrote: I have added a configuration in the application to redirect the user to a particular page. I guess page expires due to a timeout? In the base application's init() IApplicationSettings settings = getApplicationSettings(); settings.setPageExpiredErrorPage(LoginPage.class); If that helps in anways. Cheers Niv On Tue, Jul 27, 2010 at 3:18 PM, Erik van Oosten e.vanoos...@grons.nlwrote: Did you already look at StatelessForm? Regards, Erik. Op 26-07-10 23:14, Erik Brakkee wrote: Hi, I am experimenting a bit with page expiry. One solution that works is to remove the page from the pagemap in the submit of a form. However, removing the page from the pagemap in the onAfterRender() of a page does not seem to work. In fact, I see the same page id and version being rendered every time. Is this the way it should be? Is there another generic callback in a wicket page in which I could remove the page from the pagemap to expire it? What makes the form's onSubmit() special? Alternatively, I am considering to use a strategy whereby I set an expired flag on form submit and then in the onBeforeRender() use setResponsePage() to delegate to a specific page providing also a specific message. That would allow total control on form submit. Would that strategy work? Cheers Erik -- Sent from my SMTP compliant software Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How do I run Wicket 1.4.9 examples with NetBeans 6.9 and Glassfish 3?
Il 27/07/2010 09:16, Martin Grigorov ha scritto: Remove wicket-jmx.jar from the classpath On Mon, Jul 26, 2010 at 6:06 PM, Alessandro Bottoni alexbott...@gmail.comwrote: Hi all, I'm trying to run the examples included in the Wicket 1.4.9 distribution on my NetBeans 6.9 with Glassfish and I'm getting the following error message. Thanks Martin, I commented out the Wicket-JMX dependency stanza from my pom.xml and now the examples work perfectly. BTW: I even had to add a license header to profiles.xml and sun-web.xml to pass all of the tests. The Wicket test-suite seems to be quite rigorous :-) Thanks again -- Alessandro Bottoni Website: http://www.alessandrobottoni.it/ Amusement to an observing mind is study. -- Benjamin Disraeli - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Candy?
Looks real cool but no I have not used. Nive On Mon, Jul 26, 2010 at 7:03 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Has someone implemented Candy on Wicket as an extension to tabbed panels? http://vimeo.com/13560319 ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
When object is null
I hope someone can help a newbie who is learning Wicket. I have the following code which accepts a parameter and then does a database query to get the 'Data' object. If the user enters the wrong Id the database query will return null and in this case I want to notify the user the data could not be found and any other component should be hidden. But, when I get an null object the code stops working and a null exception is thrown, any ideas? Or is there a elegant way to do this? public class DataView extends WebPage { private Data data; public DataView(PageParameters parameters) { long dataId = parameters.getLong(dataId); DataDao dataDao = new DataDao(); data = dataDao.getData( dataId ); // display message that the data could not be found Label dataNotFound = new Label(dataNotFound, Data could not be found); dataNotFound.setVisible(data == null); // otherwise display the panel containing the data SomePanel panel = new SomePanel(somePanel); panel.setVisible(data != null); add(dataNotFound); add(panel); } public class SomePanel extends Panel { public SomePanel(String id) { super(id); // this throws null exception when data is null Label label = new Label(someLabel, String.valueOf(data.getId())); add(label); } } } Thanks
Re: When object is null
Abid, Hi, I noted that you are adding the panel whether the data is null or not. I would suggest you do this; if (data!= null){ //construct and add the panel } On Tue, Jul 27, 2010 at 11:28 AM, Abid K abz...@gmail.com wrote: I hope someone can help a newbie who is learning Wicket. I have the following code which accepts a parameter and then does a database query to get the 'Data' object. If the user enters the wrong Id the database query will return null and in this case I want to notify the user the data could not be found and any other component should be hidden. But, when I get an null object the code stops working and a null exception is thrown, any ideas? Or is there a elegant way to do this? public class DataView extends WebPage { private Data data; public DataView(PageParameters parameters) { long dataId = parameters.getLong(dataId); DataDao dataDao = new DataDao(); data = dataDao.getData( dataId ); // display message that the data could not be found Label dataNotFound = new Label(dataNotFound, Data could not be found); dataNotFound.setVisible(data == null); // otherwise display the panel containing the data SomePanel panel = new SomePanel(somePanel); panel.setVisible(data != null); add(dataNotFound); add(panel); } public class SomePanel extends Panel { public SomePanel(String id) { super(id); // this throws null exception when data is null Label label = new Label(someLabel, String.valueOf(data.getId())); add(label); } } } Thanks
Re: When object is null
Abid, Hi, I noted that you are adding the panel whether the data is null or not. I would suggest you do this; Data data = dataDao.getData(id) if (data!= null){ //construct and add the panel DataPanel panel = new DataPanel(panel, data); add(panel); //the panel has implementation of what to do with the data once it is passed to it. } else { //forget about the panel and only add the label that says there is no data add(new Label(No data to display)); } regards Josh On Tue, Jul 27, 2010 at 11:48 AM, Josh Kamau joshnet2...@gmail.com wrote: Abid, Hi, I noted that you are adding the panel whether the data is null or not. I would suggest you do this; if (data!= null){ //construct and add the panel } On Tue, Jul 27, 2010 at 11:28 AM, Abid K abz...@gmail.com wrote: I hope someone can help a newbie who is learning Wicket. I have the following code which accepts a parameter and then does a database query to get the 'Data' object. If the user enters the wrong Id the database query will return null and in this case I want to notify the user the data could not be found and any other component should be hidden. But, when I get an null object the code stops working and a null exception is thrown, any ideas? Or is there a elegant way to do this? public class DataView extends WebPage { private Data data; public DataView(PageParameters parameters) { long dataId = parameters.getLong(dataId); DataDao dataDao = new DataDao(); data = dataDao.getData( dataId ); // display message that the data could not be found Label dataNotFound = new Label(dataNotFound, Data could not be found); dataNotFound.setVisible(data == null); // otherwise display the panel containing the data SomePanel panel = new SomePanel(somePanel); panel.setVisible(data != null); add(dataNotFound); add(panel); } public class SomePanel extends Panel { public SomePanel(String id) { super(id); // this throws null exception when data is null Label label = new Label(someLabel, String.valueOf(data.getId())); add(label); } } } Thanks
Re: When object is null
You could try using a PropertyModel instead like this: Label label = new Label(someLabel, new PropertyModelString(DataView.this,data.id); PropertyModels take care of possible null pointers. Kind regards, Daniel www.joyn-it.at On 27.07.2010 10:28, Abid K wrote: I hope someone can help a newbie who is learning Wicket. I have the following code which accepts a parameter and then does a database query to get the 'Data' object. If the user enters the wrong Id the database query will return null and in this case I want to notify the user the data could not be found and any other component should be hidden. But, when I get an null object the code stops working and a null exception is thrown, any ideas? Or is there a elegant way to do this? public class DataView extends WebPage { private Data data; public DataView(PageParameters parameters) { long dataId = parameters.getLong(dataId); DataDao dataDao = new DataDao(); data = dataDao.getData( dataId ); // display message that the data could not be found Label dataNotFound = new Label(dataNotFound, Data could not be found); dataNotFound.setVisible(data == null); // otherwise display the panel containing the data SomePanel panel = new SomePanel(somePanel); panel.setVisible(data != null); add(dataNotFound); add(panel); } public class SomePanel extends Panel { public SomePanel(String id) { super(id); // this throws null exception when data is null Label label = new Label(someLabel, String.valueOf(data.getId())); add(label); } } } Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: When object is null
Thanks Josh and Daniel - both methods have worked. I have gone with checking if the object is null or not like so... public class SomePanel extends Panel { public SomePanel(String id) { super(id); if ( data == null ) { return; } Label label = new Label(someLabel, String.valueOf(data.getId())); add(label); } } I have decided to do this because I am not sure how I can format a date without doing this... SimpleDateFormat dateFormat = new SimpleDateFormat( dd/MM/ ); Label dateLabel = new Label( date, dateFormat.format( data.getDate( ) ) ); Thanks.
Re: When object is null
I've come across similar scenarios fairly often - i.e. where a the construction of component is impossible if its model object is null, or some other construction parameter is null. I'm still not sure what the best approach is in this situation. One of the methods I've used is to late-bind the optional component in the onBeforeRender() of a special wrapper container (e.g. if the model object != null, add the component, make the wrapper visible. If model object == null, don't add the component and make the wrapper non-visible). This seems like a blatant hack, however. see these threads: http://apache-wicket.1842946.n4.nabble.com/Nullable-resource-link-td1886391.html#a1886395 http://apache-wicket.1842946.n4.nabble.com/Components-and-nullable-data-td1888023.html#none Abid K wrote: Thanks Josh and Daniel - both methods have worked. I have gone with checking if the object is null or not like so... public class SomePanel extends Panel { public SomePanel(String id) { super(id); if ( data == null ) { return; } Label label = new Label(someLabel, String.valueOf(data.getId())); add(label); } } I have decided to do this because I am not sure how I can format a date without doing this... SimpleDateFormat dateFormat = new SimpleDateFormat( dd/MM/ ); Label dateLabel = new Label( date, dateFormat.format( data.getDate( ) ) ); Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: HttpsRequestCycleProcessor Configuration
My problem is not specific to wicket but I'm hoping that someone in the community has fought this battle before and is willing to lend a helping hand. I am using the HttpsRequestCycleProcessor and I only have the @RequireHttps annotation on one page, the registration page. I have apache httpd and tomcat talking to each other with a virtual host using proxypass and proxypassreverse on port 80 and all that is working fine. The problem becomes when I try to configure everything for SSL. I'm unsure whether I need SSL to be configured in tomcat and apache httpd or just one of them and not the other. I have generated a self signed certificate and key file for apache httpd and tried it with just that. When that did not work I pointed tomcat to the same files. Still nothing. It sounds like you have your SSL for apache incorrectly configured. First start by getting SSL configured and working correctly for your apache. Create a test page and make sure you can see it over HTTPS. Then verify that you've added your tomcat connector to your HTTPS server e.g. VirtualHost _default_:443# General setup for the virtual hostDocumentRoot /usr/local/www/webapps/ROOTServerName www.example.com:443ErrorLog /usr/apache/apache-2.2.11/logs/error_logTransferLog /usr/apache/apache-2.2.11/logs/access_logJkMount /app/* worker1JkMount /asyncService/* worker1JkMount /*.jsp worker1 # SSL Engine Switch:# Enable/Disable SSL for this virtual host.SSLEngine on.../VirtualHost If you want to use proxy pass instead of mod_jk, that shouldn't be an issue. Russ _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
Bug or feature - strange behavior?
Hi! Is it abug or a feature that if I have the following: public void renderHead(IHeaderResponse response) { // Tweak 1 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } ); response.renderString(CssUtils.INLINE_CLOSE_TAG); // Tweak 2 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.container-panel { width: 98%; }); response.renderString(CssUtils.INLINE_CLOSE_TAG); } The result rendered in browser is: style type=text/css!-- div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } --/style div.container-panel { width: 98%; } This seems sensless... it considers the css script open/close tags duplicate and drops them from the rendering phase. I will do the same for any javascript line? For example if I had alert(value); in multiple places it would just strip them and I would get bizzearre results? Seems a bit over-optimized to me what do you think? ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Using Apache mod rewrite to fix home page parameter problem
I am looking for a solution to a nagging problem on my first wicket site, www.luckeffect.com. The problem is that page parameters are not bookmarkable on the page that is specified as the application home page. For an example, the breadcrumb link Home 'Page 1' on http://www.luckeffect.com/ is unintentionally obfuscated through the crypted url coding strategy because the parameters on the home page are standard query parameters. However, on any other page, they are bookmarked correctly, for example, the exact same link on the unlucky page http://www.luckeffect.com/unlucky works as intended. One idea was to change my application home page to a class that simply redirects to a new StoriesPage, mapped to /stories. This fixes the page parameter problem, but I really don't like adding a redirect to the home page for seo reasons. To circumvent this, is it possible to use apache's mod rewrite to change www.luckeffect.com/ to www.luckeffect.com/stories behind the scenes? Are there any known problems with using apache mod rewrite with wicket? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bug or feature - strange behavior?
Accoring to org.apache.wicket.markup.html.IHeaderResponse.renderString(CharSequence) javadoc: /** * Renders an arbitrary string to the header. The string is only rendered if the same string * hasn't been rendered before. Each sequence is rendered only once! So you need to pass the whole CSS in one pass: open+body+close On Tue, Jul 27, 2010 at 5:48 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Is it abug or a feature that if I have the following: public void renderHead(IHeaderResponse response) { // Tweak 1 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } ); response.renderString(CssUtils.INLINE_CLOSE_TAG); // Tweak 2 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.container-panel { width: 98%; }); response.renderString(CssUtils.INLINE_CLOSE_TAG); } The result rendered in browser is: style type=text/css!-- div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } --/style div.container-panel { width: 98%; } This seems sensless... it considers the css script open/close tags duplicate and drops them from the rendering phase. I will do the same for any javascript line? For example if I had alert(value); in multiple places it would just strip them and I would get bizzearre results? Seems a bit over-optimized to me what do you think? ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Bug or feature - strange behavior?
/** * Renders an arbitrary string to the header. The string is only rendered if the same string * hasn't been rendered before. * p * Note: This method is kind of dangerous as users are able to write to the output whatever they * like. * * @param string *string to be rendered to head */ public void renderString(CharSequence string); -igor On Tue, Jul 27, 2010 at 8:48 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Is it abug or a feature that if I have the following: public void renderHead(IHeaderResponse response) { // Tweak 1 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } ); response.renderString(CssUtils.INLINE_CLOSE_TAG); // Tweak 2 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.container-panel { width: 98%; }); response.renderString(CssUtils.INLINE_CLOSE_TAG); } The result rendered in browser is: style type=text/css!-- div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } --/style div.container-panel { width: 98%; } This seems sensless... it considers the css script open/close tags duplicate and drops them from the rendering phase. I will do the same for any javascript line? For example if I had alert(value); in multiple places it would just strip them and I would get bizzearre results? Seems a bit over-optimized to me what do you think? ** Martin - 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: Bug or feature - strange behavior?
Could someone add some debug output warning for stripped tags that looks like open close tags ;]]] 2010/7/27 Martin Grigorov mgrigo...@apache.org: Accoring to org.apache.wicket.markup.html.IHeaderResponse.renderString(CharSequence) javadoc: /** * Renders an arbitrary string to the header. The string is only rendered if the same string * hasn't been rendered before. Each sequence is rendered only once! So you need to pass the whole CSS in one pass: open+body+close On Tue, Jul 27, 2010 at 5:48 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! Is it abug or a feature that if I have the following: public void renderHead(IHeaderResponse response) { // Tweak 1 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } ); response.renderString(CssUtils.INLINE_CLOSE_TAG); // Tweak 2 response.renderString(CssUtils.INLINE_OPEN_TAG); response.renderString(div.container-panel { width: 98%; }); response.renderString(CssUtils.INLINE_CLOSE_TAG); } The result rendered in browser is: style type=text/css!-- div.upper-background-canvas { background: url(/images/template-bg.png) repeat-x rgb(55,115,130); } body { background: none rgb(68,68,20); } --/style div.container-panel { width: 98%; } This seems sensless... it considers the css script open/close tags duplicate and drops them from the rendering phase. I will do the same for any javascript line? For example if I had alert(value); in multiple places it would just strip them and I would get bizzearre results? Seems a bit over-optimized to me what do you think? ** Martin - 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: Error integrating with Hibernate and Spring
Which version of hibernate? Try the latest 3.5 version? Luther Baker lutherba...@gmail.com 07/26/2010 06:55 PM Please respond to users@wicket.apache.org To users@wicket.apache.org cc Subject Error integrating with Hibernate and Spring I'm sure I'm doing something incorrectly. For the most part, I copied the Spring config file from http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ but upon startup, I'm getting the following error. Specifically, I can't find where the listener type [wicketApplication] is implemented/exists/read ... Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/fuzzybearings/projx/config/spring.sb.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Unrecognized listener type [wicketApplication] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 51 more Both jetty:run and tomcat:run do this. Thanks in advance for any suggestions, -Luther Here is the actual config I am using: ?xml version=1.0 encoding=UTF-8? beans default-autowire=autodetect xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd; bean id=wicketApplication class=com.fuzzybearings.projx.WicketApplication / bean id=placeholderConfigurer class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer property name=ignoreUnresolvablePlaceholders value=false / property name=systemPropertiesModeName value=SYSTEM_PROPERTIES_MODE_OVERRIDE / property name=ignoreResourceNotFound value=false / property name=locations list valueclasspath:/com/fuzzybearings/projx/config/application.properties/value /list /property /bean bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value${jdbc.driver}/value /property property name=url value${jdbc.url}/value /property property name=username value${jdbc.username}/value /property property name=password value${jdbc.password}/value /property /bean tx:annotation-driven transaction-manager=txManager / !-- hibernate session factory -- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean property name=dataSource ref=dataSource / property name=hibernateProperties props prop key=hibernate.hbm2ddl.auto${hibernate.ddl}/prop prop key=hibernate.dialect${hibernate.dialect}/prop prop key=hibernate.connection.pool_size5/prop prop key=hibernate.current_session_context_classthread/prop prop key=hibernate.show_sqltrue/prop prop key=hibernate.cglib.use_reflection_optimizertrue/prop prop key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop prop key=hibernate.hibernate.cache.use_query_cachetrue/prop /props /property property name=packagesToScan
Re: Error integrating with Hibernate and Spring
You can see here http://duydo.com/spring-3-hibenate-3-5-wicket-maven/ for more detail. On Mon, Jul 26, 2010 at 3:52 PM, Luther Baker lutherba...@gmail.com wrote: I'm sure I'm doing something incorrectly. For the most part, I copied the Spring config file from http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ but upon startup, I'm getting the following error. Specifically, I can't find where the listener type [wicketApplication] is implemented/exists/read ... Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/fuzzybearings/projx/config/spring.sb.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Unrecognized listener type [wicketApplication] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 51 more Both jetty:run and tomcat:run do this. Thanks in advance for any suggestions, -Luther Here is the actual config I am using: ?xml version=1.0 encoding=UTF-8? beans default-autowire=autodetect xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd; bean id=wicketApplication class=com.fuzzybearings.projx.WicketApplication / bean id=placeholderConfigurer class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer property name=ignoreUnresolvablePlaceholders value=false / property name=systemPropertiesModeName value=SYSTEM_PROPERTIES_MODE_OVERRIDE / property name=ignoreResourceNotFound value=false / property name=locations list valueclasspath:/com/fuzzybearings/projx/config/application.properties/value /list /property /bean bean id=dataSource class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value${jdbc.driver}/value /property property name=url value${jdbc.url}/value /property property name=username value${jdbc.username}/value /property property name=password value${jdbc.password}/value /property /bean tx:annotation-driven transaction-manager=txManager / !-- hibernate session factory -- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean property name=dataSource ref=dataSource / property name=hibernateProperties props prop key=hibernate.hbm2ddl.auto${hibernate.ddl}/prop prop key=hibernate.dialect${hibernate.dialect}/prop prop key=hibernate.connection.pool_size5/prop prop key=hibernate.current_session_context_classthread/prop prop key=hibernate.show_sqltrue/prop prop key=hibernate.cglib.use_reflection_optimizertrue/prop prop key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop prop key=hibernate.hibernate.cache.use_query_cachetrue/prop /props /property property name=packagesToScan list valuecom.fuzzybearings.projx.model/value /list /property /bean
Re: DateField throwing runtime error in IE only
Does anyone know if this issue was ever resolved? I've just come across it as well. I am trying to display a DateTextField and a DatePicker within a Form, within a Panel, within a ModalWindow. Works just fine in FF but fails in evil IE7/8 (that is, the calendar does not appear). I am using version 1.4.9 of Wicket. Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DateField-throwing-runtime-error-in-IE-only-tp1872555p2303931.html Sent from the Wicket - User 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: Using Apache mod rewrite to fix home page parameter problem
What do you mean unintentionally? Why do you use a crypted url strategy? On Tue, Jul 27, 2010 at 6:54 PM, fatefree [via Apache Wicket] ml-node+2303737-2108181663-293...@n4.nabble.comml-node%2b2303737-2108181663-293...@n4.nabble.com wrote: I am looking for a solution to a nagging problem on my first wicket site, www.luckeffect.com. The problem is that page parameters are not bookmarkable on the page that is specified as the application home page. For an example, the breadcrumb link Home 'Page 1' on http://www.luckeffect.com/ is unintentionally obfuscated through the crypted url coding strategy because the parameters on the home page are standard query parameters. However, on any other page, they are bookmarked correctly, for example, the exact same link on the unlucky page http://www.luckeffect.com/unlucky works as intended. One idea was to change my application home page to a class that simply redirects to a new StoriesPage, mapped to /stories. This fixes the page parameter problem, but I really don't like adding a redirect to the home page for seo reasons. To circumvent this, is it possible to use apache's mod rewrite to change www.luckeffect.com/ to www.luckeffect.com/stories behind the scenes? Are there any known problems with using apache mod rewrite with wicket? - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2303737i=0 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2303737i=1 -- View message @ http://apache-wicket.1842946.n4.nabble.com/Using-Apache-mod-rewrite-to-fix-home-page-parameter-problem-tp2303737p2303737.html To start a new topic under Wicket - User, email ml-node+1842947-1647783149-293...@n4.nabble.comml-node%2b1842947-1647783149-293...@n4.nabble.com To unsubscribe from Wicket - User, click herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YXZyYWhhbXJAZ21haWwuY29tfDE4NDI5NDd8LTEwNzY0NzQ1ODc=. -- []'s Avraham Rosenzweig avrah...@gmail.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-Apache-mod-rewrite-to-fix-home-page-parameter-problem-tp2303737p2303959.html Sent from the Wicket - User mailing list archive at Nabble.com.
How to set the value of a Drop Down Choice
Hello, I was wondering how to set the currently selected value for a DropDownList? Currently I have a .properties file which sets the value when I have a null selection, however, I was wondering how do I change the currently selected value to a different one (e.g. if I am pulling a previous selection from a database?) Thank you, -- Eric Reagan
Re: How to set the value of a Drop Down Choice
Have you tried if setDefaultModelObject() works for you? ** Martin 2010/7/27 Eric Reagan reaga...@gmail.com: Hello, I was wondering how to set the currently selected value for a DropDownList? Currently I have a .properties file which sets the value when I have a null selection, however, I was wondering how do I change the currently selected value to a different one (e.g. if I am pulling a previous selection from a database?) Thank you, -- Eric Reagan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to set the value of a Drop Down Choice
Martin, I have the following. All I am getting is a null value. Am I setting the model object wrong? IModelString stringObjectModel = new LoadableDetachableModel String() { /** * */ private static final long serialVersionUID = 2165619560012612599L; private String text; @Override protected String load() { return text; } }; stringObjectModel.setObject(abc); DropDownChoiceString programList = new DropDownChoiceString(users,stringObjectModel, users.getAll(), new IChoiceRendererObject() { /** * Generated */ private static final long serialVersionUID = -7278851941695545331L; @Override public Object getDisplayValue(Object object) { return object.toString(); } @Override public String getIdValue(Object object, int index) { object.toString() } } ); programList.setDefaultModelObject(stringObjectModel); On Tue, Jul 27, 2010 at 2:33 PM, Eric Reagan reaga...@gmail.com wrote: Martin, I have the following. All I am getting is a null value. Am I setting the model object wrong? IModelString stringObjectModel = new LoadableDetachableModelString() { /** * */ private static final long serialVersionUID = 2165619560012612599L; private String text; @Override protected String load() { return text; } }; stringObjectModel.setObject(abc); DropDownChoiceString programList = new DropDownChoiceString(users,stringObjectModel, users.getAll(), new IChoiceRendererObject() { /** * Generated */ private static final long serialVersionUID = -7278851941695545331L; @Override public Object getDisplayValue(Object object) { return object.toString(); } @Override public String getIdValue(Object object, int index) { object.toString() } } ); programList.setDefaultModelObject(stringObjectModel); On Tue, Jul 27, 2010 at 2:05 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Have you tried if setDefaultModelObject() works for you? ** Martin 2010/7/27 Eric Reagan reaga...@gmail.com: Hello, I was wondering how to set the currently selected value for a DropDownList? Currently I have a .properties file which sets the value when I have a null selection, however, I was wondering how do I change the currently selected value to a different one (e.g. if I am pulling a previous selection from a database?) Thank you, -- Eric Reagan -- Eric Reagan -- Eric Reagan
Re: How to set the value of a Drop Down Choice
Martin, Thanks for the advice. I had a mental fart and left out the setter function. Once you add the setter...works like a charm. Thanks again. Thank you, On Tue, Jul 27, 2010 at 2:34 PM, Eric Reagan reaga...@gmail.com wrote: Martin, I have the following. All I am getting is a null value. Am I setting the model object wrong? IModelString stringObjectModel = new LoadableDetachableModel String() { /** * */ private static final long serialVersionUID = 2165619560012612599L; private String text; @Override protected String load() { return text; } }; stringObjectModel.setObject(abc); DropDownChoiceString programList = new DropDownChoiceString(users,stringObjectModel, users.getAll(), new IChoiceRendererObject() { /** * Generated */ private static final long serialVersionUID = -7278851941695545331L; @Override public Object getDisplayValue(Object object) { return object.toString(); } @Override public String getIdValue(Object object, int index) { object.toString() } } ); programList.setDefaultModelObject(stringObjectModel); On Tue, Jul 27, 2010 at 2:33 PM, Eric Reagan reaga...@gmail.com wrote: Martin, I have the following. All I am getting is a null value. Am I setting the model object wrong? IModelString stringObjectModel = new LoadableDetachableModelString() { /** * */ private static final long serialVersionUID = 2165619560012612599L; private String text; @Override protected String load() { return text; } }; stringObjectModel.setObject(abc); DropDownChoiceString programList = new DropDownChoiceString(users,stringObjectModel, users.getAll(), new IChoiceRendererObject() { /** * Generated */ private static final long serialVersionUID = -7278851941695545331L; @Override public Object getDisplayValue(Object object) { return object.toString(); } @Override public String getIdValue(Object object, int index) { object.toString() } } ); programList.setDefaultModelObject(stringObjectModel); On Tue, Jul 27, 2010 at 2:05 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Have you tried if setDefaultModelObject() works for you? ** Martin 2010/7/27 Eric Reagan reaga...@gmail.com: Hello, I was wondering how to set the currently selected value for a DropDownList? Currently I have a .properties file which sets the value when I have a null selection, however, I was wondering how do I change the currently selected value to a different one (e.g. if I am pulling a previous selection from a database?) Thank you, -- Eric Reagan -- Eric Reagan -- Eric Reagan -- Eric Reagan
Re: How to set the value of a Drop Down Choice
Why not set up a property on your page/component for the selected text and use a PropertyModelString? On Tue, Jul 27, 2010 at 3:34 PM, Eric Reagan reaga...@gmail.com wrote: Martin, I have the following. All I am getting is a null value. Am I setting the model object wrong? IModelString stringObjectModel = new LoadableDetachableModel String() { /** * */ private static final long serialVersionUID = 2165619560012612599L; private String text; �...@override protected String load() { return text; } }; stringObjectModel.setObject(abc); DropDownChoiceString programList = new DropDownChoiceString(users,stringObjectModel, users.getAll(), new IChoiceRendererObject() { /** * Generated */ private static final long serialVersionUID = -7278851941695545331L; �...@override public Object getDisplayValue(Object object) { return object.toString(); } �...@override public String getIdValue(Object object, int index) { object.toString() } } ); programList.setDefaultModelObject(stringObjectModel); On Tue, Jul 27, 2010 at 2:33 PM, Eric Reagan reaga...@gmail.com wrote: Martin, I have the following. All I am getting is a null value. Am I setting the model object wrong? IModelString stringObjectModel = new LoadableDetachableModelString() { /** * */ private static final long serialVersionUID = 2165619560012612599L; private String text; @Override protected String load() { return text; } }; stringObjectModel.setObject(abc); DropDownChoiceString programList = new DropDownChoiceString(users,stringObjectModel, users.getAll(), new IChoiceRendererObject() { /** * Generated */ private static final long serialVersionUID = -7278851941695545331L; @Override public Object getDisplayValue(Object object) { return object.toString(); } @Override public String getIdValue(Object object, int index) { object.toString() } } ); programList.setDefaultModelObject(stringObjectModel); On Tue, Jul 27, 2010 at 2:05 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Have you tried if setDefaultModelObject() works for you? ** Martin 2010/7/27 Eric Reagan reaga...@gmail.com: Hello, I was wondering how to set the currently selected value for a DropDownList? Currently I have a .properties file which sets the value when I have a null selection, however, I was wondering how do I change the currently selected value to a different one (e.g. if I am pulling a previous selection from a database?) Thank you, -- Eric Reagan -- Eric Reagan -- Eric Reagan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Expiring pages in form submit and onAfterRender...
I have indeed seen how to set the default expiry page in the Application class and that might come in handy. Will have a look too at the StatelessForm. Anyway, I have a working solution now with the pagemap trick. However, perhaps I need to do even more, because the flow isList of items - view item page- edit item page- back - back In that case, the first back leads to en Expired page. But, the second back button leads to the view item page showing incorrect contents of the modified item. This is probably because the edit item page has its own copy of the item (even though the edit page was constructed from the view page by passing it the item object). Possibly this happens because of serialization of individual pages. Therefore, the second time the back button is pressed I am viewing stale data. I could solve it perhaps by reloading the entity from the database in the view page's onBeforeRender() and even to check for its existence (item might have been deleted) and in the latter case forward to another page. Or am I going perhaps too far in trying to get consistent views of my application's model?
Re: Expiring pages in form submit and onAfterRender...
Thinking about it some more. Perhaps the best solution is to simply use a detachable model for the entity in the view page and then send the user to an error page when the entry is no longer there. I could of course also use a detachable model for the entity on the edit page because in this page all editing is done on one page and not on multiple pages. This would provide the most userfriendly behavior.
RE: HttpsRequestCycleProcessor Configuration
Thanks a lot for your help Russ. I was so caught up with the problem I didn't step back and think about having a dummy test page to isolate the SSL configuration on apache. I'll give that a try. Thanks again. Josh -Original Message- From: Russell Simpkins [mailto:russellsimpk...@hotmail.com] Sent: Tuesday, July 27, 2010 9:38 AM To: users@wicket.apache.org Subject: RE: HttpsRequestCycleProcessor Configuration My problem is not specific to wicket but I'm hoping that someone in the community has fought this battle before and is willing to lend a helping hand. I am using the HttpsRequestCycleProcessor and I only have the @RequireHttps annotation on one page, the registration page. I have apache httpd and tomcat talking to each other with a virtual host using proxypass and proxypassreverse on port 80 and all that is working fine. The problem becomes when I try to configure everything for SSL. I'm unsure whether I need SSL to be configured in tomcat and apache httpd or just one of them and not the other. I have generated a self signed certificate and key file for apache httpd and tried it with just that. When that did not work I pointed tomcat to the same files. Still nothing. It sounds like you have your SSL for apache incorrectly configured. First start by getting SSL configured and working correctly for your apache. Create a test page and make sure you can see it over HTTPS. Then verify that you've added your tomcat connector to your HTTPS server e.g. VirtualHost _default_:443# General setup for the virtual hostDocumentRoot /usr/local/www/webapps/ROOTServerName www.example.com:443ErrorLog /usr/apache/apache-2.2.11/logs/error_logTransferLog /usr/apache/apache-2.2.11/logs/access_logJkMount /app/* worker1JkMount /asyncService/* worker1JkMount /*.jsp worker1 # SSL Engine Switch:# Enable/Disable SSL for this virtual host.SSLEngine on.../VirtualHost If you want to use proxy pass instead of mod_jk, that shouldn't be an issue. Russ _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28 326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Transparent FB auth from cookie?
Hi, Having trouble with how this would best be done in Wicket: I have a Facebook OAuth token, which I use to request data from FB API and then assemble a User object. What I'd like to do is store this token in a Cookie, and whenever the user requests any page in my Wicket app, I'd like to reassemble the User object and put it in the WicketSession first. This works fine if I send a user to a login page that looks up the token, etc, but I'd rather this be transparent so that any page could be requested, without smearing this logic into every page. Is there a clean way to do this? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org