Request for help with generics-related compiler warnings
Greetings, Wicket Wizards, I am updating a sample Wicket program from 1.3.6 to 1.4.3 and running into a few generics-related issues. I am hoping you folks can quickly set me straight. My code appears to run successfully and passes its JUnit tests, despite the warnings I would like to remove. The purpose of the code is to demonstrate simple use of Forms, Lists, and Tables and associated testing of these constructs using WicketTester. First off, although you hopefully will not need to, you can download the sample code from here: http://ics-wicket-examples.googlecode.com/files/wicket-example02-1.0.1106.zip Unzip, cd into the directory, and type ant, It should download Ivy, then download Wicket, Jetty, SLF4J, and JUnit, and finally compile the system, generating the following generic-related warnings. Let me now show you what they are: Problem 1: please take a look at line 39 of TablePage.java: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TablePage.java The problematic line is: new ListDataProvider(contacts) and obviously requires a generic argument, but neither of the following work: new ListDataProviderContact(contacts) // my preferred guess new ListDataProviderListContact(contacts) The compiler warning is: [javac] TablePage.java:39: warning: [unchecked] unchecked call to ListDataProvider(java.util.ListT) as a member of the raw type org.apache.wicket.markup.repeater.data.ListDataProvider [javac] new ListDataProvider(contacts)) { [javac] ^ [javac] TablePage.java:39: warning: [unchecked] unchecked conversion [javac] found : org.apache.wicket.markup.repeater.data.ListDataProvider [javac] required: org.apache.wicket.markup.repeater.data.IDataProviderjava.util.Listedu.hawaii.wicket.TablePage.Contact [javac] new ListDataProvider(contacts)) { [javac] ^ Problem 2: on line 49 of the same file, TablePage.java: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TablePage.java The line is: Contact contact = (Contact) item.getModelObject(); Since the preceding line provides a parameterized declaration of item (ItemListContact item), I don't understand why I need to cast here. But the code does not compile if I don't. Then, I get the following warning: [javac] TablePage.java:49: warning: [unchecked] unchecked cast [javac] found : java.util.Listedu.hawaii.wicket.TablePage.Contact [javac] required: edu.hawaii.wicket.TablePage.Contact [javac] Contact contact = (Contact) item.getModelObject(); [javac] ^ Problem 3: WicketTester and generics. I clearly don't understand how to test with WicketTester. Take a look at lines 37-39 of TestListPage: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TestListPage.java This is a mess, and generates the following warning: [javac] TestListPage.java:39: warning: [unchecked] unchecked cast [javac] found : capture#294 of ? [javac] required: java.util.Listjava.lang.String [javac] ListString metaVars = (ListString) varsModel.getObject(); I have a feeling that my whole approach to getting values out of the table for testing is wrong, but I don't know what the correct approach is. If any of you can give me a hand, the first Mai Tai is on me the next time you are in Hawaii. Thanks! Philip - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Request for help with generics-related compiler warnings
This does not produces any warnings public class TablePage extends WebPage { /** Support serialization. */ private static final long serialVersionUID = 1L; /** * Creates a page containing a table of Contacts. */ public TablePage() { // Initialize our list of Contact instances. // Use ArrayList, not List, since ArrayList is Serializable. ArrayListContact contacts = new ArrayListContact(); contacts.add(new Contact(Joe Smith, 123 Honu St., Kailua, HI 96734)); contacts.add(new Contact(Sally Forth, 456 Alapapa St., Honolulu, HI 96813)); // Create the dataview to display our list of contact instances. // Note that the following commented out line is OK from a type perspective. // ListDataProviderContact test = new ListDataProviderContact(contacts); // But we can't say new ListDataProviderContact in the next line. Why? DataViewContact dataView = new DataViewContact(ContactList, new ListDataProviderContact(contacts)) { /** For serialization. */ private static final long serialVersionUID = 1L; /** * Display each row in the table. * * @param item A Contact instance to be displayed. */ public void populateItem(ItemContact item) { Contact contact = (Contact) item.getModelObject(); item.add(new Label(Name, contact.getName())); item.add(new Label(Address, contact.getAddress())); } }; // Add the dataview to the TablePage. add(dataView); } /** * An inner class implementing a record of data to be displayed as a row in the table. Package * private so that TestTablePage can access it. * * @author Philip Johnson */ static class Contact implements Serializable { /** Support serialization. */ private static final long serialVersionUID = 2L; private String name; private String address; /** * Create a new contact, given a name and an address. * * @param name The name. * @param address The address. */ public Contact(String name, String address) { this.name = name; this.address = address; } /** * Return the name. * * @return The name of this contact. */ public String getName() { return name; } /** * Return the address of this contact. * * @return The address. */ public String getAddress() { return address; } } } at least on my IDE Best, Ernesto On Sat, Nov 7, 2009 at 9:42 AM, Philip Johnson john...@hawaii.edu wrote: Greetings, Wicket Wizards, I am updating a sample Wicket program from 1.3.6 to 1.4.3 and running into a few generics-related issues. I am hoping you folks can quickly set me straight. My code appears to run successfully and passes its JUnit tests, despite the warnings I would like to remove. The purpose of the code is to demonstrate simple use of Forms, Lists, and Tables and associated testing of these constructs using WicketTester. First off, although you hopefully will not need to, you can download the sample code from here: http://ics-wicket-examples.googlecode.com/files/wicket-example02-1.0.1106.zip Unzip, cd into the directory, and type ant, It should download Ivy, then download Wicket, Jetty, SLF4J, and JUnit, and finally compile the system, generating the following generic-related warnings. Let me now show you what they are: Problem 1: please take a look at line 39 of TablePage.java: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TablePage.java The problematic line is: new ListDataProvider(contacts) and obviously requires a generic argument, but neither of the following work: new ListDataProviderContact(contacts) // my preferred guess new ListDataProviderListContact(contacts) The compiler warning is: [javac] TablePage.java:39: warning: [unchecked] unchecked call to ListDataProvider(java.util.ListT) as a member of the raw type org.apache.wicket.markup.repeater.data.ListDataProvider [javac] new ListDataProvider(contacts)) { [javac] ^ [javac] TablePage.java:39: warning: [unchecked] unchecked conversion [javac] found : org.apache.wicket.markup.repeater.data.ListDataProvider [javac] required: org.apache.wicket.markup.repeater.data.IDataProviderjava.util.Listedu.hawaii.wicket.TablePage.Contact [javac] new ListDataProvider(contacts)) { [javac] ^ Problem 2: on line 49 of the same file, TablePage.java: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TablePage.java The line is: Contact contact = (Contact) item.getModelObject(); Since the preceding line provides a parameterized declaration of item (ItemListContact item), I don't understand why I need to cast here. But the code does not compile if I don't. Then, I get the following warning: [javac] TablePage.java:49:
Re: Request for help with generics-related compiler warnings
and the casting is no longer needed DataViewContact dataView = new DataViewContact(ContactList, new ListDataProviderContact(contacts)) { /** For serialization. */ private static final long serialVersionUID = 1L; /** * Display each row in the table. * * @param item A Contact instance to be displayed. */ public void populateItem(ItemContact item) { Contact contact = item.getModelObject(); item.add(new Label(Name, contact.getName())); item.add(new Label(Address, contact.getAddress())); } }; Regards, Ernesto On Sat, Nov 7, 2009 at 10:14 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: This does not produces any warnings public class TablePage extends WebPage { /** Support serialization. */ private static final long serialVersionUID = 1L; /** * Creates a page containing a table of Contacts. */ public TablePage() { // Initialize our list of Contact instances. // Use ArrayList, not List, since ArrayList is Serializable. ArrayListContact contacts = new ArrayListContact(); contacts.add(new Contact(Joe Smith, 123 Honu St., Kailua, HI 96734)); contacts.add(new Contact(Sally Forth, 456 Alapapa St., Honolulu, HI 96813)); // Create the dataview to display our list of contact instances. // Note that the following commented out line is OK from a type perspective. // ListDataProviderContact test = new ListDataProviderContact(contacts); // But we can't say new ListDataProviderContact in the next line. Why? DataViewContact dataView = new DataViewContact(ContactList, new ListDataProviderContact(contacts)) { /** For serialization. */ private static final long serialVersionUID = 1L; /** * Display each row in the table. * * @param item A Contact instance to be displayed. */ public void populateItem(ItemContact item) { Contact contact = (Contact) item.getModelObject(); item.add(new Label(Name, contact.getName())); item.add(new Label(Address, contact.getAddress())); } }; // Add the dataview to the TablePage. add(dataView); } /** * An inner class implementing a record of data to be displayed as a row in the table. Package * private so that TestTablePage can access it. * * @author Philip Johnson */ static class Contact implements Serializable { /** Support serialization. */ private static final long serialVersionUID = 2L; private String name; private String address; /** * Create a new contact, given a name and an address. * * @param name The name. * @param address The address. */ public Contact(String name, String address) { this.name = name; this.address = address; } /** * Return the name. * * @return The name of this contact. */ public String getName() { return name; } /** * Return the address of this contact. * * @return The address. */ public String getAddress() { return address; } } } at least on my IDE Best, Ernesto On Sat, Nov 7, 2009 at 9:42 AM, Philip Johnson john...@hawaii.edu wrote: Greetings, Wicket Wizards, I am updating a sample Wicket program from 1.3.6 to 1.4.3 and running into a few generics-related issues. I am hoping you folks can quickly set me straight. My code appears to run successfully and passes its JUnit tests, despite the warnings I would like to remove. The purpose of the code is to demonstrate simple use of Forms, Lists, and Tables and associated testing of these constructs using WicketTester. First off, although you hopefully will not need to, you can download the sample code from here: http://ics-wicket-examples.googlecode.com/files/wicket-example02-1.0.1106.zip Unzip, cd into the directory, and type ant, It should download Ivy, then download Wicket, Jetty, SLF4J, and JUnit, and finally compile the system, generating the following generic-related warnings. Let me now show you what they are: Problem 1: please take a look at line 39 of TablePage.java: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TablePage.java The problematic line is: new ListDataProvider(contacts) and obviously requires a generic argument, but neither of the following work: new ListDataProviderContact(contacts) // my preferred guess new ListDataProviderListContact(contacts) The compiler warning is: [javac] TablePage.java:39: warning: [unchecked] unchecked call to ListDataProvider(java.util.ListT) as a member of the raw type org.apache.wicket.markup.repeater.data.ListDataProvider [javac] new ListDataProvider(contacts)) { [javac] ^ [javac] TablePage.java:39: warning: [unchecked] unchecked
How to get Session in Application
Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get Session in Application
Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get Session in Application
Hi, I tried this, but I got the following: you can only locate or create sessions in the context of a request cycle when I start the application. On Sat, Nov 7, 2009 at 7:38 PM, James Carman jcar...@carmanconsulting.com wrote: Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get Session in Application
What session are you trying to access during the application startup? A session is tied to a user's session as they browse your site. Who's browsing upon application startup? On Sat, Nov 7, 2009 at 6:42 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I tried this, but I got the following: you can only locate or create sessions in the context of a request cycle when I start the application. On Sat, Nov 7, 2009 at 7:38 PM, James Carman jcar...@carmanconsulting.com wrote: Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get Session in Application
Hi, James: I just using the following code, then I get that error. getSecuritySettings().setAuthorizationStrategy( new IAuthorizationStrategy(){ SecuritySession session = SecuritySession.get(); public boolean isActionAuthorized(Component component, Action action) { return session.auth(component,action) } public T extends Component boolean isInstantiationAuthorized(ClassT clazz) { return session.auth(clazz); } } ); On Sat, Nov 7, 2009 at 8:01 PM, James Carman jcar...@carmanconsulting.com wrote: What session are you trying to access during the application startup? A session is tied to a user's session as they browse your site. Who's browsing upon application startup? On Sat, Nov 7, 2009 at 6:42 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I tried this, but I got the following: you can only locate or create sessions in the context of a request cycle when I start the application. On Sat, Nov 7, 2009 at 7:38 PM, James Carman jcar...@carmanconsulting.com wrote: Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to get Session in Application
Don't try to access the session so early. Just get it inside each method, because those methods will be called during a request cycle. Basically, remove your member variable that holds the session and just use SecuritySession.get() in its place. On Sat, Nov 7, 2009 at 7:23 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, James: I just using the following code, then I get that error. getSecuritySettings().setAuthorizationStrategy( new IAuthorizationStrategy(){ SecuritySession session = SecuritySession.get(); public boolean isActionAuthorized(Component component, Action action) { return session.auth(component,action) } public T extends Component boolean isInstantiationAuthorized(ClassT clazz) { return session.auth(clazz); } } ); On Sat, Nov 7, 2009 at 8:01 PM, James Carman jcar...@carmanconsulting.com wrote: What session are you trying to access during the application startup? A session is tied to a user's session as they browse your site. Who's browsing upon application startup? On Sat, Nov 7, 2009 at 6:42 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I tried this, but I got the following: you can only locate or create sessions in the context of a request cycle when I start the application. On Sat, Nov 7, 2009 at 7:38 PM, James Carman jcar...@carmanconsulting.com wrote: Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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: London Wicket Event at Foyles Bookshop, November 21st, 2009
Martijn, I'm glad you can make it. RackSpace's cloud was down when we announced the event. Registration [1] is now back online. Regards - Cemal jWeekend OO Java Technologies, Wicket Training and Development http://jWeekend.com [1] http://jweekend.com/dev/LWUGReg Martijn Dashorst wrote: Bring your copy of Wicket in Action Martijn On Tue, Nov 3, 2009 at 12:11 AM, jWeekend jweekend_for...@cabouge.com wrote: We will hold our next London Wicket Event on Saturday, 21st November, from 14:45. This time we have hired The Gallery at the iconic Foyles Bookshop in central London. We again welcome guests and speakers from several countries, including at least 3 core committers, Matej, Jeremy and of course, Alastair, as well as the founders of WiQuery (Wicket-jQuery integration), Lionel Armanet and his team. Join us for some very interesting, high quality presentations and to chat with fellow Wicket users and developers at all levels. We're expecting this to be another popular event and since places are limited book and confirm early if you can make it. Details and registration are at the usual place [1]. There is a cool little Jazz cafe at Foyles too, where there'll be a live act (Femi Temowo) at 13:00 if you enjoy some Jazz guitar relaxation before your intellectual stimulation. They offer a decent range of food and drink there too. The event schedule looks like: Cemal Bayramoglu: Introduction Jeremy Thomerson (USA): Custom JavaScript Integrations with Wicket + Auto Resolvers Lionel Armanet (FR): Announcing WiQuery 1.0: Introduction Demo Matej Knopp (SK): BRIX CMS + Wicket 1.5 Developments QA Alastair Maw (UK): The Al Talk Our Regular General Wicket QA with Al and Cemal We expect to formally finish by around 19:00. I would expect the usual suspects will be heading somewhere in the neighbourhood for refreshments straight after the event, and of course you are more than welcome to join us. Regards - Cemal jWeekend http://jWeekend.com Training, Consulting, Development [1] http://jweekend.com/dev/LWUGReg/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://old.nabble.com/London-Wicket-Event-at-Foyles-Bookshop%2C-November-21st%2C-2009-tp26172328p26240927.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: How to get Session in Application
Thanks James, I works well, that means no request, no session. On Sat, Nov 7, 2009 at 8:27 PM, James Carman jcar...@carmanconsulting.com wrote: Don't try to access the session so early. Just get it inside each method, because those methods will be called during a request cycle. Basically, remove your member variable that holds the session and just use SecuritySession.get() in its place. On Sat, Nov 7, 2009 at 7:23 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, James: I just using the following code, then I get that error. getSecuritySettings().setAuthorizationStrategy( new IAuthorizationStrategy(){ SecuritySession session = SecuritySession.get(); public boolean isActionAuthorized(Component component, Action action) { return session.auth(component,action) } public T extends Component boolean isInstantiationAuthorized(ClassT clazz) { return session.auth(clazz); } } ); On Sat, Nov 7, 2009 at 8:01 PM, James Carman jcar...@carmanconsulting.com wrote: What session are you trying to access during the application startup? A session is tied to a user's session as they browse your site. Who's browsing upon application startup? On Sat, Nov 7, 2009 at 6:42 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I tried this, but I got the following: you can only locate or create sessions in the context of a request cycle when I start the application. On Sat, Nov 7, 2009 at 7:38 PM, James Carman jcar...@carmanconsulting.com wrote: Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter:
Re: How to get Session in Application
Yes, it's just like servlet programming. You have to have an HttpServletRequest to get to the HttpSession. On Sat, Nov 7, 2009 at 8:05 AM, Haulyn R. Jason saharab...@gmail.com wrote: Thanks James, I works well, that means no request, no session. On Sat, Nov 7, 2009 at 8:27 PM, James Carman jcar...@carmanconsulting.com wrote: Don't try to access the session so early. Just get it inside each method, because those methods will be called during a request cycle. Basically, remove your member variable that holds the session and just use SecuritySession.get() in its place. On Sat, Nov 7, 2009 at 7:23 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, James: I just using the following code, then I get that error. getSecuritySettings().setAuthorizationStrategy( new IAuthorizationStrategy(){ SecuritySession session = SecuritySession.get(); public boolean isActionAuthorized(Component component, Action action) { return session.auth(component,action) } public T extends Component boolean isInstantiationAuthorized(ClassT clazz) { return session.auth(clazz); } } ); On Sat, Nov 7, 2009 at 8:01 PM, James Carman jcar...@carmanconsulting.com wrote: What session are you trying to access during the application startup? A session is tied to a user's session as they browse your site. Who's browsing upon application startup? On Sat, Nov 7, 2009 at 6:42 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I tried this, but I got the following: you can only locate or create sessions in the context of a request cycle when I start the application. On Sat, Nov 7, 2009 at 7:38 PM, James Carman jcar...@carmanconsulting.com wrote: Session.get()? http://wicket.apache.org/docs/1.4/org/apache/wicket/Session.html#get%28%29 In your custom session class, you can add your own get() method that returns your specific type: public static MySession get() { return (MySession)Session.get(); } Then, you don't have to cast: MySession.get().getMySessionInformationThatImInterestedIn(); On Sat, Nov 7, 2009 at 5:22 AM, Haulyn R. Jason saharab...@gmail.com wrote: Hi, I want to implement IAuthorizationStrategy in MyApplication, but I do not know how to get WicketSession, I need to get Component Action List from WicketSession. Is there some reference? -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan Shumagang 6H-8, 25 Mobile: +086-15864011231 email: saharab...@gmail.com website: http://haulynjason.net gtalk: saharab...@gmail.com skype: saharabear QQ: 378606292 persional Twitter: http://twitter.com/saharabear persional Linkedin: http://www.linkedin.com/in/haulyn Haulyn Microproduction Twitter: http://twitter.com/haulynmp Haulyn Jason - 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 -- Many thanks! Haulyn Microproduction You can access me via: Location: Shandong Jinan
dynamic components
Hi people, Does anyone know how to dynamically add components to a form? The types and numbers of the components are arbitrary, and will be determined programmatically. In one page, the form may contain 1 textbox, 2 buttons. In another page, it may contain 2 textareas, 1 checkbox, and so on... Perhaps there's a framework over Wicket for this? Lots of thanks in advance for ur assist. Regards, Mike
Help me with setting up Ubuntu, NetBeans, Maven2, Wicket, Jetty and Google App Engine
Hi, I am trying to develop Wicket application (site about my research in Data Compression Algorithms) to Google App Engine using NetBeans and Maven2. I need an up-to-date pom.xml files with short dependencies, ie. the ones I saw had a long list of dependencies. Currently I've found two unsatisfactory solutions: http://gae-j-maven.appspot.com/ http://code.google.com/p/maven-gae-plugin/ Do you know something better? I need to have access to Google App Engine features like DataStore, MemCache etc. I've set netbeans.deploy=false so NetBeans doesn't ask for deploying server (besides, I am using embedded Jetty to run that, so the question was weird), but sadly, now NetBeans doesn't open new browser window and doesn't stop Jetty before another run command. Do you think that using Maven2 with that project makes sense? Maybe I should make regular NetBeans project... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
links on the page after invalidating the session
I am reading the book: Wicket in Action. The first sentence of the Note on page 274 reads: - Always set a bookmarkable response page after you invalidate the session. - My understanding is that if this page has any Wicket-generated links, it MUST be bookmarkable links too. Correct? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic components
What determines which components will be on the form? On Sat, Nov 7, 2009 at 8:38 AM, Gw not4spamm...@gmail.com wrote: Hi people, Does anyone know how to dynamically add components to a form? The types and numbers of the components are arbitrary, and will be determined programmatically. In one page, the form may contain 1 textbox, 2 buttons. In another page, it may contain 2 textareas, 1 checkbox, and so on... Perhaps there's a framework over Wicket for this? Lots of thanks in advance for ur assist. Regards, Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
A question about the book WIA
I am reading the book: Wicket in Action. The first sentence of second paragraph of page 273 reads: - In the UserPanel, we created a model that extends LoadableDetachableModel for representing the current user (if any). - In this chapter (Chapter 11 Securiing your application), I am unable to see any code for the above-mentioned model creation. I cannot understand it. Could someone out there elaborate on this? Thank you for your help! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Help me with setting up Ubuntu, NetBeans, Maven2, Wicket, Jetty and Google App Engine
unfortunately, there are no public maven repositories that contain the needed artifacts. I did install them all manually in my local repo... If you are interested I can send you my pom (but that'll be monday, since I can't access my pc right now...) pieter On Sat, Nov 7, 2009 at 3:52 PM, Piotr Tarsa piotr.ta...@gmail.com wrote: Hi, I am trying to develop Wicket application (site about my research in Data Compression Algorithms) to Google App Engine using NetBeans and Maven2. I need an up-to-date pom.xml files with short dependencies, ie. the ones I saw had a long list of dependencies. Currently I've found two unsatisfactory solutions: http://gae-j-maven.appspot.com/ http://code.google.com/p/maven-gae-plugin/ Do you know something better? I need to have access to Google App Engine features like DataStore, MemCache etc. I've set netbeans.deploy=false so NetBeans doesn't ask for deploying server (besides, I am using embedded Jetty to run that, so the question was weird), but sadly, now NetBeans doesn't open new browser window and doesn't stop Jetty before another run command. Do you think that using Maven2 with that project makes sense? Maybe I should make regular NetBeans project... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be
Re: Request for help with generics-related compiler warnings
Thanks so much, both of you! Anyone have any ideas about the WicketTester code? Problem 3: WicketTester and generics. I clearly don't understand how to test with WicketTester. Take a look at lines 37-39 of TestListPage: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example02/src/edu/hawaii/wicket/TestListPage.java This is a mess, and generates the following warning: [javac] TestListPage.java:39: warning: [unchecked] unchecked cast [javac] found : capture#294 of ? [javac] required: java.util.Listjava.lang.String [javac] ListString metaVars = (ListString) varsModel.getObject(); Cheers, Philip -- View this message in context: http://old.nabble.com/Request-for-help-with-generics-related-compiler-warnings-tp26242997p26245535.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: Help me with setting up Ubuntu, NetBeans, Maven2, Wicket, Jetty and Google App Engine
Piotr: On Sat, Nov 7, 2009 at 11:55 AM, Piotr Tarsa piotr.ta...@gmail.com wrote: I need an up-to-date pom.xml files with short dependencies, ie. the ones I saw had a long list of dependencies. I usually start with the wicket quickstart project and it fits my needs. Later, I add the dependecies that I need. I've set netbeans.deploy=false so NetBeans doesn't ask for deploying server (besides, I am using embedded Jetty to run that, so the question was weird), but sadly, now NetBeans doesn't open new browser window and doesn't stop Jetty before another run command. You could use the option 'apply code changes' if you change a class. This replace the old class file with the new one without needing to restart the jetty. It's very usefull and reduces the deployment dead time. In order to use this options you should run your start jetty in debug mode. Do you think that using Maven2 with that project makes sense? Maybe I should make regular NetBeans project... In my opinion Maven is the correct option. Downloading the jars manually is a ugly task. Cheers. -- Mauro Ciancio
Re: links on the page after invalidating the session
the links on the page dont have to be bookmarkable, the only requirement is that after you invalidate the session you use setresponsepage(page.class) variant - which constructs a bookmarkable link vs a setresponsepage(page) - which constructs a session-relative link and wont work because you invalidated the session -igor On Sat, Nov 7, 2009 at 6:30 AM, David Chang david_q_zh...@yahoo.com wrote: I am reading the book: Wicket in Action. The first sentence of the Note on page 274 reads: - Always set a bookmarkable response page after you invalidate the session. - My understanding is that if this page has any Wicket-generated links, it MUST be bookmarkable links too. Correct? Thanks! - 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: Help me with setting up Ubuntu, NetBeans, Maven2, Wicket, Jetty and Google App Engine
OK. I will be grateful for any help. 2009/11/7 Pieter Degraeuwe pieter.degrae...@systemworks.be: unfortunately, there are no public maven repositories that contain the needed artifacts. I did install them all manually in my local repo... If you are interested I can send you my pom (but that'll be monday, since I can't access my pc right now...) pieter On Sat, Nov 7, 2009 at 3:52 PM, Piotr Tarsa piotr.ta...@gmail.com wrote: Hi, I am trying to develop Wicket application (site about my research in Data Compression Algorithms) to Google App Engine using NetBeans and Maven2. I need an up-to-date pom.xml files with short dependencies, ie. the ones I saw had a long list of dependencies. Currently I've found two unsatisfactory solutions: http://gae-j-maven.appspot.com/ http://code.google.com/p/maven-gae-plugin/ Do you know something better? I need to have access to Google App Engine features like DataStore, MemCache etc. I've set netbeans.deploy=false so NetBeans doesn't ask for deploying server (besides, I am using embedded Jetty to run that, so the question was weird), but sadly, now NetBeans doesn't open new browser window and doesn't stop Jetty before another run command. Do you think that using Maven2 with that project makes sense? Maybe I should make regular NetBeans project... - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic components
Let's say... an XML file containing screen configuration file will determine the form's content. On Sat, Nov 7, 2009 at 9:30 PM, James Carman jcar...@carmanconsulting.comwrote: What determines which components will be on the form? On Sat, Nov 7, 2009 at 8:38 AM, Gw not4spamm...@gmail.com wrote: Hi people, Does anyone know how to dynamically add components to a form? The types and numbers of the components are arbitrary, and will be determined programmatically. In one page, the form may contain 1 textbox, 2 buttons. In another page, it may contain 2 textareas, 1 checkbox, and so on... Perhaps there's a framework over Wicket for this? Lots of thanks in advance for ur assist. Regards, Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic components
Can build using repeaters, or an form with all possible form components added on it, with they isVisible implementation returning true due parameters you read in an xml On Sat, Nov 7, 2009 at 11:38 AM, Gw not4spamm...@gmail.com wrote: Hi people, Does anyone know how to dynamically add components to a form? The types and numbers of the components are arbitrary, and will be determined programmatically. In one page, the form may contain 1 textbox, 2 buttons. In another page, it may contain 2 textareas, 1 checkbox, and so on... Perhaps there's a framework over Wicket for this? Lots of thanks in advance for ur assist. Regards, Mike -- Pedro Henrique Oliveira dos Santos
FormTester not working in Cheesr (Wicket In Action) update to 1.4.3
Greetings, Wicketopians, I am updating the Cheesr application to 1.4.3, and with some help from Andrig Miller, have got the actual application working fine. The problem I am having is with the unit tests that I wrote for the 1.3.6 version. I use FormTester to fill out the fields on a Checkout page and then submit the results. When running the application interactively, submitting the form works correctly and sends you back to an Index page. My test code looks like this: FormTester formTester = tester.newFormTester(form); formTester.setValue(name, Philip); formTester.setValue(street, Main Street); formTester.setValue(zipcode, 96822); formTester.setValue(city, Anchorage); formTester.setValue(state-wmc:state, Alaska); formTester.submit(); tester.assertRenderedPage(Index.class); But it doesn't work: the last assertion indicates that we're still on the Checkout page. This test worked under 1.3.6. I've played around with this for a couple of hours now and am convinced that there's something simple going on that I simply can't see. Can any of you straighten me out? Here's the test class: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example04/src/com/cheesr/TestCheckoutPage.java Here's the Form definition: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example04/src/com/cheesr/CheckoutPage.java Here's the page's HTML: http://code.google.com/p/ics-wicket-examples/source/browse/trunk/example04/src/com/cheesr/CheckoutPage.html If you'd like to download the entire application: http://ics-wicket-examples.googlecode.com/files/wicket-example04-1.0.1107.zip Thanks so much for any help you can provide, Philip - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: dynamic components
this should give you a very decent starting point https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/attic/wicketstuff-crud/ -igor On Sat, Nov 7, 2009 at 5:38 AM, Gw not4spamm...@gmail.com wrote: Hi people, Does anyone know how to dynamically add components to a form? The types and numbers of the components are arbitrary, and will be determined programmatically. In one page, the form may contain 1 textbox, 2 buttons. In another page, it may contain 2 textareas, 1 checkbox, and so on... Perhaps there's a framework over Wicket for this? Lots of thanks in advance for ur assist. Regards, Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicketstuff.org down?
Hi, I cannot reach wicketstuff.org anymore. Anyone else experiencing this problem? Best Regards, Ilja Pavkovic -- binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin +49 · 171 · 9342 465 Handelsregister: HRB 115854 - Amtsgericht Charlottenburg Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: LDAP Authentication
Ryan McKinley wrote: take a look at Apache Shiro http://incubator.apache.org/shiro/ I found it much easier to work with... I agree with this. Apache Shiro is very easy to be used. Although the learning curve is a little bit steep because of the documentation. But once you get the hang for Realms and the (very few) classes you need to know, things become less difficult. We now integrated Shiro in our application and Authentication as well as Authorisation is a very simple process now. Ping me if you need some pointers to our implementation. Cheers, Adrian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WicketFilter.getLastModified creates a RequestCycle but does not clean it up
Hi Wicketeers, I noticed that WicketFilter.getLastModified creates a RequestCycle but does not /detach /it, so onEndRequest is not called. I use JCR and open a session to it on first use (lazy init). I store the JCR session in th RequestCycle. I close the JCR session in RequestCycle.onEndRequest (overriden). Kind of Open Session In View pattern. When WicketFilter.getLastModified calls Resource.getResourceStream() I have to open a JCR session to stream the requested resource. But then onEndRequest is not called on the RequestCycle so the JCR session remains open. By debugging I found the following sequence in WicketFilter: doFilter getLastModified webApplication.newRequestCycle resource.getResourceStream // requestCycle.detach - this is commented requestCycle.unset // this does not call onEndRequest doGet webApplication.newRequestCycle // second RequestCycle is created cycle.request() // this calls again getResourceStream but also RequestCycle.detach It turns out two RequestCycle's are created but only the second one is detached. Also Resource.getResourceStream is called twice. This is all for one request. I use Wicket 1.4.1. Best regards, Peter
Re: wicketstuff.org down?
Yes. 2009/11/7 Ilja Pavkovic ilja.pavko...@binaere-bauten.de: Hi, I cannot reach wicketstuff.org anymore. Anyone else experiencing this problem? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicketstuff.org down?
THE server had been moves to another ip. I havent had time to update dns Martijn On Saturday, November 7, 2009, Janos Cserep cser...@metaprime.hu wrote: Yes. 2009/11/7 Ilja Pavkovic ilja.pavko...@binaere-bauten.de: Hi, I cannot reach wicketstuff.org anymore. Anyone else experiencing this problem? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicketstuff.org down?
I have the same issue On Sat, Nov 7, 2009 at 4:39 PM, Ilja Pavkovic ilja.pavko...@binaere-bauten.de wrote: Hi, I cannot reach wicketstuff.org anymore. Anyone else experiencing this problem? Best Regards, Ilja Pavkovic -- binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin +49 · 171 · 9342 465 Handelsregister: HRB 115854 - Amtsgericht Charlottenburg Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
model update in moveuplink and movedownlink onclick
Is there anyway that you can update model before you move the item up or down using moveuplink and movedownlink in listview. My goal is to save the input data to the model so that I don't loose use input on the item before moving the item. I did try to extend the ListView and added my own moveuplink and downlink code called form's updateFormComponentModels() method but that didn't really help. Does anyone have any idea how this can be done. LeadTransnodeChain lc = new LeadTransnodeChain(1, 2, 3, 4, 5, LeadTransnodeChain.MODE.ASYNC); masterChainList.add(lc); masterChainList.add(new LeadTransnodeChain(11, 12, 13, 14, 15, LeadTransnodeChain.MODE.SYNC)); masterChainList.add(new LeadTransnodeChain(21, 22, 23, 24, 25, LeadTransnodeChain.MODE.SYNC)); ListView propertiesList = new MyListView(masterChainList, masterChainList) { @Override protected void populateItem(ListItem item) { LeadTransnodeChain leadTransnodeChain = (LeadTransnodeChain) item.getModelObject(); item.add(new Label(masterChain, new PropertyModel(leadTransnodeChain, m_masterChainID))); item.add(new DropDownChoice(runAs, new PropertyModel(leadTransnodeChain, m_mode), Arrays.asList(LeadTransnodeChain.MODE.values()), new IChoiceRenderer() { public Object getDisplayValue(Object mode) { return ((LeadTransnodeChain.MODE) mode).toString(); } public String getIdValue(Object obj, int index) { return obj.toString(); } } )); item.add(moveMyUpLink(moveUp, item, form)); item.add(moveMyDownLink(moveDown, item, form)); } }; add(new Button(submitButton)); propertiesList.setReuseItems(true); add(propertiesList); }public void updateComponentModels(){ super.updateFormComponentModels(); } public abstract class MyListViewT extends ListViewT { ... protected abstract void populateItem(ListItem item) ; /** * Returns a link that will move the given item down (towards the end) in the listView. * * @param id *Name of move-down link component to create * @param item * @return The link component */ public final LinkVoid moveMyDownLink(final String id, final ListItemT item, final MasterChainListForm form) { return new LinkVoid(id) { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.markup.html.link.Link#onClick() */ @Override public void onClick() { final int index = getList().indexOf(item.getModelObject()); if (index != -1) { form.updateComponentModels(); addStateChange(new Change() { private static final long serialVersionUID = 1L; final int oldIndex = index; @Override public void undo() { Collections.swap(getList(), oldIndex + 1, oldIndex); } }); // Swap list items and invalidate listView Collections.swap(getList(), index, index + 1); MasterChainListView.this.removeAll(); } } /** * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { super.onBeforeRender(); setAutoEnable(false); if (getList().indexOf(item.getModelObject()) == (getList().size() - 1)) { setEnabled(false); } } }; } /**
Re: wicketstuff.org down?
Same problem here. I'm pretty new to this business of building off of repositories using Maven - so new that I assumed my failed 'make install' was my fault since it was the first time I did it on my own :) Jake Ilja Pavkovic-3 wrote: Hi, I cannot reach wicketstuff.org anymore. Anyone else experiencing this problem? Best Regards, Ilja Pavkovic -- binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin +49 · 171 · 9342 465 Handelsregister: HRB 115854 - Amtsgericht Charlottenburg Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://old.nabble.com/wicketstuff.org-down--tp26248816p26249945.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: model update in moveuplink and movedownlink onclick
you have to use submitlinks for move up/down. -igor On Sat, Nov 7, 2009 at 4:31 PM, Swarnim Ranjitkar swarn...@hotmail.com wrote: Is there anyway that you can update model before you move the item up or down using moveuplink and movedownlink in listview. My goal is to save the input data to the model so that I don't loose use input on the item before moving the item. I did try to extend the ListView and added my own moveuplink and downlink code called form's updateFormComponentModels() method but that didn't really help. Does anyone have any idea how this can be done. LeadTransnodeChain lc = new LeadTransnodeChain(1, 2, 3, 4, 5, LeadTransnodeChain.MODE.ASYNC); masterChainList.add(lc); masterChainList.add(new LeadTransnodeChain(11, 12, 13, 14, 15, LeadTransnodeChain.MODE.SYNC)); masterChainList.add(new LeadTransnodeChain(21, 22, 23, 24, 25, LeadTransnodeChain.MODE.SYNC)); ListView propertiesList = new MyListView(masterChainList, masterChainList) { �...@override protected void populateItem(ListItem item) { LeadTransnodeChain leadTransnodeChain = (LeadTransnodeChain) item.getModelObject(); item.add(new Label(masterChain, new PropertyModel(leadTransnodeChain, m_masterChainID))); item.add(new DropDownChoice(runAs, new PropertyModel(leadTransnodeChain, m_mode), Arrays.asList(LeadTransnodeChain.MODE.values()), new IChoiceRenderer() { public Object getDisplayValue(Object mode) { return ((LeadTransnodeChain.MODE) mode).toString(); } public String getIdValue(Object obj, int index) { return obj.toString(); } } )); item.add(moveMyUpLink(moveUp, item, form)); item.add(moveMyDownLink(moveDown, item, form)); } }; add(new Button(submitButton)); propertiesList.setReuseItems(true); add(propertiesList); }public void updateComponentModels(){ super.updateFormComponentModels(); } public abstract class MyListViewT extends ListViewT { ... protected abstract void populateItem(ListItem item) ; /** * Returns a link that will move the given item down (towards the end) in the listView. * * @param id * Name of move-down link component to create * @param item * @return The link component */ public final LinkVoid moveMyDownLink(final String id, final ListItemT item, final MasterChainListForm form) { return new LinkVoid(id) { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.markup.html.link.Link#onClick() */ �...@override public void onClick() { final int index = getList().indexOf(item.getModelObject()); if (index != -1) { form.updateComponentModels(); addStateChange(new Change() { private static final long serialVersionUID = 1L; final int oldIndex = index; �...@override public void undo() { Collections.swap(getList(), oldIndex + 1, oldIndex); } }); // Swap list items and invalidate listView Collections.swap(getList(), index, index + 1); MasterChainListView.this.removeAll(); } } /** * @see org.apache.wicket.Component#onBeforeRender() */ �...@override protected void onBeforeRender() { super.onBeforeRender(); setAutoEnable(false); if (getList().indexOf(item.getModelObject()) == (getList().size() - 1)) { setEnabled(false); } } }; } /** - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicketstuff.org down?
At least this gives me a reason and time now to setup Nexus to proxy wicketstuff.org until my builds are broken:) Any estimate when the dns change would be visible? Thanks, Janos 2009/11/7 Martijn Dashorst martijn.dasho...@gmail.com: THE server had been moves to another ip. I havent had time to update dns Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: model update in moveuplink and movedownlink onclick
Thank you very much .It worked well with submitlinks. I thought it would be better with AjaxSubmitlink but i couldn't get it working on that. It doesn't move the item when i click first time. next time it gives me WicketMessage: org.apache.wicket.WicketRuntimeException: component form:masterChainList:1:moveUp not found on page com.swishmark.tugboat.tools.MasterChainListPage[id = 8], listener interface = [RequestListenerInterface name=IActivePageBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] Root cause: org.apache.wicket.WicketRuntimeException: component form:masterChainList:1:moveUp not found on page com.swishmark.tugboat.tools.MasterChainListPage[id = 8], listener interface = [RequestListenerInterface name=IActivePageBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:204) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:482) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) Complete stack: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: component form:masterChainList:1:moveUp not found on page com.swishmark.tugboat.tools.MasterChainListPage[id = 8], listener interface = [RequestListenerInterface name=IActivePageBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] Here is my code . /** * Returns a link that will move the given item up (towards the beginning) in the listView. * * @param id *Name of move-up link component to create * @param item * @param form * @return The link component */ public final AjaxSubmitLink moveMyUpLink(final String id, final ListItemT item, MasterChainListForm form) { return new AjaxSubmitLink(id) { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.markup.html.link.Link#onClick() */ /** * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { super.onBeforeRender(); //setAutoEnable(false); if (getList().indexOf(item.getModelObject()) == 0) { setEnabled(false); } } @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { { final int index = getList().indexOf(item.getModelObject()); if (index != -1) { addStateChange(new Change() { private static final long serialVersionUID = 1L; final int oldIndex = index; @Override