Re: Compoundpropertymodel with shadow map?
If you dont want to use an original object why not just clone/create a copy of the original end use that and then copy the values over again? (i think beanutils or something van do that for you) On 11/18/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Hi Im trying todo a compoundpropertymodel which does not change original values in the original model. I need this since I am updating some stuff in a wizard but I first want to commit when the user confirms in the end of the wizard, and if the model are changed directly the transaction are automatically committed to the database So my idea were to todo a shadowCompoundPropertyModel something like this: class EditorModel extends CompoundPropertyModel { private Map newValues=new HashMapString, Object(); public EditorModel(CompoundPropertyModel underlyingModel, String propertyName) { super(underlyingModel); } public getObject (String property){ check if there are something in the map if so return it, otherwise fall back to the underlying model } public setObject (String prop, Value){ put changes in the map... } public UpdateOriginal(){ iterate over the map and use reflection to set values on the original model.. } } Does anybody have something similar floating around, in a more complete state..? Or could it be done in a easier way? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - 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: Properties file
Thanks a lot, Cemal. As always, you gave me a quick and brilliant answer. I tried your first solution, and it works as a charm. However, i wonder if there is a way to overload this properties file according to the deployment environment (typically, i will have a file named MyApplication.properties, another MyApplication.test.properties, and a 3rd MyApplication.prod.properties) ? Landry 2008/11/20 jWeekend [EMAIL PROTECTED] Landry, If your properties are application wide, create MyApplication.properties (assuming you called your WebApplication subclass MyApplication) in the same package as your MyApplication class and use getString if you have a Component (or subclass, like a Page) to talk to, otherwise use Applicaion.get().getResourceSettings().getLocalizer().getString ... Regards - Cemal http://www.jWeekend.co.uk http://www.jweekend.co.uk/ http://jWeekend.co.uk http://jweekend.co.uk/ landry soules wrote: Hello, i have a question about properties files : I want to access several variables residing in a property file, from various components of my application. What is the best way to achieve this trivial need ? Do you guys use Commons Configuration, or another api ? How do you configure it to work with Wicket ? Is there an example somewhere ? I know my question sounds dumb, but in my previous job we used an home made api to achieve this... Thanks in advance ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Properties-file-tp20610610p20611147.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: Compoundpropertymodel with shadow map?
True, this is also what I am thinking about doing... Johan Compagner wrote: If you dont want to use an original object why not just clone/create a copy of the original end use that and then copy the values over again? (i think beanutils or something van do that for you) On 11/18/08, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Hi Im trying todo a compoundpropertymodel which does not change original values in the original model. I need this since I am updating some stuff in a wizard but I first want to commit when the user confirms in the end of the wizard, and if the model are changed directly the transaction are automatically committed to the database So my idea were to todo a shadowCompoundPropertyModel something like this: class EditorModel extends CompoundPropertyModel { private Map newValues=new HashMapString, Object(); public EditorModel(CompoundPropertyModel underlyingModel, String propertyName) { super(underlyingModel); } public getObject (String property){ check if there are something in the map if so return it, otherwise fall back to the underlying model } public setObject (String prop, Value){ put changes in the map... } public UpdateOriginal(){ iterate over the map and use reflection to set values on the original model.. } } Does anybody have something similar floating around, in a more complete state..? Or could it be done in a easier way? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - 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] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Check a checkbox when focus on a textbox
You probably want to call your checker function on the onkeypressed event instead of the onfocus event. But none of this is the wicket way! With wicket you can use an AjaxFormComponentUpdatingBehavior(onkeypressed) on the text field which updates your model and rerender the checkbox. //Swanthe vishy_sb wrote: Hi all, I have a textbox and a checkbox in a form on my web page. I would like to automatically check the checkbox when the user starts to type something in the textbox. I believe this can be done by using some javascript. I did some research over the web and was able to find some code which is shown below. However I was not able to get it to work. HTML code: input name=containText TYPE=text size = 32 onfocus=checker('contain') / input type = checkbox name = contain / Javascript code: function checker(checkbox) { var checkBox=document.form.contain; checkBox.checked = true; } Any help will be greatly appreciated. Thanks a lot Cheers, vishy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Properties file
I think you could use setStyle of Session object with a text test, prod. And rename your files into MyApplication.properties (default when you dont set the style), MyApplication_test.properties(when style = test) and MyApplication_prod.properties (when style=prod) Regards, Srikanth NT - http://ntsrikanth.blogspot.com/ -- View this message in context: http://www.nabble.com/Properties-file-tp20610610p20617707.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]
WicketTester and inmethod grid
Cheers Im trying to test our wicket app with WicketTester and it works fine, but now when I try to test the EditableTreeGrid from inmethod Ive run into some problems. I want o add values to my cells but I dont know what the id's are. So is there a way to do this? Here is a bit of our implementation: private void addGrid(){ ListIGridColumn columns = new ArrayListIGridColumn(); columns.add(new EditablePropertyColumn(new Model(Article number), userObject.m_artNr)); columns.add(new EditablePropertyColumn(new Model(Name), userObject.m_articleName)); m_rootNode = new DefaultMutableTreeNode(new InvoiceRowModelBean(0)); TreeModel model = new DefaultTreeModel(m_rootNode); m_grid = new TreeGrid(grid, model, columns); m_grid.setOutputMarkupId(true); m_grid.getTree().getTreeState().expandNode(m_rootNode); add(m_grid); } -- View this message in context: http://www.nabble.com/WicketTester-and-inmethod-grid-tp20618304p20618304.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]
Composite input components not updating model
Hi Thank you all for an incredibly helpful mailing list and a great framework My problem is this I have a form that gets submitted with an ajax button On the form I have a couple of composite input components. I followed the example in the book Wicket in action (sample chapter 8) to create the components. But when I submit the form and theres no validation error, the form submits fine, and all is well. But if there are errors (example: number out of range) and I fix these and submit a second time my components' convertInput() method is not called and onError() on my AjaxButton is called every time, even if I fixed the input. Also my FeedbackPanel does not go away when the error is fixed, I do target.addComponent(feedback); on the buttons' onError() and onSubmit() but as I said onSubmit() never gets called, only onError() Thanks in advance Frans -- View this message in context: http://www.nabble.com/Composite-input-components-not-updating-model-tp20618646p20618646.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]
datatable and access to toolbars
Hello, i have a question about the toolbars in the DataTable component. my use case is this : i want to embed a small editor in a bottom toolbar.Its a simple ok / cancel panel. I see that there no access to the 'bottomToolbars' variable in the DataTable its private and final and has no accessors. Plus theres no way i can replace a toolbar, if i try table.get(DataTable.TOOLBAR_COMPONENT_ID) the result is null, another approach is table.replace(new EditToolbar(table)); - which outputs an error: org.apache.wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='toolbar'... My guess is that this is because of the DataTable#addToolbar method: toolbar.setRenderBodyOnly(true); .. I have no workaround for this , except to drop the toolbars and start new with some panels. My question is if theres a reason toolbars are hidden away from the user, theres no clear way of working with them, except to initialise, and them let them be. btw i am using wicket 1.3.4 thanks, Alex
mount outside init
Hi! I'm building an application where I want to set variation and other settings determined by the path lets say a user request myapplication/customer1 I want to mount /customer1 to Base.class. I can do this in init by what if I add another customer via admin. How can I mount /customer2 outside of the init method of the wicket application class? Another question would be to keep the /customer1 or /customer2 in every request so if I call setResponsePage( new Login() ) then I would like to keep /customer1/login. Any suggestions? -- View this message in context: http://www.nabble.com/mount-outside-init-tp20619679p20619679.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: Properties file
This is a good way to achieve the required effect. If you have a custom session you could set the style in the constructor. You could also check some system variable (passed in to the JVM with the -D switch on the command line) so you don't have to recompile your app every time you want to switch mode. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Srikanth.NT wrote: I think you could use setStyle of Session object with a text test, prod. And rename your files into MyApplication.properties (default when you dont set the style), MyApplication_test.properties(when style = test) and MyApplication_prod.properties (when style=prod) Regards, Srikanth NT -- View this message in context: http://www.nabble.com/Properties-file-tp20610610p20620313.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: mount outside init
Do you really have different Pages (= Classes) for each customer? If not, then just mount the customer page with e.g. IndexedParamUrlCodingStrategy, add the customer name to the PageParameters and retrieve it then in the pages constructor. e.g. PageParameters params = new PageParameters(); params.put(0, customer.getName()); setResponsePage(CustomerPage.class, params) -- will be /customer/customerOneName and then in the pageconstructor final String customerName = params.getString(0); makes sense? michael Mathias P.W Nilsson wrote: Hi! I'm building an application where I want to set variation and other settings determined by the path lets say a user request myapplication/customer1 I want to mount /customer1 to Base.class. I can do this in init by what if I add another customer via admin. How can I mount /customer2 outside of the init method of the wicket application class? Another question would be to keep the /customer1 or /customer2 in every request so if I call setResponsePage( new Login() ) then I would like to keep /customer1/login. Any suggestions? - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/mount-outside-init-tp20619679p20620259.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: Compoundpropertymodel with shadow map?
Ok great.. Seems like SerializationHelper.clone and just a normal compound model could work.. Francisco Diaz Trepat - gmail wrote: Don't know, but LOL. This might be an instancing issue in which special handling is good for this scenario but seems to be fine for most cases. And in a lazy TDD programming way it might be good enough. Although I know from blog and other threads that you look for greatness :-) and not just code that works. Which is very inspiring now a days, in this business hour of programming history. I'll ask arround though, I think I might know someone who might know, and also is not my mother... f(t) On Thu, Nov 20, 2008 at 6:26 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: I love simple and simple is good. But this approach has issues with hibernate if your hibernate sessions are per request and your shadowmodel lives in multiple requests and your entities has references to other entities for example 1..* etc ... In simple use cases, and possibly also when not using hibernate this might be fine. This is what I am exploring currently. When not attending seminars or talking with people.. Im wondering how eclipselink openJPA handles the hibernate lazy load problem, according to a oracle guy theres not a problem when using Toplink (which now are eclipselink?) Input on these things are very welcome... regards Nino Francisco Diaz Trepat - gmail wrote: why? simple is good. doesn't need to be complex. what part you dislike the most? f(t) On Thu, Nov 20, 2008 at 2:29 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: BTW this is a flawed approch.. We need something a little more intelligent.. I'll return on the subject.. Nino Saturnino Martinez Vazquez Wael wrote: heres the raw and completely untested version of it. probably with a whole bunch of issues...: package zeuzgroup.web.model; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import org.apache.wicket.Component; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.model.AbstractPropertyModel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.IWrapModel; public class EditorModelT extends CompoundPropertyModelT { private final MapString, Object newValues = new HashMapString, Object(); public EditorModel(IModelT underlyingModel) { super(underlyingModel); } public void fillOriginal() { Class? c = this.getObject().getClass(); for (EntryString, Object entry : newValues.entrySet()) { try { Field t = c.getDeclaredField(entry.getKey()); t.set(this.getObject(), entry.getValue()); } catch (Exception e) { throw new WicketRuntimeException(Could not set + entry.getKey(), e); } } } public C IWrapModelC wrapOnInheritance(Component component) { return new AttachedCompoundPropertyModelC(component, newValues); } private class AttachedCompoundPropertyModelC extends AbstractPropertyModelC implements IWrapModelC { private static final long serialVersionUID = 1L; private final Component owner; private final MapString, Object newValues; /** * Constructor * * @param owner *component that this model has been attached to */ public AttachedCompoundPropertyModel(Component owner, MapString,Object map) { super(EditorModel.this); this.owner = owner; this.newValues = map; } @Override public C getObject() { if (EditorModel.this.newValues.containsKey(owner.getId())) { return (C) newValues.get(owner.getId()); } else { return super.getObject(); } } @Override public void setObject(C object) { newValues.put(owner.getId(), object); } /** * @see org.apache.wicket.model.AbstractPropertyModel#propertyExpression() */ @Override protected String propertyExpression() { return EditorModel.this.propertyExpression(owner); } /** * @see org.apache.wicket.model.IWrapModel#getWrappedModel() */ public IModelT getWrappedModel() { return EditorModel.this; } /** * @see org.apache.wicket.model.AbstractPropertyModel#detach() */ @Override public void detach() { super.detach(); EditorModel.this.detach(); } } } // IComponentAssignedModel / IWrapModel Francisco Diaz Trepat - gmail wrote:
Re: Composite input components not updating model
Hahaa... Ive sorted it out... My stupid mistake... I have my own implementation of Session and override the cleanupFeedbackMessages() but did not implement anything in it, so my messages remained in the session, and buggered everything up Thanks fstof wrote: Hi Thank you all for an incredibly helpful mailing list and a great framework My problem is this I have a form that gets submitted with an ajax button On the form I have a couple of composite input components. I followed the example in the book Wicket in action (sample chapter 8) to create the components. But when I submit the form and theres no validation error, the form submits fine, and all is well. But if there are errors (example: number out of range) and I fix these and submit a second time my components' convertInput() method is not called and onError() on my AjaxButton is called every time, even if I fixed the input. Also my FeedbackPanel does not go away when the error is fixed, I do target.addComponent(feedback); on the buttons' onError() and onSubmit() but as I said onSubmit() never gets called, only onError() Thanks in advance Frans -- View this message in context: http://www.nabble.com/Composite-input-components-not-updating-model-tp20618646p20620917.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]
Thank you for wicketstuff-annotation!
I recently encountered the wicketstuff-annotation project, and now mount all my pages via annotations. Thank you for this project! Gets a lot of Page configuration out of the Application subclass and back to where it should be. After seeing the mount scanner, I was very pleased to note that the same approach would solve another issue I have. In my Application subclass I always have a list of annotated Hibernate classes that need to be added to the AnnotationConfiguration. While in heavy development, I'm adding new domain objects all the time, and frequently forget to add them to this list, adding up to lots of minor frustrations. But not any more - using the MatchingResources class from wicketstuff-annotations, seven lines of code solved that one for good: MatchingResources resources = new MatchingResources(classpath*:uk/co/mypackagestructure/data/**/*.class); ListClass? extends Annotation hibernateClasses = new ArrayListClass? extends Annotation(); hibernateClasses.add(Entity.class); hibernateClasses.add(MappedSuperclass.class); for(Class? extends Annotation hibernateClass : hibernateClasses) { for(Class? c : resources.getAnnotatedMatches(hibernateClass)) { config.addAnnotatedClass(c); } } Hurrah! Charlie.
Re: mount outside init
Yes it make sence but I would not want a pair here. I would like http//sub.domain.com/customer1 not http//sub.domain.com/customer/customer1 -- View this message in context: http://www.nabble.com/mount-outside-init-tp20619679p20620631.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: Very custom URL mapping
If wicket cannot do it, try http://tuckey.org/urlrewrite/ 2008/11/19 Leszek Gawron [EMAIL PROTECTED]: Hello I would like to achieve the following url space: / redirects to /form /form - home page with a from /form?something - followup of a home page's form /resources/*.css /resources/*.jpg - resources served from webapp root/resources /id - SomePage with id in PageParamters I know it would be a lot easier if I could do /somePage/id but unfortunately the requirement is different. How can I achieve something like this without rewritng 90% of wicket's url matching logic ? lg -- Leszek Gawron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- WBR, kan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mount outside init
I think you can have the homepage handle that for you. As Micheal said, you can use Index url strategy on the home page class. So when you access the http://sub.domain.com/, HomePage.class will know that no parameter is passed. And if http://sub.domain.com/customer1 is accessed, then HomePage.class can get the value customer1 as parameter. I hope it makes sense. Mathias P.W Nilsson wrote: Yes it make sence but I would not want a pair here. I would like http//sub.domain.com/customer1 not http//sub.domain.com/customer/customer1 - http://ntsrikanth.blogspot.com/ -- View this message in context: http://www.nabble.com/mount-outside-init-tp20619679p20621477.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: mount outside init
I can't get this to work. IF I do /customer1 then wicket tries to find a mount with this. -- View this message in context: http://www.nabble.com/mount-outside-init-tp20619679p20621876.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 1.3.5 behind a front-end proxy
Maybe this is related to servlet mapping? http://cwiki.apache.org/WICKET/best-practices-and-gotchas.html#BestPracticesandGotchas-WicketServletMapping Roman Anton Veretennikov schrieb: To get Apache 2.2 to proxy around Wicket, I have the following defined: IfDefine PROXY ProxyPass / http://localhost:8080/cware/ ProxyPassReverse/ http://localhost:8080/cware/ ProxyPassReverseCookieDomainlocalhost .laccetti.com ProxyPassReverseCookiePath /cware / /IfDefine Nothing special required in the web.xml, Tomcat doesn't know that it is being proxied, etc. HTH, Mike My configuration is about the same. ServerAlias wicket.ru ProxyPass /stats/ ! ProxyPass /webmail/ ! ProxyPass /lxadmin/ ! ProxyPass / ajp://localhost:8858/WicketRu/ ProxyPassReverse / ajp://localhost:8858/WicketRu/ ProxyPassReverseCookiePath /WicketRu / Only AJP protocol is different, cookies work OK - domain and path are set correctly, session id is not generated again after every GET. I'll repeat the problem: Application is WicketRu. It works correctly when accessed through full URL. Alias is wicket.ru http://wicket.ru opens. But links don't work. wicket.ru on the top is a Link with onClick() and setResponsePage(Index.class). Click on it shows 404 with ***strange*** ***double WicketRu. I think something wrong with relative path. Wicket 1.3.5 Tony. - 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: datatable and access to toolbars
see #addbottomtoolbar() -igor On Fri, Nov 21, 2008 at 2:57 AM, Alex Parvulescu [EMAIL PROTECTED] wrote: Hello, i have a question about the toolbars in the DataTable component. my use case is this : i want to embed a small editor in a bottom toolbar.Its a simple ok / cancel panel. I see that there no access to the 'bottomToolbars' variable in the DataTable its private and final and has no accessors. Plus theres no way i can replace a toolbar, if i try table.get(DataTable.TOOLBAR_COMPONENT_ID) the result is null, another approach is table.replace(new EditToolbar(table)); - which outputs an error: org.apache.wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='toolbar'... My guess is that this is because of the DataTable#addToolbar method: toolbar.setRenderBodyOnly(true); .. I have no workaround for this , except to drop the toolbars and start new with some panels. My question is if theres a reason toolbars are hidden away from the user, theres no clear way of working with them, except to initialise, and them let them be. btw i am using wicket 1.3.4 thanks, Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dojo 1.1 integration available from wicketstuff
Hi folks, I just shared a new project called wicketstuff-dojo-1.1 [1], an integration of the Dojo JavaScript toolkit [2] into Wicket. This project is based on wicketstuff-dojo [3] and wicketstuff-push [4] (both based on dojo 0.4). However, not all of the components from wicketstuff-dojo have been ported to the new dojo version (but feel free to do so). Currently, there is no documentation available. I'll add some info to the wicketstuff wiki next week. In the meantime, (really) early adopters can check it out for review. To build the project, check it out and run `mvn clean install`. To build a custom dojo distribution, place your profile.profile.js (e.g. foobar.profile.js) in buildDojo/custom-profile/ and run `mvn -Ddojo.profile=profile clean install`. In your project pom, add dependency groupIdorg.wicketstuff/groupId artifactIdwicketstuff-dojo-1.1/artifactId version1.3.5-standard-SNAPSHOT/version /dependency or, for the custom profile dependency groupIdorg.wicketstuff/groupId artifactIdwicketstuff-dojo-1.1/artifactId version1.3.5-profile-SNAPSHOT/version /dependency (Not sure if this versioning strategy is the best choice, but it makes it quite easy to use different custom profiles for different projects) Looking forward to your feedback! Regards, Stefan [1] https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-dojo-1.1/ [2] http://dojotoolkit.org/ [3] http://wicketstuff.org/confluence/display/STUFFWIKI/WicketStuff+Dojo [4] https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-push/ - --- Stefan Fußenegger http://talk-on-tech.blogspot.com // looking for a nicer domain ;) -- View this message in context: http://www.nabble.com/Dojo-1.1-integration-available-from-wicketstuff-tp20625220p20625220.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: wicketstuff-push is over, wickestuff-dojo-1.1 is born ???
see http://www.nabble.com/Dojo-1.1-integration-available-from-wicketstuff-to20625220.html Michael Sparer wrote: Hi Julien, we're doing our last tests today and tomorrow and will put wicketstuff-dojo-1.1 into production by Monday. If no issues arise, we'll share it as a wicketstuff project next week. Please note that so far, we only ported some components to 1.1. (includes wiper, slider, drag and drop and cometd). We're also making extensive use of cometd, which is quite a bit better than in dojo 0.4 by the way, and it is also included in the wicketstuff-dojo-1.1 project then. Then it's your turn to give recommendations, improvements and, most important, help to get the same functionality working for 1.1. as for the corrupted push project: rodolfo made some changes, so I don't know what's going on there. A version of wicketstuff-push before rodolfo started with the makeover is available as a branch. Just check out wicketstuff's branches, if you can't wait till next week. regards, Michael julien Graglia wrote: Hi, I have read some posts (1) that seems to say that wicketstuff-push will be replaced by a new wicketstuff-dojo-1.1 artifact. The post says that this artifact is in a private SVN repo, but will be available shortly.. Do you have any informations about that? I need to do reverse ajax with wicket (cometd...) ie. push event from a server thread at the server initiative. It works with an old (rev 4245) version of wicketstuff-push. The trunk seems corrupted : a dojo folder is missing.. 1 : http://www.nabble.com/New-wicketstuff-dojo-project-td19070145.html -- Julien Graglia NetCeler - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - --- Stefan Fußenegger http://talk-on-tech.blogspot.com // looking for a nicer domain ;) -- View this message in context: http://www.nabble.com/wicketstuff-push-is-over%2C-wickestuff-dojo-1.1-is-born-tp20356751p20625246.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]
Wicket 1.4m3 and Javascript
hello list, I try the following: In the Java-file I have a list of key/value pairs(coming from database), and I want to feed out the values of the props to js-Array like: String js=array = new Array(; for (int i = 0; i props.size(); i++) { XProperties p = (XProperties) props.get(i); String propvalue = p.getValue(); js +=\ + propvalue + \; if(i==props.size()-1) {} else { js +=,; } } js +=);; How can I give this over to the HTML? Html-file: script language=javascript here I want the String to come out like e.g. var array=new Array(value1, value2, value3); I am sure that someone here uses this, but I am lost in google, nabble and wicketversions. greetings - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory consumption per session
Yes, each of the list items contains 10 child components, and all models are detached correctly. So the 2 KB per list item seem to be normal. We have not finally identified the large sessions as the root cause of the server crashes, but the 2 MB sessions caught our eyes immediately. One of our heap dumps showed 10.000 session with a total amount of 300 MB, which makes an average of 30 KB. Most of the 10.000 sessions are probably not sessions by human visitors, but may instead result from search engine robots, where each request creates a new session. Ralf. Johan Compagner wrote: No if you really render 1000 rows (list items) in a list view ands those listitems have textfields or labels again then yes it could expand quite a lot But 1000 listems with maybe 4,5 components in each listitem then that will be 5000 components on just that page that will cost memory On 11/20/08, Jeremy Thomerson [EMAIL PROTECTED] wrote: That was only after he cut the listview sizes - problem is that his sessions are 2MB now. Still should support quite a few (1000 = 2GB), but there is probably a memory issue to address there. On Thu, Nov 20, 2008 at 9:20 AM, Johan Compagner [EMAIL PROTECTED]wrote: 200kb per session sounds very reasonable. Then you should be able to handle quite a lot of concurrent sessions. What kind of hardware do you use? On 11/20/08, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. -- Ralf Siemon IT Tel 0561-820126-631 Fax 0561-820126-601 [EMAIL PROTECTED] Firmensitz Verwaltung: Gourmondo GmbH - Joseph-Dollinger-Bogen 9 - 80807 München Versandzentrum und Kundenservice: Gourmondo GmbH - Falderbaumstraße 12 - 34123 Kassel Geschäftsführung: Pascal Zier Registergericht: München Handelsregister: HRB 175597 USt-ID: DE232650271 http://www.gourmondo.de - einfach mehr genießen ++ Entdecken Sie den neuen Gourmondo-Shop: http://www.gourmondo.de ++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory consumption per session
Thanks for the advice. Unfortunately we cannot do this here, because the ListViews contain Link components for user interaction. Actually I was wondering why it is necessary to keep all of the list items in the session when the next time the page is rendered the list items are regenerated according to the underlying model of the ListView. The first thing I tried was removing all list items after the page was rendered - which I am not allowed. Then, after I studied the wicket sources, I tried a weird hack and wrote a replacement for ListView which added the list items as auto components. This worked, but unfortunately the links did not work anymore, because there were no link components on the page left ... Ralf. Igor Vaynberg wrote: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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: Memory consumption per session
On Fri, Nov 21, 2008 at 9:18 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Thanks for the advice. Unfortunately we cannot do this here, because the ListViews contain Link components for user interaction. you can generate a link yourself easily, let your custom listview implement ILinkListener and call urlfor(ILinkListener.INTERFACE) on the component which will generate the url. than append the id to it and you are done. This worked, but unfortunately the links did not work anymore, because there were no link components on the page left ... ^ and now you know why the items are kept :) Ralf. Igor Vaynberg wrote: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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]
Re: Memory consumption per session
Martin, There's no xml dom generator. Instead, Wicket uses a simple stream. In the rendering phase, you can execute getResponse().write(...) to write anything to the browser. --Cristiano On Thu, Nov 20, 2008 at 2:11 PM, Martin Makundi [EMAIL PROTECTED] wrote: What is the out-of-the-box xml dom generator for wicket, if I wanted to use such tool for generating the html structure? ** Martin 2008/11/20 Martijn Dashorst [EMAIL PROTECTED]: add(new Label(raw, h1Foo/h1).setEscapeModelStrings(false)); On Thu, Nov 20, 2008 at 5:00 PM, Martin Makundi [EMAIL PROTECTED] wrote: What is the easiest way of embedding raw html (yes, it could/should use some xml dom which is included with wicket)? Is it possible, for example, to replace a wicket:container/ element on a panel with such raw dom content? ** Martin 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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] -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.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: Memory consumption per session
Would it help using Bookmarkable links? ** Martin 2008/11/21 Igor Vaynberg [EMAIL PROTECTED]: On Fri, Nov 21, 2008 at 9:18 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Thanks for the advice. Unfortunately we cannot do this here, because the ListViews contain Link components for user interaction. you can generate a link yourself easily, let your custom listview implement ILinkListener and call urlfor(ILinkListener.INTERFACE) on the component which will generate the url. than append the id to it and you are done. This worked, but unfortunately the links did not work anymore, because there were no link components on the page left ... ^ and now you know why the items are kept :) Ralf. Igor Vaynberg wrote: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory consumption per session
yes, if you only use bookmarkable links you can remove items after they render. but like i said, component frameworks are not really made to handle modelling repeaters with 10K rows. each component has overhead, so when you are trying to render 10K*~10 components per row you end up with 100K components. in these (extremely rare cases) you should drop down to using raw html to eliminate component overhead so instead of 100K components you only have one. you have to do a bit more work yourself, but at least you still retain encapsulation. -igor On Fri, Nov 21, 2008 at 9:39 AM, Martin Makundi [EMAIL PROTECTED] wrote: Would it help using Bookmarkable links? ** Martin 2008/11/21 Igor Vaynberg [EMAIL PROTECTED]: On Fri, Nov 21, 2008 at 9:18 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Thanks for the advice. Unfortunately we cannot do this here, because the ListViews contain Link components for user interaction. you can generate a link yourself easily, let your custom listview implement ILinkListener and call urlfor(ILinkListener.INTERFACE) on the component which will generate the url. than append the id to it and you are done. This worked, but unfortunately the links did not work anymore, because there were no link components on the page left ... ^ and now you know why the items are kept :) Ralf. Igor Vaynberg wrote: if you are planning on displaying 1000 rows per page, which is quiet uncommon for webapps, you should produce output as raw html instead of using listview and adding components inside. -igor On Thu, Nov 20, 2008 at 7:15 AM, Ralf Siemon [EMAIL PROTECTED] wrote: Hi, we have recently launched our new Wicket-based website, and now we are experiencing that the memory consumption of the website is very high, so that it crashes the site regularly. When profiling the application server, we found out that there are HTTP sessions that consume up to 2 MB of memory, mostly because there are very large ListViews with up to 1000 entries, where each entry consumes about 2 KB. Our preliminary solution is to limit the size of those ListViews to a maximum of 50 entries, but even in those cases the session size is still at about 200 KB, which seems quite large to us. I know that there have already been some discussions about memory consumption in Wicket due to the fact that the whole Page object of the last visited page is stored in the session; but what I'd like to know is: Have you experienced session sizes in a comparable magnitude, or are we doing something wrong? Or is this something we have to live with when using Wicket? We are using Wicket 1.3.5. Thanks, Ralf. - 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] - 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]
ListView model is CompoundPropertyModelListMyObject
ListView model is CompoundPropertyModelListMyObject And when I populate items such what: protected void populateItem(final ListItemSaleTransfer item) { item.add(new Label(fullName)); } I getting error: WicketMessage: The expression 'fullName' is neither an index nor is it a method or field for the list class java.util.ArrayList Why ListView doesn't set appropriate item's model to items? -- WBR, kan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView model is CompoundPropertyModelListMyObject
item's model needs to be compound, not listview's -igor On Fri, Nov 21, 2008 at 9:45 AM, kan [EMAIL PROTECTED] wrote: ListView model is CompoundPropertyModelListMyObject And when I populate items such what: protected void populateItem(final ListItemSaleTransfer item) { item.add(new Label(fullName)); } I getting error: WicketMessage: The expression 'fullName' is neither an index nor is it a method or field for the list class java.util.ArrayList Why ListView doesn't set appropriate item's model to items? -- WBR, kan. - 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]
Set the HTML id programmatically
I am usign this version of Wicket: 1.3.5 1- I would like to override an id for a TextArea programmatically textarea wicket:id=description id=toOverride name=description rows=10 cols=50 /textarea 2- In my java code I tried this method TextArea description = new TextArea(description); description.setMarkupId(myDescription); form.add(description); 3- But it's not setting anything... Here is the generated HTML textarea cols=50 rows=10 wicket:id=description name=description id=toOverride/textarea :confused: Question: Is it possible to override the id programatically. Because it would be usefull in my integration between YUI and Wicket... -- View this message in context: http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.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: Set the HTML id programmatically
Have you tried using setMarkupId()? On Fri, Nov 21, 2008 at 3:08 PM, Martin Letendre [EMAIL PROTECTED] wrote: I am usign this version of Wicket: 1.3.5 1- I would like to override an id for a TextArea programmatically textarea wicket:id=description id=toOverride name=description rows=10 cols=50 /textarea 2- In my java code I tried this method TextArea description = new TextArea(description); description.setMarkupId(myDescription); form.add(description); 3- But it's not setting anything... Here is the generated HTML textarea cols=50 rows=10 wicket:id=description name=description id=toOverride/textarea :confused: Question: Is it possible to override the id programatically. Because it would be usefull in my integration between YUI and Wicket... -- View this message in context: http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.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]
RES: Set the HTML id programmatically
AttributeModifier does not work? -Mensagem original- De: Martin Letendre [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 21 de novembro de 2008 18:09 Para: users@wicket.apache.org Assunto: Set the HTML id programmatically I am usign this version of Wicket: 1.3.5 1- I would like to override an id for a TextArea programmatically textarea wicket:id=description id=toOverride name=description rows=10 cols=50 /textarea 2- In my java code I tried this method TextArea description = new TextArea(description); description.setMarkupId(myDescription); form.add(description); 3- But it's not setting anything... Here is the generated HTML textarea cols=50 rows=10 wicket:id=description name=description id=toOverride/textarea :confused: Question: Is it possible to override the id programatically. Because it would be usefull in my integration between YUI and Wicket... -- View this message in context: http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.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] *** Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas. Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Set the HTML id programmatically
Sorry, didn't see that second point there. Disregard On Fri, Nov 21, 2008 at 3:18 PM, James Carman [EMAIL PROTECTED] wrote: Have you tried using setMarkupId()? On Fri, Nov 21, 2008 at 3:08 PM, Martin Letendre [EMAIL PROTECTED] wrote: I am usign this version of Wicket: 1.3.5 1- I would like to override an id for a TextArea programmatically textarea wicket:id=description id=toOverride name=description rows=10 cols=50 /textarea 2- In my java code I tried this method TextArea description = new TextArea(description); description.setMarkupId(myDescription); form.add(description); 3- But it's not setting anything... Here is the generated HTML textarea cols=50 rows=10 wicket:id=description name=description id=toOverride/textarea :confused: Question: Is it possible to override the id programatically. Because it would be usefull in my integration between YUI and Wicket... -- View this message in context: http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.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: Set the HTML id programmatically
The attributeModifier behavior should do the trick. description.add(new AttributeModifier(id, true, myDescription)); See here http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/AttributeModifier.htmlfor mor details. Marc-Andre On Fri, Nov 21, 2008 at 3:19 PM, Bruno Cesar Borges [EMAIL PROTECTED] wrote: AttributeModifier does not work? -Mensagem original- De: Martin Letendre [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 21 de novembro de 2008 18:09 Para: users@wicket.apache.org Assunto: Set the HTML id programmatically I am usign this version of Wicket: 1.3.5 1- I would like to override an id for a TextArea programmatically textarea wicket:id=description id=toOverride name=description rows=10 cols=50 /textarea 2- In my java code I tried this method TextArea description = new TextArea(description); description.setMarkupId(myDescription); form.add(description); 3- But it's not setting anything... Here is the generated HTML textarea cols=50 rows=10 wicket:id=description name=description id=toOverride/textarea :confused: Question: Is it possible to override the id programatically. Because it would be usefull in my integration between YUI and Wicket... -- View this message in context: http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.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] *** Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas. Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Set the HTML id programmatically
also need to call setoutputmarkupid(true) -igor On Fri, Nov 21, 2008 at 12:08 PM, Martin Letendre [EMAIL PROTECTED] wrote: I am usign this version of Wicket: 1.3.5 1- I would like to override an id for a TextArea programmatically textarea wicket:id=description id=toOverride name=description rows=10 cols=50 /textarea 2- In my java code I tried this method TextArea description = new TextArea(description); description.setMarkupId(myDescription); form.add(description); 3- But it's not setting anything... Here is the generated HTML textarea cols=50 rows=10 wicket:id=description name=description id=toOverride/textarea :confused: Question: Is it possible to override the id programatically. Because it would be usefull in my integration between YUI and Wicket... -- View this message in context: http://www.nabble.com/Set-the-HTML-id-programmatically-tp20628692p20628692.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]
Authorization and authentication
I'm trying to use the build-in authentication and authorization stuff of Wicket (1.4-rc1), as demonstrated on the examples page: http://wicketstuff.org/wicket13/index.html (there does not appear to be a http://wicketstuff.org/wicket14/index.html). However I can not see org.apache.wicket.authorization.strategies.role.Roles nor the entire package org.apache.wicket.authentication. It looks like it's part of the Wicket core, so I am going to guess this is due to changes between 1.3 and 1.4-rc1 which I am currently running up against. Is there an up-to-date example somewhere, has it been factored into the WASP/SWARM stuff or am I simply doing something wrong? Thanks in advance, /Casper -- View this message in context: http://www.nabble.com/Authorization-and-authentication-tp20629077p20629077.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: Usage of getString with parameters (model?)
A small addition, if anyone encounters this situation. After trying the new Model[]{bla}, it still didn't work for me. Looking at the code (Ernesto ;) ), I saw in PropertyVariableInterpolator.interpolate(...) that it is looking for a ${ mark. So in my properties file I had to change to be: Reports.ReportTitle.SuspectedConnectionsUserRes = Suspected User-Resource Connections by ${0} Pattern Report (The $ was missing before). Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Tue, Nov 18, 2008 at 1:00 PM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Hi Eyal, If you open the Component class you will see a method: public String getString(final String key, final Component component, final IModel? model, final String defaultValue) throws MissingResourceException { } which finds a localizer... an Localizer after locating the key calls to : public String substitutePropertyExpressions(final Component component, final String string, final IModel? model) { if ((string != null) (model != null)) { return PropertyVariableInterpolator.interpolate(string, model.getObject()); } return string; } if you look into the code of PropertyVariableInterpolator you will see it delegates to PropertyResolver for variable sustitution. So, I would guess something like: getString(Reports.ReportTitle.SuspectedConnectionsUserRes, new ModelObject(new Object[]{bla}); will produce: Suspected User-Resource Connections by bla Pattern Report You could also use: 1- Suspected User-Resource Connections by {bla} Pattern Report 2- A bean class class MyBean { String bla = bla; } 3- and getString(Reports.ReportTitle.SuspectedConnectionsUserRes, new ModelMyBean(new MyBean()); with the same result. Don't be afraid of looking into Wicket''s source code;-) A quick search in google also shows me the following link http://day-to-day-stuff.blogspot.com/2008/05/wicket-internationalization.html Best, Ernesto On Tue, Nov 18, 2008 at 11:21 AM, Eyal Golan [EMAIL PROTECTED] wrote: Hi, I have a key in the property file: Reports.ReportTitle.SuspectedConnectionsUserRes = Suspected User-Resource Connections by {0} Pattern Report I want to use getString(Reports.ReportTitle.SuspectedConnectionsUserRes, SOMETHING); to get the value with the {0} substituted. I'm not sure how to do this. Please advise, thanks Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary
Make FeedbackMessages#add(FeedbackMessage) public?
Greetings! Is there any reason why FeedbackMessages#add(FeedbackMessage) is package private? I'd like to be able to just stick a FeedbackMessage directly in my Session rather than having to call add(Component, String, int), info(...), error(...), warn(...), fatal(...) or debug(...). Alternatively, but probably more disruptive, could the signature of the add, info, warn, fatal and debug methods be changed from taking a String object to taking a Serializable, like the error method does? This would achieve what I am looking for. Basically, I have a javascript FeedbackPanel which works on a subclass of FeedbackMessage. I wrap my javascript foo as the serializable object in the FeedbackMessage. This works great for all component feedback, but I came across a case where I'd like to stick a feedback message in my session for events such as the first visit to a page, for example, and this message kind of falls outside the standard feedback levels. I'd like to be able to manually create my js message, wrap it in a FeedbackMessage and stick it in the session. If there is a better suggestion, I'd be open to that, too! Thanks! Regards, Matt. -- Matthew Rollins Hanlon http://squareoftwo.org _ Hanlon's Razor: Never attribute to malice that which can be adequately explained by stupidity. http://wikipedia.org/wiki/Hanlon's_razor
Re: Authorization and authentication
It never was part of core. It's in wicket-auth-roles. On Fri, Nov 21, 2008 at 3:36 PM, Casper Bang [EMAIL PROTECTED] wrote: I'm trying to use the build-in authentication and authorization stuff of Wicket (1.4-rc1), as demonstrated on the examples page: http://wicketstuff.org/wicket13/index.html (there does not appear to be a http://wicketstuff.org/wicket14/index.html). However I can not see org.apache.wicket.authorization.strategies.role.Roles nor the entire package org.apache.wicket.authentication. It looks like it's part of the Wicket core, so I am going to guess this is due to changes between 1.3 and 1.4-rc1 which I am currently running up against. Is there an up-to-date example somewhere, has it been factored into the WASP/SWARM stuff or am I simply doing something wrong? Thanks in advance, /Casper -- View this message in context: http://www.nabble.com/Authorization-and-authentication-tp20629077p20629077.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]
How to use Validatable to check all cells in a table?
Hi, I have a DataTable and most cells are AjaxEditableLabel. These labels have IValidator's attached, and validate as soon as you finish typing in them. How do I run one big validation of all cells in my table? I need to kick it off programmatically. I think the solution involves Validatable, but I don't know how to do the iteration over all cells properly. Thanks! James -- View this message in context: http://www.nabble.com/How-to-use-%22Validatable%22-to-check-all-cells-in-a-table--tp20631861p20631861.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: How to use Validatable to check all cells in a table?
I haven't used AjaxEditableLabel, but I would suspect that if you put your table in your form and added a FeedbackPanel to your form, a submit (or AjaxSubmit) would do your validation and display errors in the feedback panel (assuming like you said that you have validators added to the editable labels). On Fri, Nov 21, 2008 at 6:31 PM, metalotus [EMAIL PROTECTED] wrote: Hi, I have a DataTable and most cells are AjaxEditableLabel. These labels have IValidator's attached, and validate as soon as you finish typing in them. How do I run one big validation of all cells in my table? I need to kick it off programmatically. I think the solution involves Validatable, but I don't know how to do the iteration over all cells properly. Thanks! James -- View this message in context: http://www.nabble.com/How-to-use-%22Validatable%22-to-check-all-cells-in-a-table--tp20631861p20631861.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] -- Jeremy Thomerson http://www.wickettraining.com
Re: ListView model is CompoundPropertyModelListMyObject
How to get appropriate item model inside populateItem method? Why ListView cannot do it automatically? 2008/11/21 Igor Vaynberg [EMAIL PROTECTED]: item's model needs to be compound, not listview's -igor On Fri, Nov 21, 2008 at 9:45 AM, kan [EMAIL PROTECTED] wrote: ListView model is CompoundPropertyModelListMyObject And when I populate items such what: protected void populateItem(final ListItemSaleTransfer item) { item.add(new Label(fullName)); } I getting error: WicketMessage: The expression 'fullName' is neither an index nor is it a method or field for the list class java.util.ArrayList Why ListView doesn't set appropriate item's model to items? -- WBR, kan. - 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] -- WBR, kan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView model is CompoundPropertyModelListMyObject
There's a few ways: - Use PropertyListView - or override ListView and return return new CompoundPropertyModelT(super.getListItemModel(model, index)); (which is what the PropertyListView does) - or put this on your first line: item.setModel(new CompoundPropertyModel(item.getModel()) -- Jeremy Thomerson http://www.wickettraining.com On Fri, Nov 21, 2008 at 8:38 PM, kan [EMAIL PROTECTED] wrote: How to get appropriate item model inside populateItem method? Why ListView cannot do it automatically? 2008/11/21 Igor Vaynberg [EMAIL PROTECTED]: item's model needs to be compound, not listview's -igor On Fri, Nov 21, 2008 at 9:45 AM, kan [EMAIL PROTECTED] wrote: ListView model is CompoundPropertyModelListMyObject And when I populate items such what: protected void populateItem(final ListItemSaleTransfer item) { item.add(new Label(fullName)); } I getting error: WicketMessage: The expression 'fullName' is neither an index nor is it a method or field for the list class java.util.ArrayList Why ListView doesn't set appropriate item's model to items? -- WBR, kan. - 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] -- WBR, kan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket 1.4m3 and Javascript
You could use TextTemplateHeaderContributor jt On Fri, Nov 21, 2008 at 10:56 AM, Herbert Winter [EMAIL PROTECTED]wrote: hello list, I try the following: In the Java-file I have a list of key/value pairs(coming from database), and I want to feed out the values of the props to js-Array like: String js=array = new Array(; for (int i = 0; i props.size(); i++) { XProperties p = (XProperties) props.get(i); String propvalue = p.getValue(); js +=\ + propvalue + \; if(i==props.size()-1) {} else { js +=,; } } js +=);; How can I give this over to the HTML? Html-file: script language=javascript here I want the String to come out like e.g. var array=new Array(value1, value2, value3); I am sure that someone here uses this, but I am lost in google, nabble and wicketversions. greetings - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jeremy Thomerson http://www.wickettraining.com
Passing simple data between java code and the template
Hi, I have some Javascript code in one of my pages. I want to keep this JS in the template file. However, this JS has a variable whose value is derived from a page parameter. For example, Is there a way I can do something like, ${value} in the template file and have the actual value be substituted by wicket? What is the best practice to have simple values substituted in templates? Thanks, Vinayak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: datatable and access to toolbars
Hi Alex, We had a similar situation. We want a bottom toolbar that has a drop down for selection of number of rows in a page. After a while another requirement was added: add links that open a popup window to change columns in the table and another one to open a popup for filtering the table. I wanted to add them both to the bottom toolbar. As Igor said, we use addBottomToolbar. Our table inherits from DataTable (not DefaultDataTable) because we changed also the top toolbars. Here's the code in the customized data table: addBottomToolbar(new NoRecordsToolbar(this)); addBottomToolbar(new CustomizedBottomTableToolbar(this, rowsPerPage, popupWindowsModel, showSelectRecordsPerPage)); The NoRecordToolbar is from Wicket. CustomizedBottomToolbar inherits from AbstractToolbar. Here's the HTML for the toolbar, the java code is normal with no special features: wicket:panel tr td wicket:id=span class=select-number-recordsspan style=float: left; vertical-align: bottom; span wicket:id=modalsLinksList a href=# wicket:id=modalLinkspan wicket:id=modalText[Link Text]/span/a /span /span label wicket:id=pagingLabel /label select wicket:id=pagingSelect /select/td /tr /wicket:panel Hope that helps. Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Fri, Nov 21, 2008 at 5:49 PM, Igor Vaynberg [EMAIL PROTECTED]wrote: see #addbottomtoolbar() -igor On Fri, Nov 21, 2008 at 2:57 AM, Alex Parvulescu [EMAIL PROTECTED] wrote: Hello, i have a question about the toolbars in the DataTable component. my use case is this : i want to embed a small editor in a bottom toolbar.Its a simple ok / cancel panel. I see that there no access to the 'bottomToolbars' variable in the DataTable its private and final and has no accessors. Plus theres no way i can replace a toolbar, if i try table.get(DataTable.TOOLBAR_COMPONENT_ID) the result is null, another approach is table.replace(new EditToolbar(table)); - which outputs an error: org.apache.wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='toolbar'... My guess is that this is because of the DataTable#addToolbar method: toolbar.setRenderBodyOnly(true); .. I have no workaround for this , except to drop the toolbars and start new with some panels. My question is if theres a reason toolbars are hidden away from the user, theres no clear way of working with them, except to initialise, and them let them be. btw i am using wicket 1.3.4 thanks, Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]