Re: Why Localizer Retained so many heapsize?

2008-05-11 Thread Iman Rahmatizadeh
Well actually I haven't :-) My localizer gets quite large, but it hasnt made any problems, yet . You see when the localizer wants to find the resource value for a specific key, it caches the result into the localizer. Now if your component has a deep hierarchy, the generated key will be quite large

Re: Why Localizer Retained so many heapsize?

2008-05-11 Thread Jonathan Locke
maybe localizer should limit its size or use a soft reference cache? Johan Compagner wrote: > > Can you really see what it holds? > Almost 2G in memory in localizer is extreme... Thats really a lot of > strings.. > You could try to read that dump with yourkit if your current one > doesnt show

Re: Problem with Textfield

2008-05-11 Thread Jonathan Locke
yes. that's what i originally said. ;-) Ikenna Okpala wrote: > > Hi, > > i went to bed and woke up this morning and took and another hard look. @ > the > problem and i changed: > > Model model = new Model("MSFT"); > > to: > > model = new Model("MSFT"); > > and the problem was

Re: Why Localizer Retained so many heapsize?

2008-05-11 Thread Quan Zhou
Thanks for your all replys. I review the dump file with both SAP MemoryAnalyzer and YourKit They all show the same hierachy as follows: -org.apache.wicket.settings.Settings - org.apache.wicket.Localizer - org.apache.wicket.util.concurrent.ConcurrentHashMap - org.apache.wicket.util.concurren

Re: Wicket 1.4 Generics

2008-05-11 Thread Andre Prasetya
usually there is a wicket-spring release for every wicket release, can I use wicket-spring 1.3.3 for 1.4-m1 or should i wait until there is a spesific release for 1.4-m1 ? -andre- Igor Vaynberg wrote: spring support has been there since 1.2, see wicket-spring and spring examples. -igor On S

Re: Overriding panel markup: close tag not found for tag

2008-05-11 Thread Eelco Hillenius
> Instead, I want the MyPage.html to contain the panel markup: In a > similar manner to how the feedbackpanel markup is given in that > example in the book "created the component component structure inside > the page". You should use a Fragment instead of a Panel in that case. Eelco

Re: Problem with Textfield

