[Wicket-user] ModalWindow, Forms, and Updating underlying Panels
Here's the situation: I have a panel that displays a list of users using AjaxFallbackDefaultDataTable. This is working just fine. I have a button on the page, "Create" which launches a page based modal dialog with a form for gathering input on the new user. I couldn't get SubmitButton to work on the modal dialog form, so I tried AjaxSubmitButton, which worked. I get the User object from the form, persist it with the data API (EJB3), and close the window, which brings me back to the original user list panel. All great, except the DataTable doesn't show the new entry. I need to update it somehow. If I refresh, the re-rendered page / panel shows the new entry. So, I know it's making it into the database. What would you guys suggest? Should the traditional form submit logic work on a page based modal dialog (thus triggering a round trip)? Or is there a way that I can trigger an Ajax update of the DataTable as part of the closing method? Thanks in advance. -jjk - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] ModalWindow, Forms, and Updating underlying Panels
Hi, To refresh the dataview, you need to register a windowsclosedcallback on your modal window. final WebMarkupContainer dataTableHolder = new WebMarkupContainer("dataTableHolder); dataTableHolder.setOutputMarkupId(true); add(dataTableHolder); dataTableHolder.add(dataTable); window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { public void onClose(AjaxRequestTarget target) { target.addComponent(dataTableHolder); } }); Something like this should work. -Matej On 4/15/07, Julian Klappenbach <[EMAIL PROTECTED]> wrote: > Here's the situation: > > I have a panel that displays a list of users using > AjaxFallbackDefaultDataTable. This is working just fine. I have a button > on the page, "Create" which launches a page based modal dialog with a form > for gathering input on the new user. I couldn't get SubmitButton to work on > the modal dialog form, so I tried AjaxSubmitButton, which worked. I get the > User object from the form, persist it with the data API (EJB3), and close > the window, which brings me back to the original user list panel. > > All great, except the DataTable doesn't show the new entry. I need to > update it somehow. If I refresh, the re-rendered page / panel shows the new > entry. So, I know it's making it into the database. > > What would you guys suggest? Should the traditional form submit logic work > on a page based modal dialog (thus triggering a round trip)? Or is there a > way that I can trigger an Ajax update of the DataTable as part of the > closing method? > > Thanks in advance. > > -jjk > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-user > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Nullify objectModel when component is not visible
when is it set to null? public final Component setVisible(final boolean visible) { // Is new visibility state a change? if (visible != getFlag(FLAG_VISIBLE)) { // record component's visibility change addStateChange(new VisibilityChange(this)); // Change visibility setFlag(FLAG_VISIBLE, visible); } return this; } i don't see any code touching the model. johan On 4/15/07, Alex Objelean <[EMAIL PROTECTED]> wrote: I don't understand why if the component visibility is set to false, the backing model object is set to null? Is there any reason? I find it more useful to not touch at all the backing object is such case. What is your opinion? Thank you! -- View this message in context: http://www.nabble.com/Nullify-objectModel-when-component-is-not-visible-tf3577965.html#a9998155 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] ModalWindow, Forms, and Updating underlying Panels
Worked like a charm. I had been trying a similar approach, but was attempting to use the following: target.addComponent(dataTable) Which complained that there was no page assignment. This does the trick. Also, for anyone else interested, I had to structure my markup as: Wicket rocks. -jjk - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] switching back to WicketFilter from ReloadingWicketFilter in production
you could use a system property for that? so the filter only works if a system property is set. johan On 4/14/07, Jean-Baptiste Quenot <[EMAIL PROTECTED]> wrote: * Peter Thomas: > Thanks. Do you want me to open a JIRA? Well, I don't think this will really work, because when the application sets the configuration mode (development or deployment) the application has already been loaded in the reloading class loader. In other words either it's too early to know if the application is in development or not because the application is not created yet, or it's too late because the application is already in the reloading class loader and thus we're impacting the class loading in production, which is not good. -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Creating Entire Forms in Java Code Only?
Also, it seems like a lot of swing developers wish they had something like wicket, where they can do the form layout/design in xml and then do the complicated bits in java. I think that although that isn't exactly what F3 is, that's why people are excited by it. i wouldn't like that, why would i place the structure of the ui in xml code generation in that area is fine especially when you have a gui builder that works both ways. So you could tweak it by hand and you just see that directly in the ui builder. johan - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Unable to add images to Wicket wiki
Hi, I'm in the middle of adding a Wiki page on using JMeter and Wicket here: http://cwiki.apache.org/confluence/display/WICKET/Wicket+and+JMeter+with+Regular+Expressions I wanted to add a couple of screenshots but looks like this is restricted. I can send across the 3 PNG files to someone if required and the page already has the placeholders - so all that needs to be done is upload. Thanks, Peter. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Capture Selection of a AutoCompleteTextBox
Hi All, I was wondering if it is possible to capture the user selection of a AutoComplete Text Box? I have tried capturing lostFocus and other events but nothing seems to work. Thanks for your help David -- View this message in context: http://www.nabble.com/Capture-Selection-of-a-AutoCompleteTextBox-tf3579156.html#a10001292 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket 1.2.5 and/or 1.3 on WOJ (World of Java) ?
On 4/14/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: i emailed them back in the day they started out and asked for a free oss license. they turned me down, and that led me to discover Yes, we (Jayasoft, editor of WOJ) were still searching a good compromise between cost and pricing. Now you can use it for free except for commercial use. It could be free even for commercial use in the future, but I can't say too much for the moment. The ongoing changes will certainly also help the service get more up to date versions. mvn eclipse:eclipse -DdownloadSources=true which downloads the dependencies and their sources (when available) and links them to my eclipse project. so i have the sources and thus the javadocs available. works pretty well for me so far, most projects now publish their sources into maven repo. Yes, using maven facility for this is really fine now that maven repo has more and more sources and modules. The main differences I see is that with maven you will actually download all sources, which takes time at first, but then you have your sources attached even when disconnected. OTOH WOJ gets sources and javadocs on demand, so it doesn't take any additional time. It's also *very* useful if you're not a maven user, because it doesn't need any meta data. The downside is that it won't work offline, and that you need a plugin in your IDE to get it work... My 2c. - Xavier -igor On 4/13/07, ZedroS Schwart < [EMAIL PROTECTED]> wrote: > > Hi all > > I've recently discovered World of Java > (http://www.worldofjava.org/language.do?locale=en) > > It's an engine allowing to view the javadoc and the source for many > open source projects. This engine is packaged in some plugins for > Eclipse, Netbeans and IntelliJ. > > It really rocks, since you're sure to get the javadoc/source for so > many projects, I find it really helpful. > > Do you know it ? BTW, the licence is free for OSS projects or personal > use. > > Currently, regarding Wicket, only some versions 1.2.3 (and under) are > available. I think 1.2.5 could be as well on it (I don't know why it > isn't), and I even dare to think at 1.3, but : > - I don't know if 1.3 is ready enough for it > - 1.3 has to be included under Apache and not wicket > > What do you say of it ? > > BR, > ZedroS > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-user > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Ivy at ApacheCon: http://www.eu.apachecon.com/ Manage your dependencies with Ivy! http://incubator.apache.org/ivy/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Capture Selection of a AutoCompleteTextBox
Answering my own question: use new AjaxFormComponentUpdatingBehavior("onchange") for example: suggestField.add(new AjaxFormComponentUpdatingBehavior("onchange") { protected void onUpdate(AjaxRequestTarget target) { target.addComponent(aContainer); return; } }); Regards David djsnowsill wrote: > > Hi All, > > I was wondering if it is possible to capture the user selection of a > AutoComplete Text Box? I have tried capturing lostFocus and other events > but nothing seems to work. > > Thanks for your help > > David > -- View this message in context: http://www.nabble.com/Capture-Selection-of-a-AutoCompleteTextBox-tf3579156.html#a10001397 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket-user Digest, Vol 11, Issue 98
actually, i don't know how to use jira .:P. could you send me a url for it? Need apply a account for it? > Message: 1 > Date: Sat, 14 Apr 2007 10:22:01 -0700 > From: "Eelco Hillenius" <[EMAIL PROTECTED]> > Subject: Re: [Wicket-user] crtypted url cannot work for current 2.0 > snap shot > To: [EMAIL PROTECTED] > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >> hi, >> i think it should work since I had patched it as the same way in >> yesterday. i also mentioned it in another email. > > Yep, I used that other email as input. Though I do a couple of extra checks. > >> ps, I checked the Page object , and find the NPE bug about version manager >> is still there. > > Did you open a JIRA issue for that? If yes, you can assign it to me. > If not, please open one, as it's nearly impossible for us to track the > work we need to do otherwise. > > Eelco > > > > -- - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket-user Digest, Vol 11, Issue 98
Wicket's JIRA installation can be found here https://issues.apache.org/jira/browse/WICKET You can create an account for free, which you can use for all Apache projects that use JIRA. When you're done registering and logging in, click 'create new issue' and go. Eelco On 4/15/07, tooy li(Gmail) <[EMAIL PROTECTED]> wrote: > actually, i don't know how to use jira .:P. could you send me a url for it? > Need apply a account for it? > > Message: 1 > > Date: Sat, 14 Apr 2007 10:22:01 -0700 > > From: "Eelco Hillenius" <[EMAIL PROTECTED]> > > Subject: Re: [Wicket-user] crtypted url cannot work for current 2.0 > > snap shot > > To: [EMAIL PROTECTED] > > Message-ID: > > <[EMAIL PROTECTED]> > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > >> hi, > >> i think it should work since I had patched it as the same way in > >> yesterday. i also mentioned it in another email. > > > > Yep, I used that other email as input. Though I do a couple of extra checks. > > > >> ps, I checked the Page object , and find the NPE bug about version > >> manager is still there. > > > > Did you open a JIRA issue for that? If yes, you can assign it to me. > > If not, please open one, as it's nearly impossible for us to track the > > work we need to do otherwise. > > > > Eelco > > > > > > > > -- > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Unable to add images to Wicket wiki
I see 3 screenshots now, so I guess you worked it out right? Thanks for the contribution btw. Eelco On 4/15/07, Peter Thomas <[EMAIL PROTECTED]> wrote: > Hi, > > I'm in the middle of adding a Wiki page on using JMeter and Wicket here: > > http://cwiki.apache.org/confluence/display/WICKET/Wicket+and+JMeter+with+Regular+Expressions > > I wanted to add a couple of screenshots but looks like this is restricted. > I can send across the 3 PNG files to someone if required and the page > already has the placeholders - so all that needs to be done is upload. > > Thanks, > > Peter. > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-user > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Testing an External SubmitLink
* Joe Brunner: > I'm attempting to test a panel that contains a SubmitLink. > However, the WicketTester.clickLink() method does not recognize > the SubmitLink. > > When I run the test, I get a stack trace stating: > > wicket.WicketRuntimeException: Link testpanel:graph is not a > Link, AjaxLink, AjaxFallbackLink or AjaxSubmitLink > > In case it matters, the SubmitLink is outside the form > heirarchy, taking the form as a constructor parameter. Is there > a method for testing a SubmitLink that I am unaware of? Hi Joe, Is it the current Wicket? If not, can you test with a recent 1.3 snapshot, otherwise can you file a JIRA issue? -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] set "dir" attribute of body tag of page
my page has transparent two border . how change direction of page based say locale of page (fa_IRan is dir="rlt") -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Integrating Guice into wicket-phonebook
I was able to get Guice's DI working and the wicket-phonebook app displays fine (btw, I am on 1.3.0-incubating-snapshot), but when I call a service from the HibernateContactDao class I get the following (i.e - I get this message after trying to edit a contact in the list displayed. When I click "save" on the EditContactPage I get...): - WicketMessage: Method onFormSubmitted of interface wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = contactForm, page = wicket.contrib.phonebook.web.page.EditContactPage, path = 1:contactForm.Form, isVisible = true, isVersioned = true]] threw an exception Root cause: java.lang.NullPointerException at wicket.contrib.phonebook.HibernateContactDao.getSession( HibernateContactDao.java:75) - Something is happening to the SessionFactory when Guice does its DI/bind???, it is null after clicking on the save button in the edit form. Any ideas from the pros? If it helps I am integrating Guice using the same methods as these links: http://www.jroller.com/page/cagataycivici?entry=integrating_guice_and_jsf and http://java-x.blogspot.com/2007/03/my-first-guice-web-application.html As a quick hack I used - SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); - when the sessionFactory became null, but that gives me 2 out-of-sync sessions and causes ehcache problems. Appreciate any feedback/things to check Wesley Hales http://www.jroller.com/page/wesleyhales - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Integrating Guice into wicket-phonebook
you get that error because a hibernatre session has not been created yet guice is just DI, wicket-phonebook uses spring for a lot more. it uses open-session-in-view filter, as well as spring's ability to create sessions for transactional contexts used by phonebook. so to the short of it is, you need to recreate all the services of spring's that phonebook uses. -igor On 4/15/07, Wesley Hales <[EMAIL PROTECTED]> wrote: I was able to get Guice's DI working and the wicket-phonebook app displays fine (btw, I am on 1.3.0-incubating-snapshot), but when I call a service from the HibernateContactDao class I get the following (i.e - I get this message after trying to edit a contact in the list displayed. When I click "save" on the EditContactPage I get...): - WicketMessage: Method onFormSubmitted of interface wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = contactForm, page = wicket.contrib.phonebook.web.page.EditContactPage, path = 1: contactForm.Form, isVisible = true, isVersioned = true]] threw an exception Root cause: java.lang.NullPointerException at wicket.contrib.phonebook.HibernateContactDao.getSession ( HibernateContactDao.java:75) - Something is happening to the SessionFactory when Guice does its DI/bind???, it is null after clicking on the save button in the edit form. Any ideas from the pros? If it helps I am integrating Guice using the same methods as these links: http://www.jroller.com/page/cagataycivici?entry=integrating_guice_and_jsf and http://java-x.blogspot.com/2007/03/my-first-guice-web-application.html As a quick hack I used - SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); - when the sessionFactory became null, but that gives me 2 out-of-sync sessions and causes ehcache problems. Appreciate any feedback/things to check Wesley Hales http://www.jroller.com/page/wesleyhales - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Property model with getter/setter parameters
Hi, I would like to know if there is a way in wicket to have a model use getter/setter with parameters. Have a look at my example below; I have a bean called Product with a "name" property, but it's stored in a map using a java.util.Locale as a key. I would like to bind this property to a textfield using a specific Locale (for example, instanciating 2 fields in my page, one for to affect the English Locale value and another one for French). To do this I have at instruct a model to call (get/set)name using a predefined Locale parameter. Is there anything like that built-in in Wicket ? public class Product implements Serializable { private Map names = new HashMap(); public String getName(Locale locale) { return names.get(locale); } public void setName(Locale locale, String name) { names.put(locale, name); } } -- View this message in context: http://www.nabble.com/Property-model-with-getter-setter-parameters-tf3582050.html#a10009353 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Property model with getter/setter parameters
class localemodel exnteds imodel { private Locale locale; private IModel productModel; public localemodel(Locale locale, IModel pm) { this.locale=locale; this.productModel=pm; } public Object getObject() { return ((Product)pm.getObject()).getName(locale); } public void setObject(Object o) { ((Product)productModel.getObject()).setName(locale, ((String)o); } public void detach() { productModel.detach(); } } IModel productModel=new Model(new Product()); add(new TextField("french", new localemodel(Local.FR, productModel)); add(new TextField("english", new localemodel(Local.EN, productModel)); lots of shortcuts are possible if you get comfy with stuff like this. -igor On 4/15/07, Dreamage <[EMAIL PROTECTED]> wrote: Hi, I would like to know if there is a way in wicket to have a model use getter/setter with parameters. Have a look at my example below; I have a bean called Product with a "name" property, but it's stored in a map using a java.util.Locale as a key. I would like to bind this property to a textfield using a specific Locale (for example, instanciating 2 fields in my page, one for to affect the English Locale value and another one for French). To do this I have at instruct a model to call (get/set)name using a predefined Locale parameter. Is there anything like that built-in in Wicket ? public class Product implements Serializable { private Map names = new HashMap(); public String getName(Locale locale) { return names.get(locale); } public void setName(Locale locale, String name) { names.put(locale, name); } } -- View this message in context: http://www.nabble.com/Property-model-with-getter-setter-parameters-tf3582050.html#a10009353 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Export to CSV encoding problem
Hi I'm try to export a table to CSV format; Following the example from "wicket.examples.displaytag.export", most things goes well, except the encoding. It seems that when I export it to the CSV or XLS format, the Excel don't know what encoding my file used. All the Chinese characters in CSV and XLS are crap, and when exports to XML it works well with the browser at UTF-8 encoding. Plus, when I use WORD to open my CSV files, it asked me to choose the encoding, and with "UTF-8", it just fine. So I think the Excel may not know the encoding by himself, I wondered if there is a way to let him know. I tried this response.setCharacterEncoding("UTF-8"); while reponse is WebResponse. But no luck. Any idea to fix that? Regards LongkerDandy - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Export to CSV encoding problem
Unlike XML, CSV files don't have a tag or any other option to tell which encoding the characters are. Hence Word, Excel etc are assuing the encoding is equal to you computers default encoding (CP1259 in Germany). Some programms are more intelligent than others and recognize if certain byte codes are not allowed within the assumed charset and than ask you (e.g. WORD). You need to output the CSV file with the encoding you are using on your computer. Juergen On 4/16/07, LongkerDandy <[EMAIL PROTECTED]> wrote: > Hi > > I'm try to export a table to CSV format; > Following the example from "wicket.examples.displaytag.export", most > things goes well, except the encooding. > It seems that when I export it to the CSV or XLS format, the Excel don't > know what encoding my file used. > All the Chinese characters in CSV and XLS are crap, and when exports to > XML it works well with the browser at UTF-8 encoding. > Plus, when I use WORD to open my CSV files, it asked me to choose the > encoding, and with "UTF-8", it just fine. > > So I think the Excel may not know the encoding by himself, > I wondered if there is a way to let him know. > > I tried this > > response.setCharacterEncoding("UTF-8"); > > while reponse is WebResponse. > But no luck. > > Any idea to fix that? > > Regards > LongkerDandy > > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user