Re: Two wicket apps
Any ideas on it? Yet another question. In my admin application I want to have a link show client screens. The link must follow to the main site with a client already signed it (in other words the WebSession, but from different app is set to hold chosen client id). What is a way to do it? -- WBR, kan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feature idea: sealed flag on MarkupContainer
Wouldn't it be more powerful to override / hook into the process of adding a component of a container? Something like that ... new WebMarkupContainer(id) { @Override public void onComponentAdd(Component child) { // check the sealed flag, decorate the child, throw exception, or do [whatever] } } Am 20.11.2008 um 05:25 schrieb John Krasnay: Hi folks, In my current Wicket app I have a panel that contains a vertically stacked list of sub-panels. Because the precise list of sub-panels is not known until runtime, I've implemented this with a RepeatingView. My parent panel has the following methods that I use to build the list of sub-panels (rv is my RepeatingView instance): public void addSubPanel(Panel subPanel) { rv.add(subPanel); } public String newSubPanelId() { return rv.newChildId(); } I use this same pattern in a number of other instances such as menus and button bars. The problem is that I often mistakenly call add instead of addSubPanel, which of course fails at render time with an exception that I always find hard to decipher. It would be nice if there was a way to seal a MarkupContainer once I had populated it such that any subsequent call to add, remove, or replace would fail immediately with an exception. This would make it much easier to find out where I had made the mistake. Does anyone else think this would be a worthwhile feature? 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]
page refresh cleans my page state
Hi, I am using wicket. I have a page with one links which increase the counter value based on user click on the link, for all these actions I am using Ajax. For instance user click 5 times on link the counter shows value 5. It is ok but if I click on browsers refresh button all changes are lost and it shows the counter value 0 instead of 5. How to handle the refresh button? Please find the code below. TestPage.java import org.apache.wicket.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; public class TestPage extends WebPage { public TestPage(PageParameters parameters) { super(parameters); final ModelInteger modell = new ModelInteger(new Integer(0)); // Slik at telleverdien legges i session setDefaultModel(modell); final Label telleLabel = new Label(teller, modell); telleLabel.setOutputMarkupId(true); final Label hashcodeLabel = new Label(hashcode, new IModelString() { private static final long serialVersionUID = 1L; public String getObject() { return String.valueOf(System.identityHashCode(TestPage.this)); } public void setObject(String object) { /* NOOP */ } public void detach() { /* NOOP */ } }); hashcodeLabel.setOutputMarkupId(true); add(telleLabel); add(new AjaxLinkInteger(link, modell) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { // Øk det delte modellobjektet Integer tall = getModelObject(); int verdi = tall.intValue() + 1; tall = new Integer(verdi); setModelObject(tall); // Fortell klienten hvilken komponent som skal oppdateres target.addComponent(telleLabel); target.addComponent(hashcodeLabel); } }); add(hashcodeLabel); add(new AjaxCheckBox(versioned, new ModelBoolean(Boolean.TRUE)) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { setVersioned(this.getModelObject().booleanValue()); } }); setVersioned(true); } } TestApplication.java import org.apache.wicket.Page; import org.apache.wicket.Request; import org.apache.wicket.Response; import org.apache.wicket.Session; import org.apache.wicket.protocol.http.WebApplication; public class TestApplication extends WebApplication { @Override public Class? extends Page getHomePage() { return TestPage.class; } } TestPage.html html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org/; !-- Basis-side som inneholder navigasjonssti -- head titleTestside/title /head body a href=# style=font: bold 12pt 'Arial' wicket:id=link+/anbsp;span wicket:id=teller0/span p class=portlet-fontDenne portleten har hashCode lik b wicket:id=hashcode34563/b./p p class=portlet-fontinput type=checkbox class=portlet-form-field wicket:id=versioned span class=portlet-form-labelVersjonert/span/p /body /html Please suggest me the way how to handle the refresh button problem. Please do the needful. Med vennlig hilsen MUKESH SINGH CAPGEMINI Consultant Arrive AS T (+47) 46 47 90 16 E-post: [EMAIL PROTECTED] http://servicedesk.arrive.no
Re: page refresh cleans my page state
store the value on the session? make it a static member variable or store it at application level? it all depends on what you want: the value to change independently for each user or be the same for all users... Ernesto On Thu, Nov 20, 2008 at 11:30 AM, Singh Mukesh [EMAIL PROTECTED] wrote: Hi, I am using wicket. I have a page with one links which increase the counter value based on user click on the link, for all these actions I am using Ajax. For instance user click 5 times on link the counter shows value 5. It is ok but if I click on browsers refresh button all changes are lost and it shows the counter value 0 instead of 5. How to handle the refresh button? Please find the code below. TestPage.java import org.apache.wicket.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; public class TestPage extends WebPage { public TestPage(PageParameters parameters) { super(parameters); final ModelInteger modell = new ModelInteger(new Integer(0)); // Slik at telleverdien legges i session setDefaultModel(modell); final Label telleLabel = new Label(teller, modell); telleLabel.setOutputMarkupId(true); final Label hashcodeLabel = new Label(hashcode, new IModelString() { private static final long serialVersionUID = 1L; public String getObject() { return String.valueOf(System.identityHashCode(TestPage.this)); } public void setObject(String object) { /* NOOP */ } public void detach() { /* NOOP */ } }); hashcodeLabel.setOutputMarkupId(true); add(telleLabel); add(new AjaxLinkInteger(link, modell) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { // Øk det delte modellobjektet Integer tall = getModelObject(); int verdi = tall.intValue() + 1; tall = new Integer(verdi); setModelObject(tall); // Fortell klienten hvilken komponent som skal oppdateres target.addComponent(telleLabel); target.addComponent(hashcodeLabel); } }); add(hashcodeLabel); add(new AjaxCheckBox(versioned, new ModelBoolean(Boolean.TRUE)) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { setVersioned(this.getModelObject().booleanValue()); } }); setVersioned(true); } } TestApplication.java import org.apache.wicket.Page; import org.apache.wicket.Request; import org.apache.wicket.Response; import org.apache.wicket.Session; import org.apache.wicket.protocol.http.WebApplication; public class TestApplication extends WebApplication { @Override public Class? extends Page getHomePage() { return TestPage.class; } } TestPage.html html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org/; !-- Basis-side som inneholder navigasjonssti -- head titleTestside/title /head body a href=# style=font: bold 12pt 'Arial' wicket:id=link+/anbsp;span wicket:id=teller0/span p class=portlet-fontDenne portleten har hashCode lik b wicket:id=hashcode34563/b./p p class=portlet-fontinput type=checkbox class=portlet-form-field wicket:id=versioned span class=portlet-form-labelVersjonert/span/p /body /html Please suggest me the way how to handle the refresh button problem. Please do the needful. Med vennlig hilsen MUKESH SINGH CAPGEMINI Consultant Arrive AS T (+47) 46 47 90 16 E-post: [EMAIL PROTECTED] http://servicedesk.arrive.no
Re: Wicket 1.3.5 behind a front-end proxy
Resolved. Hosting provider did something. Thank you all. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Generics changes in 1.4-rc1
Hi, I've been using m3 for a while and just tried switching to rc1. I found several problems: - LabelTree.getNodeTextModel requires IModel and returns IModel. I was overriding it and returning a ModelString, but I can't do that anymore. Why not just return IModel? ? - RatingPanel now requires an IModelInteger for the rating, but I was using IModelDouble. How can I show rated 3.6 from 7 votes now? Can it use IModel? extends Number instead? - BaseTree requires IModelTreeModel; I was using a Model with a DefaultTreeModel object, but I can't do that anymore (TreeModel is not necessarily Serializable). Why not just require IModel? extends TreeModel ? Adrian -- View this message in context: http://www.nabble.com/Generics-changes-in-1.4-rc1-tp20599173p20599173.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: Feature idea: sealed flag on MarkupContainer
Yeah, I thought about that. The problem is add() is usually called from a component's constructor, so you would have a case of a constructor (indirectly) calling a non-final method, jk On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote: Wouldn't it be more powerful to override / hook into the process of adding a component of a container? Something like that ... new WebMarkupContainer(id) { @Override public void onComponentAdd(Component child) { // check the sealed flag, decorate the child, throw exception, or do [whatever] } } Am 20.11.2008 um 05:25 schrieb John Krasnay: Hi folks, In my current Wicket app I have a panel that contains a vertically stacked list of sub-panels. Because the precise list of sub-panels is not known until runtime, I've implemented this with a RepeatingView. My parent panel has the following methods that I use to build the list of sub-panels (rv is my RepeatingView instance): public void addSubPanel(Panel subPanel) { rv.add(subPanel); } public String newSubPanelId() { return rv.newChildId(); } I use this same pattern in a number of other instances such as menus and button bars. The problem is that I often mistakenly call add instead of addSubPanel, which of course fails at render time with an exception that I always find hard to decipher. It would be nice if there was a way to seal a MarkupContainer once I had populated it such that any subsequent call to add, remove, or replace would fail immediately with an exception. This would make it much easier to find out where I had made the mistake. Does anyone else think this would be a worthwhile feature? 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feature idea: sealed flag on MarkupContainer
I was thinking about something like this: [warning, sketchy pseudo code will follow] method org.apache.wicket.MarkupContainer.add(Component... children) : - call empty overridable method onComponentAdd(Component child) for each component - add component protected void onComponentAdd(Component child) { /* overridable */ } Am 20.11.2008 um 12:30 schrieb John Krasnay: Yeah, I thought about that. The problem is add() is usually called from a component's constructor, so you would have a case of a constructor (indirectly) calling a non-final method, jk On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote: Wouldn't it be more powerful to override / hook into the process of adding a component of a container? Something like that ... new WebMarkupContainer(id) { @Override public void onComponentAdd(Component child) { // check the sealed flag, decorate the child, throw exception, or do [whatever] } } Am 20.11.2008 um 05:25 schrieb John Krasnay: Hi folks, In my current Wicket app I have a panel that contains a vertically stacked list of sub-panels. Because the precise list of sub-panels is not known until runtime, I've implemented this with a RepeatingView. My parent panel has the following methods that I use to build the list of sub-panels (rv is my RepeatingView instance): public void addSubPanel(Panel subPanel) { rv.add(subPanel); } public String newSubPanelId() { return rv.newChildId(); } I use this same pattern in a number of other instances such as menus and button bars. The problem is that I often mistakenly call add instead of addSubPanel, which of course fails at render time with an exception that I always find hard to decipher. It would be nice if there was a way to seal a MarkupContainer once I had populated it such that any subsequent call to add, remove, or replace would fail immediately with an exception. This would make it much easier to find out where I had made the mistake. Does anyone else think this would be a worthwhile feature? 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] - 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: DateTimeField - changing the format of the date
Hey guys Thanks for the help, but I found the solution. Its so easy. :D The DateTimeField class has a method called newDateTextField(PropertyModel model, String id). All that I did was override this method as follows: DateTimeField dateToField = new DateTimeField(dateToField, new PropertyModel(this, dateTo)) { @Override public Locale getLocale() { return new Locale(en); } @Override protected DateTextField newDateTextField(String id,PropertyModel dateFieldModel) { return DateTextField.forDatePattern(id, dateFieldModel,dd/MM/); } }; Regards, Yazeed Isaacs -Original Message- From: Yazeed Isaacs [mailto:[EMAIL PROTECTED] Sent: 19 November 2008 10:47 AM To: users@wicket.apache.org Subject: DateTimeField - changing the format of the date Hi I would like to change the format of the default displayed date MM/dd/yy to dd/MM/ when using the DateTimeField. I cannot find any resource online that shows how this is implemented. Is this even possible? Yazeed Isaacs - Java Developer [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]
Display two modal windows in one request
Hi *, i'm facing a problem i couldn't solve until now. Our base page contain an modal error window which is used to present the occurred error. Now i added a password request modal window on a page. If an error occurred after clicking the request button i would like to display the error window over the request window. If i click the close button on error window this should disappear but the request window should stay. But the error window disappears immidiatly ( 1sec). The request window stays. After i clicked the request button again the request window gets closed. Is there a solution for that issue? I've tried the example (multiple windows) but there are used pages and cookies for displaying (it seems to be to heavy for me). thanks 4 help Per -- View this message in context: http://www.nabble.com/Display-two-modal-windows-in-one-request-tp20600479p20600479.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: page refresh cleans my page state
Singh, Take a look at http://cwiki.apache.org/WICKET/url-coding-strategies.html HybridUrlCodingStrategy . Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Singh Mukesh wrote: Hi, I am using wicket. I have a page with one links which increase the counter value based on user click on the link, for all these actions I am using Ajax. For instance user click 5 times on link the counter shows value 5. It is ok but if I click on browsers refresh button all changes are lost and it shows the counter value 0 instead of 5. How to handle the refresh button? Please find the code below. TestPage.java import org.apache.wicket.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; public class TestPage extends WebPage { public TestPage(PageParameters parameters) { super(parameters); final ModelInteger modell = new ModelInteger(new Integer(0)); // Slik at telleverdien legges i session setDefaultModel(modell); final Label telleLabel = new Label(teller, modell); telleLabel.setOutputMarkupId(true); final Label hashcodeLabel = new Label(hashcode, new IModelString() { private static final long serialVersionUID = 1L; public String getObject() { return String.valueOf(System.identityHashCode(TestPage.this)); } public void setObject(String object) { /* NOOP */ } public void detach() { /* NOOP */ } }); hashcodeLabel.setOutputMarkupId(true); add(telleLabel); add(new AjaxLinkInteger(link, modell) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { // Øk det delte modellobjektet Integer tall = getModelObject(); int verdi = tall.intValue() + 1; tall = new Integer(verdi); setModelObject(tall); // Fortell klienten hvilken komponent som skal oppdateres target.addComponent(telleLabel); target.addComponent(hashcodeLabel); } }); add(hashcodeLabel); add(new AjaxCheckBox(versioned, new ModelBoolean(Boolean.TRUE)) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { setVersioned(this.getModelObject().booleanValue()); } }); setVersioned(true); } } TestApplication.java import org.apache.wicket.Page; import org.apache.wicket.Request; import org.apache.wicket.Response; import org.apache.wicket.Session; import org.apache.wicket.protocol.http.WebApplication; public class TestApplication extends WebApplication { @Override public Class? extends Page getHomePage() { return TestPage.class; } } TestPage.html html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org/; !-- Basis-side som inneholder navigasjonssti -- head titleTestside/title /head body # + nbsp;0 p class=portlet-fontDenne portleten har hashCode lik 34563./p p class=portlet-fontinput type=checkbox class=portlet-form-field wicket:id=versioned Versjonert/p /body /html Please suggest me the way how to handle the refresh button problem. Please do the needful. Med vennlig hilsen MUKESH SINGH CAPGEMINI Consultant Arrive AS T (+47) 46 47 90 16 E-post: [EMAIL PROTECTED] http://servicedesk.arrive.no -- View this message in context: http://www.nabble.com/page-refresh-cleans-my-page-state-tp20598492p20601031.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?
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: Nice, I was up to something similar. On Tue, Nov 18, 2008 at 9:43 AM, 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
Re: Validation Question
Works like a charm Thanks a lot Cheers, vishy jWeekend wrote: Vishy, Add IConverter=Invalid Input to a properties file in, for example, MyApplication.properties for your whole application or in MyPage.properties if you want this custom message on a particular page only ... etc, in the same package as the class with the same name. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk vishy_sb wrote: Hi all, I am trying to get some validations to work using the FeedbackPanel. My form has a Textfield and I am trying to use a NumberValidator to check if it is in a given range. The code that I have used is : TextField pgLongLimit = new TextField(pgLongLimit, new PropertyModel( pglimit, longLimit)); pgLongLimit.setRequired(false); pgLongLimit.setLabel(new Model(Long Limit)); validator.addNumberRange(pgLongLimit, 0, Integer.MAX_VALUE); My classname.properties file looks has following code: NumberValidator.range = ${label} should have a positive integer value Now whenever I put in a negative input I get the correct error i.e Long Limit should have a positive integer value. However if I put in a char value as an input (say 'a') then the error is a is not a valid int. I want to change this error to something like Invalid input. Any ideas about how I can do that. I don't know which resource key I would have to use here. Thanks, vishy -- View this message in context: http://www.nabble.com/Validation-Question-tp20590141p20603101.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]
Memory consumption per session
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]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory consumption per session
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. - 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
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. - 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] -- Jeremy Thomerson http://www.wickettraining.com
Re: Memory consumption per session
Your ListView instances must be holding on to domain objects. You should use LoadableDetachableModels so that the ListView doesn't hold on to references to objects. The most common memory issue is always that your components are holding on to objects directly or using Model, which holds the object. -- Jeremy Thomerson http://www.wickettraining.com On Thu, Nov 20, 2008 at 9: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]
Re: Generics changes in 1.4-rc1
Please make issues for this in jira On 11/20/08, aditsu [EMAIL PROTECTED] wrote: Hi, I've been using m3 for a while and just tried switching to rc1. I found several problems: - LabelTree.getNodeTextModel requires IModel and returns IModel. I was overriding it and returning a ModelString, but I can't do that anymore. Why not just return IModel? ? - RatingPanel now requires an IModelInteger for the rating, but I was using IModelDouble. How can I show rated 3.6 from 7 votes now? Can it use IModel? extends Number instead? - BaseTree requires IModelTreeModel; I was using a Model with a DefaultTreeModel object, but I can't do that anymore (TreeModel is not necessarily Serializable). Why not just require IModel? extends TreeModel ? Adrian -- View this message in context: http://www.nabble.com/Generics-changes-in-1.4-rc1-tp20599173p20599173.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]
Check a checkbox when focus on a textbox
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 -- View this message in context: http://www.nabble.com/Check-a-checkbox-when-focus-on-a-textbox-tp20603583p20603583.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: Memory consumption per session
200kb is quite a lot for page with listview with 50 entries (unless there's lot of other components). It's more likely that you don't detach something properly. Still, what are you hardware specs and number of concurrent users? -Matej On Thu, Nov 20, 2008 at 4:15 PM, 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]
Re: Memory consumption per session
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. - 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] -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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: Feature idea: sealed flag on MarkupContainer
Here's the problem (also with sketchy pseudo code :) public class BasePanel extends Panel { public BasePanel(String id) { super(id); add(new Label(foo, ...)); } } public class SubPanel extends BasePanel { @Override public void onComponentAdd(Component child) { // oops, called from BasePanel ctor // my fields aren't initialized yet } } jk On Thu, Nov 20, 2008 at 12:38:39PM +0100, Peter Ertl wrote: I was thinking about something like this: [warning, sketchy pseudo code will follow] method org.apache.wicket.MarkupContainer.add(Component... children) : - call empty overridable method onComponentAdd(Component child) for each component - add component protected void onComponentAdd(Component child) { /* overridable */ } Am 20.11.2008 um 12:30 schrieb John Krasnay: Yeah, I thought about that. The problem is add() is usually called from a component's constructor, so you would have a case of a constructor (indirectly) calling a non-final method, jk On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote: Wouldn't it be more powerful to override / hook into the process of adding a component of a container? Something like that ... new WebMarkupContainer(id) { @Override public void onComponentAdd(Component child) { // check the sealed flag, decorate the child, throw exception, or do [whatever] } } Am 20.11.2008 um 05:25 schrieb John Krasnay: Hi folks, In my current Wicket app I have a panel that contains a vertically stacked list of sub-panels. Because the precise list of sub-panels is not known until runtime, I've implemented this with a RepeatingView. My parent panel has the following methods that I use to build the list of sub-panels (rv is my RepeatingView instance): public void addSubPanel(Panel subPanel) { rv.add(subPanel); } public String newSubPanelId() { return rv.newChildId(); } I use this same pattern in a number of other instances such as menus and button bars. The problem is that I often mistakenly call add instead of addSubPanel, which of course fails at render time with an exception that I always find hard to decipher. It would be nice if there was a way to seal a MarkupContainer once I had populated it such that any subsequent call to add, remove, or replace would fail immediately with an exception. This would make it much easier to find out where I had made the mistake. Does anyone else think this would be a worthwhile feature? 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] - 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
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]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
Like this? new YourComponent(id) { @Override public boolean isVisible() { return yourCondition; } } On Thu, Nov 20, 2008 at 9:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] -- Jeremy Thomerson http://www.wickettraining.com
Re: Memory consumption per session
BTW, is it easy to control what wicket stores in session? May be by patching wicket code? P.S. Sorry if the question is lame, I have just started studying wicket and I want to decide whether to use it in production. 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.
Re: Memory consumption per session
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]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
That's bad because isVisible is invoked many times (50+ sometimes) per request so no complex logic can be put there. 2008/11/20 Jeremy Thomerson [EMAIL PROTECTED]: Like this? new YourComponent(id) { @Override public boolean isVisible() { return yourCondition; } } On Thu, Nov 20, 2008 at 9:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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] -- Jeremy Thomerson http://www.wickettraining.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
I'm trying to choose strategy for handling conditional component visibility (and we have complex tree where many components are conditionally visible). Overriding isVisible is bad, because many calls. overriding onBeforeRender and callOnBeforeRender is bad, because children visibility is calculated even when there is no need. I'd prefer overriding onBeforeRender and skipping child traversion if isVisible = false, but that cannot be done with current Component#onBeforeRender implementation. 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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
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]
Re: Memory consumption per session
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: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
i still dont see a concrete usecase -igor On Thu, Nov 20, 2008 at 8:04 AM, Marat Radchenko [EMAIL PROTECTED] wrote: I'm trying to choose strategy for handling conditional component visibility (and we have complex tree where many components are conditionally visible). Overriding isVisible is bad, because many calls. overriding onBeforeRender and callOnBeforeRender is bad, because children visibility is calculated even when there is no need. I'd prefer overriding onBeforeRender and skipping child traversion if isVisible = false, but that cannot be done with current Component#onBeforeRender implementation. 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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]
Open FAQ/wiki somewhere?
In Wicket in Action it's mentioned briefly how one could use a SimpleAttributeModifier to limit the text length of an input, by binding to a JPA @Column annotation and its length attribute. This sounds nice DRY to me (albeit perhaps a bit expensive?!) so I gave it a try: protected String getColumnLength(Class entityName, String fieldName){ try { Field field = entityName.getDeclaredField(fieldName); field.setAccessible(true); return String.valueOf(field.getAnnotation(Column.class).length()); } catch (Exception ex) { return ; } } Which got me thinking (after spending an hour figuring out I had to use setAccessible) if there's an open FAQ/wiki for these kind of things? I have not been able to find any except the locked down official confluence. Google is nice, but as a newbie it would be nice to have a central place with lots of micro-examples/snippets to get you going. /Casper -- View this message in context: http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607065.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: Feature idea: sealed flag on MarkupContainer
for SubPanel the ctor is called that order - - Panel - BasePanel - SubPanel so the fields will be initialized, eh?! Am 20.11.2008 um 16:32 schrieb John Krasnay: Here's the problem (also with sketchy pseudo code :) public class BasePanel extends Panel { public BasePanel(String id) { super(id); add(new Label(foo, ...)); } } public class SubPanel extends BasePanel { @Override public void onComponentAdd(Component child) { // oops, called from BasePanel ctor // my fields aren't initialized yet } } jk On Thu, Nov 20, 2008 at 12:38:39PM +0100, Peter Ertl wrote: I was thinking about something like this: [warning, sketchy pseudo code will follow] method org.apache.wicket.MarkupContainer.add(Component... children) : - call empty overridable method onComponentAdd(Component child) for each component - add component protected void onComponentAdd(Component child) { /* overridable */ } Am 20.11.2008 um 12:30 schrieb John Krasnay: Yeah, I thought about that. The problem is add() is usually called from a component's constructor, so you would have a case of a constructor (indirectly) calling a non-final method, jk On Thu, Nov 20, 2008 at 11:27:39AM +0100, Peter Ertl wrote: Wouldn't it be more powerful to override / hook into the process of adding a component of a container? Something like that ... new WebMarkupContainer(id) { @Override public void onComponentAdd(Component child) { // check the sealed flag, decorate the child, throw exception, or do [whatever] } } Am 20.11.2008 um 05:25 schrieb John Krasnay: Hi folks, In my current Wicket app I have a panel that contains a vertically stacked list of sub-panels. Because the precise list of sub-panels is not known until runtime, I've implemented this with a RepeatingView. My parent panel has the following methods that I use to build the list of sub-panels (rv is my RepeatingView instance): public void addSubPanel(Panel subPanel) { rv.add(subPanel); } public String newSubPanelId() { return rv.newChildId(); } I use this same pattern in a number of other instances such as menus and button bars. The problem is that I often mistakenly call add instead of addSubPanel, which of course fails at render time with an exception that I always find hard to decipher. It would be nice if there was a way to seal a MarkupContainer once I had populated it such that any subsequent call to add, remove, or replace would fail immediately with an exception. This would make it much easier to find out where I had made the mistake. Does anyone else think this would be a worthwhile feature? 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] - 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: Open FAQ/wiki somewhere?
Hi Casper, Have you seen the reference library documentation on the main wiki: http://cwiki.apache.org/WICKET/reference-library.html Any one can create an account and then edit the wiki pages. Mike In Wicket in Action it's mentioned briefly how one could use a SimpleAttributeModifier to limit the text length of an input, by binding to a JPA @Column annotation and its length attribute. This sounds nice DRY to me (albeit perhaps a bit expensive?!) so I gave it a try: protected String getColumnLength(Class entityName, String fieldName){ try { Field field = entityName.getDeclaredField(fieldName); field.setAccessible(true); return String.valueOf(field.getAnnotation(Column.class).length()); } catch (Exception ex) { return ; } } Which got me thinking (after spending an hour figuring out I had to use setAccessible) if there's an open FAQ/wiki for these kind of things? I have not been able to find any except the locked down official confluence. Google is nice, but as a newbie it would be nice to have a central place with lots of micro-examples/snippets to get you going. /Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Open FAQ/wiki somewhere?
Casper, Something like http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html this ? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Casper Bang wrote: In Wicket in Action it's mentioned briefly how one could use a SimpleAttributeModifier to limit the text length of an input, by binding to a JPA @Column annotation and its length attribute. This sounds nice DRY to me (albeit perhaps a bit expensive?!) so I gave it a try: protected String getColumnLength(Class entityName, String fieldName){ try { Field field = entityName.getDeclaredField(fieldName); field.setAccessible(true); return String.valueOf(field.getAnnotation(Column.class).length()); } catch (Exception ex) { return ; } } Which got me thinking (after spending an hour figuring out I had to use setAccessible) if there's an open FAQ/wiki for these kind of things? I have not been able to find any except the locked down official confluence. Google is nice, but as a newbie it would be nice to have a central place with lots of micro-examples/snippets to get you going. /Casper -- View this message in context: http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607391.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: Feature idea: sealed flag on MarkupContainer
On Thu, Nov 20, 2008 at 07:18:11PM +0100, Peter Ertl wrote: for SubPanel the ctor is called that order - - Panel - BasePanel calls MarkupContainer.add() calls SubPanel.onComponentAdd() (before SubPanel ctor!) - SubPanel so the fields will be initialized, eh?! Am 20.11.2008 um 16:32 schrieb John Krasnay: Here's the problem (also with sketchy pseudo code :) public class BasePanel extends Panel { public BasePanel(String id) { super(id); add(new Label(foo, ...)); } } public class SubPanel extends BasePanel { @Override public void onComponentAdd(Component child) { // oops, called from BasePanel ctor // my fields aren't initialized yet } } jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory consumption per session
Ralf, If you want to discard the generated text after rendering, you may use a detachable model, like LoadableDetachableModel: IModel model = new LoadableDetachableModel() { public Object load() { return generateMyHTML(); } } add(new Label(raw, model).setEscapeModelStrings(false)); Assigning the text directly to the label (as in Label(raw, h1Foo/h1)) will keep a reference to the String 'forever'. It's ok when the HTML is short, but it doesn't seem to be your case. --Cristiano On Thu, Nov 20, 2008 at 2:08 PM, Martijn Dashorst [EMAIL PROTECTED] wrote: 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]
Re: Open FAQ/wiki somewhere?
Oh wow, that's a virtual gold mine. Thanks!. /Casper jWeekend wrote: Casper, Something like http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html this ? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Casper Bang wrote: In Wicket in Action it's mentioned briefly how one could use a SimpleAttributeModifier to limit the text length of an input, by binding to a JPA @Column annotation and its length attribute. This sounds nice DRY to me (albeit perhaps a bit expensive?!) so I gave it a try: protected String getColumnLength(Class entityName, String fieldName){ try { Field field = entityName.getDeclaredField(fieldName); field.setAccessible(true); return String.valueOf(field.getAnnotation(Column.class).length()); } catch (Exception ex) { return ; } } Which got me thinking (after spending an hour figuring out I had to use setAccessible) if there's an open FAQ/wiki for these kind of things? I have not been able to find any except the locked down official confluence. Google is nice, but as a newbie it would be nice to have a central place with lots of micro-examples/snippets to get you going. /Casper -- View this message in context: http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607796.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: Extremely confisung onBeforeRender/callOnBeforeRenderIfNotVisible behavior
private Boolean visible = null; public boolean isVisible() { if (visible == null) { visible = [ put your complicated logic here]; } return visible; } public void onDetach() { super.onDetach(); visible = null; } What's wrong with this? -Matej On Thu, Nov 20, 2008 at 5:04 PM, Marat Radchenko [EMAIL PROTECTED] wrote: I'm trying to choose strategy for handling conditional component visibility (and we have complex tree where many components are conditionally visible). Overriding isVisible is bad, because many calls. overriding onBeforeRender and callOnBeforeRender is bad, because children visibility is calculated even when there is no need. I'd prefer overriding onBeforeRender and skipping child traversion if isVisible = false, but that cannot be done with current Component#onBeforeRender implementation. 2008/11/20 Igor Vaynberg [EMAIL PROTECTED]: you havent actually described your usecase yet... -igor On Thu, Nov 20, 2008 at 7:33 AM, Marat Radchenko [EMAIL PROTECTED] wrote: So. Is there any recommended (and hopefully not error-prone) way of handling conditional visibility? 2008/11/20 Matej Knopp [EMAIL PROTECTED]: That's first confusing point. Javadocs on callOnBeforeRenderIfNotVisible promise us that onBeforeRender will be called even if component is not visible, but it is a lie. Bad, bad javadoc! -Matej - 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: Invalid URLPatternSpec for Ajax Calls in Wicket Portlet
which portlet 2 patch are you referring to? Where is it available? Thanks Thijs wrote: But does it also have a problem if it's running a standalone wicket application? Btw I've run wicket portlets (with the portlet 2 patch) in Glassfish open portal portlet container(v. rc2 then) and that worked just fine... So I don't know what the problem could be... Thijs On 11/19/08 8:44 PM, krisNog wrote: The difference appears to be : vs %3A (the URL encoded : ) in urls. For example wicket seems to be creating test:test2 in Firefox and test%3Atest2 in IE. Glassfish doesn't like the : Thijs wrote: Do you know what is send differently to the server in FF2 vs IE (WireShark?) And where the error is thrown, why it says that the URLPatternSpec is invalid... Thijs On 18-11-2008 22:57, prasana wrote: Hi all, We are running Wicket Portlet in Jetspeed Portal deployed in Glassfish. But whenever we make a Ajax calls, it results in There are some problems in the request: invalid URLPatternSpec|# in the server log file and Ajax Debug windows shows ERROR: Received Ajax response with code: 400 The above error happens only in Firefox 2 and not in IE 6/7 I greatly appreciate any help regarding on what I need to do to see the workflow actions for assets. Thanks Prasanna - 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/Invalid-URLPatternSpec-for-Ajax-Calls-in-Wicket-Portlet-tp20569102p20609170.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?
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: Nice, I was up to something similar. On Tue, Nov 18, 2008 at 9:43 AM, 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,
Re: Invalid URLPatternSpec for Ajax Calls in Wicket Portlet
https://issues.apache.org/jira/browse/WICKET-1620 (Though it's still a work in process) and not yet supported by the wicket core committers On 11/20/08 9:17 PM, krisNog wrote: which portlet 2 patch are you referring to? Where is it available? Thanks Thijs wrote: But does it also have a problem if it's running a standalone wicket application? Btw I've run wicket portlets (with the portlet 2 patch) in Glassfish open portal portlet container(v. rc2 then) and that worked just fine... So I don't know what the problem could be... Thijs On 11/19/08 8:44 PM, krisNog wrote: The difference appears to be : vs %3A (the URL encoded : ) in urls. For example wicket seems to be creating test:test2 in Firefox and test%3Atest2 in IE. Glassfish doesn't like the : Thijs wrote: Do you know what is send differently to the server in FF2 vs IE (WireShark?) And where the error is thrown, why it says that the URLPatternSpec is invalid... Thijs On 18-11-2008 22:57, prasana wrote: Hi all, We are running Wicket Portlet in Jetspeed Portal deployed in Glassfish. But whenever we make a Ajax calls, it results in There are some problems in the request: invalid URLPatternSpec|# in the server log file and Ajax Debug windows shows ERROR: Received Ajax response with code: 400 The above error happens only in Firefox 2 and not in IE 6/7 I greatly appreciate any help regarding on what I need to do to see the workflow actions for assets. Thanks Prasanna - 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]
Properties file
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]
Re: Compoundpropertymodel with shadow map?
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: Nice, I was up to something similar. On Tue,
Re: Properties file
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://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]
Formatting dates in Inmethod DataGrid
How does one format a date in the inmethod datagrid? Thanks, Jurek.
Re: Generics changes in 1.4-rc1
Johan Compagner wrote: Please make issues for this in jira Since you said issues, I created 3 issues: WICKET-1947, WICKET-1948, WICKET-1949 Adrian -- View this message in context: http://www.nabble.com/Generics-changes-in-1.4-rc1-tp20599173p20615568.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]