2008-05-11 Thread Ikenna Okpala
Hi, i went to bed and woke up this morning and took and another hard look. @ the problem and i changed: Model model = new Model("MSFT"); to: model = new Model("MSFT"); and the problem was resolved. thanks everyone for helping out still studying wicket hard yet to have a final impre

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
if you stored this list in a field (lazy init it), i imagine the provider would not hit the db after loading the list the first time. it might also work to set an item reuse strategy (don't know, i've never tried this since i stopped trying to optimize away from detachable models). of course, e

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
try setting a breakpoint on this line: List certificateList = DAOManager.getExemptionCertificateDAO().getExemptionCertificates( m_certificateSearchCriteriaName,m_certificateSearchCriteriaValue, Integer.valueOf(first), Integer.valueOf

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
Jonathan Locke wrote: > > > oh, okay. sorry, i was speed-reading your question and misunderstood it. > > maurice and johan are correct that hybrid urls will avoid creating the > instance. the part i mistakenly assumed we were talking about was whether > one can completely avoid creating a

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
yeah, they're right. i just got confused and started answering a different question (already sent a response explaining...) mfs wrote: > > I see...I wonder what was johan (where he suggested using > hybridurlcodingstrategy) and maurice refering to when he mentioned that it > would be the same

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
I see...I wonder what was johan (where he suggested using hybridurlcodingstrategy) and maurice refering to when he mentioned that it would be the same page instance is reused (and hence i assume the model with it too) given its a non-bookmarkable page You have got a valid point, but its just tha

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
consider also this possibility: you will end up with a new component hierarchy on every request anyway (unless matej has been doing something very clever). and with the right caching in place (ORM and/or DB level), the serialization overhead associated with your attempt at premature optimization

Re: Overriding panel markup: close tag not found for tag

2008-05-11 Thread Martin Makundi
I do not want to have a separate MyPalette.html, because many times I use the palette its layout must be different. Instead, I want the MyPage.html to contain the panel markup: In a similar manner to how the feedbackpanel markup is given in that example in the book "created the component component

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
oh, okay. sorry, i was speed-reading your question and misunderstood it. maurice and johan are correct that hybrid urls will avoid creating the instance. the part i mistakenly assumed we were talking about was whether one can completely avoid creating a new version of the page in the page st

Re: Wicket 1.4 Generics

2008-05-11 Thread Igor Vaynberg
spring support has been there since 1.2, see wicket-spring and spring examples. -igor On Sun, May 11, 2008 at 8:10 PM, Andre Prasetya <[EMAIL PROTECTED]> wrote: > Doug Donohoe wrote: > > > I just migrated to 1.4-M1 and converted all my classes to use the new > > generics support. It cleaned up

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
okay, so i think the answer to your question is no, you can't optimize that. you should be using detachable models and an OTS db cache. what i don't understand is why you want to do this. if the user hits refresh in their browser they are hoping to see updated data. why do you want to turn tha

Re: Wicket 1.4 Generics

2008-05-11 Thread Andre Prasetya
Doug Donohoe wrote: I just migrated to 1.4-M1 and converted all my classes to use the new generics support. It cleaned up my code quite nicely - I got to remove a lot of casting and cured many unchecked/raw messages. It also make the code much more readable - especially in list views, etc. Exc

Re: Redundant method only works for PropertyModel

2008-05-11 Thread smallufo
2008/5/11 Johan Compagner <[EMAIL PROTECTED]>: > > But if a PropertyModel sees a IModel as its object > then it will call getObject() and on that it will evaluate "city" > So what is getObject() returning MyModel?? > > You shouldnt mix these things. > > if you want the city object from a model it

Re: Problem with Textfield

2008-05-11 Thread Jonathan Locke
if you assigned to that null field (clearly not with the code below) and you are still getting an NPE, it could not be the /same/ error by definition. i suggest you slow down, get out a debugger and think this through. kengimel wrote: > > i assigned new Model() to the field. > > String sym

Re: Problem with Textfield

2008-05-11 Thread kengimel
i assigned new Model() to the field. String sym = (String) new Model().getObject(); int stockValue = sym.hashCode() % 100; QuoteResult quoteResult = new QuoteResult(stockValue); setResponsePage(quoteResult); and it still threw the same error. i a

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
I have the condensed version of the code here, with some comments on the top of each class.. http://papernapkin.org/pastebin/view/788/ Waiting for follow up Jonathan Locke wrote: > > > you must be making some mistake (probably conceptual). can you create a > quickstart example of your probl

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
you must be making some mistake (probably conceptual). can you create a quickstart example of your problem and post it at some link where we can see exactly what you're doing? mfs wrote: > > Well actually before posting this up, i did try this i.e. mounted the page > using hybridurlcodingstra

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
okay, suit yourself, but this is the normal/expected use case for wicket detachable models, which are the preferred route to go. i think you will find other options less workable. mfs wrote: > > we might opt for this eventually, but trying to utilize/serve-the-purpose > for now with what wick

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
we might opt for this eventually, but trying to utilize/serve-the-purpose for now with what wicket offers... Jonathan Locke wrote: > > > normally you don't hit the db on refresh. you hit a fast local db cache. > > > mfs wrote: >> >> Guys, >> >> Firstly, Is that a right understanding that

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
Mr Mean wrote: > > On Sun, May 11, 2008 at 9:04 AM, mfs <[EMAIL PROTECTED]> wrote: >> >> Guys, >> >> Firstly, Is that a right understanding that doing a browser-refresh of >> the >> page would result in a new instance of the page being created everytime >> and >> similarly a new model instan

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
Well actually before posting this up, i did try this i.e. mounted the page using hybridurlcodingstrategy (with the assumption that since the pageId is there in the url doing a refresh would load the already instantiated page against the id) but at that time i had the page as bookmarkable (i.e. had

Re: Problem with Textfield

2008-05-11 Thread Jonathan Locke
no, the problem is more basic than that. it would work if new Model() was assigned to the field. instead it is being assigned to a local variable, which goes out of scope, leaving the field still null: Model model = new Model("MSFT"); if the field were final, the compiler would warn that the

Re: Problem with Textfield

2008-05-11 Thread Per Newgro
Hello Kengimel, You do this private Model model;                and that String sym = (String) model.getObject(); but you did not form.setModel(model) or @ least setModel(model) You only can get things you've assigned before. Cheers Per -

Re: Problem with Textfield

2008-05-11 Thread Ikenna Okpala
i have taken a very hard look @ the code believe i can't still figure it out. please can i get @ least an example or clue of where or what you mean. thanks On Sun, May 11, 2008 at 5:54 PM, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > > take a hard look. you never assigned to field model. >

Re: add method on Form for wicket 1.4

2008-05-11 Thread Jonathan Locke
i thought it might be something like that. m_salman wrote: > > Oops, darn. jar files in WEB-INF\lib were not updated. > > Thanks so much for the quick response. > > > Jonathan Locke wrote: >> >> >> are you sure you are running against the same wicket jar you compiled >> against? >> >>

Re: add method on Form for wicket 1.4

2008-05-11 Thread m_salman
Oops, darn. jar files in WEB-INF\lib were not updated. Thanks so much for the quick response. Jonathan Locke wrote: > > > are you sure you are running against the same wicket jar you compiled > against? > > > m_salman wrote: >> >> Hi, >> >> I am very very new to Wicket and I am at a very

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Johan Compagner
HybridUrlEnoding On Sun, May 11, 2008 at 9:04 AM, mfs <[EMAIL PROTECTED]> wrote: > > Guys, > > Firstly, Is that a right understanding that doing a browser-refresh of the > page would result in a new instance of the page being created everytime and > similarly a new model instance would be binded

Re: Problem with Textfield

2008-05-11 Thread Jonathan Locke
this is one good reason, btw, to make your fields final when possible. the compiler would have warned you. Jonathan Locke wrote: > > > take a hard look. you never assigned to field model. > > > kengimel wrote: >> >> Hi, >> >> I am new to wicket and while trying out this snippet of code.

Re: Problem with Textfield

2008-05-11 Thread Jonathan Locke
take a hard look. you never assigned to field model. kengimel wrote: > > Hi, > > I am new to wicket and while trying out this snippet of code. > > > public class GetQuoteSymbol extends WebPage { > > private Model model; > > public GetQuoteSymbol() { > > Form form = new

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Jonathan Locke
normally you don't hit the db on refresh. you hit a fast local db cache. mfs wrote: > > Guys, > > Firstly, Is that a right understanding that doing a browser-refresh of the > page would result in a new instance of the page being created everytime > and similarly a new model instance would be

Re: add method on Form for wicket 1.4

2008-05-11 Thread Jonathan Locke
also, what version of java are you using? Jonathan Locke wrote: > > > are you sure you are running against the same wicket jar you compiled > against? > > > m_salman wrote: >> >> Hi, >> >> I am very very new to Wicket and I am at a very early stage of my >> understanding. I have upgraded

Re: add method on Form for wicket 1.4

2008-05-11 Thread Jonathan Locke
are you sure you are running against the same wicket jar you compiled against? m_salman wrote: > > Hi, > > I am very very new to Wicket and I am at a very early stage of my > understanding. I have upgraded to 1.4_m1. But I seem to have a weired > problem which I don't see any one else have

Re: Problem with Textfield

2008-05-11 Thread Ayodeji Aladejebi
You should use a writable model like PropertyModel. Read the documentation for more info. So i rewrite your code like this: try this First, Create a Backing Bean which will hold 2 values, the value of the TICKER SYMBOL and the value of the Stock Answer class StockBean implements Serializable {

Problem with Textfield

2008-05-11 Thread kengimel
Hi, I am new to wicket and while trying out this snippet of code. public class GetQuoteSymbol extends WebPage { private Model model; public GetQuoteSymbol() { Form form = new Form("f") { protected void onSubmit() { String sym = (String) model.get

Re: Good wicket patterns

2008-05-11 Thread Johan Compagner
dont think so see also FormComponentPanel doc On Sun, May 11, 2008 at 3:30 PM, gurgel2 <[EMAIL PROTECTED]> wrote: > > Correct. I hade a formcomponent hierarchy within a formcomponent > hierrarchy. > Sort of a search/criteriea panel. So i wanted to post the search panel and > not the form as a who

Re: form fields become page parameters

2008-05-11 Thread Johan Compagner
hmm i think this is very hard to pass over.. If it is a statelessform and the page must first be created yes the page gets the pageparameters of the request And yes that is ofcourse then all the fields of the form.. And at that point it is a normal bookmarkable request.. after the page is created

Re: Good wicket patterns

2008-05-11 Thread gurgel2
Correct. I hade a formcomponent hierarchy within a formcomponent hierrarchy. Sort of a search/criteriea panel. So i wanted to post the search panel and not the form as a whole. It was like 1. search using some criterias in the search component 2. select stuff from what the search yielded 3. suppl

Re: AjaxLazyLoadPanel question

2008-05-11 Thread Johan Compagner
just to make it more clear to you AjaxLazyLoadPanel == a Panel == Own markup so what you have is not possible you can have that code just fine in lazy load panel but the panel must have its own markup that is this: option 1 option 2

Re: Redundant method only works for PropertyModel

2008-05-11 Thread Johan Compagner
> > Well , it is in fact a my custom MyModel extends Model , > besides getCity() , setCity(...) , there are still other getter/setters out > there. > That's why I wrote PropertyModel(model , "city") there. > But if a PropertyModel sees a IModel as its object then it will call getObject() and on th

Re: Redundant method only works for PropertyModel

2008-05-11 Thread smallufo
2008/5/11 Maurice Marrink <[EMAIL PROTECTED]>: > On Sun, May 11, 2008 at 12:54 AM, smallufo <[EMAIL PROTECTED]> wrote: > > 2008/5/11 Maurice Marrink <[EMAIL PROTECTED]>: > > > > > > > PropertyModel is aware of the IModel you are passing and unwraps it. > > > So depending on what is inside your m

Re: Load serialized (or in session) page/model on refresh..

2008-05-11 Thread Maurice Marrink
On Sun, May 11, 2008 at 9:04 AM, mfs <[EMAIL PROTECTED]> wrote: > > Guys, > > Firstly, Is that a right understanding that doing a browser-refresh of the > page would result in a new instance of the page being created everytime and > similarly a new model instance would be binded to the page. O

Re: add method on Form for wicket 1.4

2008-05-11 Thread Johan Compagner
so you compile against 1.4? then you run against 1.3 because i see that it wants to have the array type and that is an 1.4 method (varargs) johan On Sun, May 11, 2008 at 9:40 AM, m_salman <[EMAIL PROTECTED]> wrote: > > Hi, > > I am very very new to Wicket and I am at a very early stage of my >

Re: Redundant method only works for PropertyModel

2008-05-11 Thread Maurice Marrink
On Sun, May 11, 2008 at 12:54 AM, smallufo <[EMAIL PROTECTED]> wrote: > 2008/5/11 Maurice Marrink <[EMAIL PROTECTED]>: > > > > PropertyModel is aware of the IModel you are passing and unwraps it. > > So depending on what is inside your model you have different options: > > -the model contains an

add method on Form for wicket 1.4

2008-05-11 Thread m_salman
Hi, I am very very new to Wicket and I am at a very early stage of my understanding. I have upgraded to 1.4_m1. But I seem to have a weired problem which I don't see any one else have a problem with. I would appreciate any quick help. Thanks. Problem is with the add(firstNameTextField) line

Load serialized (or in session) page/model on refresh..

2008-05-11 Thread mfs
Guys, Firstly, Is that a right understanding that doing a browser-refresh of the page would result in a new instance of the page being created everytime and similarly a new model instance would be binded to the page. Is there a way one can use the same version of the page/model (which wicket kep