Re: [Wicket-user] Problem loading dynamic image using ajax
Is that what causing the dynamic image to be expired? - Original Message From: Kent Tong <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Saturday, May 26, 2007 10:49:53 PM Subject: Re: [Wicket-user] Problem loading dynamic image using ajax Michael K yahoo.com> writes: > To obtain the requestcycle in the constructor, I do RequestCycle.get(); > in the WebPage constructor. You shouldn't do that. You have a request cycle only when there is a request from the browser, not when your page is constructed. - 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 Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. http://new.toolbar.yahoo.com/toolbar/features/norton/index.php- 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] Problem loading dynamic image using ajax
Thanks for spotting the error in my previous post. The code I posted wasn't copy-paste from the actual code since it works fine except the image issue, but rather a simplify version to explain my problem. Anyway I 've made correction to my sample code below: public class AjaxPage extends WebPage { public AjaxPage() { Panel panelA = new PanelA("panelA"); add(panelA); // Correction to my previous code Component comp = panelA; comp.setVisible(true); ComponentRequestTarget target = new ComponentRequestTarget(comp); RequestCycle cycle = RequestCycle.get(); cycle.setRequestTarget(target); } } public class PanelA extends Panel { public PanelA(String string) { super(string); add(new Label("title","Circle")); Image image1 = new Image("logo",new RenderedDynamicImageResource(100,100){ protected boolean render(Graphics2D graphics2D) { drawCircle(graphics2D); return true; } }); add(image1); // image1 will expired. } } To obtain the requestcycle in the constructor, I do RequestCycle.get(); in the WebPage constructor. Please help. Michael - Original Message From: Kent Tong <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Saturday, May 26, 2007 2:49:12 PM Subject: Re: [Wicket-user] Problem loading dynamic image using ajax Michael K yahoo.com> writes: > Hi,I have problem displaying dynamic image using ajax. The problem is > that the image url became expired after the page has rendered. The page > was loaded fine it didn't triggered page expired. I think there is something wrong with your code: How can you access the request cycle in the constructor? Besides, your panelA is not added to your page at all. - 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 Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.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
[Wicket-user] Problem loading dynamic image using ajax
Hi, I have problem displaying dynamic image using ajax. The problem is that the image url became expired after the page has rendered. The page was loaded fine it didn't triggered page expired. Please check out my sample code below: public class AjaxPage extends WebPage { public AjaxPage() { Component comp = new PanelA("panelA"); comp.setVisible(true); ComponentRequestTarget target = new ComponentRequestTarget(comp); RequestCycle cycle = RequestCycle.get(); cycle.setRequestTarget(target); } } public class PanelA extends Panel { public PanelA(String string) { super(string); add(new Label("title","Circle")); Image image1 = new Image("logo",new RenderedDynamicImageResource(100,100){ protected boolean render(Graphics2D graphics2D) { drawCircle(graphics2D); return true; } }); add(image1); // image1 will expired. } } I 'm currently using Wicket 1.2.6. Thanks and regards, Michael Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL- 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] Questions about non-wicket ajax call to wicket component
Thanks very much. It's working now. Cheers, Michael Igor Vaynberg <[EMAIL PROTECTED]> wrote: see ComponentRequestTarget which will render a markup of a certain component only and RequestCycle.urlFor(Component,RequestInterface) which will create a url to any callback method on any component -igor On 3/5/07, Michael K <[EMAIL PROTECTED]> wrote: Hi, I got a problem when i tried to use yui-ext updateManager script to load wicket component via XHR. Here is what I 've done so far: I created a js script that contain a Yui-ext's Dialog panel and embedded into the header page. Next, I override Wicket.link's getOnClickScript(url) so that the onclick script will callback the yui-ext.updateManager script with a given url. Now, that works fine but my next challenge is to generate a url that points to a panel so that when the script make a request, wicket will response to that particular panel. My other solution is to load an entire page into page, but I prefer using panel. Any suggestion? Thanks, Michael - 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. - 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Have a burning question? Go to Yahoo! Answers and get answers from real people who know.- 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Questions about non-wicket ajax call to wicket component
Hi, I got a problem when i tried to use yui-ext updateManager script to load wicket component via XHR. Here is what I 've done so far: I created a js script that contain a Yui-ext's Dialog panel and embedded into the header page. Next, I override Wicket.link's getOnClickScript(url) so that the onclick script will callback the yui-ext.updateManager script with a given url. Now, that works fine but my next challenge is to generate a url that points to a panel so that when the script make a request, wicket will response to that particular panel. My other solution is to load an entire page into page, but I prefer using panel. Any suggestion? Thanks, Michael - 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut.- 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom web form in Wicket
Hi Paolo, Thanks for your suggestion. I 'm about to download the package but I 'm not sure which package the beanpanel is belong to. Cause, I saw a list of categorized packages such as contrib-data, contrib-dojo etc in the download page. Thanks, Michael - Original Message From: Paolo Di Tommaso <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Wednesday, January 17, 2007 3:52:59 PM Subject: Re: [Wicket-user] Custom web form in Wicket We are just refactoing the package name to wicket.contrib.markup.html.beanpanel What do you think is? Is there a naming convention for Wicket-stuff contribs ? Thanks, Paolo On 1/16/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: Ah, ok. In that case, you should move the project from trunk to the 1.3 branch in the wicket-stuff project. Trunk is reserved for 2.0 projects. I regularly update those projects (like last weekend) when there are API breaks. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom web form in Wicket
Thanks very much Igor. I 'll give it a try. Michael - Original Message From: Igor Vaynberg <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Friday, January 12, 2007 12:51:14 AM Subject: Re: [Wicket-user] Custom web form in Wicket wrap each type (textfield, dropdown, etc) of component in a panel, then add them to repeatingview or another repeater to build the form -igor On 1/11/07, Michael K <[EMAIL PROTECTED]> wrote: hmm certainly my next question is: what are the tricks? :) AFAIK, Wicket demands the form component to be mapped out during development time. Michael - Original Message From: Igor Vaynberg <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Friday, January 12, 2007 12:38:30 AM Subject: Re: [Wicket-user] Custom web form in Wicket not only is it feasible, it is easy :) -igor On 1/11/07, Michael K <[EMAIL PROTECTED]> wrote: Hi, I 'm planning to include a feature in my web application that enables a customer to build a webform on the fly. The customer can determine which type of form component (i.e. textfield, list, options etc.) needs to be included. The web application displays the custom form and process the submitted information. Is it feasible to develop such feature in Wicket? TIA. Michael Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster. - 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Want to start your own business? Learn how on Yahoo! Small Business. - 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index- 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Custom web form in Wicket
hmm certainly my next question is: what are the tricks? :) AFAIK, Wicket demands the form component to be mapped out during development time. Michael - Original Message From: Igor Vaynberg <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Friday, January 12, 2007 12:38:30 AM Subject: Re: [Wicket-user] Custom web form in Wicket not only is it feasible, it is easy :) -igor On 1/11/07, Michael K <[EMAIL PROTECTED]> wrote: Hi, I 'm planning to include a feature in my web application that enables a customer to build a webform on the fly. The customer can determine which type of form component (i.e. textfield, list, options etc.) needs to be included. The web application displays the custom form and process the submitted information. Is it feasible to develop such feature in Wicket? TIA. Michael Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster. - 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 Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Custom web form in Wicket
Hi, I 'm planning to include a feature in my web application that enables a customer to build a webform on the fly. The customer can determine which type of form component (i.e. textfield, list, options etc.) needs to be included. The web application displays the custom form and process the submitted information. Is it feasible to develop such feature in Wicket? TIA. Michael Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Custom session expiry page
Hi,How do I embed a custom session expiry page into wicket application?Thanks,Michael- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Cached list object?
Bugger me, I 've came across with setReuseItem when I had a different issue with ListView but forgot all about it. Shouldn't spend too much on soccer channel :)Appreciate for your quick response, it works!Cheers,MichaelEelco Hillenius <[EMAIL PROTECTED]> wrote: If you did listView.setReuseItems(true), which is a good choice whenyou embed a ListView in a form, you should manually 'update' the listview by calling listView.removeAll, which will trigger the list viewto get all the fresh results again and build the list items fromscratch.If you use ListView with the default options, (orsetReuseItems(false)), you don't have to do that. However, if youpassed in an actual List, that list itself might be stale. A betterpattern typically is:IModel myListModel = new LoadableDetachableModel() { protected Object load() {return someServiceOrDao.findSomeListOfObjects(); }};so that the list is refreshed every request. Of course, this mightlead to issues if you have multiple clients working (adding/ removing)on the same data if reuseItems == true, but for the default cases,like displaying some records with delete button, this works excellent.EelcoOn 7/6/06, Michael K <[EMAIL PROTECTED]> wrote:> Hi,>> I'm not sure if this problem I'm dealing with have something to do with> Wicket or Cayenne.> A bit of a background, I'm using Wicket and Cayenne ORM to build a simple> CRUD application.> I want to be able to select and delete a record from the list (using> ListView component) and then redirect back to the list to display the> update.> The problem I had is whenever I delete a record, wicket re-render the> listview component. The list was taken from the original list including the> deleted object. Thus, a null pointer exception was thrown by Cayenne because> the deleted object was called.>> Does setResponsePage(...) trigger Wicket to re-render from cached or does it> re-initialise the entire page?> if option 1 is valid, is there any chance to tell wicket to drop the cache's> model and re-init instead?>> Thank you.>> Michael>>> > Want to be your own boss? Learn how on Yahoo! Small Business.>>> Using Tomcat but need to do more? Need to support web services, security?> Get stuff done quickly with pre-integrated technology to make your job> easier> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>> ___> Wicket-user mailing list> Wicket-user@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/wicket-user>>>Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Cached list object?
Hi,I'm not sure if this problem I'm dealing with have something to do with Wicket or Cayenne.A bit of a background, I'm using Wicket and Cayenne ORM to build a simple CRUD application.I want to be able to select and delete a record from the list (using ListView component) and then redirect back to the list to display the update. The problem I had is whenever I delete a record, wicket re-render the listview component. The list was taken from the original list including the deleted object. Thus, a null pointer exception was thrown by Cayenne because the deleted object was called.Does setResponsePage(...) trigger Wicket to re-render from cached or does it re-initialise the entire page?if option 1 is valid, is there any chance to tell wicket to drop the cache's model and re-init instead?Thank you.Michael Want to be your own boss? Learn how on Yahoo! Small Business. Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Wizard's Confirmation Page
Hi,I 've been playing with the latest Wizard example this morning as well as wicket-extensions-1.2-rc4, I come across couple of questions:1. How can I 'manipulate' model's value before being rendered within confirmation page? For example I want to set Firstname to 'Not available' whenever the model is null instead of default to 'blank'2. Still on the confirmation page, Can I render .html and populate those value into table cell instead of using StringResourceModel?Please advise.Michael How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.
Re: [Wicket-user] users: your opinions please! (was: feedback messages)
I m using 'error'.Ingram Chen <[EMAIL PROTECTED]> wrote: info & errorOn 3/26/06, lu dongping <[EMAIL PROTECTED]> wrote: info & errorOn 3/26/06, Nick Heudecker <[EMAIL PROTECTED]> wrote:> I'm only using info and error.>>> On 3/25/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:> > Hey Wicket users, please tell us whether or not you are using those> > different levels. We are about to remove them for a next version, so > > *if* you feel attached to them, you should shout out now before it is> > too late.>>-- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwan blog: http://www.javaworld.com.tw/roller/page/ingramchen Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
[Wicket-user] Resize static image
Hi,I am writing a code that enable resizing images on the fly. The images are located under /resources/images//.gif I try to use BufferedDynamicImageResource but I don't know how to bind image resource to the default resource location or perhaps I can directly read the image data from the filesystem and pass it to BufferedImage. Any suggestion? Thanks in advance.Michael Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Re: [Wicket-user] Newbie question: applying dynamic form component with ListView
mmhh It did struck me for a while to understand the underlying concept of Wicket's model and the relationship with various components. One thing I notice, It seems that Struts deal with form backing model more transparent than Wicket does in terms of accessing the model object (or may be I'm just being bias :). Or perhaps it just the way model 2 was implemented. However I agree in long run Wicket provides better reusability and scalability once I get used to with the concept. Thanks for your thorough explanation I really appreciate it.MichaelJonathan Cone <[EMAIL PROTECTED]> wrote:Hi Michael, One thing that I personally think is important to understanding ListView is knowing that each item in the ListView is one concrete model object instance. If you think about it, then you will see you shouldn't need many(if any) collections in your form backing model classes. So a ListView takes a 'list' of model objects and displays each one independent of the other. One of the cool things about wicket is that your model object instance fields can be strongly typed (more easily than Struts). As you'll see in the model object below. Take a look at the following code which is based on your example (I only used generics for type clarity): public class DetailForm extends Form { private final List ageList = Arrays.asList(new Integer[] { Integer.valueOf(10), Integer.valueOf(20), Integer.valueOf(30) }); // You'll probably want to pass your list in to your form constructor, as opposed to this. private final static List model = initModelList(); public DetailForm(final String id) { super(id); // This model is a list of DetailModels ListView listView = new ListView("detailList", model) { public void populateItem(final ListItem listItem) { listItem.setModel(new CompoundPropertyModel( (DetailModel) listItem.getModelObject())); // This is bound to model.getCode()/setCode()listItem.add(new TextField("code")); // Same for model.getAge()/setAge()listItem.add(new DropDownChoice("age", ageList)); // Same for model.getName()/setName()listItem.add(new TextField("name")); } }; add(listView); } // Just a test to see that your changes are taking effect. @Override protected void onSubmit() { System.out.println(model); } // Again, not ideal, but for the sake of this example. private static List initModelList() { List model = new ArrayList(); model.add(new DetailModel(Integer.valueOf(10), "Harry", "bigboy")); model.add(new DetailModel(Integer.valueOf(20), "Jan", "foo")); model.add(new DetailModel(Integer.valueOf(30), "Meg", "boss")); return model; } public static class DetailModel implements Serializable { private Integer age; private String name; private String code; public DetailModel() { } public DetailModel(Integer age, String name, String code) { super(); this.age = age; this.name = name; this.code = code; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return name + ", " + age + "(" + code + ")"; } } } Good luck, I hope this helps you understand. Just remember th at it really is as easy as it should be, which (sadly) takes some getting used to if you've used other frameworks.- Original Message -From:Michael K To: Wicket User ListSent: Wednesday, March 15, 2006 4:22AM Subject: [Wicket-user] Newbie question:applying dynamic form component with ListView Hi,Which type should I define in POJO Model to hold thevalue of the array of TextField/DropDownChoice when populated by ListView?Should I define it as String[] or ArrayList o r something else? I haveattached the following example to explain mysituation: public class DetailForm extends Form{ private java.util.List ageList= Arrays.asList(new String[]{ "10", "20", "30"}); public DetailForm(Stringstring){ super(string); DetailModel dm = newDetailModel(); setModel(newCompoundPropertyModel(dm)); ListView listView = new ListView("detailList", new PropertyModel(this,"detailData")){ public void populateItem(final ListItemlistItem){ final String detail = (String)listItem.getModelObject(); listItem.add(newLabel("code",detail));
[Wicket-user] Newbie question: applying dynamic form component with ListView
Hi,Which type should I define in POJO Model to hold the value of the array of TextField/DropDownChoice when populated by ListView? Should I define it as String[] or ArrayList or something else? I have attached the following example to explain my situation: public class DetailForm extends Form { private java.util.List ageList = Arrays.asList(new String[]{ "10", "20", "30" }); public DetailForm(String string){ super(string); DetailModel dm = new DetailModel(); setModel(new CompoundPropertyModel(dm)); ListView listView = new ListView("detailList", new PropertyModel(this, "detailData")){ public void populateItem(final ListItem listItem){ final String detail = (String) listItem.getModelObject(); listItem.add(new Label("code",detail)); listItem.add(new DropDownChoice("age",ageList)); listItem.add(new TextField("name")); } }; add(listView); } public List getDetailData(){ java.util.List hm = new ArrayList(); // Should get the data from DB, for simplicity I use hardcode value hm.add(""); hm.add(""); hm.add(""); return hm; } } & nbsp; // Model class public class DetailModel implements Serializable { private String[] age = new ArrayList(); // Not sure about the type private String[] name; public String[] getAge(){ return age; } public void setAge(String[] age){ this.age = age; } public String[] getName(){ return name; } public void setName(String[] name){ this.name = name; } }The idea behind String[] was my 'past time' with Struts :) Any suggestion?Cheers,Michael Yahoo! Travel Find great deals to the top 10 hottest destinations!
[Wicket-user] Re: ListMultipleChoice unable to reference all selected items
Referring to my earlier post, I just realise that the problem occurs when I have form.setMultiPart set to true. Also, I tested ListMultipleChoicePage (taken from Wicket-example), same thing happened. Is there any workaround?Cheers,Michael Michael K <[EMAIL PROTECTED]> wrote: Hi,I 'm wondering if the problem posted by Jonathan Cone (below) had been solved. I also come across with similar problem where ListMultipleChoice is unable to reference to all selected item, instead it is only refering to the last selected item.I 'm currently using wicket 1.1.1.Thanks very much.MichaelOn 2/10/06, Jonathan Cone <[EMAIL PROTECTED]> wrote: > > Description: > I'm using a ListMultipleChoice component to populate a List model object. > When the user selects multiple items in the list, I want the list model > object to be populated with those items. > > Problem: > The ListMultipleChoice renders correctly with all the proper 'choices' and > corresponding 'id's from the choice List I provide it. The problem occurs > when I try to submit the form with multiple items selected. After each > submit, the model is only updated with one of the selected items - the > last > item in the selection chain. For example, if I submit a form with "A" "B" > and "C" selected (top to bottom). The model List only contains "C". > > Desired Result: > I would like the model List to contain references to ALL of the selected > objects in the ListMultipleChoice. Any suggestions on what I'm doing > wrong? > > Here is the code (1.2-20060122): > > ChoiceRenderer renderer = new ChoiceRenderer("name","id"); > > // ListMultipleChoice(id, model, choice list) > > unitAmenities = new ListMultipleChoice("unitAmenities", > new PropertyModel(unit, "unitAmenities"), Arrays > .asList(AmenityType.values())); > unitAmenities.setChoiceRenderer(renderer); > > > Now 'unitAmenities' is a List and AmenityType is a 5.0 > enumeration containing a 'name' and 'id' String fields. I have, however, > tried replacing the enumeration with a concrete class and a static method > to > supply list values to no avail. 'unit' is a model object containing the > 'unitAmenities' list. > > Here is the simple HTML I'm using to bind this component to > 'unitAmenities': > > > id="unitAmenities"> > > Thanks in advance. > > > --- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > ___ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-userYahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. Yahoo! Mail Use Photomail to share photos without annoying attachments.
[Wicket-user] Re: ListMultipleChoice unable to reference all selected items
Hi,I 'm wondering if the problem posted by Jonathan Cone (below) had been solved. I also come across with similar problem where ListMultipleChoice is unable to reference to all selected item, instead it is only refering to the last selected item.I 'm currently using wicket 1.1.1.Thanks very much.MichaelOn 2/10/06, Jonathan Cone <[EMAIL PROTECTED]> wrote: > > Description: > I'm using a ListMultipleChoice component to populate a List model object. > When the user selects multiple items in the list, I want the list model > object to be populated with those items. > > Problem: > The ListMultipleChoice renders correctly with all the proper 'choices' and > corresponding 'id's from the choice List I provide it. The problem occurs > when I try to submit the form with multiple items selected. After each > submit, the model is only updated with one of the selected items - the > last > item in the selection chain. For example, if I submit a form with "A" "B" > and "C" selected (top to bottom). The model List only contains "C". > > Desired Result: > I would like the model List to contain references to ALL of the selected > objects in the ListMultipleChoice. Any suggestions on what I'm doing > wrong? > > Here is the code (1.2-20060122): > > ChoiceRenderer renderer = new ChoiceRenderer("name","id"); > > // ListMultipleChoice(id, model, choice list) > > unitAmenities = new ListMultipleChoice("unitAmenities", > new PropertyModel(unit, "unitAmenities"), Arrays > .asList(AmenityType.values())); > unitAmenities.setChoiceRenderer(renderer); > > > Now 'unitAmenities' is a List and AmenityType is a 5.0 > enumeration containing a 'name' and 'id' String fields. I have, however, > tried replacing the enumeration with a concrete class and a static method > to > supply list values to no avail. 'unit' is a model object containing the > 'unitAmenities' list. > > Here is the simple HTML I'm using to bind this component to > 'unitAmenities': > > > id="unitAmenities"> > > Thanks in advance. > > > --- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > ___ > Wicket-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/wicket-user Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.
Re: [Wicket-user] ListView: Rendering table row id attribute
Title: Re: [Wicket-user] ListView: Rendering table row id attribute Hi Karl,I thought it will be much easier if I use row (or may be I 'm wrong) instead of retrieving 'tr' element. In real situation I 'm going to use it against a nested table and use _javascript_ to toggle (hide/visible) for each row within the nested table and the table below it. Having said that I use row to 'handle' the messy table layout. Thanks guys, its been very helpful now I got it running.Cheers,MichaelKarl-Erik R�nsen <[EMAIL PROTECTED]> wrote: Why do you need to set an id for each row? Instead you can set an id for the table element and call: var myRow = document.getElementById( âtabl eIdâ ).getElementsByTagName( âtrâ )[indexOfRowYouWant]; Karl-Erik On 13-03-06 12:24, "Dirk Markert" <[EMAIL PROTECTED]> wrote: Hi Michael, you need an AttributeModifier. Something like protected void populateItem(final ListItem listItem) { add(new Label("name","Scooby").new AttributeModifier("id", .., new Model("row" + listItem.getIndex())); } Dirk 2006/3/13, Michael K <[EMAIL PROTECTED]>: Hi, I want to be able to render id="row" attribute when using ListView. I need it to code _javascript_ using getElementById(). Please find the examples below: Html code: --- namenamename Java code: --- add(new ListView("rowToRender",someArrayList){ protected void populateItem(final ListItem listItem) { add(new Label("name","Scooby"); } }); Has anyone done this? Any help wo uld be greatly appreciated. BTW, I 'm using Wicket 1.1.1. Thanks in Advance. --Michael Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
[Wicket-user] ListView: Rendering table row id attribute
Hi,I want to be able to render id="row" attribute when using ListView. I need it to code _javascript_ using getElementById(). Please find the examples below:Html code:--- name name nameJava code:---add(new ListView("rowToRender",someArrayList){ protected void populateItem(final ListItem listItem) { add(new Label("name","Scooby");}});Has anyone done this? Any help wo uld be greatly appreciated.BTW, I 'm using Wicket 1.1.1.Thanks in Advance.--Michael Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.