Re: AutoCompleteTextField type mismatch in line 227
On Fri, May 9, 2008 at 2:04 AM, Hoover, William [EMAIL PROTECTED] wrote: i'm assuming the same issue also causes the selection to be lost on occasion never heard of this one... -Original Message- From: Gerolf Seitz [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 7:57 PM To: users@wicket.apache.org Subject: Re: AutoCompleteTextField type mismatch in line 227 in case you mean [0], that's going to be dealt with probably tomorrow ;) [0] https://issues.apache.org/jira/browse/WICKET-1595 On Fri, May 9, 2008 at 1:52 AM, Hoover, William [EMAIL PROTECTED] wrote: Although, it still has some issues when dealing with mouseover and keyboard events combo ;o) -Original Message- From: Gerolf Seitz [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 4:23 PM To: users@wicket.apache.org Subject: Re: AutoCompleteTextField type mismatch in line 227 it's fixed in the upcoming 1.3.4 and the already release 1.4-M1 Gerolf On Thu, May 8, 2008 at 10:20 PM, taygolf [EMAIL PROTECTED] wrote: Yes I am just starting to try and get the autocompletetextfield working on my app and I am using wicket 1.3. as well and it is doing the same thing. It is throwing a js type mismatch error. Works fine in firefox but not in IE. Did you figure out the problem? T Niels Bo wrote: Hi I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript error type mismatch in line 227, wich is this line in wicket-autocomplete.js: menu.style.zIndex=index==auto?index:Number(index)+1; Only in IE (6.0) - firefox works fine. Does anyone else see this problem? Niels -- View this message in context: http://www.nabble.com/AutoCompleteTextField-%22type-mismatch%22-in-l in e-227-tp16560166p17135623.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to close modalwindow
Yes Mr Mean I tried as , you suggested. When I created a single ModalWindow outside of dataview it showed the error Unable to find component with id 'modalS'So i didn't do it. I deleted the modalS.close(target); from the windowClosedCallBack. Other things are unchanged . This code does the tasks of editing but could not close the modalwindow in firefox. But in IE 6.0 it even does not do the task of editing. I need your help. And please tell me the information you need. I am using wicket 1.3.0 thanks suresh Mr Mean wrote: Did you try my suggestions? What does the code look like now? Can you reproduce this in a quickstart? If you want our help you need to give us some more info. Maurice On Fri, May 2, 2008 at 7:50 AM, tsuresh [EMAIL PROTECTED] wrote: Hello All, I am still unable to close this modal window. Could someone please help me to close it or show my mistakes in the code in the first post. thanks tsuresh -- View this message in context: http://www.nabble.com/Unable-to-close-modalwindow-tp16981993p16996698.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Unable-to-close-modalwindow-tp16981993p17142038.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: n-Level Page Navigation. How to implement?
Nobody has a hint? -- View this message in context: http://www.nabble.com/n-Level-Page-Navigation.-How-to-implement--tp17083157p17142043.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MarkupNotFoundException
Hi. I have a class IpLookupPage that uses markupinheritence and inherits a class called BasePage. I is working fine when i test it manually but when i am using testng to do unit testing on the page i get an exception. The code looks like: ApplicationContext context = getStubApplicationContextForPage(); BossoWicketTester app = createWicketTester(context); app.openPage(IpLookupPage.class); And i get this error message: org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for component 'com.ongame.bo.bofraud.markup.pages.IpLookupPage' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried: [Page class = com.ongame.bo.bofraud.markup.pages.IpLookupPage, id = 0, version = 0] at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:354) at org.apache.wicket.Page.onRender(Page.java:1435) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.Page.renderPage(Page.java:891) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1100) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1169) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:382) at com.ongame.bo.bofraud.WicketApplicationTest$BossoWicketTester.openPage(WicketApplicationTest.java:101) at com.ongame.bo.bofraud.markup.pages.IpLookupPageTest.testInvalidIpAddress(IpLookupPageTest.java:68) Caused by: org.apache.wicket.markup.MarkupNotFoundException: Markup not found. Component class: com.ongame.bo.bofraud.markup.pages.IpLookupPage Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried at org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:215) at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:342) ... 33 more ... Removed 21 stack frames Anyone that knows what the problem is? Regards Alex -- View this message in context: http://www.nabble.com/MarkupNotFoundException-tp17142219p17142219.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: n-Level Page Navigation. How to implement?
you will have to fill in some blanks public class MenuItem { private MenuItem parent; private ListMenuItem children; private IModel label; private Class? extends Page } public class Menu extends Panel { private boolean refresh = true; public MenuItem getPageItem() { return ((entrypage)getPage()).getMenuItem(); } @Override protected void onBeforeRender() { if (refresh) { if (get(menu) != null) { remove(menu); } MenuItem item = getPageItem(); ArrayListMenuItem stack = new ArrayListMenuItem(); if (!item.getChildren().isEmpty()) { stack.add(0, item); } item = item.getParent(); while (item != null) { stack.add(0, item); item = item.getParent(); } add(new MenuItemFragment(menu, stack, 0)); refresh = false; } super.onBeforeRender(); } private static class ItemLink extends BookmarkablePageLink { private final boolean selected; public ItemLink(String id, Class? pageClass, boolean selected) { super(id, pageClass); this.selected = selected; } @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); if (selected) { tag.put(class, on); } } } private class MenuItemFragment extends Fragment { public MenuItemFragment(String id, ListMenuItem stack, int index) { super(id, menu-panel, Menu.this); MenuItem current = stack.get(index); StringBuilder stackPrefix = new StringBuilder(); for (int i = 0; i = index; i++) { stackPrefix.append(stack.get(i).getMarkupId()); stackPrefix.append(__); } final String stackPrefixId = stackPrefix.toString(); RepeatingView items = new RepeatingView(items); add(items); for (MenuItem child : current.getChildren()) { if (!child.isVisible(security)) { continue; } final boolean selected = stack.contains(child) || child == getPageItem(); WebMarkupContainer item = new WebMarkupContainer(items.newChildId()); item.setMarkupId(stackPrefixId + child.getMarkupId()); item.setOutputMarkupId(true); items.add(item); Link link = new ItemLink(link, child.getPageClass(), selected); item.add(link); link.add(new Label(label, child.getLabel())); WebMarkupContainer submenu = new WebMarkupContainer(submenu); item.add(submenu); if (selected !child.getChildren().isEmpty()) { submenu.add(new MenuItemFragment(items, stack, index + 1)); } else { submenu.setVisible(false); } } } } } wicket:panel ul id=nav wicket:container wicket:id=menu/wicket:container /ul wicket:fragment wicket:id=menu-panel li wicket:id=items a wicket:id=linkspan wicket:id=label[[ menu item label ]]/span/a ul wicket:id=submenu wicket:container wicket:id=items/wicket:container /ul /li /wicket:fragment /wicket:panel public abstract class entrypage extends webpage { entrypage() { add(new menu(menu)); } public abstract MenuItem getMenuItem(); } -igor On Thu, May 8, 2008 at 11:25 PM, ArthIT [EMAIL PROTECTED] wrote: Nobody has a hint? -- View this message in context: http://www.nabble.com/n-Level-Page-Navigation.-How-to-implement--tp17083157p17142043.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Default choice
Using nullvalid you can change the text that will be displayed by adding nullValid=some text here To your application properties file to set a global text if your component requires a custom text you can use the properties file for that page or panel to override like so componentid.nullValid=some other text if required you can specify as much of the componentpath as you need to starting from the component you want to customize: form.textfield1.nullValid=my text here Maurice On Thu, May 8, 2008 at 10:25 PM, Mathias P.W Nilsson [EMAIL PROTECTED] wrote: Hi! I'm using the getDefaultChoice to have --- choose brand in my drop box. @Override protected java.lang.CharSequence getDefaultChoice(final Object selected){ return option value=\\+ getLocalizer().getString(category.select.edit, CategoryPage.this ) +/option; } This is rather teedious to have this in every drop list. I it possible to have a default choice without using this? I know I can set setNullValid( true ) but I can't handle the localization default choice. -- View this message in context: http://www.nabble.com/Default-choice-tp17135706p17135706.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why Localizer Retained so many heapsize?
Hello everyone. I recently develop my App use Wicket1.3.3. It's my first time to use this framework and I feel it's really really a perfect framework for me. My app support both Simplified Chinese , Traditional Chinese, I implement this with Wicket i18n feature. With the load increasing these days, I found my app would become very lag abount every 24 hours ,so that i would only restart it without any choice. when I found the lag, My log records many Exceptions like : after 1 minute the Pagemap null is still locked by: Thread[http-8080-321,5,main], giving up trying to get the page for path xxx I check the JVM status with jstat -gc , It tells that the Heapsize is full even after full GC. My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m -XX:MaxPermSize=250m My deploy server has 2*CPU and 4G memory, Redhat AS4 OS + tomcat 6.0. There're 2000 sessions on the day while the timeout threshold is 15 minutes. So i dump the whole heapsize with the command jmap -dump:live,format=b,file=3.dump.hprof processid and i truely get a 2G size dump files. I use SAP Memory Analyer to see what're stored in HeapMemory. and I found a strange number of Retained Heap usage: Classname ShallowHeap RetainHeap RetainedHeap% [EMAIL PROTECTED] 16 1,755,070,35287.64% [EMAIL PROTECTED] 48 1,755,070,33687.69% [EMAIL PROTECTED] 33,554,448 1,755,069,632 87.69% - [EMAIL PROTECTED] 24 3928 0.00% - [EMAIL PROTECTED] 24 3928 0.00% - [EMAIL PROTECTED] 24 3928 0.00% - [EMAIL PROTECTED] 24 3928 0.00% - [EMAIL PROTECTED] 24 3928 0.00% - [EMAIL PROTECTED] 24 3928 0.00% + 2,863,659 more... Is that means that the Localizer Object used most of the heap size? or Is this number normal for Wicket App? I wonder whether I forget to release the memory by my mis-using of i18n feature? Is there any attentions I must pay to when dealing with Localizer? This problem annoys me more the 2 weeks. I really need some help. Thanks .
Re: n-Level Page Navigation. How to implement?
Thank you very much igor! I'll try this today. igor.vaynberg wrote: you will have to fill in some blanks ... -- View this message in context: http://www.nabble.com/n-Level-Page-Navigation.-How-to-implement--tp17083157p17142586.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript adding input
Why would you want to do that? If it happens at form load you must know about this inputfield when you create the page so why not add a wicket component for it too? Maurice On Fri, May 9, 2008 at 1:02 AM, Dan Kaplan [EMAIL PROTECTED] wrote: Let's say that hypothetically I used javascript to add an input to a form in its onload method. How can I get wicket to become aware of that input so I can do things like validate it, etc.? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does SqlTimestampConverter only use the time portion of the timestamp?
This seems to have appeared in 1.3 - when I upgraded from 1.2.6 to 1.3 is when two separate customers reported it. The DateTextField below doesn't actually fix it, because it appears when you supply a Timestamp to a Label, which happens commonly with any Date pulled from the database (depending on ORM etc). Can one of the devs explain why this change was made? It probably should be filed as a bug, but I'd like to make sure before I file it. For anyone who hasn't figured out a workaround yet, here is one: Add this to your web app init method: ((ConverterLocator) getConverterLocator()).set(Timestamp.class, new IConverterTimestamp() { private static final long serialVersionUID = 1L; public Timestamp convertToObject(String value, Locale locale) { if (value == null) { return null; } if (locale == null) { locale = Locale.getDefault(); } DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); try { Date date = format.parse(value); return new Timestamp(date.getTime()); } catch (ParseException e) { throw new ConversionException(Cannot parse ' + value + ' using format + format) .setSourceValue(value).setTargetType( Timestamp.class).setConverter(this) .setLocale(locale); } } public String convertToString(final Timestamp value, Locale locale) { if (value == null) { return null; } if (locale == null) { locale = Locale.getDefault(); } DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); return format.format(value); } }); Hope this helps. Jeremy Thomerson http://www.wickettraining.com On Fri, Mar 14, 2008 at 11:33 AM, Alex Jacoby [EMAIL PROTECTED] wrote: I can't answer your question about why, but I can suggest using a DateTextField from wicket-datetime for more control over the formatting. Unfortunately, it requires adding two jars (wicket-datetime and jodatime). Alex On Mar 13, 2008, at 2:08 PM, Markus Strickler wrote: Hi- is there any reason why SqlTimestampConverter.convertToString() only returns a time? Or is this a bug? Thanks, -kusako - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Good wicket patterns
You could have a look at the broadcaster that is discussed in https://issues.apache.org/jira/browse/WICKET-1312 The solution that is proposed there uses a visitor instead of registration. That has the advantage that you don't have to _unregister_ at the appropriate time. Because Wicket does not have lifecycle management of components you would have to do this by hand. Of course, if your components are never replaced, this is not an issue. cheers, Frank On Thu, 2008-05-08 at 18:15 -0700, Scott Swank wrote: e.g. public class AjaxEvent { private SetComponent listeners = new HashSetComponent(); public void register(Component listener) { listeners.add(listener); } public void fire(AjaxRequestTarget request) { for (Component listener : listeners) request.addComponent(listener); } } On Thu, May 8, 2008 at 6:07 PM, Scott Swank [EMAIL PROTECTED] wrote: Ajax 3. Now im working with more Ajax. What is a good inter component communication scheme? Swing has its listeners, but in wicket i tend to call methods on dependent components from ajax event handlers. Is this a good approach - (it atleast dont feel so good)? I try to have my components just be a view of their model. Then it's just a matter of setting the model(s) appropriately and refreshing the components. Alternately, create a AjaxEvent class that you subclass to represent each of the actions in which you're interested. Put a collection of those on your Page. Then have allow each component to register itself as a listener of an event. Then an ajax call would result in SomeAjaxEvent.fire(AjaxTargetRequest) and that would in turn call addComponent() for each registered listener component. - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-3329 +1 (707) 773-4646 - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to close modalwindow
On Fri, May 9, 2008 at 8:24 AM, tsuresh [EMAIL PROTECTED] wrote: Yes Mr Mean I tried as , you suggested. When I created a single ModalWindow outside of dataview it showed the error Unable to find component with id 'modalS'So i didn't do it. Please show me the code and html when you tried this, it should work and would make the closing problem a lot simpler if not disappear. I deleted the modalS.close(target); from the windowClosedCallBack. Other things are unchanged . This code does the tasks of editing but could not close the modalwindow in firefox. But in IE 6.0 it even does not do the task of editing. I need your help. And please tell me the information you need. I am using wicket 1.3.0 You could try wicket 1.3.3, there have been a few fixes to the modal window although not directly related to your closing problem. Also if Martijn was reading this he would probably suggest to use a Page instead of a Panel as they generally give less problems with forms and ajax and stuff. But for simple cases a Panel should also work (i am currently working on a modalwindow with a Panel too, yeah Martijn go sue me :P). So if you cannot get a singlemodalwindow to work please provide a quickstart and i'll have a look. Maurice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unmount sub url
I made a JIRA for this (with patch). https://issues.apache.org/jira/browse/WICKET-1603 Regards, Sebastiaan Sebastiaan van Erk wrote: Eelco Hillenius wrote: On Thu, May 8, 2008 at 3:15 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote: 2) using a special RequestCodingStrategy, i.e. UnmountedRequestCodingStrategy and tweaking isWicketRequest to return false if it detects this request coding strategy... What do you guys think? Well, my first impulse is to say that mounting was never meant to serve complex cases, and that instead of mounting you'd do best with a custom request coding strategy instead. That said though, I'm not against something like 2 if we have a nice construct for it. Eelco I made a proof of concept which works, though I have some questions about it (I'm not really into the whole request coding strategy API). Basically what I did was: 1) Add PassThroughUrlCodingStrategy: public class PassThroughUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { public PassThroughUrlCodingStrategy(final String mountPath) { super(mountPath); } public IRequestTarget decode(RequestParameters requestParameters) { return null; } public CharSequence encode(IRequestTarget requestTarget) { return null; } public boolean matches(IRequestTarget requestTarget) { return false; } } That's the one I have questions about: I'm not quite sure how to implement these methods properly. 2) Modify wicket filter isWicketRequest // Mounted page IRequestTargetUrlCodingStrategy urlCodingStrategy = webApplication.getRequestCycleProcessor() .getRequestCodingStrategy() .urlCodingStrategyForPath(relativePath); // Mounted and not pass through? return urlCodingStrategy != null !(urlCodingStrategy instanceof PassThroughUrlCodingStrategy); 3) Mount my PassThroughUrlCodingStrategy in my Application.init() method: mount(new QueryStringUrlCodingStrategy(/path1, MyPage.class)); mount(new PassThroughUrlCodingStrategy(/path1/dir)); 4) Fired up tomcat and tested it. :-) It works... That leaves me with the questions about the decode, encode and matches... How should I implement them properly? :-) Regards, Sebastiaan smime.p7s Description: S/MIME Cryptographic Signature
Re: Why does SqlTimestampConverter only use the time portion of the timestamp?
this seem to me like a bug can you add a jira issue? i guess this: DateFormat format = DateFormat.getTimeInstance(DateFormat.SHORT, locale); return format.format(timestamp); needs to change. On Thu, Mar 13, 2008 at 8:08 PM, Markus Strickler [EMAIL PROTECTED] wrote: Hi- is there any reason why SqlTimestampConverter.convertToString() only returns a time? Or is this a bug? Thanks, -kusako This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A question about partial form updates with AJAX
but that wont work ofcourse you are replacing components.. wicket generates then the html on the server with the data it then haves. johan On Thu, May 8, 2008 at 8:04 PM, nate roe [EMAIL PROTECTED] wrote: Hrm. I've only added the AjaxFormComponentUpdatingBehavior to the components that cause the visibility of other components to change. The idea -- and I'm new to Wicket so it may not have been a very good one -- was to limit server round-trips until a rendering change is required. I'll add the behavior to all of the elements and see how that goes. On Thu, May 8, 2008 at 1:09 AM, Johan Compagner [EMAIL PROTECTED] wrote: are you sure that all the form elements that are in that div that you replace have the AjaxFormComponentUpdatingBehavior attached? On Thu, May 8, 2008 at 1:22 AM, nate roe [EMAIL PROTECTED] wrote: I have a form with several items. About half of the form is wrapped in a named div attached to a WebMarkupContainer. When a drop-down value changes, the div is updated via AJAX, re-rendering that part of the form. However, the components in that part of the form are not updated and so this re-rendering causes their values to revert to the initial value. I've used an AjaxFormComponentUpdatingBehavior to accomplish the AJAX update. Is there a more appropriate behavior that I should use? When I use no AJAX, then the form maintains its values rather than resetting (but the whole page is refreshed.) How can I prevent a form reset? Thanks, Nate Roe
Re: wicket-extensions javadoc
I understand that the 1.2 docs must be on sf.net hardware, and that they are still available there. I just want the most recent version of the wicket-extensions javadoc to be available too, somewhere, anywhere. Doug did just that, so a big thanks there! Matthijs Martijn Dashorst wrote: wicketframework.org is not the main site. http://wicket.apache.org is As you can see, http://wicketframework.org redirects to http://wicket.apache.org The 1.2 docs are still available for reference, and *must* be hosted on the sf.net hardware (they are not released under supervision of Apache). Martijn On 5/7/08, Doug Donohoe [EMAIL PROTECTED] wrote: Matthijs, I had to host javadoc for my own wicketstuff-annotations project, so I decided to put the Wicket docs there (since the main site isn't up-to-date). I added wicket-extensions to the site: http://www.ddpoker.com/javadoc/ -Doug Matthijs Wensveen-2 wrote: Hi, I'm not sure this is the right place, but anyway. The online javadoc of wicket-extensions at http://wicketframework.org/wicket-extensions/apidocs/index.html is of version 1.2-SNAPSHOT, but the latest release is 1.3.3. The javadoc that maven pulls in is more current. Could the online javadocs be updated please? Thanks, Matthijs -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/wicket-extensions-javadoc-tp17099232p17108936.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-extensions javadoc
http://wicket.apache.org/docs/wicket-1.3.2/wicket-extensions/apidocs/index.html On 5/9/08, Matthijs Wensveen [EMAIL PROTECTED] wrote: I understand that the 1.2 docs must be on sf.net hardware, and that they are still available there. I just want the most recent version of the wicket-extensions javadoc to be available too, somewhere, anywhere. Doug did just that, so a big thanks there! Matthijs Martijn Dashorst wrote: wicketframework.org is not the main site. http://wicket.apache.org is As you can see, http://wicketframework.org redirects to http://wicket.apache.org The 1.2 docs are still available for reference, and *must* be hosted on the sf.net hardware (they are not released under supervision of Apache). Martijn On 5/7/08, Doug Donohoe [EMAIL PROTECTED] wrote: Matthijs, I had to host javadoc for my own wicketstuff-annotations project, so I decided to put the Wicket docs there (since the main site isn't up-to-date). I added wicket-extensions to the site: http://www.ddpoker.com/javadoc/ -Doug Matthijs Wensveen-2 wrote: Hi, I'm not sure this is the right place, but anyway. The online javadoc of wicket-extensions at http://wicketframework.org/wicket-extensions/apidocs/index.html is of version 1.2-SNAPSHOT, but the latest release is 1.3.3. The javadoc that maven pulls in is more current. Could the online javadocs be updated please? Thanks, Matthijs -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/wicket-extensions-javadoc-tp17099232p17108936.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-extensions javadoc
Yes, but that URL isn't obvious. Is there a link on the main site anywhere to that Javadoc? I couldn't find it. I always have to hand-type it (or bookmark it of course :) On Fri, May 9, 2008 at 7:03 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: http://wicket.apache.org/docs/wicket-1.3.2/wicket-extensions/apidocs/index.html On 5/9/08, Matthijs Wensveen [EMAIL PROTECTED] wrote: I understand that the 1.2 docs must be on sf.net hardware, and that they are still available there. I just want the most recent version of the wicket-extensions javadoc to be available too, somewhere, anywhere. Doug did just that, so a big thanks there! Matthijs Martijn Dashorst wrote: wicketframework.org is not the main site. http://wicket.apache.org is As you can see, http://wicketframework.org redirects to http://wicket.apache.org The 1.2 docs are still available for reference, and *must* be hosted on the sf.net hardware (they are not released under supervision of Apache). Martijn On 5/7/08, Doug Donohoe [EMAIL PROTECTED] wrote: Matthijs, I had to host javadoc for my own wicketstuff-annotations project, so I decided to put the Wicket docs there (since the main site isn't up-to-date). I added wicket-extensions to the site: http://www.ddpoker.com/javadoc/ -Doug Matthijs Wensveen-2 wrote: Hi, I'm not sure this is the right place, but anyway. The online javadoc of wicket-extensions at http://wicketframework.org/wicket-extensions/apidocs/index.html is of version 1.2-SNAPSHOT, but the latest release is 1.3.3. The javadoc that maven pulls in is more current. Could the online javadocs be updated please? Thanks, Matthijs -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/wicket-extensions-javadoc-tp17099232p17108936.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form onSubmit called after Page components created
Hi Igor, Yes I take your point about being able to replace components within the onSubmit, that's certainly a good option in some cases. However - in the scenario that I'm looking there are components in the page that initialise themselves dynamically from a database model. What's happening now is that they initialise themselves once when the page and components are first created (some default arrangement say) and then during the onSubmit they need to be set up again, based on the values submitted in the form. This then means that the database is accessed twice, and not once, and I'm trying to avoid multiple database access. (actually to get around this for the time being I'm not using the forms onSubmit() to access the form values, instead I'm reading directly off the PageParameters object when the page is first created, which avoids the dual load issue described above, but it seems like a bit of a hack as I don't feel I'm leveraging the framework correctly) Cheers, Joel -- From: Igor Vaynberg [EMAIL PROTECTED] Sent: Friday, May 09, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Form onSubmit called after Page components created the stateless stuff has to recreate the component hierarchy first - eg the form instance has to exist before you can call onsubmit on it :) however, inside onsubmit you can do any component replacement you want, just like in a non-stateless page. -igor On Thu, May 8, 2008 at 4:36 PM, Joel Halbert [EMAIL PROTECTED] wrote: Hi, I've noticed that when submitting a (stateless) Form page the onSubmit() method of the form is only called once all the Page components have all been created, and likewise any model objects relating to the form are only populated once the page components have been rendered. This means that it is hard to create dynamic content in the page that is dependent on the contents of the submitted form without reloading the page using setResponsePage(MyPage.class, pageParams) at the end of the onSubmit() call of the form. Has anyone else noticed this and is there a way around it? i.e. can the models be populated before the page components are created? Rgs Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get select objects from ListView
What do you need them for? Why not pick them up when they are created? 2008/5/9 Mathias P.W Nilsson [EMAIL PROTECTED]: Hi! I have this list view ListView view = new ListView( translatorView , cultureModel ){ private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem item) { Culture culture = (Culture) item.getModelObject(); item.add( new Label( culture , culture.getName() )); DropDownChoice translatorChoice = new DropDownChoice( translatorChoice, new LoadableDetachableTranslatorModel( culture) , new FtcUserChoiceRenderer() ){ private static final long serialVersionUID = 1L; @Override protected java.lang.CharSequence getDefaultChoice(final Object selected){ return option value=\\+ getLocalizer().getString( culture.select.empty, TranslatorInvitationPage.this ) + /option; } }; item.add( translatorChoice ); } }; The model is a detached model for users. How can I get the list of drop down choice model objects? -- View this message in context: http://www.nabble.com/How-to-get-select-objects-from-ListView-tp17146212p17146212.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get select objects from ListView
When submit is pressed I need to get an array of selected users. It can contain 100 drop down boxes and I want the selected user in each drop down. -- View this message in context: http://www.nabble.com/How-to-get-select-objects-from-ListView-tp17146212p17146322.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-extensions javadoc
It is under the section labeled Documentation called JavaDocs ;) Incidentally should it not point to 1.3.3 now? or has nothing changed in the javadoc since then. Maurice On Fri, May 9, 2008 at 1:05 PM, James Carman [EMAIL PROTECTED] wrote: Yes, but that URL isn't obvious. Is there a link on the main site anywhere to that Javadoc? I couldn't find it. I always have to hand-type it (or bookmark it of course :) On Fri, May 9, 2008 at 7:03 AM, Martijn Dashorst [EMAIL PROTECTED] wrote: http://wicket.apache.org/docs/wicket-1.3.2/wicket-extensions/apidocs/index.html On 5/9/08, Matthijs Wensveen [EMAIL PROTECTED] wrote: I understand that the 1.2 docs must be on sf.net hardware, and that they are still available there. I just want the most recent version of the wicket-extensions javadoc to be available too, somewhere, anywhere. Doug did just that, so a big thanks there! Matthijs Martijn Dashorst wrote: wicketframework.org is not the main site. http://wicket.apache.org is As you can see, http://wicketframework.org redirects to http://wicket.apache.org The 1.2 docs are still available for reference, and *must* be hosted on the sf.net hardware (they are not released under supervision of Apache). Martijn On 5/7/08, Doug Donohoe [EMAIL PROTECTED] wrote: Matthijs, I had to host javadoc for my own wicketstuff-annotations project, so I decided to put the Wicket docs there (since the main site isn't up-to-date). I added wicket-extensions to the site: http://www.ddpoker.com/javadoc/ -Doug Matthijs Wensveen-2 wrote: Hi, I'm not sure this is the right place, but anyway. The online javadoc of wicket-extensions at http://wicketframework.org/wicket-extensions/apidocs/index.html is of version 1.2-SNAPSHOT, but the latest release is 1.3.3. The javadoc that maven pulls in is more current. Could the online javadocs be updated please? Thanks, Matthijs -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/wicket-extensions-javadoc-tp17099232p17108936.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get select objects from ListView
Or just the selectionmodels for the combos. Maurice On Fri, May 9, 2008 at 2:00 PM, Martin Makundi [EMAIL PROTECTED] wrote: Why don't you just add the combos into a list during the populate event? 2008/5/9 Mathias P.W Nilsson [EMAIL PROTECTED]: When submit is pressed I need to get an array of selected users. It can contain 100 drop down boxes and I want the selected user in each drop down. -- View this message in context: http://www.nabble.com/How-to-get-select-objects-from-ListView-tp17146212p17146322.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-extensions javadoc
On Fri, May 9, 2008 at 7:54 AM, Maurice Marrink [EMAIL PROTECTED] wrote: It is under the section labeled Documentation called JavaDocs ;) Those Javadocs don't contain the wicket-extensions classes. That's only the Javadoc for the core Wicket stuff. Incidentally should it not point to 1.3.3 now? or has nothing changed in the javadoc since then. +1. And what about 1.4-m1? Can we get a link to that Javadoc from the main site? Since there are two active branches of development, it would be nice to have links to both sets of documentation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get select objects from ListView
Of course :) thanks. -- View this message in context: http://www.nabble.com/How-to-get-select-objects-from-ListView-tp17146212p17146720.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MarkupNotFoundException
Are IpLookupPage.html and BasePage.html both in the same location as IpLookupPage.class and BasePage.class respectively and on the testing classpath? -Original Message- From: AlexTM [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 2:41 AM To: users@wicket.apache.org Subject: MarkupNotFoundException Hi. I have a class IpLookupPage that uses markupinheritence and inherits a class called BasePage. I is working fine when i test it manually but when i am using testng to do unit testing on the page i get an exception. The code looks like: ApplicationContext context = getStubApplicationContextForPage(); BossoWicketTester app = createWicketTester(context); app.openPage(IpLookupPage.class); And i get this error message: org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html' for component 'com.ongame.bo.bofraud.markup.pages.IpLookupPage' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried: [Page class = com.ongame.bo.bofraud.markup.pages.IpLookupPage, id = 0, version = 0] at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContai ner.java:354) at org.apache.wicket.Page.onRender(Page.java:1435) at org.apache.wicket.Component.render(Component.java:2266) at org.apache.wicket.Page.renderPage(Page.java:891) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget .respond(BookmarkablePageRequestTarget.java:231) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(Abstract RequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java :1100) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1169) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(M ockWebApplication.java:382) at com.ongame.bo.bofraud.WicketApplicationTest$BossoWicketTester.openPage(W icketApplicationTest.java:101) at com.ongame.bo.bofraud.markup.pages.IpLookupPageTest.testInvalidIpAddress (IpLookupPageTest.java:68) Caused by: org.apache.wicket.markup.MarkupNotFoundException: Markup not found. Component class: com.ongame.bo.bofraud.markup.pages.IpLookupPage Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried at org.apache.wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:21 5) at org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContai ner.java:342) ... 33 more ... Removed 21 stack frames Anyone that knows what the problem is? Regards Alex -- View this message in context: http://www.nabble.com/MarkupNotFoundException-tp17142219p17142219.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket-security
In UPC.getSubject you can store the username in your custom session. But you should be aware that in some very exotic situations this could cause a stackoverflow. And by exotic i mean calling session.login directly after you have created a new session in Application.newSession. I don't think you have to worry about that :) Maurice On Fri, May 9, 2008 at 2:14 PM, Leif Jantzen [EMAIL PROTECTED] wrote: Hi, I am using wicket + wicket-security (swarm) configured with Basic HTTP authentication (subclass of UsernamePasswordContext etc). I would like to display the name of the currently logged in user on the page header, but I cannot find any way to get hold of that information outside of the UsernamePasswordContext . And in the UsernamePasswordContext I cant put the info anywhere useful, AFAIK. Any pointers? :-lj - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket-extensions javadoc
On Fri, May 9, 2008 at 2:17 PM, James Carman [EMAIL PROTECTED] wrote: On Fri, May 9, 2008 at 7:54 AM, Maurice Marrink [EMAIL PROTECTED] wrote: It is under the section labeled Documentation called JavaDocs ;) Those Javadocs don't contain the wicket-extensions classes. That's only the Javadoc for the core Wicket stuff. You are correct, Martijn also pointed this out to me :) Incidentally should it not point to 1.3.3 now? or has nothing changed in the javadoc since then. +1. And what about 1.4-m1? Can we get a link to that Javadoc from the main site? Since there are two active branches of development, it would be nice to have links to both sets of documentation. I agree, i mentioned this to Martijn but he did not seem overly enthusiastic :P There are some problems with letting maven generate the site for us that prevent us from doing everything we would like to do. Maurice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: behavior for onComponentTagBody
Hi all, Thanks for the replies and sorry for the mess :) I have MyButton and MyAjaxButton that for now, each overrides the onComponentTagBody (the one I mentioned above). I also have a behavior for onComponentTag that works fine. I thought of putting the onComponentTagBody in the same behavior. Johan, Eelco, What do you mean by Converters? Is there a special class / interface I'm not aware of? Thanks Eyal On Thu, May 8, 2008 at 10:39 AM, Eelco Hillenius [EMAIL PROTECTED] wrote: On Wed, May 7, 2008 at 8:42 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: doesnt Label do this already? Yeah, I think just using getModelValueAsString would give the same results. Also, Label is the only (or one of the few at most) class(es) where overriding onComponentTagBody makes sense. Why not do your thing in a base class Eyal? Or... make model wrappers, where the sole purpose of your wrapping models is to format the output of your wrapped models. Or... do this using converters. Creating a base class makes sense if you do this with the same kind of components all the time (labels I pressume?). If your components are very different, any of the other options are fine. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
RE: How to get select objects from ListView
@SuppressWarnings(unchecked) public final ListCulture findCultures() { final ListCulture cultures = new ArrayListCulture(); final IteratorItem items = ratingScalesView.getItems(); if (items != null) { while (items.hasNext()) { cultures.add((Culture) items.next().getModelObject()); } } return cultures; } -Original Message- From: Mathias P.W Nilsson [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 7:37 AM To: users@wicket.apache.org Subject: How to get select objects from ListView Hi! I have this list view ListView view = new ListView( translatorView , cultureModel ){ private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem item) { Culture culture = (Culture) item.getModelObject(); item.add( new Label( culture , culture.getName() )); DropDownChoice translatorChoice = new DropDownChoice( translatorChoice, new LoadableDetachableTranslatorModel( culture) , new FtcUserChoiceRenderer() ){ private static final long serialVersionUID = 1L; @Override protected java.lang.CharSequence getDefaultChoice(final Object selected){ return option value=\\+ getLocalizer().getString( culture.select.empty, TranslatorInvitationPage.this ) + /option; } }; item.add( translatorChoice ); } }; The model is a detached model for users. How can I get the list of drop down choice model objects? -- View this message in context: http://www.nabble.com/How-to-get-select-objects-from-ListView-tp17146212 p17146212.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form onSubmit called after Page components created
Personally i would not worry about the dual load. Usually hibernate or even the database itself can cache these calls efficiently enough. But if you must an alternative could be a model that gets the information once and then does not detach it like a common detachablemodel does, however since you are using statelesspages the model should persist the data in the session and then next time the statelesspage is created get it from the session instead of making the database call. Note that you have to be very careful when storing hibernate objects like this in the session. It certainly is not an elegant solution just another option you could explore, it has the added benefit that you do not have to tackle those pageparams yourself. just my 2c Maurice On Fri, May 9, 2008 at 1:07 PM, Joel Halbert [EMAIL PROTECTED] wrote: Hi Igor, Yes I take your point about being able to replace components within the onSubmit, that's certainly a good option in some cases. However - in the scenario that I'm looking there are components in the page that initialise themselves dynamically from a database model. What's happening now is that they initialise themselves once when the page and components are first created (some default arrangement say) and then during the onSubmit they need to be set up again, based on the values submitted in the form. This then means that the database is accessed twice, and not once, and I'm trying to avoid multiple database access. (actually to get around this for the time being I'm not using the forms onSubmit() to access the form values, instead I'm reading directly off the PageParameters object when the page is first created, which avoids the dual load issue described above, but it seems like a bit of a hack as I don't feel I'm leveraging the framework correctly) Cheers, Joel -- From: Igor Vaynberg [EMAIL PROTECTED] Sent: Friday, May 09, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Form onSubmit called after Page components created the stateless stuff has to recreate the component hierarchy first - eg the form instance has to exist before you can call onsubmit on it :) however, inside onsubmit you can do any component replacement you want, just like in a non-stateless page. -igor On Thu, May 8, 2008 at 4:36 PM, Joel Halbert [EMAIL PROTECTED] wrote: Hi, I've noticed that when submitting a (stateless) Form page the onSubmit() method of the form is only called once all the Page components have all been created, and likewise any model objects relating to the form are only populated once the page components have been rendered. This means that it is hard to create dynamic content in the page that is dependent on the contents of the submitted form without reloading the page using setResponsePage(MyPage.class, pageParams) at the end of the onSubmit() call of the form. Has anyone else noticed this and is there a way around it? i.e. can the models be populated before the page components are created? Rgs Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IActivePageBehaviorListener exception
In case anyone else has this problem, the solution I found was to manually register the IActivePageBehaviorListener in my application constructor: public WicketApplication() { IActivePageBehaviorListener.INTERFACE.register(); } richardwilko wrote: Hi, I have wicket running clustered and occasionally see this exception: WicketMessage: Attempt to access unknown request listener interface IActivePageBehaviorListener Root cause: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface IActivePageBehaviorListener at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:397) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) I happens when I start up my wicket instances, go to a page and start typing in an autocomplete text box. I only see it if I haven't done anything else in the session, ie all I have done is open the page. Im using wicket 1.3.3, jetty 6 and wadi to cluster my jetty sessions. I presume that I get this error because the session state hasnt been propagated yet when i open my first page. Has anyone had a similar error or seen this problem before? Any help would be great, Richard -- View this message in context: http://www.nabble.com/IActivePageBehaviorListener-exception-tp17127279p17147767.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form onSubmit called after Page components created
unfortunately in this case the model is different in both cases. -- From: Maurice Marrink [EMAIL PROTECTED] Sent: Friday, May 09, 2008 2:16 PM To: users@wicket.apache.org Subject: Re: Form onSubmit called after Page components created Personally i would not worry about the dual load. Usually hibernate or even the database itself can cache these calls efficiently enough. But if you must an alternative could be a model that gets the information once and then does not detach it like a common detachablemodel does, however since you are using statelesspages the model should persist the data in the session and then next time the statelesspage is created get it from the session instead of making the database call. Note that you have to be very careful when storing hibernate objects like this in the session. It certainly is not an elegant solution just another option you could explore, it has the added benefit that you do not have to tackle those pageparams yourself. just my 2c Maurice On Fri, May 9, 2008 at 1:07 PM, Joel Halbert [EMAIL PROTECTED] wrote: Hi Igor, Yes I take your point about being able to replace components within the onSubmit, that's certainly a good option in some cases. However - in the scenario that I'm looking there are components in the page that initialise themselves dynamically from a database model. What's happening now is that they initialise themselves once when the page and components are first created (some default arrangement say) and then during the onSubmit they need to be set up again, based on the values submitted in the form. This then means that the database is accessed twice, and not once, and I'm trying to avoid multiple database access. (actually to get around this for the time being I'm not using the forms onSubmit() to access the form values, instead I'm reading directly off the PageParameters object when the page is first created, which avoids the dual load issue described above, but it seems like a bit of a hack as I don't feel I'm leveraging the framework correctly) Cheers, Joel -- From: Igor Vaynberg [EMAIL PROTECTED] Sent: Friday, May 09, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Form onSubmit called after Page components created the stateless stuff has to recreate the component hierarchy first - eg the form instance has to exist before you can call onsubmit on it :) however, inside onsubmit you can do any component replacement you want, just like in a non-stateless page. -igor On Thu, May 8, 2008 at 4:36 PM, Joel Halbert [EMAIL PROTECTED] wrote: Hi, I've noticed that when submitting a (stateless) Form page the onSubmit() method of the form is only called once all the Page components have all been created, and likewise any model objects relating to the form are only populated once the page components have been rendered. This means that it is hard to create dynamic content in the page that is dependent on the contents of the submitted form without reloading the page using setResponsePage(MyPage.class, pageParams) at the end of the onSubmit() call of the form. Has anyone else noticed this and is there a way around it? i.e. can the models be populated before the page components are created? Rgs Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DefaultDataTable + CheckGroupSelector / CheckGroup
Hi, I am trying to implement CheckGroupSelector and CheckGroup( which will hold all the Check(s) ) inside DefaultDataTable, so that each row that gets displayed should also have checkbox and there should be checkbox on top which allows to check/uncheck all checkboxes. Can someone please post a simple example for this? Also, Please suggest how to find out which check box is selected (considering there is a button on the page) Thanks, ~R -- View this message in context: http://www.nabble.com/DefaultDataTable-%2B-CheckGroupSelector---CheckGroup-tp17148286p17148286.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Good wicket patterns
Thanx guys... really good answers/feedback there. /Kalle Frank van Lankvelt wrote: You could have a look at the broadcaster that is discussed in https://issues.apache.org/jira/browse/WICKET-1312 The solution that is proposed there uses a visitor instead of registration. That has the advantage that you don't have to _unregister_ at the appropriate time. Because Wicket does not have lifecycle management of components you would have to do this by hand. Of course, if your components are never replaced, this is not an issue. cheers, Frank On Thu, 2008-05-08 at 18:15 -0700, Scott Swank wrote: e.g. public class AjaxEvent { private SetComponent listeners = new HashSetComponent(); public void register(Component listener) { listeners.add(listener); } public void fire(AjaxRequestTarget request) { for (Component listener : listeners) request.addComponent(listener); } } On Thu, May 8, 2008 at 6:07 PM, Scott Swank [EMAIL PROTECTED] wrote: Ajax 3. Now im working with more Ajax. What is a good inter component communication scheme? Swing has its listeners, but in wicket i tend to call methods on dependent components from ajax event handlers. Is this a good approach - (it atleast dont feel so good)? I try to have my components just be a view of their model. Then it's just a matter of setting the model(s) appropriately and refreshing the components. Alternately, create a AjaxEvent class that you subclass to represent each of the actions in which you're interested. Put a collection of those on your Page. Then have allow each component to register itself as a listener of an event. Then an ajax call would result in SomeAjaxEvent.fire(AjaxTargetRequest) and that would in turn call addComponent() for each registered listener component. - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-3329 +1 (707) 773-4646 - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Good-wicket-patterns-tp17139005p17148622.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form action
Hi, Does anyone know if there is an easy way of appending page parameters to the action query string of a stateless form without overriding Page.getPageParameters() ? The reason I would want to do this is if I had two forms on the page and I wanted to hold different state in each form. (I would like to do this without using hidden fields - so as parameters tagged on to the forms action string) Thanks, joel
RE: form action
You could just have the forms be two different classes (or instances) and have them bound via PropertyModels to different objects, in order to keep separate states. Why do you want URL query strings (and hence GET requests) with forms anyway? -Original Message- From: Joel Halbert [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 9:04 AM To: users@wicket.apache.org Subject: form action Hi, Does anyone know if there is an easy way of appending page parameters to the action query string of a stateless form without overriding Page.getPageParameters() ? The reason I would want to do this is if I had two forms on the page and I wanted to hold different state in each form. (I would like to do this without using hidden fields - so as parameters tagged on to the forms action string) Thanks, joel ___ The information in this email or in any file attached hereto is intended only for the personal and confiden- tial use of the individual or entity to which it is addressed and may contain information that is propri- etary and confidential. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communica- tion is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product. Email trans- mission cannot be guaranteed to be secure or error- free. P6070214 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wicket 1.4 Generics
I just migrated to 1.4-M1 and converted all my classes to use the new generics support. It cleaned up my code quite nicely - I got to remove a lot of casting and cured many unchecked/raw messages. It also make the code much more readable - especially in list views, etc. Excellent work, Wicket team. -Doug -- View this message in context: http://www.nabble.com/Wicket-1.4-Generics-tp17149922p17149922.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form action
why don't you just store it in the page as properties? Why hidden fields or page parameters? Martijn On 5/9/08, Joel Halbert [EMAIL PROTECTED] wrote: Hi, Does anyone know if there is an easy way of appending page parameters to the action query string of a stateless form without overriding Page.getPageParameters() ? The reason I would want to do this is if I had two forms on the page and I wanted to hold different state in each form. (I would like to do this without using hidden fields - so as parameters tagged on to the forms action string) Thanks, joel -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice throws IllegalArgumentException with Integer values
On Fri, May 09, 2008 at 08:25:05AM -0700, Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). That example is terrible. SelectOption is a Wicket component and an internal implementation detail of DropDownChoice. It should not be in your business model as the example shows. If you're setting an integer property via a DropDownChoice, you should pass a ListInteger and implement ChoiceRenderer.getDisplayValue() to output the right string to display. My wild-ass guess would be that Wicket is trying to cast a SelectOption into an Integer, with predictable results. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form action
If I do it using PageParameters then the parameters will be appended to the forms action query string, sure, but the same set of parameters will be appended to both forms on the page, and I would like different parameters for each form. (also please note that all the elements on the pages are completely stateless) -- From: Martijn Dashorst [EMAIL PROTECTED] Sent: Friday, May 09, 2008 4:48 PM To: users@wicket.apache.org Subject: Re: form action why don't you just store it in the page as properties? Why hidden fields or page parameters? Martijn On 5/9/08, Joel Halbert [EMAIL PROTECTED] wrote: Hi, Does anyone know if there is an easy way of appending page parameters to the action query string of a stateless form without overriding Page.getPageParameters() ? The reason I would want to do this is if I had two forms on the page and I wanted to hold different state in each form. (I would like to do this without using hidden fields - so as parameters tagged on to the forms action string) Thanks, joel -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice throws IllegalArgumentException with Integer values
On Fri, May 09, 2008 at 11:53:30AM -0400, John Krasnay wrote: On Fri, May 09, 2008 at 08:25:05AM -0700, Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). That example is terrible. SelectOption is a Wicket component and an internal implementation detail of DropDownChoice. It should not be in your business model as the example shows. If you're setting an integer property via a DropDownChoice, you should pass a ListInteger and implement ChoiceRenderer.getDisplayValue() to output the right string to display. My wild-ass guess would be that Wicket is trying to cast a SelectOption into an Integer, with predictable results. jk Ugh, I just noticed that the example has its own SelectOption class, not the one from Wicket. But I stand by the golden rule of DropDownChoice: always pass a list of the same type of object that you expect to receive back in your business model. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IActivePageBehaviorListener exception
i added the missing registration to our Initializer in trunk, can one of the committers do it in the 1.3 branch please? -igor On Fri, May 9, 2008 at 6:21 AM, richardwilko [EMAIL PROTECTED] wrote: In case anyone else has this problem, the solution I found was to manually register the IActivePageBehaviorListener in my application constructor: public WicketApplication() { IActivePageBehaviorListener.INTERFACE.register(); } richardwilko wrote: Hi, I have wicket running clustered and occasionally see this exception: WicketMessage: Attempt to access unknown request listener interface IActivePageBehaviorListener Root cause: org.apache.wicket.WicketRuntimeException: Attempt to access unknown request listener interface IActivePageBehaviorListener at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:397) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) I happens when I start up my wicket instances, go to a page and start typing in an autocomplete text box. I only see it if I haven't done anything else in the session, ie all I have done is open the page. Im using wicket 1.3.3, jetty 6 and wadi to cluster my jetty sessions. I presume that I get this error because the session state hasnt been propagated yet when i open my first page. Has anyone had a similar error or seen this problem before? Any help would be great, Richard -- View this message in context: http://www.nabble.com/IActivePageBehaviorListener-exception-tp17127279p17147767.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form onSubmit called after Page components created
you can make those objects initialize lazily by either using models that load data lazily or doing the initialization in onbeforerender() -igor On Fri, May 9, 2008 at 4:07 AM, Joel Halbert [EMAIL PROTECTED] wrote: Hi Igor, Yes I take your point about being able to replace components within the onSubmit, that's certainly a good option in some cases. However - in the scenario that I'm looking there are components in the page that initialise themselves dynamically from a database model. What's happening now is that they initialise themselves once when the page and components are first created (some default arrangement say) and then during the onSubmit they need to be set up again, based on the values submitted in the form. This then means that the database is accessed twice, and not once, and I'm trying to avoid multiple database access. (actually to get around this for the time being I'm not using the forms onSubmit() to access the form values, instead I'm reading directly off the PageParameters object when the page is first created, which avoids the dual load issue described above, but it seems like a bit of a hack as I don't feel I'm leveraging the framework correctly) Cheers, Joel -- From: Igor Vaynberg [EMAIL PROTECTED] Sent: Friday, May 09, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Form onSubmit called after Page components created the stateless stuff has to recreate the component hierarchy first - eg the form instance has to exist before you can call onsubmit on it :) however, inside onsubmit you can do any component replacement you want, just like in a non-stateless page. -igor On Thu, May 8, 2008 at 4:36 PM, Joel Halbert [EMAIL PROTECTED] wrote: Hi, I've noticed that when submitting a (stateless) Form page the onSubmit() method of the form is only called once all the Page components have all been created, and likewise any model objects relating to the form are only populated once the page components have been rendered. This means that it is hard to create dynamic content in the page that is dependent on the contents of the submitted form without reloading the page using setResponsePage(MyPage.class, pageParams) at the end of the onSubmit() call of the form. Has anyone else noticed this and is there a way around it? i.e. can the models be populated before the page components are created? Rgs Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
Great input and you're forgiven for jumping the gun with SelectOption ;-) I didn't even know there was a wicket SelectOption, which puts a new spin on things. Regarding the conversion back to the model: Yes, I was following the example hoping IT WOULD BE CORRECT. I concur with you that it's probably trying to cast SelectOption into an Integer, but that doesn't explain why it actually works when I refrain from tagging a non-integer string to the label (e.g. '1' as the label vs. '1 guest'). How does it manage to convert properly then? Michael -Original Message- From: John Krasnay [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 9:02 AM To: users@wicket.apache.org Subject: Re: DropDownChoice throws IllegalArgumentException with Integer values On Fri, May 09, 2008 at 11:53:30AM -0400, John Krasnay wrote: On Fri, May 09, 2008 at 08:25:05AM -0700, Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). That example is terrible. SelectOption is a Wicket component and an internal implementation detail of DropDownChoice. It should not be in your business model as the example shows. If you're setting an integer property via a DropDownChoice, you should pass a ListInteger and implement ChoiceRenderer.getDisplayValue() to output the right string to display. My wild-ass guess would be that Wicket is trying to cast a SelectOption into an Integer, with predictable results. jk Ugh, I just noticed that the example has its own SelectOption class, not the one from Wicket. But I stand by the golden rule of DropDownChoice: always pass a list of the same type of object that you expect to receive back in your business model. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Forcing An AjaxTabbedPanel To Refresh...
I've set up a page such that it contains two panels - one with a form for selecting an individual, and the other with an AjaxTabbedPanel to show information on different aspects of a given individual. The hierarchy is roughly like so: Page - Panel ---Form with drop down to select individual - Panel ---AjaxTabbedPanel My problem is that when I select the individual from the first panel and capture this event via Ajax, I can't seem to make the current tab page of the AjaxTabbedPanel refresh. Other tab pages indicate the individual chosen, but not the tab page visible when the choice was made. Is there any easy way to tell the whole AjaxTabbedPanel (or even its parent panel) to update all tab pages immediately? Let me know and best regards to all, Steve -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forcing An AjaxTabbedPanel To Refresh...
the best solution is to let the tabbed panel work off the same model that the selector uses, that way all you would have to do is add the tabbedpanel to the ajax target. -igor On Fri, May 9, 2008 at 9:21 AM, Steve Thompson [EMAIL PROTECTED] wrote: I've set up a page such that it contains two panels - one with a form for selecting an individual, and the other with an AjaxTabbedPanel to show information on different aspects of a given individual. The hierarchy is roughly like so: Page - Panel ---Form with drop down to select individual - Panel ---AjaxTabbedPanel My problem is that when I select the individual from the first panel and capture this event via Ajax, I can't seem to make the current tab page of the AjaxTabbedPanel refresh. Other tab pages indicate the individual chosen, but not the tab page visible when the choice was made. Is there any easy way to tell the whole AjaxTabbedPanel (or even its parent panel) to update all tab pages immediately? Let me know and best regards to all, Steve -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
I posted on my wiki how I solved this problem. Hopefully it will help you: http://wiki.donohoedigital.com/wiki/Wiki.jsp?page=DropDownChoice+Example -Doug Michael Mehrle wrote: The code is pretty massive, would be tough to post all that here. Basically, it's an integer backed DropDownChoice that has the word 'guest' tagged on to incrementing numbers (e.g. 1 - 10) in the label. When I remove the word 'guest' in the label it works just fine. Did your dropdown have integers as the labels or was there more? It seems that the problem lies in the conversion, and that Wicket somehow is trying to grab the label value and put it into the model. If anyone has run into such a problem I'd appreciate any input. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 8:41 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Post your code. It's hard to guess w/out seeing the code. I have an integer-based drop down choice working well (I used that example as my starting point). -Doug Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 6:35 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Okay, I just stepped through this and getting the feeling that 'somehow' the label is being passed on to the model. Now, if the label is '1' it works fine, but if it's '1 day', then I get that error. The question here is: why is the label being passed back to the model? Doesn't make any sense - I'm using a ChoiceRenderer as such: new ChoiceRenderer(label, value) Do I also need to add some kind of converter to properly assign the model? Any input would be appreciated. Michael -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 5:19 PM To: users@wicket.apache.org Subject: DropDownChoice throws IllegalArgumentException with Integer values This is the error I'm getting: [DEBUG LoadAdDataInterceptor] Loaded AdData:[EMAIL PROTECTED] [ERROR RequestCycle] Cannot format given Object as a Number java.lang.IllegalArgumentException: Cannot format given Object as a Number at java.text.DecimalFormat.format(DecimalFormat.java:480) at java.text.Format.format(Format.java:133) at org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver tToString(AbstractNumberConverter.java:109) at org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe solverConverter.java:84) I'm using ListSelectOption to populate the DropDownChoice, as per the online example: http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). Anyone any ideas as to what's going on? I'm pretty sure I didn't swap the label/value pairs as the labels show up properly. Thanks, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-wit h-Integer-values-tp17139227p17150771.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-with-Integer-values-tp17139227p17151647.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice throws IllegalArgumentException with Integer values
On Fri, May 09, 2008 at 09:15:50AM -0700, Michael Mehrle wrote: Great input and you're forgiven for jumping the gun with SelectOption ;-) I didn't even know there was a wicket SelectOption, which puts a new spin on things. Regarding the conversion back to the model: Yes, I was following the example hoping IT WOULD BE CORRECT. I concur with you that it's probably trying to cast SelectOption into an Integer, but that doesn't explain why it actually works when I refrain from tagging a non-integer string to the label (e.g. '1' as the label vs. '1 guest'). How does it manage to convert properly then? Michael Well, it's probably noticing that it's a string and trying Integer.parseInt(), but it's really beside the point. Unless you follow the golden rule your code will most certainly break in 1.4, where the DDC constructor looks something like this: public DropDownChoice(String id, ModelT model, ListT choices, ChoiceRendererT choiceRenderer); jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: behavior for onComponentTagBody
Johan, Eelco, What do you mean by Converters? Is there a special class / interface I'm not aware of? IConverter. See the forminput example of wicket-examples for an idea. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageParameters request-for-enhancement
What is the likelihood that we can get this patch included in the next 1.4 milestone? Again, I'll repeat my offer to submit it myself if given commit access. I updated the JIRA issue with the API javadoc to show what I added. -Doug Doug Donohoe wrote: I created https://issues.apache.org/jira/browse/WICKET-1596 and submitted a patch with test cases. I'd be happy to commit if given commit access if that is easier. Perhaps my work on wicketstuff-annotation demonstrates my attention to detail in code and documentation. Thanks, -Doug Eelco Hillenius wrote: Hi, You can best file an RFE in JIRA for things like this. The list is primarily for questions and discussions, and adding it to JIRA will at least make sure it stays on the list of things to look at. Cheers, Eelco On Thu, Apr 24, 2008 at 3:00 PM, Doug Donohoe [EMAIL PROTECTED] wrote: Hi Wicket team: I'd like to be able to call getInt(name, default) and not have to worry about catching exceptions. If the number can't be parsed, just return the default. I have a utility method which I use: public static int getInt(PageParameters params, String name, int def) { try { return params.getInt(name, def); } catch (StringValueConversionException ignored) { return def; } } Basically for my bookmarkable pages, I don't care if a user mucks with the URL - this would let me default to something reasonable. It would be nice if there were a comparable method on PageParameters ... like getIntSafe(name, def) or some something similar (and for other number-based getters). In addition, it would be nice to have a getInteger() object method that returns null if not defined or an Integer object. The way it is now, I have to pick a default value that I assume won't ever be valid (usually -1). There are valid use cases where null is an expected value. -Doug -Doug -- View this message in context: http://www.nabble.com/PageParameters-request-for-enhancement-tp16853545p16853545.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/PageParameters-request-for-enhancement-tp16853545p17152141.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3
call setReuseItems(true) on the listview that contains radio components. javadoc of listview recommends this for listviews inside forms that contain formcomponents. -igor On Thu, May 8, 2008 at 1:49 PM, Frank Silbermann [EMAIL PROTECTED] wrote: Here's the URL of my jira issue. https://issues.apache.org/jira/browse/WICKET-1601 The issue has attached a quickstart project and a screen print. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 12:13 PM To: users@wicket.apache.org Subject: Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3 On Thu, May 8, 2008 at 10:06 AM, Frank Silbermann [EMAIL PROTECTED] wrote: I wrote earlier about my problems going from Wicket 1.2.2 to Wicket 1.2.6. This has to do with a RadioGroup component that I built; whenever I used it on more than one page, clicking on one RadioGroup caused the marker to disapper from all the other RadioGroups on the page. I wasn't given much help because Wicket 1.2 is end-of-life. Today I tried the example on Wicked 1.3.3. I downloaded the QuickStart application for Wicket 1.3.3, installed an upgraded version of my RadioGroup component, modified the home page to show my RadioGroup panel twice, and the bad behavior is still there. By the way, the only change in the generated HTML that I could see was that in Wicket 1.2.2 the buttons were defined: input value=radios:2:radio ...etc. -- with the numbers starting over again for each RadioGroup, whereas in Wicket 1.2.6 and Wicket 1.3.3 it was more like: input value=radio7 ...etc. with the numbers _not_ starting over for each RadioGroup. Clicking on one radio group causes the marker to disappear from the other radio group -- as if part of Wicket were treating the buttons as though they all belonged to the same radio group. I'd like the Wicket 1.3 developers either to fix the bug in a future release (after which I'll upgrade my entire application to 1.3), or tell me what I'm doing wrong. How do I get the process started? the usual way, create a jira issue and attach a quickstart project that demonstrates the problem. than post the jira url back into this thread. it is not very helpful when you post huge fragments of code and markup into an email. -igor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Javascript adding input
That's not the point, but if you need a good reason how about this: I'm using recaptcha (it generates a captcha on the page). It works by putting a script tag where you want it to show up. When the page loads, it puts a text input field and a bunch of hidden fields there. You need these hidden fields to tell the recaptcha server what it gave you so it can compare it to what the user typed in. Without them, it can't tell you if the user entered things in correctly or not. -Original Message- From: Maurice Marrink [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 12:24 AM To: users@wicket.apache.org Subject: Re: Javascript adding input Why would you want to do that? If it happens at form load you must know about this inputfield when you create the page so why not add a wicket component for it too? Maurice On Fri, May 9, 2008 at 1:02 AM, Dan Kaplan [EMAIL PROTECTED] wrote: Let's say that hypothetically I used javascript to add an input to a form in its onload method. How can I get wicket to become aware of that input so I can do things like validate it, etc.? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reloading a Page in Wicket
Hi, I need help on wicket. I am trying to reaload my entire page on a click of a button in that page. In the page constructor I fetch data from the DB and create some tables. I have a button, on click of which the data has to be re-fetched and updated in the table. Could anyone please help me on this. Thanks. -- View this message in context: http://www.nabble.com/Reloading-a-Page-in-Wicket-tp17154374p17154374.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Bug introduced somewhere after 1.2.2 is still in 1.3.3
I can search my application for ListView occuring in a form and do this. Are there any other components that require something like this when used in a Form? E.g. in Wicket Extensions? -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 12:52 PM To: users@wicket.apache.org Subject: Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3 call setReuseItems(true) on the listview that contains radio components. javadoc of listview recommends this for listviews inside forms that contain formcomponents. -igor On Thu, May 8, 2008 at 1:49 PM, Frank Silbermann [EMAIL PROTECTED] wrote: Here's the URL of my jira issue. https://issues.apache.org/jira/browse/WICKET-1601 The issue has attached a quickstart project and a screen print. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 12:13 PM To: users@wicket.apache.org Subject: Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3 On Thu, May 8, 2008 at 10:06 AM, Frank Silbermann [EMAIL PROTECTED] wrote: I wrote earlier about my problems going from Wicket 1.2.2 to Wicket 1.2.6. This has to do with a RadioGroup component that I built; whenever I used it on more than one page, clicking on one RadioGroup caused the marker to disapper from all the other RadioGroups on the page. I wasn't given much help because Wicket 1.2 is end-of-life. Today I tried the example on Wicked 1.3.3. I downloaded the QuickStart application for Wicket 1.3.3, installed an upgraded version of my RadioGroup component, modified the home page to show my RadioGroup panel twice, and the bad behavior is still there. By the way, the only change in the generated HTML that I could see was that in Wicket 1.2.2 the buttons were defined: input value=radios:2:radio ...etc. -- with the numbers starting over again for each RadioGroup, whereas in Wicket 1.2.6 and Wicket 1.3.3 it was more like: input value=radio7 ...etc. with the numbers _not_ starting over for each RadioGroup. Clicking on one radio group causes the marker to disappear from the other radio group -- as if part of Wicket were treating the buttons as though they all belonged to the same radio group. I'd like the Wicket 1.3 developers either to fix the bug in a future release (after which I'll upgrade my entire application to 1.3), or tell me what I'm doing wrong. How do I get the process started? the usual way, create a jira issue and attach a quickstart project that demonstrates the problem. than post the jira url back into this thread. it is not very helpful when you post huge fragments of code and markup into an email. -igor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3
we could make this automatic? search for a parent that is a Form? johan On Fri, May 9, 2008 at 7:52 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: call setReuseItems(true) on the listview that contains radio components. javadoc of listview recommends this for listviews inside forms that contain formcomponents. -igor On Thu, May 8, 2008 at 1:49 PM, Frank Silbermann [EMAIL PROTECTED] wrote: Here's the URL of my jira issue. https://issues.apache.org/jira/browse/WICKET-1601 The issue has attached a quickstart project and a screen print. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 12:13 PM To: users@wicket.apache.org Subject: Re: Bug introduced somewhere after 1.2.2 is still in 1.3.3 On Thu, May 8, 2008 at 10:06 AM, Frank Silbermann [EMAIL PROTECTED] wrote: I wrote earlier about my problems going from Wicket 1.2.2 to Wicket 1.2.6. This has to do with a RadioGroup component that I built; whenever I used it on more than one page, clicking on one RadioGroup caused the marker to disapper from all the other RadioGroups on the page. I wasn't given much help because Wicket 1.2 is end-of-life. Today I tried the example on Wicked 1.3.3. I downloaded the QuickStart application for Wicket 1.3.3, installed an upgraded version of my RadioGroup component, modified the home page to show my RadioGroup panel twice, and the bad behavior is still there. By the way, the only change in the generated HTML that I could see was that in Wicket 1.2.2 the buttons were defined: input value=radios:2:radio ...etc. -- with the numbers starting over again for each RadioGroup, whereas in Wicket 1.2.6 and Wicket 1.3.3 it was more like: input value=radio7 ...etc. with the numbers _not_ starting over for each RadioGroup. Clicking on one radio group causes the marker to disappear from the other radio group -- as if part of Wicket were treating the buttons as though they all belonged to the same radio group. I'd like the Wicket 1.3 developers either to fix the bug in a future release (after which I'll upgrade my entire application to 1.3), or tell me what I'm doing wrong. How do I get the process started? the usual way, create a jira issue and attach a quickstart project that demonstrates the problem. than post the jira url back into this thread. it is not very helpful when you post huge fragments of code and markup into an email. -igor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reloading a Page in Wicket
You can use loadable detachable models or you can call setResponsePage(Page.class) in the link. I recommend the former. On Fri, May 9, 2008 at 2:49 PM, Deb2002 [EMAIL PROTECTED] wrote: Hi, I need help on wicket. I am trying to reaload my entire page on a click of a button in that page. In the page constructor I fetch data from the DB and create some tables. I have a button, on click of which the data has to be re-fetched and updated in the table. Could anyone please help me on this. Thanks. -- View this message in context: http://www.nabble.com/Reloading-a-Page-in-Wicket-tp17154374p17154374.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ryan Gravener http://twitter.com/ryangravener
ModalWindow / zindex
Is there a way to programatically change the zindex for the modalwindow? I am having issue where the ModalWindow is being placed behind images on my page (actually behind an iframe). I search in this forum but I have tried several suggestions but they didn't work. -- View this message in context: http://www.nabble.com/ModalWindow---zindex-tp17154922p17154922.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript adding input
Get the hidden data from the request: getRequest().getParameter(hidden_token); On Fri, May 9, 2008 at 2:13 PM, Dan Kaplan [EMAIL PROTECTED] wrote: That's not the point, but if you need a good reason how about this: I'm using recaptcha (it generates a captcha on the page). It works by putting a script tag where you want it to show up. When the page loads, it puts a text input field and a bunch of hidden fields there. You need these hidden fields to tell the recaptcha server what it gave you so it can compare it to what the user typed in. Without them, it can't tell you if the user entered things in correctly or not. -Original Message- From: Maurice Marrink [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 12:24 AM To: users@wicket.apache.org Subject: Re: Javascript adding input Why would you want to do that? If it happens at form load you must know about this inputfield when you create the page so why not add a wicket component for it too? Maurice On Fri, May 9, 2008 at 1:02 AM, Dan Kaplan [EMAIL PROTECTED] wrote: Let's say that hypothetically I used javascript to add an input to a form in its onload method. How can I get wicket to become aware of that input so I can do things like validate it, etc.? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ryan Gravener http://twitter.com/ryangravener
RE: DropDownChoice throws IllegalArgumentException with Integer values
Yes, I'm on 1.4-m1. However, you can remove all the generic stuff and it will still work. I just migrated to generics yesterday, so the code does work on 1.3.3. Or you can invest in moving to 1.4-m1. It seems to be working great and using generics is nice. -Doug Michael Mehrle wrote: Hi Doug: Thanks for that - this might just work :-) One problem I'm running into is that the version of IChoiceRenderer I am using cannot be parameterized (it's not generic). Do you have a different wicket release than I do? I'm on 1.3.3. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 9:30 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values I posted on my wiki how I solved this problem. Hopefully it will help you: http://wiki.donohoedigital.com/wiki/Wiki.jsp?page=DropDownChoice+Example -Doug Michael Mehrle wrote: The code is pretty massive, would be tough to post all that here. Basically, it's an integer backed DropDownChoice that has the word 'guest' tagged on to incrementing numbers (e.g. 1 - 10) in the label. When I remove the word 'guest' in the label it works just fine. Did your dropdown have integers as the labels or was there more? It seems that the problem lies in the conversion, and that Wicket somehow is trying to grab the label value and put it into the model. If anyone has run into such a problem I'd appreciate any input. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 8:41 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Post your code. It's hard to guess w/out seeing the code. I have an integer-based drop down choice working well (I used that example as my starting point). -Doug Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 6:35 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Okay, I just stepped through this and getting the feeling that 'somehow' the label is being passed on to the model. Now, if the label is '1' it works fine, but if it's '1 day', then I get that error. The question here is: why is the label being passed back to the model? Doesn't make any sense - I'm using a ChoiceRenderer as such: new ChoiceRenderer(label, value) Do I also need to add some kind of converter to properly assign the model? Any input would be appreciated. Michael -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 5:19 PM To: users@wicket.apache.org Subject: DropDownChoice throws IllegalArgumentException with Integer values This is the error I'm getting: [DEBUG LoadAdDataInterceptor] Loaded AdData:[EMAIL PROTECTED] [ERROR RequestCycle] Cannot format given Object as a Number java.lang.IllegalArgumentException: Cannot format given Object as a Number at java.text.DecimalFormat.format(DecimalFormat.java:480) at java.text.Format.format(Format.java:133) at org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver tToString(AbstractNumberConverter.java:109) at org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe solverConverter.java:84) I'm using ListSelectOption to populate the DropDownChoice, as per the online example: http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). Anyone any ideas as to what's going on? I'm pretty sure I didn't swap the label/value pairs as the labels show up properly. Thanks, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-wit h-Integer-values-tp17139227p17150771.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View
RE: DropDownChoice throws IllegalArgumentException with Integer values
Any ideas that work with 1.3.3? ;-) -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 9:30 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values I posted on my wiki how I solved this problem. Hopefully it will help you: http://wiki.donohoedigital.com/wiki/Wiki.jsp?page=DropDownChoice+Example -Doug - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
Hey Doug - thanks for the update - good to hear that it works on 1.3.3. Bummer having to remove the generics - you did a great job defining the generic types. Reading the code makes my head spin!! :-) I'll do some surgery on this and hope to get it working. Cheers, Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 2:23 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Yes, I'm on 1.4-m1. However, you can remove all the generic stuff and it will still work. I just migrated to generics yesterday, so the code does work on 1.3.3. Or you can invest in moving to 1.4-m1. It seems to be working great and using generics is nice. -Doug Michael Mehrle wrote: Hi Doug: Thanks for that - this might just work :-) One problem I'm running into is that the version of IChoiceRenderer I am using cannot be parameterized (it's not generic). Do you have a different wicket release than I do? I'm on 1.3.3. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 9:30 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values I posted on my wiki how I solved this problem. Hopefully it will help you: http://wiki.donohoedigital.com/wiki/Wiki.jsp?page=DropDownChoice+Example -Doug Michael Mehrle wrote: The code is pretty massive, would be tough to post all that here. Basically, it's an integer backed DropDownChoice that has the word 'guest' tagged on to incrementing numbers (e.g. 1 - 10) in the label. When I remove the word 'guest' in the label it works just fine. Did your dropdown have integers as the labels or was there more? It seems that the problem lies in the conversion, and that Wicket somehow is trying to grab the label value and put it into the model. If anyone has run into such a problem I'd appreciate any input. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 8:41 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Post your code. It's hard to guess w/out seeing the code. I have an integer-based drop down choice working well (I used that example as my starting point). -Doug Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 6:35 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Okay, I just stepped through this and getting the feeling that 'somehow' the label is being passed on to the model. Now, if the label is '1' it works fine, but if it's '1 day', then I get that error. The question here is: why is the label being passed back to the model? Doesn't make any sense - I'm using a ChoiceRenderer as such: new ChoiceRenderer(label, value) Do I also need to add some kind of converter to properly assign the model? Any input would be appreciated. Michael -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 5:19 PM To: users@wicket.apache.org Subject: DropDownChoice throws IllegalArgumentException with Integer values This is the error I'm getting: [DEBUG LoadAdDataInterceptor] Loaded AdData:[EMAIL PROTECTED] [ERROR RequestCycle] Cannot format given Object as a Number java.lang.IllegalArgumentException: Cannot format given Object as a Number at java.text.DecimalFormat.format(DecimalFormat.java:480) at java.text.Format.format(Format.java:133) at org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver tToString(AbstractNumberConverter.java:109) at org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe solverConverter.java:84) I'm using ListSelectOption to populate the DropDownChoice, as per the online example: http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). Anyone any ideas as to what's going on? I'm pretty sure I didn't swap the label/value pairs as the labels show up properly. Thanks, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context:
Jump to tab in tabbed panel dynamically
hi, I have a tab just like Tabbed Panel Example: demonstrates ajax enabled tabbed panel List tabs = new ArrayList(); tabs.add(new AbstractTab(new Model(first tab)) { public Panel getPanel(String panelId) { return new TabPanel1(panelId); } }); tabs.add(new AbstractTab(new Model(second tab)) { public Panel getPanel(String panelId) { return new TabPanel2(panelId); } }); When comes to this page, it always goes to the first tab. Is it a way to dynamically goes to other tab? thanks! rtow -- View this message in context: http://www.nabble.com/Jump-to-tab-in-tabbed-panel-dynamically-tp17156868p17156868.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jump to tab in tabbed panel dynamically
TabbedPanel.setSelectedTab(zeroBasedIndex) On Fri, May 9, 2008 at 2:42 PM, rtow [EMAIL PROTECTED] wrote: hi, I have a tab just like Tabbed Panel Example: demonstrates ajax enabled tabbed panel List tabs = new ArrayList(); tabs.add(new AbstractTab(new Model(first tab)) { public Panel getPanel(String panelId) { return new TabPanel1(panelId); } }); tabs.add(new AbstractTab(new Model(second tab)) { public Panel getPanel(String panelId) { return new TabPanel2(panelId); } }); When comes to this page, it always goes to the first tab. Is it a way to dynamically goes to other tab? thanks! rtow -- View this message in context: http://www.nabble.com/Jump-to-tab-in-tabbed-panel-dynamically-tp17156868p17156868.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javascript error in internet explorer
I had a similar problem. In wicket-ajax.js, I made the following changes, and now it works fine : if (Wicket.Focus Wicket.Focus.lastFocusId) { t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId || ); } else { // t.setRequestHeader(Wicket-FocusedElementId, ); } Hope this helps. bglynn wrote: I'm also having either the same issue or one very similar. The problem I'm seeing seems to be isolated to IE. The specific build version of IE 7.0.5730.11. The issue only seems to have come up on one of 5 machines and assuming the specific IE build maybe an issue. Here's a description: We are using a AjaxLazyLoadPanel to load a long running panel. As soon as the panel is is loaded a javascript error of invalid argument is thrown and the ajax request is halted. Doing some debugging revealed that the exception was being thrown from t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId || );. The Wicket.Focus.lastFocusId variable is to , which doesn't seem like it would cause a problem given the OR operator. I'd really apperciate some assitance. Thanks, Brian Glynn atul singh-5 wrote: Hi, I wanted to know about preCallHandlers in wicket-ajax.js .What are they and How are they related in java code. Actually I am facing a problem in internet explorer. The ajax get call give error after Invoking pre-call handler(s).. It gives an error in the highlighted portion and then all ajax stops working, because this get call did not return. The error says--invalid argument I will really appreciate any help. Also if anyone know a javascript debugger/debugging technique for internet explorer, please let me know, so i will be able to do something about this :(.. Thanks doGet: function() { if (this.precondition()) { this.transport = Wicket.Ajax.getTransport(); var url = this.createUrl(); this.log(GET, url); Wicket.Ajax.invokePreCallHandlers(); * var t = this.transport;** if (t != null) { if (Wicket.Browser.isGecko()) { var href = document.location.href; var lastIndexOf = href.lastIndexOf('/'); if (lastIndexOf 0) { url = href.substring(0,lastIndexOf+1) + url; } } t.open(GET, url, this.async); t.onreadystatechange = this.stateChangeCallback.bind(this); // set a special flag to allow server distinguish between ajax and non-ajax requests t.setRequestHeader(Wicket-Ajax, true); t.setRequestHeader(Wicket-FocusedElementId, Wicket.Focus.lastFocusId || ); t.setRequestHeader(Accept, text/xml); t.send(null); return true;* } else { this.failure(); return false; } } else { Wicket.Log.info(Ajax GET stopped because of precondition check, url: + this.url); this.done(); return true; } } -- View this message in context: http://www.nabble.com/javascript-error-in-internet-explorer-tp16732896p17157574.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
I like your solution, but you are using an IntegerSelectChoice as your model, which won't work for me. I need to set my model to a regular Integer since that's what's being persisted on the backend. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 2:23 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Yes, I'm on 1.4-m1. However, you can remove all the generic stuff and it will still work. I just migrated to generics yesterday, so the code does work on 1.3.3. Or you can invest in moving to 1.4-m1. It seems to be working great and using generics is nice. -Doug Michael Mehrle wrote: Hi Doug: Thanks for that - this might just work :-) One problem I'm running into is that the version of IChoiceRenderer I am using cannot be parameterized (it's not generic). Do you have a different wicket release than I do? I'm on 1.3.3. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 9:30 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values I posted on my wiki how I solved this problem. Hopefully it will help you: http://wiki.donohoedigital.com/wiki/Wiki.jsp?page=DropDownChoice+Example -Doug Michael Mehrle wrote: The code is pretty massive, would be tough to post all that here. Basically, it's an integer backed DropDownChoice that has the word 'guest' tagged on to incrementing numbers (e.g. 1 - 10) in the label. When I remove the word 'guest' in the label it works just fine. Did your dropdown have integers as the labels or was there more? It seems that the problem lies in the conversion, and that Wicket somehow is trying to grab the label value and put it into the model. If anyone has run into such a problem I'd appreciate any input. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 8:41 AM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Post your code. It's hard to guess w/out seeing the code. I have an integer-based drop down choice working well (I used that example as my starting point). -Doug Michael Mehrle wrote: Anyone? Was hoping for some input here ;-) -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 6:35 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values Okay, I just stepped through this and getting the feeling that 'somehow' the label is being passed on to the model. Now, if the label is '1' it works fine, but if it's '1 day', then I get that error. The question here is: why is the label being passed back to the model? Doesn't make any sense - I'm using a ChoiceRenderer as such: new ChoiceRenderer(label, value) Do I also need to add some kind of converter to properly assign the model? Any input would be appreciated. Michael -Original Message- From: Michael Mehrle [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 5:19 PM To: users@wicket.apache.org Subject: DropDownChoice throws IllegalArgumentException with Integer values This is the error I'm getting: [DEBUG LoadAdDataInterceptor] Loaded AdData:[EMAIL PROTECTED] [ERROR RequestCycle] Cannot format given Object as a Number java.lang.IllegalArgumentException: Cannot format given Object as a Number at java.text.DecimalFormat.format(DecimalFormat.java:480) at java.text.Format.format(Format.java:133) at org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver tToString(AbstractNumberConverter.java:109) at org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe solverConverter.java:84) I'm using ListSelectOption to populate the DropDownChoice, as per the online example: http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht ml The only change I made to SelectOption is to set the 'value' field to an Integer (which I need for my model). Anyone any ideas as to what's going on? I'm pretty sure I didn't swap the label/value pairs as the labels show up properly. Thanks, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-wit
How to implement hint text in a TextField?
How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe
Re: How to implement hint text in a TextField?
i havent had to do this but something like this might work: class hint extends abstractbehavior { private final imodelstring hint; onbind(component c) { c.setoutputmarkupid(true); } ondetach() { hint.detach(); super.ondetach(); } renderhead(response) { // init textfield with hint response.renderondomreadyscript(var e=document.getelementbyid('+getcomponent.getmarkupid()+'); e.value='+hint.getobject()+';e.style['color']='gray';); } oncomponenttag(tag) { tag.put(onfocus, if (this.value='+hint.getobject()+') { this.value=''; this.style['color']='black;'}); } } then just textfield.add(new hint(new modelstring(search))); -igor On Fri, May 9, 2008 at 4:25 PM, nate roe [EMAIL PROTECTED] wrote: How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to implement hint text in a TextField?
Hrm. The IHeaderResponse interface is new in 1.3 but for a little while longer I must use Wicket 1.2. How does one accomplish response.renderOnDomReadyScript() in 1.2? I don't see any method similar to renderOnDomReadyScript on the Response class. Thanks! Nate On Fri, May 9, 2008 at 4:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i havent had to do this but something like this might work: class hint extends abstractbehavior { private final imodelstring hint; onbind(component c) { c.setoutputmarkupid(true); } ondetach() { hint.detach(); super.ondetach(); } renderhead(response) { // init textfield with hint response.renderondomreadyscript(var e=document.getelementbyid('+getcomponent.getmarkupid()+'); e.value='+hint.getobject()+';e.style['color']='gray';); } oncomponenttag(tag) { tag.put(onfocus, if (this.value='+hint.getobject()+') { this.value=''; this.style['color']='black;'}); } } then just textfield.add(new hint(new modelstring(search))); -igor On Fri, May 9, 2008 at 4:25 PM, nate roe [EMAIL PROTECTED] wrote: How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to implement hint text in a TextField?
1.2 doesnt have it, so just override onrenderaftercomponent and do it there -igor On Fri, May 9, 2008 at 4:50 PM, nate roe [EMAIL PROTECTED] wrote: Hrm. The IHeaderResponse interface is new in 1.3 but for a little while longer I must use Wicket 1.2. How does one accomplish response.renderOnDomReadyScript() in 1.2? I don't see any method similar to renderOnDomReadyScript on the Response class. Thanks! Nate On Fri, May 9, 2008 at 4:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i havent had to do this but something like this might work: class hint extends abstractbehavior { private final imodelstring hint; onbind(component c) { c.setoutputmarkupid(true); } ondetach() { hint.detach(); super.ondetach(); } renderhead(response) { // init textfield with hint response.renderondomreadyscript(var e=document.getelementbyid('+getcomponent.getmarkupid()+'); e.value='+hint.getobject()+';e.style['color']='gray';); } oncomponenttag(tag) { tag.put(onfocus, if (this.value='+hint.getobject()+') { this.value=''; this.style['color']='black;'}); } } then just textfield.add(new hint(new modelstring(search))); -igor On Fri, May 9, 2008 at 4:25 PM, nate roe [EMAIL PROTECTED] wrote: How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to implement hint text in a TextField?
In Component, do you mean? I see onRender(MarkupStream) .. do I need to find the after component part by using the MarkupStream? Thank you, Nate On Fri, May 9, 2008 at 4:51 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: 1.2 doesnt have it, so just override onrenderaftercomponent and do it there -igor On Fri, May 9, 2008 at 4:50 PM, nate roe [EMAIL PROTECTED] wrote: Hrm. The IHeaderResponse interface is new in 1.3 but for a little while longer I must use Wicket 1.2. How does one accomplish response.renderOnDomReadyScript() in 1.2? I don't see any method similar to renderOnDomReadyScript on the Response class. Thanks! Nate On Fri, May 9, 2008 at 4:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i havent had to do this but something like this might work: class hint extends abstractbehavior { private final imodelstring hint; onbind(component c) { c.setoutputmarkupid(true); } ondetach() { hint.detach(); super.ondetach(); } renderhead(response) { // init textfield with hint response.renderondomreadyscript(var e=document.getelementbyid('+getcomponent.getmarkupid()+'); e.value='+hint.getobject()+';e.style['color']='gray';); } oncomponenttag(tag) { tag.put(onfocus, if (this.value='+hint.getobject()+') { this.value=''; this.style['color']='black;'}); } } then just textfield.add(new hint(new modelstring(search))); -igor On Fri, May 9, 2008 at 4:25 PM, nate roe [EMAIL PROTECTED] wrote: How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to implement hint text in a TextField?
i meant in the behavior. does it have something like rendered() or afterrender() ? somewhere so you can do getcomponent().getresponse().write(script.../script); -igor On Fri, May 9, 2008 at 5:02 PM, nate roe [EMAIL PROTECTED] wrote: In Component, do you mean? I see onRender(MarkupStream) .. do I need to find the after component part by using the MarkupStream? Thank you, Nate On Fri, May 9, 2008 at 4:51 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: 1.2 doesnt have it, so just override onrenderaftercomponent and do it there -igor On Fri, May 9, 2008 at 4:50 PM, nate roe [EMAIL PROTECTED] wrote: Hrm. The IHeaderResponse interface is new in 1.3 but for a little while longer I must use Wicket 1.2. How does one accomplish response.renderOnDomReadyScript() in 1.2? I don't see any method similar to renderOnDomReadyScript on the Response class. Thanks! Nate On Fri, May 9, 2008 at 4:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i havent had to do this but something like this might work: class hint extends abstractbehavior { private final imodelstring hint; onbind(component c) { c.setoutputmarkupid(true); } ondetach() { hint.detach(); super.ondetach(); } renderhead(response) { // init textfield with hint response.renderondomreadyscript(var e=document.getelementbyid('+getcomponent.getmarkupid()+'); e.value='+hint.getobject()+';e.style['color']='gray';); } oncomponenttag(tag) { tag.put(onfocus, if (this.value='+hint.getobject()+') { this.value=''; this.style['color']='black;'}); } } then just textfield.add(new hint(new modelstring(search))); -igor On Fri, May 9, 2008 at 4:25 PM, nate roe [EMAIL PROTECTED] wrote: How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to implement hint text in a TextField?
Oh, yeah I see IBehavior.rendered(Component) that is called when the component has been rendered. Great, thanks a lot! Nate On Fri, May 9, 2008 at 5:04 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i meant in the behavior. does it have something like rendered() or afterrender() ? somewhere so you can do getcomponent().getresponse().write(script.../script); -igor On Fri, May 9, 2008 at 5:02 PM, nate roe [EMAIL PROTECTED] wrote: In Component, do you mean? I see onRender(MarkupStream) .. do I need to find the after component part by using the MarkupStream? Thank you, Nate On Fri, May 9, 2008 at 4:51 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: 1.2 doesnt have it, so just override onrenderaftercomponent and do it there -igor On Fri, May 9, 2008 at 4:50 PM, nate roe [EMAIL PROTECTED] wrote: Hrm. The IHeaderResponse interface is new in 1.3 but for a little while longer I must use Wicket 1.2. How does one accomplish response.renderOnDomReadyScript() in 1.2? I don't see any method similar to renderOnDomReadyScript on the Response class. Thanks! Nate On Fri, May 9, 2008 at 4:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i havent had to do this but something like this might work: class hint extends abstractbehavior { private final imodelstring hint; onbind(component c) { c.setoutputmarkupid(true); } ondetach() { hint.detach(); super.ondetach(); } renderhead(response) { // init textfield with hint response.renderondomreadyscript(var e=document.getelementbyid('+getcomponent.getmarkupid()+'); e.value='+hint.getobject()+';e.style['color']='gray';); } oncomponenttag(tag) { tag.put(onfocus, if (this.value='+hint.getobject()+') { this.value=''; this.style['color']='black;'}); } } then just textfield.add(new hint(new modelstring(search))); -igor On Fri, May 9, 2008 at 4:25 PM, nate roe [EMAIL PROTECTED] wrote: How would one implement hint text on a text field in Wicket? By hint text I mean an empty TextField has greyed out text in it to indicate its purpose, and gets cleared onFocus?) Thanks, Nate Roe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Weird form behavior
Hi, I am observing really weird form behavior. See code below. For some reason the quantity and the checkbox for each item in the view is only updated the first time I submit the form. Second time onwards in the SubmitLink.onSubmit() I dont get updated form field values. Have spent hours moving things around without success. // Cart Form Form cartForm = new Form(cartForm); add(cartForm); // Shipping Options Panel final Panel shippingOptionsPanel = new ShippingOptionsPanel(shippingOptionsPanel); cartForm.add(shippingOptionsPanel); // Cart Header Toolbar WebMarkupContainer headerToolbar = new WebMarkupContainer(cartHeaderToolbar); cartForm.add(headerToolbar); headerToolbar.add(new BookmarkablePageLink(continueShopping, HomePage.class)); SubmitLink updateCartLink = new SubmitLink(updateCartLink, cartForm) { public static final long serialVersionUID = 1L; @Override public void onSubmit() { ShoppingCartWorkerEx.modifyCart(_cartItemValueObjList, true, true); _cartItemValueObjList = ShoppingCartWorkerEx.getCartItemsValueObjsFromSession(); // Refresh the page only if there are no items in cart if (ShoppingCartWorkerEx.getShoppingCart().size() == 0) setResponsePage(new ViewCartPage()); else { shippingOptionsPanel.modelChanged(); LOG.info( Update cart link using the same page); } } }; headerToolbar.add(updateCartLink); updateCartLink.add(new OfbizImage(updateCartImage)); headerToolbar.add(new CheckoutButton(checkoutButton, new ResourceModel(CartForm.checkoutButton))); // Show Cart Items final DataView cartItemView = new DataView(cartItemView, new ListDataProvider(_cartItemValueObjList)) { public static final long serialVersionUID = 1L; @Override protected void populateItem(Item item) { CartItemValueObj formCartItem = (CartItemValueObj)item.getModelObject(); item.setModel(new CompoundPropertyModel(formCartItem)); item.add(new Label(index, new Model(item.getIndex()+1)).setRenderBodyOnly(true)); PopupSettings popupSettings = new PopupSettings(PageMap.forName(popupPageMap), PopupSettings.SCROLLBARS|PopupSettings.RESIZABLE).setHeight(400).setWidth(400); Link productLink = new BookmarkablePageLink(productLink, NoNavProductDetailPage.class, new PageParameters(productId= + formCartItem.getProductId() + , popup=true)).setPopupSettings(popupSettings); productLink.add(new Label(name)); item.add(productLink); item.add(new FormComponentFeedbackBorder(quantityBorder). add(new TextField(quantity).setRequired(true).setLabel(new Model(Quantity)) .add(NumberValidator.minimum(1; item.add(new CurrencyLabel(itemSubTotal)); item.add(new CheckBox(markedForRemove)); } @Override protected Item newItem(String id, int index, IModel model) { return new OddEvenItem(id, index, model); } }; cartForm.add(cartItemView); -- View this message in context: http://www.nabble.com/Weird-form-behavior-tp17158833p17158833.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice throws IllegalArgumentException with Integer values
On Fri, May 09, 2008 at 03:39:07PM -0700, Michael Mehrle wrote: I like your solution, but you are using an IntegerSelectChoice as your model, which won't work for me. I need to set my model to a regular Integer since that's what's being persisted on the backend. Michael Quite right. I really don't like the idea of SelectChoice (a view-related class) in a business model. Try this, Michael... public MyBusinessClass { private int period; // getter/setter omitted for clarity } MyBusinessClass myObject = // blah List periods = Arrays.asList(new Integer[] { 1, 7, 14, 30, 365 }); new DropDownChoice(period, new PropertyModel(myObject, period), periods, new ChoiceRenderer() { public String getDisplayValue(Object object) { int period = ((Integer) object).intValue(); switch (period) { case 1: return Day; case 7: return Week; case 14: return Fortnight; case 30: return Month; case 365: return Year; default: throw new RuntimeException(); } } } ); If like me you have to localize all your strings, it becomes even simpler... new DropDownChoice(period, new PropertyModel(myObject, period), periods, new ChoiceRenderer() { public String getDisplayValue(Object object) { return getString(period_ + object.toString()); } } ); ...then in your properties file... period_1=Day period_7=Week # ...and so on jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
You can get at the underlying Integer by calling getKey() on the IntegerSelectChoice object the model holds. If that doesn't work, you'll have to figure out an alternative on your own. The good news is that you have working code to start from. -Doug Michael Mehrle wrote: I like your solution, but you are using an IntegerSelectChoice as your model, which won't work for me. I need to set my model to a regular Integer since that's what's being persisted on the backend. Michael -- View this message in context: http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-with-Integer-values-tp17139227p17159082.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
Thanks for the input, John - but I the plot thickens here. It seems that there is actually a Wicket bug that needs to get fixed. After a lot of tinkering I figured out why I was getting this error. The VERY FIRST TIME my renderer is being called it actually calls getIdValue() with an Integer, not with the Object that I'm using. In my debugger I saw the same method being called with different object types (Integer and IntegerSelectChoice). Take a look at my (obviously silly, but working) work around: /* Manages the display/id value for our dropdown choices. */ private class CountChoiceRenderer implements IChoiceRenderer { /** * Get the display value from the SelectChoice (what the user sees) * * @param object a SelectChoice object * @return display */ @Todo(comment = Replace Object with T once Wicket incl. generics is available ) public String getDisplayValue(Object object) { return ((IntegerSelectChoice)object).getDisplay(); } /** * Get key value (what is returned from the browser) * * @param object a SelectChoice object * @param index not used * @return object.getKeyAsString() */ @Todo(comment = Replace Object with T once Wicket incl. generics is available ) public String getIdValue(Object object, int index) { String result = A; if (object instanceof Integer) { // WICKET BUG!!! LOG.debug(Integer returned); } else { result = ((IntegerSelectChoice)object).getKeyAsString(); } return result; } } Now, it works, but only because I'm forcing my renderer to omit the case when it's being called with an Integer. My log gets hit four times and there are four dropdowns of that type in my panel. Very weird stuff going on here. Of course there's a chance that I screwed something up, but I have been over my code with a fine toothed comb and everything looks clean. I'm only using IntegerSelectChoice for populating my DropDownChoice, never Integers directly. Michael -Original Message- From: John Krasnay [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 6:27 PM To: users@wicket.apache.org Subject: Re: DropDownChoice throws IllegalArgumentException with Integer values On Fri, May 09, 2008 at 03:39:07PM -0700, Michael Mehrle wrote: I like your solution, but you are using an IntegerSelectChoice as your model, which won't work for me. I need to set my model to a regular Integer since that's what's being persisted on the backend. Michael Quite right. I really don't like the idea of SelectChoice (a view-related class) in a business model. Try this, Michael... public MyBusinessClass { private int period; // getter/setter omitted for clarity } MyBusinessClass myObject = // blah List periods = Arrays.asList(new Integer[] { 1, 7, 14, 30, 365 }); new DropDownChoice(period, new PropertyModel(myObject, period), periods, new ChoiceRenderer() { public String getDisplayValue(Object object) { int period = ((Integer) object).intValue(); switch (period) { case 1: return Day; case 7: return Week; case 14: return Fortnight; case 30: return Month; case 365: return Year; default: throw new RuntimeException(); } } } ); If like me you have to localize all your strings, it becomes even simpler... new DropDownChoice(period, new PropertyModel(myObject, period), periods, new ChoiceRenderer() { public String getDisplayValue(Object object) { return getString(period_ + object.toString()); } } ); ...then in your properties file... period_1=Day period_7=Week # ...and so on jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DropDownChoice throws IllegalArgumentException with Integer values
I used some of your stuff but ran into a suspected 1.3.3 Wicket bug (see previous message I just sent out). Thanks for the help - go and enjoy your weekend. Michael -Original Message- From: Doug Donohoe [mailto:[EMAIL PROTECTED] Sent: Friday, May 09, 2008 6:41 PM To: users@wicket.apache.org Subject: RE: DropDownChoice throws IllegalArgumentException with Integer values You can get at the underlying Integer by calling getKey() on the IntegerSelectChoice object the model holds. If that doesn't work, you'll have to figure out an alternative on your own. The good news is that you have working code to start from. -Doug Michael Mehrle wrote: I like your solution, but you are using an IntegerSelectChoice as your model, which won't work for me. I need to set my model to a regular Integer since that's what's being persisted on the backend. Michael -- View this message in context: http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-wit h-Integer-values-tp17139227p17159082.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice throws IllegalArgumentException with Integer values
On Fri, May 09, 2008 at 06:42:11PM -0700, Michael Mehrle wrote: Thanks for the input, John - but I the plot thickens here. It seems that there is actually a Wicket bug that needs to get fixed. After a lot of tinkering I figured out why I was getting this error. The VERY FIRST TIME my renderer is being called it actually calls getIdValue() with an Integer, not with the Object that I'm using. In my debugger I saw the This isn't a bug. The integer is coming from your business model. DropDownChoice calls getIdValue() with this value so it can pre-select the correct option based on your current business object value. I'll try explaining this again. Maybe this time it will click. You give a DDC a model and a list of possible values. The type of object returned by the model and the type of objects in the list *must* be the same. You've already mentioned that your model returns an Integer, so you *must* pass a list of Integers, not IntegerSelectChoice or anything else. If you want to display something different than the integer, you have to implement some custom code in ChoiceRenderer.getDisplayValue(). Don't get hung up on the idea that the value returned has to be a property of the objects in your list. It can be anything, such as the getString(period_ + object.toString()) in my example. You are probably used to a Model2 framework like Struts, where you have to create lists of key/value pair objects to render selects. No need for such an artificial structure in Wicket. Is the light coming on yet? jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice throws IllegalArgumentException with Integer values
And thats why i think the wiki example is a bad one. It points people in the wrong way. On 5/10/08, John Krasnay [EMAIL PROTECTED] wrote: On Fri, May 09, 2008 at 06:42:11PM -0700, Michael Mehrle wrote: Thanks for the input, John - but I the plot thickens here. It seems that there is actually a Wicket bug that needs to get fixed. After a lot of tinkering I figured out why I was getting this error. The VERY FIRST TIME my renderer is being called it actually calls getIdValue() with an Integer, not with the Object that I'm using. In my debugger I saw the This isn't a bug. The integer is coming from your business model. DropDownChoice calls getIdValue() with this value so it can pre-select the correct option based on your current business object value. I'll try explaining this again. Maybe this time it will click. You give a DDC a model and a list of possible values. The type of object returned by the model and the type of objects in the list *must* be the same. You've already mentioned that your model returns an Integer, so you *must* pass a list of Integers, not IntegerSelectChoice or anything else. If you want to display something different than the integer, you have to implement some custom code in ChoiceRenderer.getDisplayValue(). Don't get hung up on the idea that the value returned has to be a property of the objects in your list. It can be anything, such as the getString(period_ + object.toString()) in my example. You are probably used to a Model2 framework like Struts, where you have to create lists of key/value pair objects to render selects. No need for such an artificial structure in Wicket. Is the light coming on yet? jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ModalWindow / zindex
I think that is hardcoded, make a patch/jira issue On 5/9/08, Doug Leeper [EMAIL PROTECTED] wrote: Is there a way to programatically change the zindex for the modalwindow? I am having issue where the ModalWindow is being placed behind images on my page (actually behind an iframe). I search in this forum but I have tried several suggestions but they didn't work. -- View this message in context: http://www.nabble.com/ModalWindow---zindex-tp17154922p17154922.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageParameters request-for-enhancement
I will look at it this weekend On 5/9/08, Doug Donohoe [EMAIL PROTECTED] wrote: What is the likelihood that we can get this patch included in the next 1.4 milestone? Again, I'll repeat my offer to submit it myself if given commit access. I updated the JIRA issue with the API javadoc to show what I added. -Doug Doug Donohoe wrote: I created https://issues.apache.org/jira/browse/WICKET-1596 and submitted a patch with test cases. I'd be happy to commit if given commit access if that is easier. Perhaps my work on wicketstuff-annotation demonstrates my attention to detail in code and documentation. Thanks, -Doug Eelco Hillenius wrote: Hi, You can best file an RFE in JIRA for things like this. The list is primarily for questions and discussions, and adding it to JIRA will at least make sure it stays on the list of things to look at. Cheers, Eelco On Thu, Apr 24, 2008 at 3:00 PM, Doug Donohoe [EMAIL PROTECTED] wrote: Hi Wicket team: I'd like to be able to call getInt(name, default) and not have to worry about catching exceptions. If the number can't be parsed, just return the default. I have a utility method which I use: public static int getInt(PageParameters params, String name, int def) { try { return params.getInt(name, def); } catch (StringValueConversionException ignored) { return def; } } Basically for my bookmarkable pages, I don't care if a user mucks with the URL - this would let me default to something reasonable. It would be nice if there were a comparable method on PageParameters ... like getIntSafe(name, def) or some something similar (and for other number-based getters). In addition, it would be nice to have a getInteger() object method that returns null if not defined or an Integer object. The way it is now, I have to pick a default value that I assume won't ever be valid (usually -1). There are valid use cases where null is an expected value. -Doug -Doug -- View this message in context: http://www.nabble.com/PageParameters-request-for-enhancement-tp16853545p16853545.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/PageParameters-request-for-enhancement-tp16853545p17152141.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]