[Wicket-user] impressed w/ performance!

2006-03-11 Thread Vincent Jenks
OK, I ran a test using the small CLI app siege. I don't know how reliable this test is but the results logged are *definitely* impressive...to say the least...not at all what I expected given what I've done. This setup is as ghetto as it gets.
Here's my app:Presentation: Wicket 1.1.1Application: EJB3 on JBoss 4.0.4RC1 (non-clustered)Database: MSSQL 2000 (Developer Edition)The app is on my dev machine (my laptop) which is a single proc 2GHz Dell Latitude w/ 2GB ram.
I'm simply calling a collection of Entity beans from a stateless session bean and looping them in a table in Wicket. There's maybe 20 records in the table.Here's my Wicket code (without detachable model):
-
public class Home extends WebPage{ public Home() {  ListProduct products = this.getAllProducts();add(new ListView(products, products)  {
   protected void populateItem(ListItem item)   {Product product = (Product)item.getModelObject();item.add(new Label(description, product.getDescription

()));   }  }); }  private ListProduct getAllProducts() {Products p = null;  try  {   InitialContext ctx = new InitialContext();
   p = (Products)ctx.lookup(MyEarProject/ProductsBean/local);  }  catch (NamingException exp)  {   exp.printStackTrace();  }
  return 
p.getAll(); }}Here's the same code *with* detachable model (ctor only):- public Home() {

  add(new HeaderPanel(headerPanel));  add(new FooterPanel(footerPanel));   IModel loadingModel = new LoadableDetachableModel()  {   Products p = null;
   protected Object load()   {try{ InitialContext ctx = new InitialContext(); p = (Products)ctx.lookup(MyEarProject/ProductsBean/local);  
}catch (NamingException exp){ exp.printStackTrace();} return p.getAll();   }

  };add(new ListView(products, loadingModel)  {   protected void populateItem(ListItem item)   {Product product = (Product)item.getModelObject();
item.add(new Label(description, product.getDescription()));   }  }); }Here are the results without detachable model:-
Transactions: 5006 hitsAvailability: 100.00 %Elapsed time: 99.61 secsData transferred: 22311742 bytesResponse time: 1.46 secs
Transaction rate: 50.26 trans/secThroughput: 223990.98 bytes/secConcurrency: 73.32Successful transactions: 5067Failed transactions: 0
Longest transaction: 7.27Shortest transaction: 0.02...and with detachable model:-Transactions: 5388 hits
Availability: 100.00 %Elapsed time: 99.56 secsData transferred: 24014316 bytesResponse time: 1.32 secsTransaction rate: 54.12 trans/sec
Throughput: 241204.47 bytes/secConcurrency: 71.47Successful transactions: 5448Failed transactions: 0Longest transaction: 7.08Shortest transaction: 
0.35Now, the real question is; shouldn't I have seen serious performance/scalability degredation by *not* detaching the objects? Really all we're talking about here are abstracted Hibernate sessions (JBoss EJB 3).
It's probably safe to say that this would be a more dramatic difference w/ larger, more complex objects, correct?I know these tests are rough and in no way professional benchmarks...but it's interesting nonetheless. It appears that I could get away w/ *not* using detached objects on this project (and cleaner code)...since we never anticipate 100 *concurrent* usersbut even if we did...the app would probably still be highly available. Also, in production, All services won't be on the same machine...it'll likely start out on a dual-proc (
2.8GHz xeon) app/web server w/ about the same amt. of ram and a separate database server w/ MSSQL 2K Enterprise (not my first choice in DB but I *have* no choice.) Obviously, we could easily scale up later by both throwing more hardware at it by clustering it and adding detachable models around the session beans, if it became necessary.
Any thoughts?-v



[Wicket-user] Wicket community...

2006-03-11 Thread Vincent Jenks
I've noticed that there's not been a Wicket release in about 6 mo. - is Wicket being actively developed? From what little experimentation I've done it seems like the best web UI framework out there, hands down. Obviously, I have to be concerned with popularity if I'm to recommend an open source framework for our projects at work...if Wicket should fade into obscurity we'd essentially be stuck and of course, I'd catch a lot of heat having to switch out the UI for another technology.
The website appears to have a lot of outdated info (e.g. 
	The Wicket 1.2 release is scheduled to become final for early januari, possibly
	earlier.) and the documentation is fairly sparse, even w/ the wiki. I could not determine if there are any Wicket books available (or on the way) - can we expect at least a book sometime soon? I'd be the first in line for a copy!
Thanks!-v


[Wicket-user] query strings...

2006-03-11 Thread Vincent Jenks
I'm still getting used to the way wicket utilizes querystring values for requests...how would one use querystrings to pass values around to pages? I can't find a simple answer to that in the documentation.Thanks!
-v


Re: [Wicket-user] Wicket community...

2006-03-11 Thread Vincent Jenks
Absolutely, there's definitely growing buzz on some of the java sites I frequent too (javalobby, java.net, etc.) which is where I first heard of Wicket.I wasn't implying that there was no community...I was just put off at the lack of real rich documentation (non-javadoc) and book selection (zero to-date.)
-vOn 3/11/06, Johan Compagner [EMAIL PROTECTED] wrote:
also just look at this url:https://sourceforge.net/mailarchive/forum.php?forum_id=42353
can't say nothing is happening :)johan
On 3/11/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
That's what I was hoping to hear! Can't wait for 1.2 and the accompanying book!
On 3/11/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:the irc channel juergen is referring to is on 
irc.freenode.net ##wicketif you check 


http://wicket.sourceforge.net/ you will see the news item release a few days ago detailing all the new features of 
1.2 beta 1. weve been so busy with it we havent had the chance to update some parts of our website.wicket is used as the ui framework by a lot of the committers in their day jobs, so its not going anywhere, nor will it get stale :)
-IgorOn 3/11/06, 
Juergen Donnerstag [EMAIL PROTECTED] wrote:



We are definitely active. Scanning the mail archiv will proof thatpoint. We recently provided 1.2B1 to the community and the sourceforgedownload page will provide you with many more early 1.2 releases(which also proofs that we are active). Lots of work went into 
1.2 andmany many improvement driven by the community have been implemented.Yes documentation needs to be improved, though javadoc is very goodcompared to many other frameworks. The mailing list IMO is excellent
and irc channel ##wicket is a valuable source for information as well.The first book based on 1.2 will be out this summer.JuergenOn 3/11/06, Vincent Jenks 



[EMAIL PROTECTED] wrote: I've noticed that there's not been a Wicket release in about 6 mo. - is Wicket being actively developed?From what little experimentation I've done it seems like the best web UI framework out there, hands down.Obviously, I
 have to be concerned with popularity if I'm to recommend an open source framework for our projects at work...if Wicket should fade into obscurity we'd essentially be stuck and of course, I'd catch a lot of heat having to
 switch out the UI for another technology. The website appears to have a lot of outdated info (e.g.  The Wicket 1.2 release is scheduled to become final for early januari, possibly earlier.)
 and the documentation is fairly sparse, even w/ the wiki.I could not determine if there are any Wicket books available (or on the way) - can we expect at least a book sometime soon?I'd be the first in line for a copy!
 Thanks! -v---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!


http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user








Re: [Wicket-user] query strings...

2006-03-11 Thread Vincent Jenks
Very good, thanks! It's not that I prefer querystrings, I'm just not as familiar w/ the approach wicket uses to version the page state (or so it appears.)Params are definitely cleaner (and safer).
On 3/11/06, Johan Compagner [EMAIL PROTECTED] wrote:
if you use bookmarkable pages used pageparameters like juergen pointed out.If you just use links and you do new Page() yourself.Then just hold that state on the server side like
setResponsePage(new MyPage(x,y,z))
johanOn 3/11/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

I'm still getting used to the way wicket utilizes querystring values for requests...how would one use querystrings to pass values around to pages? I can't find a simple answer to that in the documentation.
Thanks!
-v






Re: [Wicket-user] impressed w/ performance!

2006-03-11 Thread Vincent Jenks
Sure, I'd be interested to see how it stacks up. Where is 1.2 in terms of relative stability vs. 1.1.1? Is it at or near production quality for say, a mid-sized application w/ maybe a few dozen concurrent users, tops? Are there any glaring, known-issues?
Sorry if I'm asking redundant questions...I'm sure it's been asked 1000x now.I ran this same benchmark on Gentoo Linux w/ the 2.6.15 kernel using mysql 4.1 and it wasn't nearly as fast...and that box has a 3GHz proc w/ HT. I'm stuck w/ MSSQL for my work projects but I'd like to see how different db's stack up w/ JBoss EJB3.
-vOn 3/11/06, Johan Compagner [EMAIL PROTECTED] wrote:
can you do these test with the current 1.2 code?there are a lot of performance enhancements in 1.2, but ofcourse there are added functionality so don't know exactly how it did turn out.
johan
On 3/11/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:
Definitely helps, thanks much. I've been running more siege tests and yeah, performance goes right down the drain after running the test a few more times...to the point where it's taking 20+ seconds to load a page and the server's memory is getting sucked up quick.
In both cases, after running the test, the performance degrades and stays lower on each run...but the detached model version isn't nearly as bad.I'm going to test this on a server here in my home office which should provide better results than a centrino laptop.
And yeah, I could probably get a lot better information by using better tests but for now, I'd like to see how it stands up in a read-only scenario. Since this is a shopping cart...there won't be a *ton* of insert/update activity...but it will certainly have to stand up to the load when activity *does* pick up.
Thanks Igor!On 3/11/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
one. you wouldve seen a huge hit when not using detachable models if you were running your test on a non-sticky cluster. because then all that data you are putting into the session would be replicated on every request.

two. detached models help you to reduce the amount of memory your server is using. you load the model, use it for rendering, and then throw it away. if you dont use a detachable model, then the object the model is pointing to remains in ram until the page expires. so cpu/memory trade off here.
three. your app is a read only app. sometimes wicket needs to clone the model to support undo. if you are not using a detachable model that points to a large object then that object might get cloned which is often undesirable ( ie if it is the hibernate session you dont want the whole thing getting cloned because it can be huge and even when the model is rolled back on a back button that session is useless )
hope this clarifies some things.-Igor
On 3/11/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:OK, I ran a test using the small CLI app siege. I don't know how reliable this test is but the results logged are *definitely* impressive...to say the least...not at all what I expected given what I've done. This setup is as ghetto as it gets.
Here's my app:Presentation: Wicket 1.1.1Application: EJB3 on JBoss 4.0.4RC1 (non-clustered)Database: MSSQL 2000 (Developer Edition)The app is on my dev machine (my laptop) which is a single proc 2GHz Dell Latitude w/ 2GB ram.
I'm simply calling a collection of Entity beans from a stateless session bean and looping them in a table in Wicket. There's maybe 20 records in the table.Here's my Wicket code (without detachable model):
-
public class Home extends WebPage{ public Home() {  ListProduct products = this.getAllProducts();add(new ListView(products, products)  {
   protected void populateItem(ListItem item)   {Product product = (Product)item.getModelObject();item.add(new Label(description, product.getDescription





()));   }  }); }  private ListProduct getAllProducts() {Products p = null;  try  {   InitialContext ctx = new InitialContext();
   p = (Products)ctx.lookup(MyEarProject/ProductsBean/local);  }  catch (NamingException exp)  {   exp.printStackTrace();  }




  return 
p.getAll(); }}Here's the same code *with* detachable model (ctor only):- public Home() {





  add(new HeaderPanel(headerPanel));  add(new FooterPanel(footerPanel));   IModel loadingModel = new LoadableDetachableModel()  {   Products p = null;
   protected Object load()   {try{ InitialContext ctx = new InitialContext(); p = (Products)ctx.lookup(MyEarProject/ProductsBean/local);  
}catch (NamingException exp){ exp.printStackTrace();} return p.getAll();   }





  };add(new ListView(products, loadingModel)  {   protected void populateItem(ListItem item)   {Product product = (Product)item.getModelObject();
item.add(new Label(description, product.getDescription()));   }  }); }Here

Re: [Wicket-user] Wicket community...

2006-03-11 Thread Vincent Jenks
Understandable...and fair enough. I'd be willing to help out in that dept...maybe some tutorials?On 3/11/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:we simply lack the time for docs because we are very busy trying to finish 
1.2 with plans already for 1.3 and 2.0. we try to make up for the lack of documentation via our activiy on this list and irc, and the upcoming book.
-IgorOn 3/11/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

Absolutely, there's definitely growing buzz on some of the java sites I frequent too (javalobby, 

java.net, etc.) which is where I first heard of Wicket.I wasn't implying that there was no community...I was just put off at the lack of real rich documentation (non-javadoc) and book selection (zero to-date.)
-vOn 3/11/06, 
Johan Compagner [EMAIL PROTECTED] wrote:


also just look at this url:https://sourceforge.net/mailarchive/forum.php?forum_id=42353
can't say nothing is happening :)johan
On 3/11/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
That's what I was hoping to hear! Can't wait for 1.2 and the accompanying book!
On 3/11/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:the irc channel juergen is referring to is on 
irc.freenode.net ##wicketif you check 




http://wicket.sourceforge.net/ you will see the news item release a few days ago detailing all the new features of 
1.2 beta 1. weve been so busy with it we havent had the chance to update some parts of our website.wicket is used as the ui framework by a lot of the committers in their day jobs, so its not going anywhere, nor will it get stale :)
-IgorOn 3/11/06, 
Juergen Donnerstag [EMAIL PROTECTED] wrote:





We are definitely active. Scanning the mail archiv will proof thatpoint. We recently provided 1.2B1 to the community and the sourceforgedownload page will provide you with many more early 1.2 releases(which also proofs that we are active). Lots of work went into 
1.2 andmany many improvement driven by the community have been implemented.Yes documentation needs to be improved, though javadoc is very goodcompared to many other frameworks. The mailing list IMO is excellent
and irc channel ##wicket is a valuable source for information as well.The first book based on 1.2 will be out this summer.JuergenOn 3/11/06, Vincent Jenks 





[EMAIL PROTECTED] wrote: I've noticed that there's not been a Wicket release in about 6 mo. - is Wicket being actively developed?From what little experimentation I've done it seems like the best web UI framework out there, hands down.Obviously, I
 have to be concerned with popularity if I'm to recommend an open source framework for our projects at work...if Wicket should fade into obscurity we'd essentially be stuck and of course, I'd catch a lot of heat having to
 switch out the UI for another technology. The website appears to have a lot of outdated info (e.g.  The Wicket 1.2 release is scheduled to become final for early januari, possibly earlier.)
 and the documentation is fairly sparse, even w/ the wiki.I could not determine if there are any Wicket books available (or on the way) - can we expect at least a book sometime soon?I'd be the first in line for a copy!
 Thanks! -v---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!




http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user












[Wicket-user] nesting components

2006-03-13 Thread Vincent Jenks
I'm trying to nest a Label within a Link so the name of the link displayed is dynamic (please fill me in if there's a better way.)Here's my Link  Label on the page:a href="" wicket:id=linkspan wicket:id=linkNamelink/span/a
Here's the panel class:public class TrailPanel extends Panel{ public TrailPanel(String id, String linkName) {  super(id);//create link w/ event handler
  Link currentLink = new Link(link)  {   public void onClick()   {//redirectsetResponsePage(getPage());   }  };  
//add link to page  add(currentLink);  add(new Label(linkName, linkName)); }}I'm getting this exception, which makes sense..just don't know how to fix it:
wicket.markup.MarkupException: Unable to find component with id 'linkName' in [MarkupContainer [Component id = link, page = com.myapp.ui.admin.EditProduct, path = 1:trailPanel:link.TrailPanel$1, isVisible = true, isVersioned = true]]. This means that you declared wicket:id=linkName in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match
Don't shoot the n00b!!


[Wicket-user] FormInputModel not found?

2006-03-14 Thread Vincent Jenks
I'm trying to simply submit a form (Wicket 1.1.1) and I'm using the wicket-examples-1.1.1...where it shows a constructor that uses a FormInputModel class:super(name, new CompoundPropertyModel(new FormInputModel()));
However, I'm getting this error:FormInputModel cannot be resolved to a typeLooking through the javadocs, there's no FormInputModel in 1.1.1, is this a Wicket 1.2 feature? If so, why is it in 
1.1.1 examples?How do I simply submit a form and snag the post values?Thanks!


Re: [Wicket-user] FormInputModel not found?

2006-03-14 Thread Vincent Jenks
Oh I see, I hadn't noticed that, sorry. So it's similar to the managed bean concept in JSF? That was one of the things I *didn't* like about JSF, actually.Is there any way to avoid having to create a bean class for the form values? I'm using EJB3 and was hoping there was a way for me to use BeanUtils or something that would automatically populate one of my entity beans w/o having to build this extra layer to do it.
I've heard it argued that this isn't good design and so on but I'm just trying to keep it simple...what I'm doing is more a proof of concept than anything.I really liked the BeanUtils concept when I was building apps w/ servlets + JSPs to just dump the map into the model object and be done w/ it.
Thanks!On 3/14/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
FormInputModel is a java class that lives inside wicket.examples.forminput. it is in 1.1.1.it is a simple bean where the form can save its values. you need to create one for your own form.
-Igor
On 3/14/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:
I'm trying to simply submit a form (Wicket 1.1.1) and I'm using the wicket-examples-1.1.1...where it shows a constructor that uses a FormInputModel class:super(name, new CompoundPropertyModel(new FormInputModel()));
However, I'm getting this error:FormInputModel cannot be resolved to a typeLooking through the javadocs, there's no FormInputModel in 1.1.1, is this a Wicket 1.2 feature? If so, why is it in 
1.1.1 examples?How do I simply submit a form and snag the post values?Thanks!






Re: [Wicket-user] FormInputModel not found?

2006-03-14 Thread Vincent Jenks
Ahh yeah, did that, worked great! Thanks!On 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED]
 wrote:why not pass in whatever you want to populate as the model object instead of the bean. a compoundpropertymodel/propertymodel can bind to anything that has public setters/getters or public properties.
we had no such thing in the example so we created the bean.
-IgorOn 3/14/06, Vincent Jenks 

[EMAIL PROTECTED] wrote:
Oh I see, I hadn't noticed that, sorry. So it's similar to the managed bean concept in JSF? That was one of the things I *didn't* like about JSF, actually.Is there any way to avoid having to create a bean class for the form values? I'm using EJB3 and was hoping there was a way for me to use BeanUtils or something that would automatically populate one of my entity beans w/o having to build this extra layer to do it.
I've heard it argued that this isn't good design and so on but I'm just trying to keep it simple...what I'm doing is more a proof of concept than anything.I really liked the BeanUtils concept when I was building apps w/ servlets + JSPs to just dump the map into the model object and be done w/ it.
Thanks!On 3/14/06, Igor Vaynberg 


[EMAIL PROTECTED] wrote:
FormInputModel is a java class that lives inside wicket.examples.forminput. it is in 1.1.1.it is a simple bean where the form can save its values. you need to create one for your own form.
-Igor
On 3/14/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:
I'm trying to simply submit a form (Wicket 1.1.1) and I'm using the wicket-examples-1.1.1...where it shows a constructor that uses a FormInputModel class:super(name, new CompoundPropertyModel(new FormInputModel()));
However, I'm getting this error:FormInputModel cannot be resolved to a typeLooking through the javadocs, there's no FormInputModel in 1.1.1, is this a Wicket 1.2 feature? If so, why is it in 
1.1.1 examples?How do I simply submit a form and snag the post values?Thanks!











Re: [Wicket-user] FormInputModel not found?

2006-03-14 Thread Vincent Jenks
Yep, it's the code duplication that seriously turns me off...and can make for some very tedious work if the object model should change.I looked into Seam and IMO, it's a bit too intrusive on the session beans and really sort of blurs the line between your presentation and other app layersthough it obviously makes life easy. I just didn't care for it (compared to Wicket, which is quite elegant.)
If I'm using detached models and then merge them back into the persistence context after the form is submitted, I wouldn't have to worry about straggling sessions on my entities, would I? You'll have to forgive my ignorance, I just started using EJB3 about a week ago.
On 3/14/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
On 3/14/06, Vincent Jenks [EMAIL PROTECTED] wrote: Oh I see, I hadn't noticed that, sorry.So it's similar to the managed bean concept in JSF?That was one of the things I *didn't* like about JSF,
 actually.I would say it is more like the value object pattern, where you have a- usually shallow - copy of a domain object just for the purpose ofpassing parameters (input output) around in the view layer. The
disadvantage of that pattern is that you'll get quite some codeduplication. The advantage is that you'll never have to worry aboutthings like the integrity of your domain objects and whether or notthey have stale Hibernate/ EJB3 sessions attached. The difference with
JSF is that we don't force you in having any such bean, and thatWicket doesn't manage the beans you provide.Eelco---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] FormInputModel not found?

2006-03-14 Thread Vincent Jenks
Yes, it is very easy! Thanks a lot for the help. I'm beginning to see how powerful Wicket is while remaining simple.On 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:that should be fine for most cases.the workflow would be:
when the form needs to render for the first time it will attach the detachable model and load your entity. individual components will pull their initial values from the entity
you submit the form - and there is an errorform will be refreshed based on previous entered input - not from your modelyou submit the form and there are no errors - form is going to apply the values back into its model
your entity will be loaded - and values from individual form components applied via settershope this clarifies it some. we have tried to optimize our form workflow to make it as easy as possible.
-Igor
On 3/14/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:
Yep, it's the code duplication that seriously turns me off...and can make for some very tedious work if the object model should change.I looked into Seam and IMO, it's a bit too intrusive on the session beans and really sort of blurs the line between your presentation and other app layersthough it obviously makes life easy. I just didn't care for it (compared to Wicket, which is quite elegant.)
If I'm using detached models and then merge them back into the persistence context after the form is submitted, I wouldn't have to worry about straggling sessions on my entities, would I? You'll have to forgive my ignorance, I just started using EJB3 about a week ago.
On 3/14/06, Eelco Hillenius 

[EMAIL PROTECTED] wrote:
On 3/14/06, Vincent Jenks [EMAIL PROTECTED] wrote: Oh I see, I hadn't noticed that, sorry.So it's similar to the managed
 bean concept in JSF?That was one of the things I *didn't* like about JSF,
 actually.I would say it is more like the value object pattern, where you have a- usually shallow - copy of a domain object just for the purpose ofpassing parameters (input output) around in the view layer. The
disadvantage of that pattern is that you'll get quite some codeduplication. The advantage is that you'll never have to worry aboutthings like the integrity of your domain objects and whether or notthey have stale Hibernate/ EJB3 sessions attached. The difference with
JSF is that we don't force you in having any such bean, and thatWicket doesn't manage the beans you provide.Eelco---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!


http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___Wicket-user mailing list

Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user








[Wicket-user] validating input

2006-03-14 Thread Vincent Jenks
I just built a form that has a mixture of TextField, TextArea, and CheckBox components in it. I am now adding validation to get a feel for how it works but am confused.I found that I could substitute a TextField with a RequiredTextField and validation was *extremely* simple to setupif you're using input form fields. However, it doesn't appear that these helper classes exist for all types of form widgets...or am I mistaken?



[Wicket-user] DataView (extentions)

2006-03-14 Thread Vincent Jenks
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!


Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Vincent Jenks
Sorry, I didn't mention that the List is wrapped in a detached modelso it's an IModel, not List in the constructor.On 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:yes DataView works with IDataProvider instead of list. not sure why you
didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.
I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!






Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Vincent Jenks
I'm using 1.1.1 Are there any plans to whittle down the amount of code it takes to implement paging  sorting? Has it changed at all in 1.2? I spent a lot of time w/ ASP.NET (which wicket feels quite similar to) and there's a DataGrid component that has properties to set paging  sorting w/o any extra work. Something like that would be really convenient.
On 3/14/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
are you using 1.1 ? or 1.2 ?there used to be a constructor that took model in 1.1 i think. the model object must be of type IDataProvider.-Igor
On 3/14/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

Sorry, I didn't mention that the List is wrapped in a detached modelso it's an IModel, not List in the constructor.On 3/14/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:yes DataView works with IDataProvider instead of list. not sure why you
didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.
I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!










Re: [Wicket-user] DataView (extentions)

2006-03-15 Thread Vincent Jenks
I'd love to see this (along w/ an example or two on usage) ;)On 3/15/06, Frank Silbermann [EMAIL PROTECTED]
 wrote:


















The DataTable in Wicket Extensions 1.1
handles paging and sorting, but you must build a custom IDataProvider that accumulates
the sorting instructions from the DataTable and provides sorted subsets of the
data when requested by the DataTable (which handles the actual paging display).



DataTable and supporting classes have been
greatly refactored in Wicket Extensions 1.2 to give the user much more
flexibility in the set of features desired. The API changes will break Wicket 1.1
programs, so if you need to subclass anything to modify its behavior, I would
suggest going to Wicket 1.2 now. Otherwise, you can upgrade fairly easily
at any time by replacing Wicket 1.1 DataTable with Wicket 1.2
DefaultDataTable. Wicket 1.2
DataTable is more flexible but less complete; DefaultDataTable subclasses it to
provide defaults which make it behave like the Wicket 1.1 DataTable.



I have come up with my own subclass of
DataTable and implementation of IDataProvider to display any arbitrary database
java.sql.ResultSet. The basic idea
is that my IDataProvider implementation contains a List of rows, each row
consisting of a List of Object.
Also in the implementation is an array of descriptors, one per column, each
of which contains the column name and an indicator as to whether I want to be
able to sort on that column. (The
column name comes from the ResultSetMetadata; a method is provided to set the
sortability flag.) My implementation
of the abstract method to deliver a sequence of rows will delegate to the List.sublist()
command from the Java Collections API, and each time the DataTable delivers a
sort criteria I apply the Collections.sort() method to my list of rows, passing
it a Comparator that delegates to the Comparator of the Object at the relevant
column index. My implementation of
IDataProvider can also look at my array of column descriptors and generate a
list of IColumn objects (needed to construct the DataTable).



It's actually a bit more complicated
than that (and a work in progress), because I have complicated the above
mechanisms to deal with the possibility of a summary row at the end, and when
rows are requested, the query string will be recalculated based on form data --
and if it has changed since the last request then the data will be refreshed
from the database and the current page set back to 1.



The code is actually quite compact; when I'm
finished I'll post it to the list if there is any interest.





-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of 
Igor Vaynberg
Sent: Tuesday, March 14, 2006
 5:21 PM
To:
wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user]
DataView (extentions)



there is also a DataTable component which wraps
DataView+paging+sorting.

-Igor





On 3/14/06, Vincent Jenks 
 [EMAIL PROTECTED] wrote:

I'm using 1.1.1 Are there any plans to whittle
down the amount of code it takes to implement paging  sorting? Has
it changed at all in 1.2? I spent a lot of time w/ ASP.NET (which
wicket feels quite similar to) and there's a DataGrid component that has
properties to set paging  sorting w/o any extra work. Something like
that would be really convenient. 







On 3/14/06, Igor Vaynberg 
 [EMAIL PROTECTED]
wrote:

are you using 1.1 ? or 1.2 ?
there used to be a constructor that took model in 1.1 i think. the model object
must be of type IDataProvider.





-Igor





On 3/14/06, Vincent Jenks 
[EMAIL PROTECTED]
wrote:

Sorry, I didn't mention that the List is wrapped in a
detached modelso it's an IModel, not List in the constructor.







On 3/14/06, Igor Vaynberg 
 [EMAIL PROTECTED]
wrote:

yes DataView works with IDataProvider instead of list.
not sure why you didnt get a compile error since there is no (String,List)
constructor.


there are examples of dataview and datatable under wicket-examples/repeaters 

-Igor







On 3/14/06, Vincent Jenks 

[EMAIL PROTECTED] wrote: 

So, I'm trying to use a DataView so I can page a
collection of objects
from a session bean. 

I create the List collection (loadingModel) and pass it into the DataView:

DataView productsDataView = new DataView(productsDataView,
loadingModel) 

...but I'm getting an exception at runtime:

Caused by: java.lang.ClassCastException: java.util.ArrayList

I assume then, it's not like the ListView in that it will not take a
List directly? Or, have I done something wrong? 

Thanks! 









































[Wicket-user] trying to understand concept...

2006-03-15 Thread Vincent Jenks
I'm trying to wrap my head around how I would create a page where I could either edit an existing record or create a new one.Currently, I've got a form where I can add a record to the database - that part is working great. I'd like to refactor it now to also edit an existing record, if there is one. The user would choose a record from a ListView below the form and the form would be populated w/ the values of that entity bean. The user would change values and then submit the form.
My first idea was to pass the object into the constructor of the page class:public EditProduct(Product editProduct)...and then decide inside the constructor whether or not to create a new Product object or use the one passed in:
  //edit or new?  Product p = null;if (editProduct == null)   p = new Product();  else   p = editProduct;I would then pass the Product into the form:
add(new EditProductForm(editProductForm, p));...which would be bound like so:  public EditProductForm(String name, Product product)  {   super(name, new CompoundPropertyModel(product));
..However, I didn't realize you had to do everything within the *default* constructor of the WebPage derived class...oops! I start to see this exception all over again:wicket.markup.MarkupException
: Unable to find component with id 'headerPanel' in..Am I making this more complicated than it needs to be? What is a better approach?Thanks!


Re: [Wicket-user] trying to understand concept...

2006-03-15 Thread Vincent Jenks
I see, I'll try it again. So, that being said, when can I be sure I'm not using a bookmarkable page? I noticed that on some requests the bookmarkable querystring is used and on others...the path is used.
I apologize if I'm asking annoying n00b questions, I'm trying to cram Wicket into my head and into a small proof-of-concept project to convince my boss to let me use it on future projects (now that we're migrating to Java.)
Thanks again!On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
sounds like you are on the right place. you dont have to use the default constructor. the default/PageParameters constructor is only needed if this page is going to be accessed through a bookmarkable url. outside of that you are welcome to use any constructor you want.
-IgorOn 3/15/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

I'm trying to wrap my head around how I would create a page where I could either edit an existing record or create a new one.Currently, I've got a form where I can add a record to the database - that part is working great. I'd like to refactor it now to also edit an existing record, if there is one. The user would choose a record from a ListView below the form and the form would be populated w/ the values of that entity bean. The user would change values and then submit the form.
My first idea was to pass the object into the constructor of the page class:public EditProduct(Product editProduct)...and then decide inside the constructor whether or not to create a new Product object or use the one passed in:
  //edit or new?  Product p = null;if (editProduct == null)   p = new Product();  else   p = editProduct;I would then pass the Product into the form:
add(new EditProductForm(editProductForm, p));...which would be bound like so:  public EditProductForm(String name, Product product)  {   super(name, new CompoundPropertyModel(product));
..However, I didn't realize you had to do everything within the *default* constructor of the WebPage derived class...oops! I start to see this exception all over again:wicket.markup.MarkupException


: Unable to find component with id 'headerPanel' in..Am I making this more complicated than it needs to be? What is a better approach?Thanks!






Re: [Wicket-user] simple nested component question

2006-03-15 Thread Vincent Jenks
Ahh that makes perfect sense, can't believe I overlooked that! Anyhow, thank you!On 3/15/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you add components to the listview's listitem not the listview itself. since each listitem has a unique id you dont have a problem, ie :
listview.0.mylinklistview.1.mylinketc-Igor

On 3/15/06, Vincent Jenks [EMAIL PROTECTED] wrote:

So, let's say I've got a ListView and in it I need to nest other components...in my case a Link. Obviously, the id for that Link becomes duplicated after more than one record exists and throws an exception. 
What's a simple way around this?
Thanks!






Re: [Wicket-user] Newbie question: applying dynamic form component with ListView

2006-03-15 Thread Vincent Jenks
So, in a nutshell, my code could be refactored to eliminate the need for Label objects in each row and in their place, use the model objects?On 3/15/06, Jonathan Cone
 [EMAIL PROTECTED] wrote:








Hi Michael,

One thing that I personallythink is important 
to understanding ListView is knowing that each item in the ListView is one 
concrete model object instance. If you think about it, then you will see 
you shouldn't need many(if any) collections in your form backing model 
classes. So aListView takes a 'list' ofmodel objects and 
displays each one independent of the other. One of the cool things about 
wicket is that your model object instancefieldscan be strongly typed 
(more easily than Struts). As you'll see in the model object below. Take a 
look at the following code which is based on your example (I only used generics 
for type clarity):

public class DetailForm extends Form {
private final List 
ageList = Arrays.asList(new Integer[] 
{Integer.valueOf(10), Integer.valueOf(20), 
Integer.valueOf(30) });

// You'll probably want to pass your list in to your form 
constructor, as opposed to this.private final static 
ListDetailModel model = initModelList();

public DetailForm(final String id) {

super(id);

// This model is a list of DetailModelsListView 
listView = new ListView(detailList, model) {

public void populateItem(final ListItem listItem) {

listItem.setModel(new 
CompoundPropertyModel((DetailModel) 
listItem.getModelObject()));

// This is bound to 
model.getCode()/setCode()listItem.add(new 
TextField(code));

// Same for 
model.getAge()/setAge()listItem.add(new 
DropDownChoice(age, ageList));

// Same for 
model.getName()/setName()listItem.add(new 
TextField(name));}};add(listView);

}

// Just a test to see that your changes are taking 
effect.@Overrideprotected void onSubmit() 
{System.out.println(model);}

// Again, not ideal, but for the sake of this example.
private static ListDetailModel initModelList() 
{ListDetailModel model = new 
ArrayListDetailModel();model.add(new 
DetailModel(Integer.valueOf(10), Harry, 
bigboy));model.add(new DetailModel(Integer.valueOf(20), Jan, 
foo));model.add(new DetailModel(Integer.valueOf(30), Meg, 
boss));return model;}

public static class DetailModel implements Serializable {

private Integer age;private String 
name;private String code;

public DetailModel() {

}

public DetailModel(Integer age, String name, String code) 
{super();this.age = 
age;this.name = name;this.code = 
code;}

public String getCode() {return 
code;}

public void setCode(String code) 
{this.code = code;}

public Integer getAge() {return 
age;}

public void setAge(Integer age) {this.age 
= age;}

public String getName() {return 
name;}

public void setName(String name) 
{this.name = name;}

@Overridepublic String toString() 
{return name + ,  + age + ( + code + 
);}}

}
Good luck, I hope this helps you understand. Just remember that it 
really is as easy as it should be, which (sadly) takes some getting used to if 
you've used other frameworks.

  - Original Message - 
  
From: 
  Michael K 
  
  To: 
Wicket User List 
  Sent: Wednesday, March 15, 2006 4:22 
  AM
  Subject: [Wicket-user] Newbie question: 
  applying dynamic form component with ListView
  Hi,Which type should I define in POJO Model to hold the 
  value of the array of TextField/DropDownChoice when populated by ListView? 
  Should I define it as String[] or ArrayList or something else? I have 
  attached the following example to explain my 
  situation: public class DetailForm extends Form 
  { private java.util.List ageList 
  = Arrays.asList(new String[]{ 10, 20, 30 
  }); public DetailForm(String 
  string){ 
  super(string); 
  DetailModel dm = new 
  DetailModel(); 
  setModel(new 
  CompoundPropertyModel(dm)); 
  ListView listView = new ListView(detailList, new PropertyModel(this, 
  detailData)){ 
  public void populateItem(final ListItem 
  listItem){ 
  final String detail = (String) 
  listItem.getModelObject(); 
  listItem.add(new 
  Label(code,detail)); 
  listItem.add(new 
  DropDownChoice(age,ageList)); 
  listItem.add(new 
  TextField(name)); 
  } 
  }; 
  add(listView); 
  } public List 
  getDetailData(){ 
  java.util.List hm = new ArrayList(); 
// Should get the data from DB, 
  for simplicity I use hardcode 
  value 
  hm.add(); 
  hm.add(); 
  hm.add(); 
  return hm; 
  } } 
  nbsp; // Model class public class DetailModel implements 
  Serializable { private 
  String[] age = new ArrayList(); //  Not sure about the 
  type private String[] 
  name; public String[] 
  getAge(){ 
  return age; 
  } public void 
  setAge(String[] 
  age){ 
  this.age = age; 
  } public String[] 
  getName(){ 
  return name; 
  } public void 
  setName(String[] 
  name){ 
  this.name = name; 
  } }The idea behind String[] was my 'past time' 
  with Struts :) Any 
suggestion?Cheers,Michael




Re: [Wicket-user] trying to understand concept...

2006-03-15 Thread Vincent Jenks
I don't call them directly *with* the querystring...I called this up in a browser:
http://localhost:8080/MyApp/edit_product...which jumped to:
http://localhost:8080/MyApp/edit_product?path=1and threw the exception.You mean to say that I could *never* safely call a url of an Application I've mapped in web.xml like this:

http://localhost:8080/MyApp/edit_productwhere edit_product is mapped to my Application class/servlet?On 3/15/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:
you cannot call the page standalaone from the browser. wicket doesnt work that way. the /only/ pages you can call yourself are the bookmarkable pages that have a stable url.the ?path... urls are internal and the same url can point to different pages dependent on what the session state is. you should never call those urls directly.
-IgorOn 3/15/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
I still must not be understanding you entirely. It makes sense but here's an example of what I'm doing and I'm still getting an exception:My URL looks like this (non-bookmarkable):


http://localhost:8080/MyApp/edit_product?path=1The class has no default constructor...it has only one that looks like this:public class EditProduct extends WebPage{ public EditProduct(Product editProduct)
 {  I get this exception:wicket.WicketRuntimeException: Unable to instantiate Page class:...Caused by: wicket.WicketRuntimeException: Unable to create page from class ... Class does not have a default contructor
Alright, fair enough, so I add one:public class EditProduct extends WebPage{ /** * default ctor * */ public EditProduct() {   } 


 public EditProduct(Product editProduct) {  .And now I get this exception:wicket.markup.MarkupException: Unable to find component with id 'headerPanel' in...
Which must mean that all of my component additions should be in the default ctor, right?
This page isn't being instantiated through setResponsePage, I'm just calling it up in a browser, stand alone, but I'm assuming that shouldn't matter since I'm not using a bookmarked URL.

Thanks again!
On 3/15/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
when you do setResponsePage(Class) a bookmarkable url is created and the page instance will be created through the default or the (PageParameters) constructor. when you do setResponsePage(new MyPage()) you create the instance yourself with any constructor you want and a non-bookmarkable url will be used.
-IgorOn 3/15/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
I see, I'll try it again. So, that being said, when can I be sure I'm not using a bookmarkable page? I noticed that on some requests the bookmarkable querystring is used and on others...the path is used.
I apologize if I'm asking annoying n00b questions, I'm trying to cram Wicket into my head and into a small proof-of-concept project to convince my boss to let me use it on future projects (now that we're migrating to Java.)
Thanks again!On 3/15/06, Igor Vaynberg 



[EMAIL PROTECTED] wrote:




sounds like you are on the right place. you dont have to use the default constructor. the default/PageParameters constructor is only needed if this page is going to be accessed through a bookmarkable url. outside of that you are welcome to use any constructor you want.
-IgorOn 3/15/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:





I'm trying to wrap my head around how I would create a page where I could either edit an existing record or create a new one.Currently, I've got a form where I can add a record to the database - that part is working great. I'd like to refactor it now to also edit an existing record, if there is one. The user would choose a record from a ListView below the form and the form would be populated w/ the values of that entity bean. The user would change values and then submit the form.
My first idea was to pass the object into the constructor of the page class:public EditProduct(Product editProduct)...and then decide inside the constructor whether or not to create a new Product object or use the one passed in:
  //edit or new?  Product p = null;if (editProduct == null)   p = new Product();  else   p = editProduct;I would then pass the Product into the form:
add(new EditProductForm(editProductForm, p));...which would be bound like so:  public EditProductForm(String name, Product product)  {   super(name, new CompoundPropertyModel(product));
..However, I didn't realize you had to do everything within the *default* constructor of the WebPage derived class...oops! I start to see this exception all over again:wicket.markup.MarkupException






: Unable to find component with id 'headerPanel' in..Am I making this more complicated than it needs to be? What is a better approach?Thanks!














Re: [Wicket-user] trying to understand concept...

2006-03-15 Thread Vincent Jenks
Ahh OK OK, the light came on...I added this for a default ctor and it works just how I want: public EditProduct() {  this(null); }On 3/15/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:
I don't call them directly *with* the querystring...I called this up in a browser:

http://localhost:8080/MyApp/edit_product...which jumped to:

http://localhost:8080/MyApp/edit_product?path=1and threw the exception.You mean to say that I could *never* safely call a url of an Application I've mapped in 
web.xml like this:

http://localhost:8080/MyApp/edit_productwhere edit_product is mapped to my Application class/servlet?
On 3/15/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:

you cannot call the page standalaone from the browser. wicket doesnt work that way. the /only/ pages you can call yourself are the bookmarkable pages that have a stable url.the ?path... urls are internal and the same url can point to different pages dependent on what the session state is. you should never call those urls directly.
-IgorOn 3/15/06, Vincent Jenks 

[EMAIL PROTECTED] wrote:
I still must not be understanding you entirely. It makes sense but here's an example of what I'm doing and I'm still getting an exception:My URL looks like this (non-bookmarkable):



http://localhost:8080/MyApp/edit_product?path=1The class has no default constructor...it has only one that looks like this:public class EditProduct extends WebPage{ public EditProduct(Product editProduct)
 {  I get this exception:wicket.WicketRuntimeException: Unable to instantiate Page class:...Caused by: wicket.WicketRuntimeException: Unable to create page from class ... Class does not have a default contructor
Alright, fair enough, so I add one:public class EditProduct extends WebPage{ /** * default ctor * */ public EditProduct() {   } 



 public EditProduct(Product editProduct) {  .And now I get this exception:wicket.markup.MarkupException: Unable to find component with id 'headerPanel' in...
Which must mean that all of my component additions should be in the default ctor, right?
This page isn't being instantiated through setResponsePage, I'm just calling it up in a browser, stand alone, but I'm assuming that shouldn't matter since I'm not using a bookmarked URL.


Thanks again!
On 3/15/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
when you do setResponsePage(Class) a bookmarkable url is created and the page instance will be created through the default or the (PageParameters) constructor. when you do setResponsePage(new MyPage()) you create the instance yourself with any constructor you want and a non-bookmarkable url will be used.
-IgorOn 3/15/06, Vincent Jenks 



[EMAIL PROTECTED] wrote:
I see, I'll try it again. So, that being said, when can I be sure I'm not using a bookmarkable page? I noticed that on some requests the bookmarkable querystring is used and on others...the path is used.
I apologize if I'm asking annoying n00b questions, I'm trying to cram Wicket into my head and into a small proof-of-concept project to convince my boss to let me use it on future projects (now that we're migrating to Java.)
Thanks again!On 3/15/06, Igor Vaynberg 




[EMAIL PROTECTED] wrote:





sounds like you are on the right place. you dont have to use the default constructor. the default/PageParameters constructor is only needed if this page is going to be accessed through a bookmarkable url. outside of that you are welcome to use any constructor you want.
-IgorOn 3/15/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:






I'm trying to wrap my head around how I would create a page where I could either edit an existing record or create a new one.Currently, I've got a form where I can add a record to the database - that part is working great. I'd like to refactor it now to also edit an existing record, if there is one. The user would choose a record from a ListView below the form and the form would be populated w/ the values of that entity bean. The user would change values and then submit the form.
My first idea was to pass the object into the constructor of the page class:public EditProduct(Product editProduct)...and then decide inside the constructor whether or not to create a new Product object or use the one passed in:
  //edit or new?  Product p = null;if (editProduct == null)   p = new Product();  else   p = editProduct;I would then pass the Product into the form:
add(new EditProductForm(editProductForm, p));...which would be bound like so:  public EditProductForm(String name, Product product)  {   super(name, new CompoundPropertyModel(product));
..However, I didn't realize you had to do everything within the *default* constructor of the WebPage derived class...oops! I start to see this exception all over again:wicket.markup.MarkupException







: Unable to find component with id 'headerPanel' in..Am I making this more complicated than it needs to be? What is a better approach?Thanks!
















[Wicket-user] formatting

2006-03-15 Thread Vincent Jenks
I thought I had read that wicket has some formatting capabilities? Am I mistaken? Or, am I left to use Java's formatting capabilities?Thanks!


Re: [Wicket-user] formatting

2006-03-15 Thread Vincent Jenks
formatting displayed valuesdollars, number of decimal points, dates, etc.On 3/15/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:formatting?
-IgorOn 3/15/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
I thought I had read that wicket has some formatting capabilities? Am I mistaken? Or, am I left to use Java's formatting capabilities?Thanks!






[Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
If objects used in a page are stored in a session, how do I access those objects when I redirect to a new page? Say I have public users who login and I want to display their name on pages and keep their user info in-session...on each page, how would I call those values?
Thanks!


Re: [Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
MySessionObject being a class you created subclassing WebSession?On 3/16/06, Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  
From: 
  Vincent Jenks 
  To: 
wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006




Re: [Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.
I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:

MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  


From: 
  Vincent Jenks 
  To: 


wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006








Re: [Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }
  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();
   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup
().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {
setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:



MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  




From: 
  Vincent Jenks 
  To: 




wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006












Re: [Wicket-user] objects in session

2006-03-17 Thread Vincent Jenks
Yep, my mistake, thanks! It works fine. I guess it'll take some getting used to but it's not all that bad.-vOn 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:UserSession us = new UserSession(
EditProductApp.get());this is wrong, you dont create the session yourself, you let wicket create it for you (thats why you return a factory)so in your page:UserSession session=(UserSession)getSession();
sometimes nice to have this wrapped in a basepage.-IgorOn 3/16/06, 
Vincent Jenks [EMAIL PROTECTED]
 wrote:I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }


  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {
return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(
LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();


   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup


().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {


setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 



[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 




[EMAIL PROTECTED] wrote:





MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  






From: 
  Vincent Jenks 
  To: 






wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those

Re: [Wicket-user] objects in session

2006-03-17 Thread Vincent Jenks
What about removing objects from the session? Simply use the setter to set to null? Will that clear it?On 3/17/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:Yep, my mistake, thanks! It works fine. I guess it'll take some getting used to but it's not all that bad.
-vOn 3/16/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:UserSession us = new UserSession(
EditProductApp.get());this is wrong, you dont create the session yourself, you let wicket create it for you (thats why you return a factory)so in your page:UserSession session=(UserSession)getSession();
sometimes nice to have this wrapped in a basepage.-IgorOn 3/16/06, 
Vincent Jenks [EMAIL PROTECTED]
 wrote:I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }



  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {
return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(
LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();



   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup



().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {



setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 



[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 




[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 





[EMAIL PROTECTED] wrote:






MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  







From: 
  Vincent Jenks 
  To: 







wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new

Re: [Wicket-user] wicket 1.1.1: specifiying style on radiochoice or dropdownchoice

2006-03-17 Thread Vincent Jenks
If I might ask, what are the known (major) problem-areas, if any, in Wicket 1.2? What are the serious known bugs? I'd like to be developing in 1.2 myself but if there are some serious problems, I'd rather wait.My project is due to go into production in *exactly* one month...so I'm not sure if I should just wait until 
1.2 is more mature?Will 1.2 be released w/ a decent change log of differences between 1.1.1 and 1.2?Thanks!On 3/17/06, Nino Wael 
[EMAIL PROTECTED] wrote:Ok, thanks. That sound perfect.-regards Nino
-Oprindelig meddelelse-Fra: [EMAIL PROTECTED] på vegne af Johan CompagnerSendt: fr 17-03-2006 11:51
Til: wicket-user@lists.sourceforge.netCc:Emne: Re: [Wicket-user] wicket 1.1.1: specifiying style on radiochoice or dropdownchoice
if you are just developing and youre application doesn't have to go live with 1 month or soi would build in 1.2. We will break out another beta this weekend and then we will go into RC mode.
johanOn 3/17/06, Nino Wael [EMAIL PROTECTED] wrote:Hmm, how far is 1.2 from going stable, is possible to get a status on that?
Im in the midst of developing could I just switch to 1.2?-Oprindelig meddelelse-Fra: 
[EMAIL PROTECTED] på vegne af Johan CompagnerSendt: fr 17-03-2006 11:05Til: wicket-user@lists.sourceforge.net
Cc:Emne: Re: [Wicket-user] wicket 1.1.1: specifiying style on radiochoice or dropdownchoicedon't know currently for 1.1.1 but in 
1.2 we have selection change support in RadioGroup.johanOn 3/17/06, Nino Wael  [EMAIL PROTECTED] mailto:
[EMAIL PROTECTED]  wrote:On my RadioChoice I make use of the onSelectionChanged, I cant find a method to do this on Radio/RadioGroup so I guess I need to implement this aswell?
-Nino-Oprindelig meddelelse-Fra: 
[EMAIL PROTECTED] på vegne af Igor VaynbergSendt: fr 17-03-2006 09:46Til: 
wicket-user@lists.sourceforge.netCc:Emne: Re: [Wicket-user] wicket 1.1.1: specifiying style on radiochoice or dropdownchoice
you can add an attribute modifier that will insert the style attribute for dropdownchoice. for radiochoice you cant since it is in total control of the markup, if you want to style it you can use Radio/RadioGroup components instead.
-IgorOn 3/17/06, Nino Wael [EMAIL PROTECTED] wrote:
HiHow do I specify a style for radiochoice or dropdownchoice , do I need to create my own class and create a constructor which takes a style as a string and then adds it to the html ?
-regards Nino


Re: [Wicket-user] objects in session

2006-03-17 Thread Vincent Jenks
And this does what? The Javadoc just says it marks the session as dirty...does this mean it will be cleaned up automatically?On 3/17/06, Johan Compagner
 [EMAIL PROTECTED] wrote:
don't forget to call dirty() method on the session object when you change a value of the session: public void setUser(User user) {
  this.user = user;
 dirty(); }johan
On 3/17/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:Yep, my mistake, thanks! It works fine. I guess it'll take some getting used to but it's not all that bad.
-vOn 3/16/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:UserSession us = new UserSession(
EditProductApp.get());this is wrong, you dont create the session yourself, you let wicket create it for you (thats why you return a factory)so in your page:UserSession session=(UserSession)getSession();
sometimes nice to have this wrapped in a basepage.-IgorOn 3/16/06, 
Vincent Jenks [EMAIL PROTECTED]
 wrote:I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }




  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {
return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(
LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();




   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup




().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {




setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 




[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 





[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 






[EMAIL PROTECTED] wrote:







MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  








From: 
  Vincent Jenks

Re: [Wicket-user] objects in session

2006-03-17 Thread Vincent Jenks
This still isn't working how I would have expected...

So I've still got a Login page and an EditProduct page. If I go to /login (Login page) and login...I can't then go to /edit_product (EditProduct page) - I'll be automatically redirected back to Login...so obviously the User object was not found in-session.
However, if I first go to /edit_product (EditProduct) and login from there (since I was automatically redirected for not having an User object in-session)I can then go to EditProduct and the form appears.
I would have expected that if I logged-in at Login that I could go to any of the other pages and find the User object in-session.I'm confused... I changed the way I'm accessing the session per Igor's instructions so it now is called like so:
UserSession us = (UserSession)getSession();Any ideas?On 3/17/06, Johan Compagner [EMAIL PROTECTED]
 wrote:no it means that the session will be replicated when you use clustering. So it will update itself in the httpsession.
yes just clear a reference and call dirty() this will ofcourse remove the object from the session.
johanOn 3/17/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
And this does what? The Javadoc just says it marks the session as dirty...does this mean it will be cleaned up automatically?
On 3/17/06, Johan Compagner
 [EMAIL PROTECTED] wrote:


don't forget to call dirty() method on the session object when you change a value of the session: public void setUser(User user) {
  this.user = user;
 dirty(); }johan
On 3/17/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:Yep, my mistake, thanks! It works fine. I guess it'll take some getting used to but it's not all that bad.
-vOn 3/16/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:UserSession us = new UserSession(
EditProductApp.get());this is wrong, you dont create the session yourself, you let wicket create it for you (thats why you return a factory)so in your page:UserSession session=(UserSession)getSession();
sometimes nice to have this wrapped in a basepage.-IgorOn 3/16/06, 
Vincent Jenks [EMAIL PROTECTED]
 wrote:I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }






  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {
return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(
LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();






   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup






().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {






setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 






[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense

[Wicket-user] problem w/ DropDownChoice

2006-03-17 Thread Vincent Jenks
I'm trying to create a DropDownChoice select list based on a List of entity beans I'm pulling from EJB3. I'm following the example in the wicket-examples code but it's not working for me.I'm try do to it this way, per the example code:
   add(new DropDownChoice(productCategory, catsModel, new IChoiceRenderer())   {public String getDisplayValue(Object object){ return ((ProductCategory)object).getName();
}public String getIdValue(Object object, int index){ return String.valueOf(((ProductCategory)object).getCategoryId());
}   });...but eclipse is giving me an error and it won't compile:Cannot instantiate the type IChoiceRendererAnd, just taking it out causes the objects' .toString() to be returned...as expected:
   add(new DropDownChoice(productCategory, catsModel)
   {
public String getDisplayValue(Object object)
{
 return ((ProductCategory)object).getName();
}

public String getIdValue(Object object, int index)
{
 return String.valueOf(((ProductCategory)object).getCategoryId());
}
   });So...what do I do? IChoiceRender is a class, how can I instantiate it like a class per the wicket-examples DropDownChoice.java example code?Thanks!


Re: [Wicket-user] problem w/ DropDownChoice

2006-03-17 Thread Vincent Jenks
d'oh! Sorry, been at wicket all day...the brain is turning to pudding.On 3/17/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:problem is here: new IChoiceRenderer()) == remove that extra parenthesis :)
-IgorOn 3/17/06, 
Vincent Jenks 
[EMAIL PROTECTED] wrote:I'm trying to create a DropDownChoice select list based on a List of entity beans I'm pulling from EJB3. I'm following the example in the wicket-examples code but it's not working for me.
I'm try do to it this way, per the example code:
   add(new DropDownChoice(productCategory, catsModel, new IChoiceRenderer())   {public String getDisplayValue(Object object){ return ((ProductCategory)object).getName();
}public String getIdValue(Object object, int index){ return String.valueOf(((ProductCategory)object).getCategoryId());
}   });...but eclipse is giving me an error and it won't compile:Cannot instantiate the type IChoiceRendererAnd, just taking it out causes the objects' .toString() to be returned...as expected:
   add(new DropDownChoice(productCategory, catsModel)
   {
public String getDisplayValue(Object object)
{
 return ((ProductCategory)object).getName();
}

public String getIdValue(Object object, int index)
{
 return String.valueOf(((ProductCategory)object).getCategoryId());
}
   });So...what do I do? IChoiceRender is a class, how can I instantiate it like a class per the wicket-examples DropDownChoice.java example code?Thanks!






Re: [Wicket-user] objects in session

2006-03-17 Thread Vincent Jenks
I'm doing exactly that and I don't see how I could invalidating the session in any way.Let me clarify; I have a Login page and a EditProduct page. EditProduct will be one of many pages of which I'd like only the administrator User to access.
So, the Login Application class has this override: public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()
   {return new UserSession(LoginApp.this);   }  }; }...and when the user logs in, I save it in the session:.//event handler
  public void onSubmit()  {   //set user to session   ((UserSession)getSession()).setUser(user);I sub-classed WebPage and created AdminPage where I get the User from session:
public abstract class AdminPage extends WebPage{ public AdminPage() {  //get user from session  User user = ((UserSession)getSession()).getUser();//disallow access to non-admins
  if (user != null)  {   if (user.getUserGroup().getAccessLevel()  1)setResponsePage(new Login());  }  else  {   setResponsePage(new Login());
  } }}I then use the AdminPage class in a protected page (EditProduct):public class EditProduct extends AdminPageThe EditProduct Application class has this override:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(EditProductApp.this
);   }  }; }Now, here's where it gets screwed up and sort of works. I have the AdminPage class set to redirect you to Login if you are not logged-in. So, if I go to EditProduct before logging-in, I'm redirected to Login. I can login there and then go back to EditProduct...and it worked!!
Finally...if I should go to Login *first* and login...and *then* go to EditProductthe User object is null in the session...it doesn't work and I'm redirected back to Login.So, I wouldn't be able to send users to Login to log into their accountit just isn't working rightthe User should be available in-session if they login at the Login page and then go to a protected page.
I looked at the signin examples in wicket-examples and it doesn't really answer my question...it's too small to go to the length I've gone to in my example.Does this clarify where I'm having trouble? Thanks again for the help!
On 3/17/06, Johan Compagner [EMAIL PROTECTED] wrote:
i have no idea what you exactly do but if you put something in the session like((MySession)getSession()).setUser(new User());and then later on get it back:((MySession)getSession()).getUser();

then it will be there. Ofcource the session shouldn't be invalidated and the browser should support cookies or url rewriting so that it can track the session.all examples (see sign and so on) work that way so i din't know what you do wrong.
johanOn 3/17/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
This still isn't working how I would have expected...

So I've still got a Login page and an EditProduct page. If I go to /login (Login page) and login...I can't then go to /edit_product (EditProduct page) - I'll be automatically redirected back to Login...so obviously the User object was not found in-session.
However, if I first go to /edit_product (EditProduct) and login from there (since I was automatically redirected for not having an User object in-session)I can then go to EditProduct and the form appears.


I would have expected that if I logged-in at Login that I could go to any of the other pages and find the User object in-session.I'm confused... I changed the way I'm accessing the session per Igor's instructions so it now is called like so:
UserSession us = (UserSession)getSession();Any ideas?On 3/17/06, 
Johan Compagner [EMAIL PROTECTED]
 wrote:no it means that the session will be replicated when you use clustering. So it will update itself in the httpsession.
yes just clear a reference and call dirty() this will ofcourse remove the object from the session.
johanOn 3/17/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
And this does what? The Javadoc just says it marks the session as dirty...does this mean it will be cleaned up automatically?
On 3/17/06, Johan Compagner
 [EMAIL PROTECTED] wrote:




don't forget to call dirty() method on the session object when you change a value of the session: public void setUser(User user) {
  this.user = user;
 dirty(); }johan
On 3/17/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:Yep, my mistake, thanks! It works fine. I guess it'll take some getting used to but it's not all that bad.
-vOn 3/16/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:UserSession us = new UserSession(
EditProductApp.get());this is wrong, you dont create the session yourself, you let wicket create it for you (thats why you return a factory)so in your page:UserSession session=(UserSession)getSession();
sometimes nice to have this wrapped in a basepage.-IgorOn 3/16/06, 
Vincent Jenks [EMAIL PROTECTED]
 wrote:I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket

Re: [Wicket-user] objects in session

2006-03-17 Thread Vincent Jenks
You're right, the session wasn't shared because each was running as a separate Application (servlet).I built the pages at different times was just testing...but now the app is coming together - time to clean house!
It works now, thank you!On 3/17/06, Johan Compagner [EMAIL PROTECTED] wrote:
why do you have 2 applications objects for youre web application?Do you have 2 wicket servlets mapped? Do you really have 2 webapps?But then you don't share session data. Because you make 2 session objects. 1 for login and 1 for Edit product application.
Why are you doing that?Also better thing to do here:public AdminPage() {  //get user from session  User user = ((UserSession)getSession())
.getUser();
//disallow access to non-admins
  if (user != null)  {   if (user.getUserGroup().getAccessLevel()  1)setResponsePage(new Login());  }  else  {   setResponsePage(new Login());
  }is thispublic AdminPage() {  //get user from session  User user = ((UserSession)getSession())
.getUser();//disallow access to non-admins
  if (user != null)  {   if (user.getUserGroup().getAccessLevel()  1)throw new RestartResponseAtInterceptPageException(Login.class
);  }  else
  {throw new RestartResponseAtInterceptPageException(Login.class);  }johan
On 3/18/06, Vincent Jenks
 [EMAIL PROTECTED] wrote:

I'm doing exactly that and I don't see how I could invalidating the session in any way.Let me clarify; I have a Login page and a EditProduct page. EditProduct will be one of many pages of which I'd like only the administrator User to access.
So, the Login Application class has this override: public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {
   public Session newSession()
   {return new UserSession(LoginApp.this);   }  }; }...and when the user logs in, I save it in the session:

.//event handler
  public void onSubmit()  {   //set user to session   ((UserSession)getSession()).setUser(user);I sub-classed WebPage and created AdminPage where I get the User from session:
public abstract class AdminPage extends WebPage{ public AdminPage() {  //get user from session  User user = ((UserSession)getSession()).getUser();//disallow access to non-admins
  if (user != null)  {   if (user.getUserGroup().getAccessLevel()  1)setResponsePage(new Login());  }  else  {   setResponsePage(new Login());
  } }}I then use the AdminPage class in a protected page (EditProduct):public class EditProduct extends AdminPageThe EditProduct Application class has this override:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {
return new UserSession(EditProductApp.this
);   }  }; }Now, here's where it gets screwed up and sort of works. I have the AdminPage class set to redirect you to Login if you are not logged-in. So, if I go to EditProduct before logging-in, I'm redirected to Login. I can login there and then go back to EditProduct...and it worked!!
Finally...if I should go to Login *first* and login...and *then* go to EditProductthe User object is null in the session...it doesn't work and I'm redirected back to Login.So, I wouldn't be able to send users to Login to log into their accountit just isn't working rightthe User should be available in-session if they login at the Login page and then go to a protected page.
I looked at the signin examples in wicket-examples and it doesn't really answer my question...it's too small to go to the length I've gone to in my example.Does this clarify where I'm having trouble? Thanks again for the help!
On 3/17/06, Johan Compagner 

[EMAIL PROTECTED] wrote:
i have no idea what you exactly do but if you put something in the session like((MySession)getSession()).setUser(new User());and then later on get it back:((MySession)getSession()).getUser();

then it will be there. Ofcource the session shouldn't be invalidated and the browser should support cookies or url rewriting so that it can track the session.all examples (see sign and so on) work that way so i din't know what you do wrong.
johanOn 3/17/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
This still isn't working how I would have expected...

So I've still got a Login page and an EditProduct page. If I go to /login (Login page) and login...I can't then go to /edit_product (EditProduct page) - I'll be automatically redirected back to Login...so obviously the User object was not found in-session.
However, if I first go to /edit_product (EditProduct) and login from there (since I was automatically redirected for not having an User object in-session)I can then go to EditProduct and the form appears.




I would have expected that if I logged-in at Login that I could go to any of the other pages and find the User object in-session.I'm confused... I changed the way I'm accessing the session per Igor's instructions so it now is called like so:
UserSession us = (UserSession)getSession();Any ideas?On 3/17/06, 
Johan Compagner [EMAIL

[Wicket-user] onSubmit vs onClick for form submission

2006-03-19 Thread Vincent Jenks
So, I'm trying to figure out if I should do with my form buttons. I have two buttons ('save' and 'cancel') but only the onSubmit event handler is fired. I have a button inside of the form's constructor that has an onClick event but that never happens...apparently because the onSubmit 'trumps' the onClick event.
Here's my class as it stands: private static class EditProductForm extends Form {  public EditProductForm(String name, Product product)  {   super(name, new CompoundPropertyModel(product));
  //get collection of Category items   IModel catsModel = new LoadableDetachableModel()   {protected Object load(){ return 
ProductProxy.getAllCategories(); //via proxy}   };  //add form components   add(new TextField(productCode).add(RequiredValidator.getInstance
()));   add(new TextField(name).add(RequiredValidator.getInstance()));   add(new TextArea(summary).add(RequiredValidator.getInstance()));   add(new Button(saveButton));
  //add reset button DOESN'T WORK!   add(new Button(cancelButton)   {public void onClick(){ modelChanged();
 setResponsePage(new EditProduct());}   });  }public void onSubmit()  {   //save form values, redirect   Product product = (Product)getModelObject();
   ProductProxy.addProduct(product);   setResponsePage(new EditProduct());  } }Should I leave onSubmit empty and use two onClick events for the form buttons?The form is doing validation, also, if that effects anything.
Thanks!


Re: [Wicket-user] onSubmit vs onClick for form submission

2006-03-19 Thread Vincent Jenks
Alright, did that, now the button doesn't do anything at *all*.Here's the HTML button:input type=button wicket:id=cancelButton value=Cancel /...and the event handler:
   add(new Button(cancelButton)   {public void onClick(){ setResponsePage(new Home());}   });
Any ideas?On 3/19/06, Justin Lee [EMAIL PROTECTED] wrote:
-BEGIN PGP SIGNED MESSAGE-Hash: RIPEMD160Make sure the cancel button is type=button and not type=submit.then just define an onClick for your cancel button to navigate where you
want.Vincent Jenks wrote: So, I'm trying to figure out if I should do with my form buttons.I have two buttons ('save' and 'cancel') but only the onSubmit event handler is fired.I have a button inside of the form's constructor that
 has an onClick event but that never happens...apparently because the onSubmit 'trumps' the onClick event. Here's my class as it stands: private static class EditProductForm extends Form
 { public EditProductForm(String name, Product product) { super(name, new CompoundPropertyModel(product)); //get collection of Category items
 IModel catsModel = new LoadableDetachableModel() { protected Object load() { return ProductProxy.getAllCategories
(); //via proxy } }; //add form components add(new TextField(productCode).add(RequiredValidator.getInstance ()));
 add(new TextField(name).add(RequiredValidator.getInstance())); add(new TextArea(summary).add(RequiredValidator.getInstance())); add(new Button(saveButton));
 //add reset button DOESN'T WORK! add(new Button(cancelButton) { public void onClick() { modelChanged();
 setResponsePage(new EditProduct()); } }); } public void onSubmit() { //save form values, redirect
 Product product = (Product)getModelObject(); ProductProxy.addProduct(product); setResponsePage(new EditProduct()); } } Should I leave onSubmit empty and use two onClick events for the form
 buttons? The form is doing validation, also, if that effects anything. Thanks!- --Justin Leehttp://www.antwerkz.comAIM : evan chooly
720.299.0101-BEGIN PGP SIGNATURE-Version: GnuPG v1.4.2.1 (Cygwin)iD8DBQFEHc0jJnQfEGuJ90MRA/G9AJ0S8yAzsWWQH802nSef+LS23qNbMACcCWjRSDlWuEAvGEj6mweK4RudZ5U==WtvB-END PGP SIGNATURE-
---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] onSubmit vs onClick for form submission

2006-03-19 Thread Vincent Jenks
Funny seeing you here! When are we gonna see Wicket support in MyEclipse buddy? ;)On 3/19/06, Riyad Kalla [EMAIL PROTECTED]
 wrote:Don't you need to commit the response?(just a lame guess from the servlet world)
On 3/19/06, Vincent Jenks [EMAIL PROTECTED] wrote: Alright, did that, now the button doesn't do anything at *all*. Here's the HTML button:
 input type=button wicket:id=cancelButton value=Cancel / ...and the event handler: add(new Button(cancelButton)
 { public void onClick() { setResponsePage(new Home()); } }); Any ideas?
 On 3/19/06, Justin Lee [EMAIL PROTECTED] wrote:  -BEGIN PGP SIGNED MESSAGE-  Hash: RIPEMD160   Make sure the cancel button is type=button and not type=submit.
  then just define an onClick for your cancel button to navigate where you  want.   Vincent Jenks wrote:   So, I'm trying to figure out if I should do with my form buttons.I
   have two buttons ('save' and 'cancel') but only the onSubmit event   handler is fired.I have a button inside of the form's constructor that   has an onClick event but that never happens...apparently because the
   onSubmit 'trumps' the onClick event. Here's my class as it stands: private static class EditProductForm extends Form   {
   public EditProductForm(String name, Product product)   {   super(name, new CompoundPropertyModel(product)); //get collection of Category items
   IModel catsModel = new LoadableDetachableModel()   {   protected Object load()   {   return 
ProductProxy.getAllCategories (); //via proxy   }   }; //add form components   add(new
   TextField(productCode).add(RequiredValidator.getInstance ()));   add(new TextField(name).add(RequiredValidator.getInstance()));   add(new
   TextArea(summary).add(RequiredValidator.getInstance()));   add(new Button(saveButton)); //add reset button DOESN'T WORK!
   add(new Button(cancelButton)   {   public void onClick()   {   modelChanged();
   setResponsePage(new EditProduct());   }   });   } public void onSubmit()
   {   //save form values, redirect   Product product = (Product)getModelObject();   ProductProxy.addProduct(product);
   setResponsePage(new EditProduct());   }   } Should I leave onSubmit empty and use two onClick events for the form
   buttons? The form is doing validation, also, if that effects anything. Thanks!   - --  Justin Lee
  http://www.antwerkz.com  AIM : evan chooly  720.299.0101  -BEGIN PGP SIGNATURE-  Version: GnuPG v1.4.2.1 (Cygwin)
   iD8DBQFEHc0jJnQfEGuJ90MRA/G9AJ0S8yAzsWWQH802nSef+LS23qNbMACcCWjR  SDlWuEAvGEj6mweK4RudZ5U=  =WtvB  -END PGP SIGNATURE-  
  ---  This SF.Net email is sponsored by xPML, a groundbreaking scripting language  that extends applications into web and mobile media. Attend the live
 webcast  and join the prime developer group breaking into this new coding territory!  
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642  ___  Wicket-user mailing list  
Wicket-user@lists.sourceforge.net  https://lists.sourceforge.net/lists/listinfo/wicket-user ---
This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



[Wicket-user] EJB3/Hibernate Lazy fetching...

2006-03-20 Thread Vincent Jenks
OK, so I'm in a bit of a quagmire.I'm using Wicket + EJB3 (JBoss 4.0.4RC1) which uses Hibernate as the persistence behind EJB3.Unless I set all of my parent/child object relationship annotations to EAGER fetching...I get this error:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role:...when I try to access the child collection of the parent object. In my case, for example, I am passing an object to a form in Wicket using the constructor:
public class ProductDetail extends WebPage{ public ProductDetail() {  this(null); } public ProductDetail(Product product) { add(new ProductDetailForm(productDetailForm, product));
...The parent object being Product and the child being Product.getConfigurations()which is a ListConfiguration.This same ProductDetail page has a form (see above where I passed the Product into the form)...and I need to access the child collection inside the form:
   add(new ListView(configs, product.getConfigurations())   {protected void populateItem(ListItem item){ final Configuration config = (Configuration)item.getModelObject();
  item.add(new Label(quantity, String.valueOf(config.getQuantity(; item.add(new Label(name, config.getName())); 
item.add(new Label(weight, config.getWeight())); item.add(new Label(price, String.valueOf(config.getPrice(;}   });badda-bing...here's when the exception occurs. Now...I *could* fix it by setting the collection to EAGER fetching...but this could eventually cause me some severe performance problemsespecially once the collections begin to grow in size...I just have to be able to do LAZY fetching.
Since I'm using EJB3 CMP I don't have control over the hibernate session - the container does...so my flexibility there is limited. Is there something I could do to work around this?Thanks!


Re: [Wicket-user] EJB3/Hibernate Lazy fetching...

2006-03-20 Thread Vincent Jenks
Well, in the previous page which passes the Product into this page...the object was wrapped in a detachable model...not just called directly...so I should try and wrap it again in the current page?
On 3/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
instead of using the product object directly, use a detachable model.you might also need to use an open session in view interceptor in case jboss closes the hibernate session after your bean's method is finished executing. if it does this, then by the time wicket code runs the object is already disconnected from its session and thus cant load any child collections.
-IgorOn 3/20/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

OK, so I'm in a bit of a quagmire.I'm using Wicket + EJB3 (JBoss 4.0.4RC1) which uses Hibernate as the persistence behind EJB3.Unless I set all of my parent/child object relationship annotations to EAGER fetching...I get this error:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role:...when I try to access the child collection of the parent object. In my case, for example, I am passing an object to a form in Wicket using the constructor:
public class ProductDetail extends WebPage{ public ProductDetail() {  this(null); } public ProductDetail(Product product) { add(new ProductDetailForm(productDetailForm, product));
...The parent object being Product and the child being Product.getConfigurations()which is a ListConfiguration.This same ProductDetail page has a form (see above where I passed the Product into the form)...and I need to access the child collection inside the form:
   add(new ListView(configs, product.getConfigurations())   {protected void populateItem(ListItem item){ final Configuration config = (Configuration)item.getModelObject();
  item.add(new Label(quantity, String.valueOf(config.getQuantity(; item.add(new Label(name, config.getName())); 
item.add(new Label(weight, config.getWeight())); item.add(new Label(price, String.valueOf(config.getPrice(;}   });badda-bing...here's when the exception occurs. Now...I *could* fix it by setting the collection to EAGER fetching...but this could eventually cause me some severe performance problemsespecially once the collections begin to grow in size...I just have to be able to do LAZY fetching.
Since I'm using EJB3 CMP I don't have control over the hibernate session - the container does...so my flexibility there is limited. Is there something I could do to work around this?Thanks!






Re: [Wicket-user] onSubmit vs onClick for form submission

2006-03-20 Thread Vincent Jenks
OK, believe it or not, I did just that and *still* cannot get it to work.Here's my Form class: private static class EditProductForm extends Form {  public EditProductForm(String name, Product product)
  {   super(name, new CompoundPropertyModel(product));  //get collection of Category items   IModel catsModel = new LoadableDetachableModel()   {
protected Object load(){ return ProductProxy.getAllCategories(); //via proxy}   };   //add form components
   add(new TextField(productCode).add(RequiredValidator.getInstance()));   add(new TextField(name).add(RequiredValidator.getInstance()));   add(new TextArea(summary).add(
RequiredValidator.getInstance()));   add(new TextArea(description).add(RequiredValidator.getInstance()));   add(new TextField(unitPrice));   add(new TextField(weight));
   add(new TextField(height));   add(new TextField(width));   add(new TextField(length));   add(new TextField(insuredValue));
   add(new CheckBox(freeShipping));   add(new TextField(thumbnail).add(RequiredValidator.getInstance()));   add(new TextField(photo).add(RequiredValidator.getInstance
()));  //add reset button   add(new Button(cancelButton)   {public void onSubmit(){  setResponsePage(new EditProduct());
}   }.setDefaultFormProcessing(false));  //add reset button   add(new Button(saveButton)   {public void onSubmit()
{ //save form values, redirect Product product = (Product)getModelObject(); ProductProxy.addProduct(product); setResponsePage(new EditProduct());
}   });  } }The cancel button works now but the save button is now throwing an exception:wicket.WicketRuntimeException: Method public abstract void wicket.markup.html.form.IFormSubmitListener.onFormSubmitted
() of interface java.lang.reflect.Method threw an exception ..Caused by: java.lang.reflect.InvocationTargetException ..Caused by: wicket.WicketRuntimeException: OGNL Exception: _expression_='saveButton'; path='4:editProductForm:saveButton'
...Caused by: ognl.NoSuchPropertyException: com.myapp.model.Product.saveButton...Here's the form HTML just in case I'm goofing something there:form wicket:id=editProductForm id=editProductForm
... tr  td colspan=2   input type=submit wicket:id=saveButton value=Save /
   nbsp;   input type=submit wicket:id=cancelButton value=Cancel /   br /
   br /  /td /tr /form
What's wrong w/ this?Thanks!On 3/19/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
the easiest way to do this is add two buttons with two onsubmit handlers instead of using the form's onsubmit.
so add(new Button(save) { onsubmit() { // do the saving here } })add(new Button(cancel) { onsubmit() { //navigate away here } }.setDefaultFormProcessing(false));
notice the call to setDefaultFormProcessing(false) on the cancel button. this will tell wicket that when this button is pressed it should not validate/update model instead go directly to the button's onsubmit handler.
-IgorOn 3/19/06, 
Riyad Kalla [EMAIL PROTECTED] wrote:

Don't you need to commit the response?(just a lame guess from the servlet world)On 3/19/06, Vincent Jenks 
[EMAIL PROTECTED] wrote: Alright, did that, now the button doesn't do anything at *all*.
 Here's the HTML button: input type=button wicket:id=cancelButton value=Cancel / ...and the event handler: add(new Button(cancelButton)
 { public void onClick() { setResponsePage(new Home()); } }); Any ideas?
 On 3/19/06, Justin Lee [EMAIL PROTECTED] wrote:  -BEGIN PGP SIGNED MESSAGE-
  Hash: RIPEMD160   Make sure the cancel button is type=button and not type=submit.
  then just define an onClick for your cancel button to navigate where you  want.   Vincent Jenks wrote:   So, I'm trying to figure out if I should do with my form buttons.I
   have two buttons ('save' and 'cancel') but only the onSubmit event   handler is fired.I have a button inside of the form's constructor that   has an onClick event but that never happens...apparently because the
   onSubmit 'trumps' the onClick event. Here's my class as it stands: private static class EditProductForm extends Form   {
   public EditProductForm(String name, Product product)   {   super(name, new CompoundPropertyModel(product)); //get collection of Category items
   IModel catsModel = new LoadableDetachableModel()   {   protected Object load()   {   return 
ProductProxy.getAllCategories (); //via proxy   }   }; //add form components   add(new
   TextField(productCode).add(RequiredValidator.getInstance ()));   add(new TextField(name).add(RequiredValidator.getInstance()));   add(new
   TextArea(summary).add(RequiredValidator.getInstance()));   add(new Button(saveButton)); //add reset button DOESN'T WORK!
   add(new Button(cancelButton)   {   public void onClick()   {   modelChanged();
   setResponsePage(new EditProduct());   }   });   } public void onSubmit()
   {   //save form values, redirect   Product product

Re: [Wicket-user] onSubmit vs onClick for form submission

2006-03-20 Thread Vincent Jenks
I fixed this by using Form.onSubmit() for the save button and keeping the cancel button the same...now both work just fine...but not exactly as Igor described.Good enough!
On 3/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
OK, believe it or not, I did just that and *still* cannot get it to work.Here's my Form class: private static class EditProductForm extends Form
 {  public EditProductForm(String name, Product product)
  {   super(name, new CompoundPropertyModel(product));  //get collection of Category items   IModel catsModel = new LoadableDetachableModel()   {
protected Object load(){ return ProductProxy.getAllCategories(); //via proxy}   };   //add form components
   add(new TextField(productCode).add(RequiredValidator.getInstance()));   add(new TextField(name).add(RequiredValidator.getInstance()));   add(new TextArea(summary).add(
RequiredValidator.getInstance()));   add(new TextArea(description).add(RequiredValidator.getInstance()));   add(new TextField(unitPrice));
   add(new TextField(weight));
   add(new TextField(height));   add(new TextField(width));   add(new TextField(length));   add(new TextField(insuredValue));
   add(new CheckBox(freeShipping));   add(new TextField(thumbnail).add(RequiredValidator.getInstance()));   add(new TextField(photo).add(RequiredValidator.getInstance

()));  //add reset button   add(new Button(cancelButton)   {public void onSubmit(){  setResponsePage(new EditProduct());
}   }.setDefaultFormProcessing(false));  //add reset button   add(new Button(saveButton)
   {public void onSubmit()
{ //save form values, redirect Product product = (Product)getModelObject(); ProductProxy.addProduct(product); setResponsePage(new EditProduct());
}   });  } }The cancel button works now but the save button is now throwing an exception:wicket.WicketRuntimeException
: Method public abstract void wicket.markup.html.form.IFormSubmitListener.onFormSubmitted
() of interface java.lang.reflect.Method threw an exception ..Caused by: java.lang.reflect.InvocationTargetException ..Caused by: wicket.WicketRuntimeException: OGNL Exception: _expression_='saveButton'; path='4:editProductForm:saveButton'
...Caused by: ognl.NoSuchPropertyException: com.myapp.model.Product.saveButton...Here's the form HTML just in case I'm goofing something there:form wicket:id=editProductForm id=editProductForm
... tr  td colspan=2   input type=submit wicket:id=saveButton value=Save /
   nbsp;   input type=submit wicket:id=cancelButton value=Cancel /   br /
   br /  /td /tr /form

What's wrong w/ this?Thanks!On 3/19/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
the easiest way to do this is add two buttons with two onsubmit handlers instead of using the form's onsubmit.
so add(new Button(save) { onsubmit() { // do the saving here } })add(new Button(cancel) { onsubmit() { //navigate away here } }.setDefaultFormProcessing(false));
notice the call to setDefaultFormProcessing(false) on the cancel button. this will tell wicket that when this button is pressed it should not validate/update model instead go directly to the button's onsubmit handler.
-IgorOn 3/19/06, 
Riyad Kalla [EMAIL PROTECTED] wrote:


Don't you need to commit the response?(just a lame guess from the servlet world)On 3/19/06, Vincent Jenks 

[EMAIL PROTECTED] wrote: Alright, did that, now the button doesn't do anything at *all*.
 Here's the HTML button: input type=button wicket:id=cancelButton value=Cancel / ...and the event handler: add(new Button(cancelButton)
 { public void onClick() { setResponsePage(new Home()); } }); Any ideas?
 On 3/19/06, Justin Lee [EMAIL PROTECTED] wrote:  -BEGIN PGP SIGNED MESSAGE-
  Hash: RIPEMD160   Make sure the cancel button is type=button and not type=submit.
  then just define an onClick for your cancel button to navigate where you  want.   Vincent Jenks wrote:   So, I'm trying to figure out if I should do with my form buttons.I
   have two buttons ('save' and 'cancel') but only the onSubmit event   handler is fired.I have a button inside of the form's constructor that   has an onClick event but that never happens...apparently because the
   onSubmit 'trumps' the onClick event. Here's my class as it stands: private static class EditProductForm extends Form   {
   public EditProductForm(String name, Product product)   {   super(name, new CompoundPropertyModel(product)); //get collection of Category items
   IModel catsModel = new LoadableDetachableModel()   {   protected Object load()   {   return 
ProductProxy.getAllCategories (); //via proxy   }   }; //add form components   add(new
   TextField(productCode).add(RequiredValidator.getInstance ()));   add(new TextField(name).add(RequiredValidator.getInstance()));   add(new
   TextArea(summary).add(RequiredValidator.getInstance()));   add(new Button(saveButton)); //add reset button

Re: [Wicket-user] HTTPS switching

2006-03-22 Thread Vincent Jenks
I'm actually dying to know this myself as I'm in the throes of building a shopping cart that will need SSL at some point in the process.Can this in fact be done? Can part of my application somehow reside behind https?
I'm sure it's been asked before but I don't see any examples of this anywhere.Thanks!On 3/22/06, John Patterson 
[EMAIL PROTECTED] wrote:Hi,Is there a standard way to handle switching between http and https?
Thanks,John.---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] gnarly form model issue

2006-03-24 Thread Vincent Jenks
I've attached a screenshot of what this page does.Basically, the page you see receives a Product object in the constructor when it is called from the previous page. Each Product has a List of Configuration objects...which you see listed in the screenshot (
i.e. 1 Bone In Ham Half 7-10 lbs 
@ $99.00). Admins can define many product Configurations that the user can select on this screen. The Configurations have an inverse relationship back to the Product so when the Configuration is added to the cart, the Product can be referenced as well.
My problem is; in this form, how can I bind a single Configuration when there are (potentially) several, per-product?My thinking was; I could add the Product to the ShoppingCart session bean instead and it would carry the product Configuration(s) with it...assuming I could grab each Configuration from the ListView in the form (where you see the 
1 Bone In Ham Half 7-10 lbs
text and the DropDownChoice lists) and manually create the Configuration object(s) and add them to the Product before submitting the form.Does this make sense?Thanks again!!
On 3/24/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
do you have a screenshot/mockup of the form? seeing it would help.so there is a list of configurations? and the user can click on one and edit it?
-IgorOn 3/24/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

I've got a form where I can't exactly bind a model object because of the way the form is used. On this page, the user selects from a list of product configurations (ProductConfiguration class) which belong to a Product objectso there is a one-to-many Product-ProductConfiguration. I can't pass a ProductConfiguration object into the CompoundPropertyModel because the user may choose more than one (or can I?) I'm thinking I need to bind the Product and manually add the ProductConfiguration objects to the product before submitting.
If I do it this way...how can I access each of the form fields programmatically, individually? In other words...can form field values be called w/o using a CompoundPropertyModel if needed?Also, if there's a better way to do this, please let me know!
Thanks!






cart_shot.gif
Description: GIF image


Re: [Wicket-user] gnarly form model issue

2006-03-24 Thread Vincent Jenks
OK, I'll try itthanks for the help! But, to answer my question - Is there a way to access each of the form fields as stand-alone variables?On 3/24/06, 
Igor Vaynberg [EMAIL PROTECTED] wrote:
public class MyPage extends WebPage {private MapLong,Integer selection=new HashMapLong,Integer();public MyPage() { IModel categories=  Form form=new Form(form);
 add(form); firm.add(new ListView(quantities, categories) {  public void populateItem(ListItem item) {  ProductCategory cat=item.getModelObject(); final Long catId=
cat.getId(); // this model will populate an appropriate entry in the selection map IModel selectionModel=new Model() { setObject(Component c, Object o) { selection.put

(catId, (Integer)o); } Object getObject(Component c) { return selection.get(catId); } } add(new DropDownChoice(qty, selectionModel, .)
 } });form.add(new Button() { onSubmit() { System.out.println(selection.toString()); } }...-Igor
On 3/24/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

It makes sense but I wouldn't know how to begin (I'm rather new to Java as well as Wicket)...is there an example in the wicket-examples somewhere? Would I just create a Map inside of the ListView?

On 3/24/06, Igor Vaynberg [EMAIL PROTECTED] wrote:


if you are using a listview there is really no way to use a compound property model. here is what you can do:on your page create a map:configid-qtythen to the dropdown choices assign a model that will read/write a key from this map.
so when the form submits you endup with a filled in map in your page.makes sense?-Igor
On 3/24/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:I've attached a screenshot of what this page does.
Basically, the page you see receives a Product object in the constructor when it is called from the previous page. Each Product has a List of Configuration objects...which you see listed in the screenshot (
i.e. 1 Bone In Ham Half 7-10 lbs 
@ $99.00). Admins can define many product Configurations that the user can select on this screen. The Configurations have an inverse relationship back to the Product so when the Configuration is added to the cart, the Product can be referenced as well.
My problem is; in this form, how can I bind a single Configuration when there are (potentially) several, per-product?My thinking was; I could add the Product to the ShoppingCart session bean instead and it would carry the product Configuration(s) with it...assuming I could grab each Configuration from the ListView in the form (where you see the 
1 Bone In Ham Half 7-10 lbs
text and the DropDownChoice lists) and manually create the Configuration object(s) and add them to the Product before submitting the form.Does this make sense?Thanks again!!




On 3/24/06, Igor Vaynberg [EMAIL PROTECTED] wrote:




do you have a screenshot/mockup of the form? seeing it would help.so there is a list of configurations? and the user can click on one and edit it?




-IgorOn 3/24/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:





I've got a form where I can't exactly bind a model object because of the way the form is used. On this page, the user selects from a list of product configurations (ProductConfiguration class) which belong to a Product objectso there is a one-to-many Product-ProductConfiguration. I can't pass a ProductConfiguration object into the CompoundPropertyModel because the user may choose more than one (or can I?) I'm thinking I need to bind the Product and manually add the ProductConfiguration objects to the product before submitting.
If I do it this way...how can I access each of the form fields programmatically, individually? In other words...can form field values be called w/o using a CompoundPropertyModel if needed?Also, if there's a better way to do this, please let me know!
Thanks!














Re: [Wicket-user] gnarly form model issue

2006-03-24 Thread Vincent Jenks
OK, I'll try itthanks for the help! But, to answer my question -
Is there a way to access each of the form fields as stand-alone
variables?On 3/24/06, Vincent Jenks [EMAIL PROTECTED] wrote:
OK, I'll try itthanks for the help! But, to answer my question - Is there a way to access each of the form fields as stand-alone variables?
On 3/24/06, 
Igor Vaynberg [EMAIL PROTECTED] wrote:

public class MyPage extends WebPage {private MapLong,Integer selection=new HashMapLong,Integer();public MyPage() { IModel categories=  Form form=new Form(form);
 add(form); firm.add(new ListView(quantities, categories) {  public void populateItem(ListItem item) {  ProductCategory cat=item.getModelObject(); final Long catId=
cat.getId(); // this model will populate an appropriate entry in the selection map IModel selectionModel=new Model() { setObject(Component c, Object o) { selection.put


(catId, (Integer)o); } Object getObject(Component c) { return selection.get(catId); } } add(new DropDownChoice(qty, selectionModel, .)
 } });form.add(new Button() { onSubmit() { System.out.println(selection.toString()); } }...-Igor
On 3/24/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:


It makes sense but I wouldn't know how to begin (I'm rather new to Java as well as Wicket)...is there an example in the wicket-examples somewhere? Would I just create a Map inside of the ListView?

On 3/24/06, Igor Vaynberg [EMAIL PROTECTED] wrote:



if you are using a listview there is really no way to use a compound property model. here is what you can do:on your page create a map:configid-qtythen to the dropdown choices assign a model that will read/write a key from this map.
so when the form submits you endup with a filled in map in your page.makes sense?-Igor
On 3/24/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:I've attached a screenshot of what this page does.
Basically, the page you see receives a Product object in the constructor when it is called from the previous page. Each Product has a List of Configuration objects...which you see listed in the screenshot (
i.e. 1 Bone In Ham Half 7-10 lbs 
@ $99.00). Admins can define many product Configurations that the user can select on this screen. The Configurations have an inverse relationship back to the Product so when the Configuration is added to the cart, the Product can be referenced as well.
My problem is; in this form, how can I bind a single Configuration when there are (potentially) several, per-product?My thinking was; I could add the Product to the ShoppingCart session bean instead and it would carry the product Configuration(s) with it...assuming I could grab each Configuration from the ListView in the form (where you see the 
1 Bone In Ham Half 7-10 lbs
text and the DropDownChoice lists) and manually create the Configuration object(s) and add them to the Product before submitting the form.Does this make sense?Thanks again!!





On 3/24/06, Igor Vaynberg [EMAIL PROTECTED] wrote:





do you have a screenshot/mockup of the form? seeing it would help.so there is a list of configurations? and the user can click on one and edit it?





-IgorOn 3/24/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:






I've got a form where I can't exactly bind a model object because of the way the form is used. On this page, the user selects from a list of product configurations (ProductConfiguration class) which belong to a Product objectso there is a one-to-many Product-ProductConfiguration. I can't pass a ProductConfiguration object into the CompoundPropertyModel because the user may choose more than one (or can I?) I'm thinking I need to bind the Product and manually add the ProductConfiguration objects to the product before submitting.
If I do it this way...how can I access each of the form fields programmatically, individually? In other words...can form field values be called w/o using a CompoundPropertyModel if needed?Also, if there's a better way to do this, please let me know!
Thanks!
















[Wicket-user] EJB3 Stateful SB - session issues/questions

2006-03-29 Thread Vincent Jenks
I'm sitting here, pondering, and getting fatter. I'm building a storefront app w/ a simple shopping cart for which I'm thinking of using a Stateful session bean (EJB 3.0).It looks like, no matter how I look at it, I'll have to keep the SFSB stub in-session throughout its use in the application...and I'm not sure of a real elegant way of doing that. So, I was just hoping someone here could provide some insight.
In Wicket, I've already got a class called UserSession which I use to pass around an User so I can test whether or not a page is accessible by certain user groups. I decided, to keep it simple, that I'd add a getter  setter for my ShoppingCart stub in the same class so it could be passed around in-session w/ the User, since each shopper will have an User automatically created for them before checking out and paying.
The problem w/ all this SFSB business is; it violates my design because I have to make my web tier talk directly to my session bean in order to keep track of its state. For everything else I've been using a handful of proxy classes where I could place calls to my session beans and other business logic.
It looks a little like this:Wicket-ProxyClass-SessionBean-DatabaseSo, now I'll have to keep track of the ShoppingCart stub class in Wicket, pass the ShoppingCart and the users' chosen form values into the Proxy, perform business logic, and then return a ShoppingCart which I'll have to place *back* into the 
UserSession.setCart() method to continue to keep track of the state of the users' carts.This is kinda nasty, is there an easier (or just more elegant) way to do this?Thanks all!


Re: [Wicket-user] EJB3 Stateful SB - session issues/questions

2006-03-30 Thread Vincent Jenks
I'd rather not introduce spring as yet another dependency on this project...especially because I know very little about it and don't have the time to tinker w/ it for this project.What about passing the ShoppingCart EJB stub around in my page constructors instead of using a getter/setter in my custom UserSession class? Wouldn't that be safe?
On 3/29/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
you can inject the proxy into any componentlook at wicket-spring projectyou can create a IFieldValueFactory that injects a proxy for your stateful bean.
-Igor
On 3/29/06, Vincent Jenks [EMAIL PROTECTED] wrote:

I'm sitting here, pondering, and getting fatter. I'm building a storefront app w/ a simple shopping cart for which I'm thinking of using a Stateful session bean (EJB 3.0).It looks like, no matter how I look at it, I'll have to keep the SFSB stub in-session throughout its use in the application...and I'm not sure of a real elegant way of doing that. So, I was just hoping someone here could provide some insight.
In Wicket, I've already got a class called UserSession which I use to pass around an User so I can test whether or not a page is accessible by certain user groups. I decided, to keep it simple, that I'd add a getter  setter for my ShoppingCart stub in the same class so it could be passed around in-session w/ the User, since each shopper will have an User automatically created for them before checking out and paying.
The problem w/ all this SFSB business is; it violates my design because I have to make my web tier talk directly to my session bean in order to keep track of its state. For everything else I've been using a handful of proxy classes where I could place calls to my session beans and other business logic.
It looks a little like this:Wicket-ProxyClass-SessionBean-DatabaseSo, now I'll have to keep track of the ShoppingCart stub class in Wicket, pass the ShoppingCart and the users' chosen form values into the Proxy, perform business logic, and then return a ShoppingCart which I'll have to place *back* into the 
UserSession.setCart() method to continue to keep track of the state of the users' carts.This is kinda nasty, is there an easier (or just more elegant) way to do this?Thanks all!






Re: [Wicket-user] Re: TabbedPanel, InputForm and submit

2006-03-30 Thread Vincent Jenks
That'd be awesome, I could use something like this!On 3/30/06, Martijn Dashorst [EMAIL PROTECTED]
 wrote:Feel free to contribute! You now know how to do it, write a (small) document about it and put it on our wiki!
MartijnOn 3/30/06, 
Stefan Lindner
 [EMAIL PROTECTED] wrote:
Once again thanks for all your help. The problem is solved. Not every
comonent inside of the form must be an ajax component.form.setOutputMarkupId(true);add(form);AjaxFormValidatingBehavior.addToAllFormComponents(form,onblur);

Does it all. It's a pleasure to use wicket. But it would be much muchmore pleasent if the documentation could be improved.Stefan Lindner
--Visionet GmbH, Am Weichselgarten 7, 91058 ErlangenTel.: (09131)691-230, FAX: (09131)691-111E-Mail: mailto:
[EMAIL PROTECTED], Internet:
http://www.visionet.de---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user
-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org




Re: [Wicket-user] EJB3 Stateful SB - session issues/questions

2006-03-30 Thread Vincent Jenks
OK, I'll check into it, thanks. Meanwhile, if I *did* want to...I could pass the cart stub around in the constructors, couldn't I? Or, is this somehow not safe?I'm thinking that might be the quickest, easiest approach for now. I only need it for a few pages.
On 3/30/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
i didnt say introduce spring as a dependency.i said look at how wicket-spring injects special proxies into wicket components that you can safely store in session, etcit will take very little tweaking to make it work for ejb3.
look at the Spring page on the wiki to see why the proxies exist and how they work.wicket-spring provides an elegant solution, but only a tiny portion of it is spring related.
-Igor
On 3/30/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:
I'd rather not introduce spring as yet another dependency on this project...especially because I know very little about it and don't have the time to tinker w/ it for this project.What about passing the ShoppingCart EJB stub around in my page constructors instead of using a getter/setter in my custom UserSession class? Wouldn't that be safe?
On 3/29/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
you can inject the proxy into any componentlook at wicket-spring projectyou can create a IFieldValueFactory that injects a proxy for your stateful bean.


-Igor
On 3/29/06, Vincent Jenks [EMAIL PROTECTED] wrote:



I'm sitting here, pondering, and getting fatter. I'm building a storefront app w/ a simple shopping cart for which I'm thinking of using a Stateful session bean (EJB 3.0).It looks like, no matter how I look at it, I'll have to keep the SFSB stub in-session throughout its use in the application...and I'm not sure of a real elegant way of doing that. So, I was just hoping someone here could provide some insight.
In Wicket, I've already got a class called UserSession which I use to pass around an User so I can test whether or not a page is accessible by certain user groups. I decided, to keep it simple, that I'd add a getter  setter for my ShoppingCart stub in the same class so it could be passed around in-session w/ the User, since each shopper will have an User automatically created for them before checking out and paying.
The problem w/ all this SFSB business is; it violates my design because I have to make my web tier talk directly to my session bean in order to keep track of its state. For everything else I've been using a handful of proxy classes where I could place calls to my session beans and other business logic.
It looks a little like this:Wicket-ProxyClass-SessionBean-DatabaseSo, now I'll have to keep track of the ShoppingCart stub class in Wicket, pass the ShoppingCart and the users' chosen form values into the Proxy, perform business logic, and then return a ShoppingCart which I'll have to place *back* into the 
UserSession.setCart() method to continue to keep track of the state of the users' carts.This is kinda nasty, is there an easier (or just more elegant) way to do this?Thanks all!










Re: [Wicket-user] EJB3 Stateful SB - session issues/questions

2006-03-30 Thread Vincent Jenks
Well...on page1 it would create the ShoppingCart stub from JNDII'd pass it to page2 as a parampage2 would modify itand pass it to page3and so on.It's a single, stateful session bean.
On 3/30/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
depends on what the stub references. if you already have it in session somewhere then its ok.-Igor
On 3/30/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:OK, I'll check into it, thanks. Meanwhile, if I *did* want to...I could pass the cart stub around in the constructors, couldn't I? Or, is this somehow not safe?
I'm thinking that might be the quickest, easiest approach for now. I only need it for a few pages.
On 3/30/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
i didnt say introduce spring as a dependency.i said look at how wicket-spring injects special proxies into wicket components that you can safely store in session, etcit will take very little tweaking to make it work for ejb3.
look at the Spring page on the wiki to see why the proxies exist and how they work.wicket-spring provides an elegant solution, but only a tiny portion of it is spring related.


-Igor
On 3/30/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:
I'd rather not introduce spring as yet another dependency on this project...especially because I know very little about it and don't have the time to tinker w/ it for this project.What about passing the ShoppingCart EJB stub around in my page constructors instead of using a getter/setter in my custom UserSession class? Wouldn't that be safe?
On 3/29/06, Igor Vaynberg 



[EMAIL PROTECTED] wrote:
you can inject the proxy into any componentlook at wicket-spring projectyou can create a IFieldValueFactory that injects a proxy for your stateful bean.




-Igor
On 3/29/06, Vincent Jenks [EMAIL PROTECTED] wrote:





I'm sitting here, pondering, and getting fatter. I'm building a storefront app w/ a simple shopping cart for which I'm thinking of using a Stateful session bean (EJB 3.0).It looks like, no matter how I look at it, I'll have to keep the SFSB stub in-session throughout its use in the application...and I'm not sure of a real elegant way of doing that. So, I was just hoping someone here could provide some insight.
In Wicket, I've already got a class called UserSession which I use to pass around an User so I can test whether or not a page is accessible by certain user groups. I decided, to keep it simple, that I'd add a getter  setter for my ShoppingCart stub in the same class so it could be passed around in-session w/ the User, since each shopper will have an User automatically created for them before checking out and paying.
The problem w/ all this SFSB business is; it violates my design because I have to make my web tier talk directly to my session bean in order to keep track of its state. For everything else I've been using a handful of proxy classes where I could place calls to my session beans and other business logic.
It looks a little like this:Wicket-ProxyClass-SessionBean-DatabaseSo, now I'll have to keep track of the ShoppingCart stub class in Wicket, pass the ShoppingCart and the users' chosen form values into the Proxy, perform business logic, and then return a ShoppingCart which I'll have to place *back* into the 
UserSession.setCart() method to continue to keep track of the state of the users' carts.This is kinda nasty, is there an easier (or just more elegant) way to do this?Thanks all!














[Wicket-user] can't get rid of Choose One in DropDownChoice

2006-03-30 Thread Vincent Jenks
The code...  //create calendar  ListString days = DateTime.getDaysListForward(2, 4);//add quantity select listform.add(new DropDownChoice(arrivalDate, days, new IChoiceRenderer()
  {   protected String getDefaultChoice(final Object selected)  { return ; //get rid of Choose One default  }  public String getDisplayValue(Object object)
   {return object.toString();   }  public String getIdValue(Object object, int index)   {return object.toString();
   }}));  When rendered...I still get the Choose One option first. Did I lose too much sleep last night...what did I miss?


Re: [Wicket-user] can't get rid of Choose One in DropDownChoice

2006-03-31 Thread Vincent Jenks
Got it, thanks. It's confusing that it doesn't work like I described, even though the method can be overridden. It'd be convenient to be able to do it how I posed verses doing this: //create calendar ListString days = 
DateTime.getDaysListForward(2, 4);  DropDownChoice arrivalChoices = new DropDownChoice(arrivalDate, days) { protected String getDefaultChoice(final Object selected)
 { return ; //get rid of Choose One default }  };  arrivalChoices.setChoiceRenderer(new IChoiceRenderer()
 {  public String getDisplayValue(Object object) { return object.toString(); }  public String getIdValue(Object object, int index)
 { return object.toString(); }  });  form.add(arrivalChoices);On 3/30/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:you are putting getDefaultChoice into the renderer, when it actually belongs in the DropDownChoice
-IgorOn 3/30/06, 
Vincent Jenks 
[EMAIL PROTECTED] wrote:The code...


  //create calendar  ListString days = DateTime.getDaysListForward(2, 4);//add quantity select listform.add(new DropDownChoice(arrivalDate, days, new IChoiceRenderer()
  {   protected String getDefaultChoice(final Object selected)  { return ; //get rid of Choose One default  }  public String getDisplayValue(Object object)
   {return object.toString();   }  public String getIdValue(Object object, int index)   {return object.toString


();
   }}));  When rendered...I still get the Choose One option first. Did I lose too much sleep last night...what did I miss?







Re: [Wicket-user] Wicket/Tomcat configuration: Where is System.out ???

2006-03-31 Thread Vincent Jenks
Of course this happens while debugging too and can drive you nuts until you realize you've goofed.Since I use MyEclipse...I like to use println statements occasionally and just watch them roll by in the Console panel...you could do this w/ Netbeans or any other IDE, I'm sure. That is - if you're actually *using* an IDE.
On 3/31/06, Martijn Dashorst [EMAIL PROTECTED] wrote:
You have to put the statements somewhere where you are sure they will be invoked. For instance, you might want to do System.out.println() in your page constructor. Or your application constructor.
This is something that has bitten me quite often: putting debug println statements in my code, and not seeing the results. Only to discover that the method never got called in the first place.
MartijnOn 3/31/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:



Possibility 1: What does the Wicket application have to
do to pass the System.out.println() statements?this has nothing to do with wicket, this is only about how you configured tomcat.

-Igor

-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org




Re: [Wicket-user] wicket tv commercial?

2006-03-31 Thread Vincent Jenks
ha! It was only a matter of time until Wicket went to the big show.On 3/31/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
http://www.chevyapprentice.com/view.php?country=usuniqueid=c4911602-1265-1029-98eb-0013724ff5a7




Re: [Wicket-user] bind Map to DropDownChoice

2006-04-01 Thread Vincent Jenks
I see. I just went w/ a List and changed the value when I created the list. The dropdown was a list of dates so I just formatted the date differently for the view portion of the list.Thanks!
On 4/1/06, Johan Compagner [EMAIL PROTECTED] wrote:
there is no map support for this.What you could do is give the map to the ChoiceRenderer impland give the keys of the map as a list to the Choice.
johanOn 3/31/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

I'm trying to get a Map of data so I can have the key be the value of the dropdown options and the value of the Map item be the value of the option in the dropdown. Problem is, it doesn't look like DropDownChoice will accept a Map...unless I'm doing it wrong?
Is a Map the best way to go? I was maybe considering using a single List collection and splitting a single string to get the two valuesbut that's pretty fugly too.






Re: [Wicket-user] can't get rid of Choose One in DropDownChoice

2006-04-01 Thread Vincent Jenks
Why have the default message at all? Why provide something for developers that they should be determining themselves? The default should be the first item in the list...if you need a default, override the method and provide one.
On 4/1/06, Johan Compagner [EMAIL PROTECTED] wrote:
yes moving the method to the renderer and calling that render method in the choice method is fine by me.Except what is then the default Choose one ?We can add it ofcourse in our default renderer: ChoiceRenderer
But then you have to specify it or subclass choicerenderer. Else suddenly you don't have that default message anymore.johan
On 3/31/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:

yes its a bit weird. if youd like you are more then welcome to file an rfe and maybe we can clean it up in a future version.-Igor
On 3/31/06, Vincent Jenks
 [EMAIL PROTECTED] wrote:


Got it, thanks. It's confusing that it doesn't work like I described, even though the method can be overridden. It'd be convenient to be able to do it how I posed verses doing this:


 //create calendar ListString days = 
DateTime.getDaysListForward(2, 4);  DropDownChoice arrivalChoices = new DropDownChoice(arrivalDate, days)


 { protected String getDefaultChoice(final Object selected)
 { return ; //get rid of Choose One default }  };  arrivalChoices.setChoiceRenderer


(new IChoiceRenderer()
 {  public String getDisplayValue(Object object) { return object.toString(); } 
 public String getIdValue(Object object, int index)
 { return object.toString(); }  });  form.add(arrivalChoices);


On 3/30/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:you are putting getDefaultChoice into the renderer, when it actually belongs in the DropDownChoice
-IgorOn 3/30/06, 
Vincent Jenks 
[EMAIL PROTECTED] wrote:The code...





  //create calendar  ListString days = DateTime.getDaysListForward(2, 4);//add quantity select listform.add(new DropDownChoice(arrivalDate, days, new IChoiceRenderer()
  {   protected String getDefaultChoice(final Object selected)  { return ; //get rid of Choose One default  }  public String getDisplayValue(Object object)
   {return object.toString();   }  public String getIdValue(Object object, int index)   {return object.toString





();
   }}));  When rendered...I still get the Choose One option first. Did I lose too much sleep last night...what did I miss?













[Wicket-user] passing IModel around

2006-04-02 Thread Vincent Jenks
I'm just testing something out. Since I use EJB3 and need lazy initialization I'm making an attempt to see if passing an object with a collection of lazily-loaded elements in an IModel, from page-to-page, will prevent a LazyInitializationException (Hibernate).
I start here in the first page:public class ViewBlog extends WebPage{  public ViewBlog() {  //get Blog in detached model  IModel blogModel = new LoadableDetachableModel()
  {   protected Object load()   {return BlogProxy.getDefault(); //via proxy   }  };//add panel components  add(new HeaderPanel(headerPanel, blogModel));
...and then in the HeaderPanel I do this:public class HeaderPanel extends Panel{  public HeaderPanel(String id, IModel blogModel) {  super(id);  
  Blog blog = (Blog)blogModel; //EXCEPTION HERE!..I get this exception:java.lang.ClassCastException: com.myapp.ui.ViewBlog$1 at com.myapp.ui.panel.HeaderPanel.init(HeaderPanel.java
:34) at com.myapp.ui.ViewBlog.init(ViewBlog.java:53) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java
:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0
(Class.java:350) at java.lang.Class.newInstance(Class.java:303)How do I down-cast to Blog (entity bean) from the IModel param?


Re: [Wicket-user] passing IModel around

2006-04-02 Thread Vincent Jenks
That won't work, since getObject takes a parameter of Componentwhat would I pass in?On 4/2/06, karthik Guru 
[EMAIL PROTECTED] wrote:The model isn't of type Blog. The object stored within
LoadableDetachableModel is of type Blog.Blog blog = (Blog)blogModel.getObject( )should hopefully work.?On 4/2/06, Vincent Jenks [EMAIL PROTECTED]
 wrote: I'm just testing something out.Since I use EJB3 and need lazy initialization I'm making an attempt to see if passing an object with a collection of lazily-loaded elements in an IModel, from page-to-page, will
 prevent a LazyInitializationException (Hibernate). I start here in the first page: public class ViewBlog extends WebPage { public ViewBlog() { //get Blog in detached model
 IModel blogModel = new LoadableDetachableModel() { protected Object load() { return BlogProxy.getDefault(); //via proxy }
 }; //add panel components add(new HeaderPanel(headerPanel, blogModel));  ...and then in the HeaderPanel I do this:
 public class HeaderPanel extends Panel { public HeaderPanel(String id, IModel blogModel) { super(id);Blog blog = (Blog)blogModel; //EXCEPTION HERE!
 .. I get this exception: java.lang.ClassCastException: com.myapp.ui.ViewBlog$1 at com.myapp.ui.panel.HeaderPanel.init(HeaderPanel.java :34) at 
com.myapp.ui.ViewBlog.init(ViewBlog.java:53) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java :39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance
(Constructor.java:494) at java.lang.Class.newInstance0 (Class.java:350) at java.lang.Class.newInstance(Class.java:303) How do I down-cast to Blog (entity bean) from the IModel param?
-- -- karthik -This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] passing IModel around

2006-04-03 Thread Vincent Jenks
I didn't actually try that...but I like the idea of setting the page model and having access to it that way...that seems to work just fine. Thanks!On 4/2/06, 
karthik Guru [EMAIL PROTECTED] wrote:
just curiousBlog blog = (Blog)blogModel.getObject(null);didn't work for you?On 4/3/06, Vincent Jenks [EMAIL PROTECTED] wrote: Works great, thanks Eelco!
 On 4/2/06, Eelco Hillenius [EMAIL PROTECTED] wrote:  Aaargh. Ok, final try:   public HeaderPanel(String id, IModel blogModel) {
  super(id, blogModel);  Blog blog = (Blog)getModelObject();   or   public HeaderPanel(String id, IModel blogModel) {  super(id);
  setModel(blogModel);  Blog blog = (Blog)getModelObject();   Eelco   On 4/2/06, Eelco Hillenius [EMAIL PROTECTED]
 wrote:   Oh, I didn't look at your example yet. Better is this: public HeaderPanel(String id, IModel blogModel)   {   super(id);
 Blog blog = (Blog)getModelObject(); Eelco   On 4/2/06, Eelco Hillenius  
[EMAIL PROTECTED] wrote:Just pass in null. The component parameter is only used byCompoundPropertyModel and friends, not by LoadableDetachableModel.   
Eelco  On 4/2/06, Vincent Jenks [EMAIL PROTECTED] wrote: That won't work, since getObject takes a parameter of
 Componentwhat would I pass in? On 4/2/06, karthik Guru  
[EMAIL PROTECTED] wrote:  The model isn't of type Blog. The object stored within  LoadableDetachableModel is of type Blog. 
  Blog blog = (Blog)blogModel.getObject( )   should hopefully work.?   On 4/2/06, Vincent Jenks 
[EMAIL PROTECTED]  wrote:   I'm just testing something out.Since I use EJB3 and need lazy   initialization I'm making an attempt to see if passing an object
 with a   collection of lazily-loaded elements in an IModel, from page-to-page, will   prevent a LazyInitializationException (Hibernate).
 I start here in the first page: public class ViewBlog extends WebPage
   {   public ViewBlog()   {   //get Blog in detached model
   IModel blogModel = new LoadableDetachableModel()   {   protected Object load()   {
   return BlogProxy.getDefault(); //via proxy   }   };  
   //add panel components   add(new HeaderPanel(headerPanel, blogModel));   
 ...and then in the HeaderPanel I do this: public class HeaderPanel extends Panel
   {   public HeaderPanel(String id, IModel blogModel)   {   super(id);
Blog blog = (Blog)blogModel; //EXCEPTION HERE!   ..  
   I get this exception: java.lang.ClassCastException: com.myapp.ui.ViewBlog$1   at 
com.myapp.ui.panel.HeaderPanel.init(HeaderPanel.java :34)   at com.myapp.ui.ViewBlog .init(ViewBlog.java:53)   at
   sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native   Method)   at
   sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java   :39)   at
   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)   at
   java.lang.reflect.Constructor.newInstance (Constructor.java:494)   at java.lang.Class.newInstance0 (Class.java:350)
   at java.lang.Class.newInstance(Class.java:303) How do I down-cast to Blog (entity bean) from the IModel param?
  --  -- karthik -- 
   ---  This SF.Net email is sponsored by xPML, a groundbreaking scripting
 language  that extends applications into web and mobile media. Attend the live webcast  and join the prime developer group breaking into this new coding
 territory!  http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
  ___  Wicket-user mailing list  
Wicket-user@lists.sourceforge.net  https://lists.sourceforge.net/lists/listinfo/wicket-user 
 ---  This SF.Net email is sponsored by xPML, a groundbreaking scripting
 language  that extends applications into web and mobile media. Attend the live webcast  and join the prime developer group breaking into this new coding territory! 
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642  ___
  Wicket-user mailing list  Wicket-user@lists.sourceforge.net  
https://lists.sourceforge.net/lists/listinfo/wicket-user -- -- karthik -This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat

[Wicket-user] ending a response

2006-04-06 Thread Vincent Jenks
I'm convinced that I saw an example of what do to when one would like to end the response of a page and redirect to another...but I can't put my finger on it...so here's my problem:In my page I'm testing for the existence of an object...if it doesn't exist I'd like to redirec to another page...but it appears to continue to try and render the page...which throws a NullReferenceException (obviously) because my object is null:
  //get cart from session  final ShoppingCart cart = ((UserSession)getSession()).getCart();if (cart == null)   setResponsePage(new EmptyCart());I want the page to stop rendering and redirect to EmptyCart
Thanks!


Re: [Wicket-user] ending a response

2006-04-06 Thread Vincent Jenks
I'm using 1.1.1, is that a 1.2 class?On 4/6/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
throw new RestartResponseException or throw new RestartResponseAtInterceptPageException depending on your needs.
you pass in the page you want to restart at via exception's constructor-Igor

On 4/6/06, Vincent Jenks [EMAIL PROTECTED] wrote:

I'm convinced that I saw an example of what do to when one would like to end the response of a page and redirect to another...but I can't put my finger on it...so here's my problem:In my page I'm testing for the existence of an object...if it doesn't exist I'd like to redirec to another page...but it appears to continue to try and render the page...which throws a NullReferenceException (obviously) because my object is null:
  //get cart from session  final ShoppingCart cart = ((UserSession)getSession()).getCart();if (cart == null)   setResponsePage(new EmptyCart());I want the page to stop rendering and redirect to EmptyCart
Thanks!






Re: [Wicket-user] ending a response

2006-04-06 Thread Vincent Jenks
Hey, that's good news...maybe I'll start looking at it. I assume it's not a drop-in replacement for an existing 1.1.1 project ;)On 4/6/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:
heh, if we are still at 1.2 in a month from now i quit! hopefully rc1 is out this weekend.-Igor
On 4/6/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:Ouch, maybe it's time to upgrade to 
1.2though I'm supposed to launch this app in a month and I don't want to use a beta or RC in production.
On 4/6/06, 
Igor Vaynberg [EMAIL PROTECTED] wrote:


yeah thats 1.2in 1.1 i guess what you can do is create your own runtimeexception that takes a page, override onRuntimeException in requestcycle? application? and return that page from that method. that should work although im not sure.
-IgorOn 4/6/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
I'm using 1.1.1, is that a 1.2 class?On 4/6/06, 
Igor Vaynberg [EMAIL PROTECTED] wrote:
throw new RestartResponseException or throw new RestartResponseAtInterceptPageException depending on your needs.
you pass in the page you want to restart at via exception's constructor-Igor

On 4/6/06, Vincent Jenks [EMAIL PROTECTED] wrote:





I'm convinced that I saw an example of what do to when one would like to end the response of a page and redirect to another...but I can't put my finger on it...so here's my problem:In my page I'm testing for the existence of an object...if it doesn't exist I'd like to redirec to another page...but it appears to continue to try and render the page...which throws a NullReferenceException (obviously) because my object is null:
  //get cart from session  final ShoppingCart cart = ((UserSession)getSession()).getCart();if (cart == null)   setResponsePage(new EmptyCart());I want the page to stop rendering and redirect to EmptyCart
Thanks!














Re: [Wicket-user] Floating Panels - any tip

2006-04-09 Thread Vincent Jenks
A good example of this...and a very easy open source _javascript_ lib to use is called wz dragdrop:http://www.walterzorn.com/dragdrop/dragdrop_e.htm
Very non-invasive and easy to use!-vOn 4/9/06, Johan Compagner [EMAIL PROTECTED] wrote:
dragging a panel around looks to me like a complete client side thing.
So you can use any _javascript_ library you find for this that does this platform independend for you,And include that in the markup.johan
On 4/9/06, Ayodeji Aladejebi 
[EMAIL PROTECTED] wrote:
Two questions:
Presently now without using _javascript_, can i build a floating Panel in Wicket which can be dragged around on the page?

I see Wicket and ECMAScript like Java and JNI.Knowing when to use ECMAscript in ur development is important not assuming the wicket API will totally eradicate _javascript_ focus in development. I think according to wicket vision, focus on even areas like _javascript_ should be as minimal as possible. i could use DW to generate ECMAScript fordragging a DIV but i dont think the _javascript_ code is cross platform and when i build my own custom wicket panels, i want to ensure the _javascript_ i use with the panel is also cross platform. Anyway that aside, my question is remains the same.







Re: [Wicket-user] Enterprise application using Wicket

2006-04-09 Thread Vincent Jenks
What argument *couldn't* be made? Comparing JSP and Wicket is like night and day...JSP is antiquated technology in comparison.The fact that you can be many more times productive and simultaneously produce clean, manageable code is probably the top-most incentive for using Wicket.
A con might be the fact that session-state is used rather heavily. However, in my own benchmarking...Wicket holds up extremely well w/ 100's of simultaneous users (that was while testing Wicket 1.1.1  Hibernate, pulling up several different types of object graphs.)
Just my 2c...-vOn 4/9/06, dave723 [EMAIL PROTECTED] wrote:
The Fortune 50 company where I work is migrating a proprietary webapplication and is tending toward JSP.I'd like to get them to consider Wicket.What persuasive arguments can Imake that would counter the momentum of JSP?Thanks.
--View this message in context: http://www.nabble.com/Enterprise-application-using-Wicket-t1420394.html#a3828769Sent from the Wicket - User forum at 
Nabble.com.---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] View from 30,000 feet of Wicket infrastructure

2006-04-09 Thread Vincent Jenks
That's tough since there is no ground-up tutorial like this when it comes to Wicket (that I know of.) There's a Wicket book on the way from what I understand but that may not be for a few months or so?The best thing you can do is get a simple Hello World working on your local machine.
1. download and install Tomcat (servlet container, http server)http://tomcat.apache.org/download-55.cgi2. download and install Eclipse (and Eclipse Webtools)
http://www.eclipse.org/downloads/http://download.eclipse.org/webtools/downloads/3. download wicket, create a User Library in Eclipse and add the Wicket jars
http://download.eclipse.org/eclipse/downloads/drops/R-3.0-200406251208/eclipse-news-part5-R3.html - see section on 
User-defined libraries4. Create a web project in Eclipse, add reference to Wicket User Library from step 3. Also set up Tomcat so you can deploy your test app to it - this should be fairly intuitive while creating your web project.
5. do this tutorialhttp://wicket.sourceforge.net/ExampleHelloWorld.htmlThis should at least give you a few clues on how to get started ASAP on a small scale. The documentation at each of the sites for each of the projects should get you what you need.
The best way to get started is to jump in! If you're comfortable w/ Eclipse and want more than Webtools can offer you, MyEclipse is a great plugin for Eclipse...I've been using it for about 4 mo. and I love it. It's not free, however.
After all of this, deploying to a linux server or another machine of any platform should be fairly simple. A web project in eclipse webtools can be exported as a .war archive which can be dropped in just about any app server/container.
Hope this helps in some way.-vOn 4/9/06, Daniel Spiewak [EMAIL PROTECTED] wrote:
I can't think of many references that give the kind of overview you're looking for. Having just been (arguably still at) the same point you're at in terms of knowledge of web apps, I really can't say that there is a good solution. What I did is blindly followed the install instructions and then poked around with the various options checking consequences. I found as many references as I could find about wicket component details, as many tutorials as I could dig up on using them, and stumbled my way through configuring Tomcat so I could experiment.
If anyone does have any references of this type, I'm interested too. :-)Daniel
On 4/9/06, Dave Johnson 
[EMAIL PROTECTED] wrote:I'm an old COBOL guy who has learned enough Java to be useful in a
corporate environment where I can see the need for a new class, generatea _javascript_ proxy to call the Java class from the UI, and build a classwith Eclipse to do the job.Now I'd like to begin developing in Wicket for my own purposes under
Windows 2000 / XP.However, when it comes to the infrastructure of webapps, I get mired in details much too quickly.What are some good references that clearly explain the various levels ofsoftware I encounter, such as Linux, Tomcat,Jetty, Hibernate, PHP,
MySQL and all the rest, and whether they're on the local machine or theremote server?And which are even needed?Most of what I find seems to assume too much familiarity with theseissues.I need a high-level overview that explains all this stuff
without dropping down to 300 feet so quickly.Blindly followinginstallation instructions doesn't work well without knowing theconsequences of various choices.Thanks for any help.Dave

---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast

and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___Wicket-user mailing listWicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user




Re: [Wicket-user] View from 30,000 feet of Wicket infrastructure

2006-04-10 Thread Vincent Jenks
Johan, I agree, the basic types that webtools provides editability for should be built into eclipse...like html, xml, _javascript_, css, etc. However, for a beginner, installing eclipse + webtools gives you everything you need to build a basic Java EE-based web app.
It was my experience, when starting out w/ Java about a year ago, that these tools alone got me up and running, building sites very quickly. I was able to work from my Gentoo workstation at home and my Winxp box at work w/ exactly the same tools.
As for MyEclipse...that was my only compromise when it came to choosing tools and trying to keep everything open source. After using it, I had to have it! :D I'm glad I did, they have a Matisse editor coming anytime now...should be interesting.
On 4/10/06, Daniel Spiewak [EMAIL PROTECTED] wrote:
Merve will either deploy to Tomcat or run the webapp in a bundled Tomcat instance. Just to give you a headstart in the flakey-ness, it all has to do with creating the Run Configuration and the webapp context dir. :-)

I would use MyEclipse if I was willing to spend the money on it.Daniel
On 4/10/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:Hmm...not familiar but it sounds like a beginner might struggle w/ something like that? I could be wrong. The webtools platform was brutally poor until recently when they managed to stabilize it...I was actually impressed the last time I test-drove it.
I'll have to check out Merve. Is it simply a plugin that deploys to tomcat? I'm using a lot of Wicket + EJB3 on JBoss 4 these days (zen, if you ask me.) I've been using Eclipse 3.1.2  MyEclipse 4.1...couldn't


 be happier.On 4/9/06, Daniel Spiewak 

[EMAIL PROTECTED] wrote:
Personally, I prefer vanilla Eclipse 3.2, XMLBuddy and the Merve plugin (very flakey, but it works well once you figure out its idiosyncrasies).
DanielOn 4/9/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:



That's tough since there is no ground-up tutorial like this when it comes to Wicket (that I know of.) There's a Wicket book on the way from what I understand but that may not be for a few months or so?
The best thing you can do is get a simple Hello World working on your local machine.
1. download and install Tomcat (servlet container, http server)http://tomcat.apache.org/download-55.cgi
2. download and install Eclipse (and Eclipse Webtools)
http://www.eclipse.org/downloads/



http://download.eclipse.org/webtools/downloads/3. download wicket, create a User Library in Eclipse and add the Wicket jars
http://download.eclipse.org/eclipse/downloads/drops/R-3.0-200406251208/eclipse-news-part5-R3.html
 - see section on 
User-defined libraries4. Create a web project in Eclipse, add reference to Wicket User Library from step 3. Also set up Tomcat so you can deploy your test app to it - this should be fairly intuitive while creating your web project.
5. do this tutorialhttp://wicket.sourceforge.net/ExampleHelloWorld.html



This should at least give you a few clues on how to get started ASAP on a small scale. The documentation at each of the sites for each of the projects should get you what you need.
The best way to get started is to jump in! If you're comfortable w/ Eclipse and want more than Webtools can offer you, MyEclipse is a great plugin for Eclipse...I've been using it for about 4 mo. and I love it. It's not free, however.
After all of this, deploying to a linux server or another machine of any platform should be fairly simple. A web project in eclipse webtools can be exported as a .war archive which can be dropped in just about any app server/container.
Hope this helps in some way.-v
On 4/9/06, Daniel Spiewak [EMAIL PROTECTED] wrote:
I can't think of many references that give the kind of overview you're looking for. Having just been (arguably still at) the same point you're at in terms of knowledge of web apps, I really can't say that there is a good solution. What I did is blindly followed the install instructions and then poked around with the various options checking consequences. I found as many references as I could find about wicket component details, as many tutorials as I could dig up on using them, and stumbled my way through configuring Tomcat so I could experiment.
If anyone does have any references of this type, I'm interested too. :-)Daniel
On 4/9/06, Dave Johnson 
[EMAIL PROTECTED] wrote:I'm an old COBOL guy who has learned enough Java to be useful in a
corporate environment where I can see the need for a new class, generatea _javascript_ proxy to call the Java class from the UI, and build a classwith Eclipse to do the job.Now I'd like to begin developing in Wicket for my own purposes under
Windows 2000 / XP.However, when it comes to the infrastructure of webapps, I get mired in details much too quickly.What are some good references that clearly explain the various levels ofsoftware I encounter, such as Linux, Tomcat,Jetty, Hibernate, PHP,
MySQL and all the rest, and whether they're on the local machine or theremote server?And which are even

Re: [Wicket-user] View from 30,000 feet of Wicket infrastructure

2006-04-10 Thread Vincent Jenks
See, I look at it the other way around...they release a very stable, feature-rich plugin for the current release and support it well w/ regular upgrades, fixes, etc. I'm sure 5.0 will support Eclipse 3.2 but I'm not entirely sure.
I'd rather not be upgrading Eclipse at every milestone and work in a reassuringly stable environment.Personally, I probably won't switch to eclipse 3.2 until it's either a) a final release or b) JDK 1.6 final is released - whichever comes first.
I couldn't see anything that compelling about 3.2M6, so far that would make me have to have it just yet...but I haven't looked at it that carefully.On 4/10/06, 
Johan Compagner [EMAIL PROTECTED] wrote:
the problem with myeclipse is that they don't move quickly enough for me.They should be atleast have a version of myeclipse for every milestone build. Else i can't really use there software.
Do they have a version for 
3.2M6 ?johanOn 4/10/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

Johan, I agree, the basic types that webtools provides editability for should be built into eclipse...like html, xml, _javascript_, css, etc. However, for a beginner, installing eclipse + webtools gives you everything you need to build a basic Java EE-based web app.
It was my experience, when starting out w/ Java about a year ago, that these tools alone got me up and running, building sites very quickly. I was able to work from my Gentoo workstation at home and my Winxp box at work w/ exactly the same tools.
As for MyEclipse...that was my only compromise when it came to choosing tools and trying to keep everything open source. After using it, I had to have it! :D I'm glad I did, they have a Matisse editor coming anytime now...should be interesting.
On 4/10/06, Daniel Spiewak 

[EMAIL PROTECTED] wrote:
Merve will either deploy to Tomcat or run the webapp in a bundled Tomcat instance. Just to give you a headstart in the flakey-ness, it all has to do with creating the Run Configuration and the webapp context dir. :-)

I would use MyEclipse if I was willing to spend the money on it.Daniel
On 4/10/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:Hmm...not familiar but it sounds like a beginner might struggle w/ something like that? I could be wrong. The webtools platform was brutally poor until recently when they managed to stabilize it...I was actually impressed the last time I test-drove it.
I'll have to check out Merve. Is it simply a plugin that deploys to tomcat? I'm using a lot of Wicket + EJB3 on JBoss 4 these days (zen, if you ask me.) I've been using Eclipse 3.1.2  MyEclipse 4.1...couldn't




 be happier.On 4/9/06, Daniel Spiewak 



[EMAIL PROTECTED] wrote:
Personally, I prefer vanilla Eclipse 3.2, XMLBuddy and the Merve plugin (very flakey, but it works well once you figure out its idiosyncrasies).
DanielOn 4/9/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:





That's tough since there is no ground-up tutorial like this when it comes to Wicket (that I know of.) There's a Wicket book on the way from what I understand but that may not be for a few months or so?
The best thing you can do is get a simple Hello World working on your local machine.
1. download and install Tomcat (servlet container, http server)http://tomcat.apache.org/download-55.cgi
2. download and install Eclipse (and Eclipse Webtools)
http://www.eclipse.org/downloads/





http://download.eclipse.org/webtools/downloads/3. download wicket, create a User Library in Eclipse and add the Wicket jars
http://download.eclipse.org/eclipse/downloads/drops/R-3.0-200406251208/eclipse-news-part5-R3.html
 - see section on 
User-defined libraries4. Create a web project in Eclipse, add reference to Wicket User Library from step 3. Also set up Tomcat so you can deploy your test app to it - this should be fairly intuitive while creating your web project.
5. do this tutorialhttp://wicket.sourceforge.net/ExampleHelloWorld.html





This should at least give you a few clues on how to get started ASAP on a small scale. The documentation at each of the sites for each of the projects should get you what you need.
The best way to get started is to jump in! If you're comfortable w/ Eclipse and want more than Webtools can offer you, MyEclipse is a great plugin for Eclipse...I've been using it for about 4 mo. and I love it. It's not free, however.
After all of this, deploying to a linux server or another machine of any platform should be fairly simple. A web project in eclipse webtools can be exported as a .war archive which can be dropped in just about any app server/container.
Hope this helps in some way.-v
On 4/9/06, Daniel Spiewak [EMAIL PROTECTED] wrote:
I can't think of many references that give the kind of overview you're looking for. Having just been (arguably still at) the same point you're at in terms of knowledge of web apps, I really can't say that there is a good solution. What I did is blindly followed the install instructions and then poked around with the various options checking consequences. I found as many

Re: [Wicket-user] bind Map to DropDownChoice

2006-04-10 Thread Vincent Jenks
Is there an example of this somewhere? I'm struggling to get this working where I have a HashMapString, String...the first String is the ID and the second String is the value.I have this:   IModel dropDownModel = new Model()
   {protected Object load(){ return StringValues.getUSAStates();}   };   add(new DropDownChoice(billingState, dropDownModel, new IChoiceRenderer()
   {public String getDisplayValue(Object object){ return object.toString();}public String getIdValue(Object object, int index)
{ return object.toString();}   }));I *just* wanted to see the page render...I know the values aren't right...but anything would have been acceptable. I keep getting a very unhelpful NullPointerException that I'm not even sure has anything to do w/ the dropdowns...but I assume it does since the rest of the form is very straightforward TextField components.
I don't see where this is being done in wicket-examplesI'm using 1.1.1Thanks!On 4/1/06, Johan Compagner 
[EMAIL PROTECTED] wrote:there is no map support for this.
What you could do is give the map to the ChoiceRenderer impland give the keys of the map as a list to the Choice.johan
On 3/31/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

I'm trying to get a Map of data so I can have the key be the value of the dropdown options and the value of the Map item be the value of the option in the dropdown. Problem is, it doesn't look like DropDownChoice will accept a Map...unless I'm doing it wrong?
Is a Map the best way to go? I was maybe considering using a single List collection and splitting a single string to get the two valuesbut that's pretty fugly too.






Re: [Wicket-user] bind Map to DropDownChoice

2006-04-10 Thread Vincent Jenks
I'm sorry, I don't think I quite understand.I have dropDownModel which looks like this:   IModel dropDownModel = new Model()   {protected Object load(){
 return StringValues.getUSAStates(); //via proxy}   };StringValues.getUSAStates() looks something like this: public static MapString, String getUSAStates()
 {  MapString, String states = new HashMapString, String();  states.put(AL, Alabama);  states.put(AK, Alaska);  
states.put(AZ, Arizona);  states.put(AR, Arkansas);  states.put(CA, California);..Where CA is the key and California is the value...which is exactly how I'd like to see it in the select dropdown.
Are you saying that I should split the keys and values into two different lists and look them up that way?It would be extremely useful, in my opinion, if Wicket had support for these types of objects internally, given the frequency of which they're used. It would be very intuitive if I could supply key/value Map objects into what is essentially a list of key/value pairs.
Thanks again...On 4/10/06, Johan Compagner [EMAIL PROTECTED] wrote:
give the choice renderen the complete hashmapAnd give the dropdown a model with the keys of that hashmap as a list.so if StringValues.getUSAStates(); are th ids in the hashmap then that should go ok.

but youre choicerender is wrong: add(new DropDownChoice(billingState, dropDownModel, new IChoiceRenderer()
   {public String getDisplayValue(Object object){ return idValueHashmap.get(object);
}public String getIdValue(Object object, int index)
{ return object.toString();}   }));
On 4/11/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:Is there an example of this somewhere? I'm struggling to get this working where I have a HashMapString, String...the first String is the ID and the second String is the value.
I have this:   IModel dropDownModel = new Model()
   {protected Object load(){ return StringValues.getUSAStates();}   };   add(new DropDownChoice(billingState, dropDownModel, new IChoiceRenderer()
   {public String getDisplayValue(Object object){ return object.toString();}public String getIdValue(Object object, int index)
{ return object.toString();}   }));I *just* wanted to see the page render...I know the values aren't right...but anything would have been acceptable. I keep getting a very unhelpful NullPointerException that I'm not even sure has anything to do w/ the dropdowns...but I assume it does since the rest of the form is very straightforward TextField components.
I don't see where this is being done in wicket-examplesI'm using 1.1.1Thanks!On 4/1/06, 
Johan Compagner 
[EMAIL PROTECTED] wrote:
there is no map support for this.
What you could do is give the map to the ChoiceRenderer impland give the keys of the map as a list to the Choice.johan


On 3/31/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:



I'm trying to get a Map of data so I can have the key be the value of the dropdown options and the value of the Map item be the value of the option in the dropdown. Problem is, it doesn't look like DropDownChoice will accept a Map...unless I'm doing it wrong?
Is a Map the best way to go? I was maybe considering using a single List collection and splitting a single string to get the two valuesbut that's pretty fugly too.










Re: [Wicket-user] EJB3/Hibernate Lazy fetching...

2006-04-11 Thread Vincent Jenks
OK, this doesn't appear to work.  I finally got around to testing this
and I still get a
LazyInitializationException.

I passed the model around and it's barfing.

main page (ViewBlog.class):

//get object graph in detachable model
IModel blogModel = new LoadableDetachableModel()
{
protected Object load()
{
//get blog  entries
Blog blog = BlogProxy.getDefault(); 

return blog;
}
};

//set as page model
setModel(blogModel);

//add panel components
add(new TopicsPanel(topicsPanel, blogModel));

In the TopicsPanel class:

public class TopicsPanel extends Panel
{
public TopicsPanel(String id, IModel blogModel)
{
super(id, blogModel);

//get model object
Blog blog = (Blog)getModelObject();

//add list view repeater
add(new ListView(categoriesView, 
((Blog)getModelObject()).getCategories())
{
protected void populateItem(ListItem item)
{
//get row model
final Category category = 
(Category)item.getModelObject();

//create link
Link categoryLink = new 
PageLink(categoryLink, ViewBlog.class)
{
public void onClick()
{
info(booyah!);
}
};

//add category name label
categoryLink.add(new Label(topic, 
category.getName()));

//add link
item.add(categoryLink);
}
});
}
}

Where I'm trying to retrive the lazy collection in the ListView the
session has still been lost.

What have I done wrong?  How can I get the lazily loaded collection
and not have to resort to eager fetching?

Remember, I'm not using Hibernate directly...I'm using JBoss EJB3 in
JBoss 4.0.4RC1...I don't have a lot of control over Hibernate...no do
I want to if I want to keep my project container-independent.

Thanks!

On 3/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:

 or pass the same model :)


 -Igor



 On 3/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  Well, in the previous page which passes the Product into this page...the 
  object was wrapped in a detachable model...not just called directly...so I 
  should try and wrap it again in the current page?
 
 
 
   On 3/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
  
   instead of using the product object directly, use a detachable model.
  
   you might also need to use an open session in view interceptor in case 
   jboss closes the hibernate session after your bean's method is finished 
   executing. if it does this, then by the time wicket code runs the object 
   is already disconnected from its session and thus cant load any child 
   collections.
  
  
   -Igor
  
  
  
  
   On 3/20/06,  Vincent Jenks [EMAIL PROTECTED] wrote:
   
OK, so I'm in a bit of a quagmire.
   
I'm using Wicket + EJB3 (JBoss 4.0.4RC1) which uses Hibernate as the 
persistence behind EJB3.
   
Unless I set all of my parent/child object relationship annotations to 
EAGER fetching...I get this error:
   
org.hibernate.LazyInitializationException: failed to lazily initialize 
a collection of role:
   
...when I try to access the child collection of the parent object.  In 
my case, for example, I am passing an object to a form in Wicket using 
the constructor:
   
public class ProductDetail extends WebPage
{
public ProductDetail()
{
this(null);
}
   
public ProductDetail(Product product)
{
add(new ProductDetailForm(productDetailForm, product));
...
   
The parent object being Product and the child being 
Product.getConfigurations()which is a ListConfiguration.
   
This same ProductDetail page has a form (see above where I passed the 
Product into the form)...and I need to access the child collection 
inside the form:
   
add(new ListView(configs, product.getConfigurations())
{
protected void populateItem(ListItem item)
{
final

Re: [Wicket-user] EJB3/Hibernate Lazy fetching...

2006-04-11 Thread Vincent Jenks
I changed the param to look like yours:

new PropertyModel(blogModel, categories)

...and I get the same exception...no luck!

On 4/11/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 you are still not using a model for the listview, you are binding the
 listview to hibernate's lazy initializable set instead in this line:


 add(new ListView(categoriesView, ((Blog)getModelObject())
  .getCategories())

 try changing that to:

 add(new ListView(categoriesView, new PropertyModel(blogModel,
 categories));

 or create a simple wrapper around blogmodel directly if you dont want to use
 soft binding and reflection.

 -Igor




 On 4/11/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  OK, this doesn't appear to work.  I finally got around to testing this
 and I still get a
 LazyInitializationException.

 I passed the model around and it's barfing.

 main page (ViewBlog.class):

 //get object graph in detachable model
 IModel blogModel = new LoadableDetachableModel()
 {
 protected Object load()
 {
 //get blog  entries
 Blog blog =
 BlogProxy.getDefault();
 return blog;
 }
 };

 //set as page model
 setModel(blogModel);

 //add panel components
 add(new TopicsPanel(topicsPanel, blogModel));

 In the TopicsPanel class:

 public class TopicsPanel extends Panel
 {
 public TopicsPanel(String id, IModel blogModel)
 {
 super(id, blogModel);

 //get model object
 Blog blog = (Blog)getModelObject();

 //add list view repeater
 add(new ListView(categoriesView,
 ((Blog)getModelObject()).getCategories())
 {
 protected void
 populateItem(ListItem item)
 {
 //get row model
 final Category category =
 (Category)item.getModelObject();

 //create link
 Link categoryLink = new
 PageLink(categoryLink, ViewBlog.class)
 {
 public void
 onClick()
 {

 info(booyah!);
 }
 };

 //add category name label
 categoryLink.add(new
 Label(topic, category.getName()));

 //add link
 item.add(categoryLink);
 }
 });
 }
 }

 Where I'm trying to retrive the lazy collection in the ListView the
 session has still been lost.

 What have I done wrong?  How can I get the lazily loaded collection
 and not have to resort to eager fetching?

 Remember, I'm not using Hibernate directly...I'm using JBoss EJB3 in
 JBoss 4.0.4RC1...I don't have a lot of control over Hibernate...no do
 I want to if I want to keep my project container-independent.

 Thanks!

 On 3/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 
  or pass the same model :)
 
 
  -Igor
 
 
  
  On 3/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
  
   Well, in the previous page which passes the Product into this page...the
 object was wrapped in a detachable model...not just called directly...so I
 should try and wrap it again in the current page?
  
  
  
On 3/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
   
instead of using the product object directly, use a detachable model.
   
you might also need to use an open session in view interceptor in case
 jboss closes the hibernate session after your bean's method is finished
 executing. if it does this, then by the time wicket code runs the object is
 already disconnected from its session and thus cant load any child
 collections.
   
   
-Igor
   
   
   
   
On 3/20/06,  Vincent Jenks  [EMAIL PROTECTED] wrote:

 OK, so I'm in a bit of a quagmire.

 I'm using Wicket + EJB3 (JBoss 4.0.4RC1) which uses Hibernate as the
 persistence behind EJB3.

 Unless I set all of my parent/child object relationship annotations
 to EAGER fetching...I get this error:

 org.hibernate.LazyInitializationException : failed
 to lazily initialize a collection of role:

 ...when I try to access the child collection of the parent object.
 In my case, for example, I am passing an object to a form in Wicket using
 the constructor:

 public class ProductDetail extends WebPage
 {
 public ProductDetail()
 {
 this(null);
 }

 public ProductDetail(Product product)
 {
 add(new
 ProductDetailForm(productDetailForm, product

Re: [Wicket-user] EJB3/Hibernate Lazy fetching...

2006-04-11 Thread Vincent Jenks
Yes...if I were using plain Hibernate and not EJB3...like I explained
in my first post.  I need another way of making this work (as Igor
said...a way to keep the session open somehow in the container) - a
way that wouldn't require any Hibernate-specific coding...

I've built several plain Hibernate (Hibernate + Servlets + EJB) where
the DAOs would open the transaction and a filter would close the
session...but that doesn't apply so much here, if I'm not mistaken.

On 4/11/06, Andrew Berman [EMAIL PROTECTED] wrote:
 You need Open Session In View --
 http://www.hibernate.org/43.html


 On 4/11/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
 
  in that case your container's persistence mechanism is closing the
 underlying hibernate session after the end of the invocation? this is a
 container specific problem not a wicket one. you need to figure out how to
 tell your container to keep the underlying entity manager session open so
 that lazy collections can be fetched even outside the session/stateless
 bean's method invocation.
 
 
  -Igor
 
 
 
  On 4/11/06, Vincent Jenks  [EMAIL PROTECTED] wrote:
   I changed the param to look like yours:
  
   new PropertyModel(blogModel, categories)
  
   ...and I get the same exception...no luck!
  
   On 4/11/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
you are still not using a model for the listview, you are binding the
listview to hibernate's lazy initializable set instead in this line:
   
   
add(new ListView(categoriesView, ((Blog)getModelObject())
 .getCategories())
   
try changing that to:
   
add(new ListView(categoriesView, new PropertyModel(blogModel,
categories));
   
or create a simple wrapper around blogmodel directly if you dont want
 to use
soft binding and reflection.
   
-Igor
   
   
   
   
On 4/11/06, Vincent Jenks  [EMAIL PROTECTED] wrote:

 OK, this doesn't appear to work.  I finally got around to testing
 this
and I still get a
LazyInitializationException.
   
I passed the model around and it's barfing.
   
main page (ViewBlog.class):
   
//get object graph in detachable model
IModel blogModel = new LoadableDetachableModel()
{
protected Object load()
{
//get blog  entries
Blog blog =
BlogProxy.getDefault ();
return blog;
}
};
   
//set as page model
setModel(blogModel);
   
//add panel components
add(new TopicsPanel(topicsPanel, blogModel));
   
In the TopicsPanel class:
   
public class TopicsPanel extends Panel
{
public TopicsPanel(String id, IModel blogModel)
{
super(id, blogModel);
   
//get model object
Blog blog = (Blog)getModelObject();
   
//add list view repeater
add(new ListView(categoriesView,
((Blog)getModelObject()).getCategories())
{
protected void
populateItem(ListItem item)
{
//get row model
final Category
 category =
(Category)item.getModelObject();
   
//create link
Link categoryLink =
 new
PageLink(categoryLink, ViewBlog.class)
{
public void
onClick()
{
   
info(booyah!);
}
};
   
//add category name
 label
categoryLink.add(new
Label(topic, category.getName ()));
   
//add link
   
 item.add(categoryLink);
}
});
}
}
   
Where I'm trying to retrive the lazy collection in the ListView the
session has still been lost.
   
What have I done wrong?  How can I get the lazily loaded collection
and not have to resort to eager fetching?
   
Remember, I'm not using Hibernate directly...I'm using JBoss EJB3 in
JBoss 4.0.4RC1...I don't have a lot of control over Hibernate...no do
I want to if I want to keep my project container-independent.
   
Thanks!
   
On 3/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:

 or pass the same model :)


 -Igor


 
 On 3/20/06, Vincent Jenks [EMAIL PROTECTED]  wrote:
 
  Well, in the previous page which passes the Product into this
 page...the
object was wrapped

Re: [Wicket-user] EJB3/Hibernate Lazy fetching...

2006-04-11 Thread Vincent Jenks
So, when I reference these persistent child collections, won't they
also need to be wrapped in a detachable model, i.e. when they're
passed to a ListView?  Or, because they're child objects of an already
detachable model, are they detached?

On 4/11/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 ah, if you were doing the same thing in jsp and it worked then it should
 work in wicket. there is no difference. if it is still not working then you
 are still not using a model somewhere and a persistent object/set ends up in
 session.


 -Igor

 On 4/11/06, Vincent Jenks [EMAIL PROTECTED] wrote:
  That'd basically require me to re-write my application and do
  everything in an entirely different way...and I'd rather just deal w/
  eager fetching and limit the number of records I'm calling instead.
  Since I'm using the EJB3 EntityManager I don't want to have to resort
  to touching the Hibernate details underneath (or using EJB at all is
  worthless to me since I could just use Hibernate and do it w/ less
  dinking around.)  This EJB3 stuff was supposed to make my life easier
  ;)
 
  I guess I assumed Wicket wouldn't cause this since I was doing the
  same thing when using Servlets  JSP.  The panels were JSP Tag Files
  and I passed data in through attributes...as wasn't getting the Lazy
  exception.  Obviously...different
 technologies...different issues.
  I'm still fairly ignorant when it comes to Wicket.
 
  I appreciate all the help anyways!
 
  On 4/11/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
   you can have a filter that opens AND closes the session/transaction.
 keep it
   in a threadlocal, and a base dao that retrieves it from the threadlocal.
 you
   can also keep rollback flag in the threadlocal so the filter knows if it
   needs to rollback or commit the transaction.
  
   hibernate 3 also has the sessionfactory.currentsession that lets you
 hook
   into the filter's session threadlocal so that your daos can just go
   sessionfactory.currentsession().
  
   also spring takes care of all this for you via open session in view
 filter.
   im sure there is something similar for ejb3.
  
  
   -Igor
  
  
   On 4/11/06, Vincent Jenks [EMAIL PROTECTED] wrote:
Ugh...I thought once I started using a container this issue would go
away...that was the one thing that made setting up Hibernate a
PITAmanaging the frickin' session context (I thought it was really
ugly to open the session in the DAO and close it in a filter...with no
real control over the transaction.)
   
Marco, what do you mean by preloading the collections?  Not a term
I've heard before...not familiar w/ the concept - it sounds a little
like eager fetching.  Or, is that to say that you fetch them
separately instead of allowing hibernate/EJB3 to automatically pull
the collection?
   
I'll just use eager fetching for now and see if someone can help me
out on the EJB3 user forums in figuring out the session problem.  I've
been scanning over the EntityManager docs for a couple hours and I
don't see an obvious solution.
   
Thanks guys!
   
On 4/11/06, Marco Geier  [EMAIL PROTECTED]  wrote:
 you could wrap a transaction around the render phase)
 (and also around the event processing phase, or both, depending on
 your
 RenderStrategy)

 The key is:

  UserTransaction ut = (UserTransaction) new

 InitialContext().lookup(java:comp/UserTransaction);

 But you may need to reattach beans to the session, for the lazy
 collection thing to work properly.

 But ususally i just preload the collections, for example when i
 build
 or attach the model,

 hth

 Marco

 Vincent Jenks wrote:
  Yes...if I were using plain Hibernate and not EJB3...like I
 explained
  in my first post.  I need another way of making this work (as Igor
  said...a way to keep the session open somehow in the container) -
 a
  way that wouldn't require any Hibernate-specific coding...
 
  I've built several plain Hibernate (Hibernate + Servlets + EJB)
 where
  the DAOs would open the transaction and a filter would close the
  session...but that doesn't apply so much here, if I'm not
 mistaken.
 
  On 4/11/06, Andrew Berman  [EMAIL PROTECTED] wrote:
 
 You need Open Session In View --
 http://www.hibernate.org/43.html
 
 
 On 4/11/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
 
 in that case your container's persistence mechanism is closing
 the
 
 underlying hibernate session after the end of the invocation? this
 is
   a
 container specific problem not a wicket one. you need to figure
 out
   how to
 tell your container to keep the underlying entity manager session
 open
   so
 that lazy collections can be fetched even outside the
   session/stateless
 bean's method invocation.
 
 
 -Igor
 
 
 
 On 4/11/06, Vincent Jenks

Re: [Wicket-user] EJB3/Hibernate Lazy fetching...

2006-04-12 Thread Vincent Jenks
Ahh yes...I've seen that done too but couldn't figure out how that would be any different than eager fetching?I have seen that trick before but wasn't sure if that was the best approach since I don't *always* want the collection (but would have it since I'm preloading before it gets to the view.)
On 4/12/06, Marco Geier [EMAIL PROTECTED] wrote:
preloading is basically just calling mybean.getMyCollection().size()while you still have a session context. (i.e. either in an ejb sessionbean or for a example in your Wicket page constructor, given that you
wrapped the eventhandling phase in a usertransaction.This approach feels a little bit like EJB2 value objects withouthaving separate classes for separate usescasesVincent Jenks wrote:
 Ugh...I thought once I started using a container this issue would go away...that was the one thing that made setting up Hibernate a PITAmanaging the frickin' session context (I thought it was really
 ugly to open the session in the DAO and close it in a filter...with no real control over the transaction.) Marco, what do you mean by preloading the collections?Not a term
 I've heard before...not familiar w/ the concept - it sounds a little like eager fetching.Or, is that to say that you fetch them separately instead of allowing hibernate/EJB3 to automatically pull
 the collection? I'll just use eager fetching for now and see if someone can help me out on the EJB3 user forums in figuring out the session problem.I've been scanning over the EntityManager docs for a couple hours and I
 don't see an obvious solution. Thanks guys! On 4/11/06, Marco Geier [EMAIL PROTECTED] wrote:you could wrap a transaction around the render phase)
(and also around the event processing phase, or both, depending on yourRenderStrategy)The key is: UserTransaction ut = (UserTransaction) newInitialContext().lookup(java:comp/UserTransaction);
But you may need to reattach beans to the session, for the lazycollection thing to work properly.But ususally i just preload the collections, for example when i build
or attach the model,hthMarcoVincent Jenks wrote:Yes...if I were using plain Hibernate and not EJB3...like I explained
in my first post.I need another way of making this work (as Igorsaid...a way to keep the session open somehow in the container) - away that wouldn't require any Hibernate-specific coding...
I've built several plain Hibernate (Hibernate + Servlets + EJB) wherethe DAOs would open the transaction and a filter would close thesession...but that doesn't apply so much here, if I'm not mistaken.
On 4/11/06, Andrew Berman [EMAIL PROTECTED] wrote:You need Open Session In View --
http://www.hibernate.org/43.htmlOn 4/11/06, Igor Vaynberg  
[EMAIL PROTECTED] wrote:in that case your container's persistence mechanism is closing theunderlying hibernate session after the end of the invocation? this is a
container specific problem not a wicket one. you need to figure out how totell your container to keep the underlying entity manager session open sothat lazy collections can be fetched even outside the session/stateless
bean's method invocation.-IgorOn 4/11/06, Vincent Jenks  
[EMAIL PROTECTED] wrote:I changed the param to look like yours:
new PropertyModel(blogModel, categories)...and I get the same exception...no luck!On 4/11/06, Igor Vaynberg  
[EMAIL PROTECTED] wrote:you are still not using a model for the listview, you are binding the
listview to hibernate's lazy initializable set instead in this line:add(new ListView(categoriesView, ((Blog)getModelObject())
.getCategories())try changing that to:add(new ListView(categoriesView, new PropertyModel(blogModel,
categories));or create a simple wrapper around blogmodel directly if you dont wantto use
soft binding and reflection.-Igor
On 4/11/06, Vincent Jenks  [EMAIL PROTECTED] wrote:
OK, this doesn't appear to work.I finally got around to testingthisand I still get a
LazyInitializationException.I passed the model around and it's barfing.main page (
ViewBlog.class): //get object graph in detachable model IModel blogModel = new LoadableDetachableModel()
 { protected Object load() { //get blog  entries
 Blog blog =BlogProxy.getDefault (); return blog; }
 }; //set as page model setModel(blogModel);
 //add panel components add(new TopicsPanel(topicsPanel, blogModel));In the TopicsPanel class:
public class TopicsPanel extends Panel{ public TopicsPanel(String id, IModel blogModel)
 { super(id, blogModel); //get model object Blog blog = (Blog)getModelObject();
 //add list view repeater add(new ListView(categoriesView,((Blog)getModelObject()).getCategories())
 { protected voidpopulateItem(ListItem item) {
 //get row model final Categorycategory =
(Category)item.getModelObject(); //create link Link categoryLink =
newPageLink(categoryLink, ViewBlog.class) {
 public voidonClick() {
info(booyah!); } };
 //add category namelabel 
categoryLink.add(newLabel(topic, category.getName ())); //add link
item.add(categoryLink); } }); }
}Where I'm trying to retrive the lazy

Re: [Wicket-user] View from 30,000 feet of Wicket infrastructure

2006-04-12 Thread Vincent Jenks
They definitely seem more focused on new features and longer delays on
releases.  Personally, I don't use half of the features but that's not
to say that I never will.  I do, however, appreciate the rock-solid
stability and the support, so far, has been very good.

How is the dependencies feature not flexible?  I specifically chose
MyEclipse because Webtools 1.0 had a broken dependencies problem and
you had to manually add jars to the web project for them to be
deployed.

On 4/12/06, Timo Stamm [EMAIL PROTECTED] wrote:
 Johan Compagner schrieb:
  the problem with myeclipse is that they don't move quickly enough for me.
  They should be atleast have a version of myeclipse for every milestone
  build. Else i can't really use there software.


 Yes, they don't move very fast. Dependencies for web projects are also a
 big issue for me. They wanted to improve the flexibility of the build
 process last summer, but AFAIK that's not done yet.

 On the other hand, support is very good.


 Timo



 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] bind Map to DropDownChoice

2006-04-12 Thread Vincent Jenks
OK, I did this exactly how you showed me here...and I'm still getting the error.

Here's my model:

IModel dropDownModel = new Model()
{
protected Object load()
{
return new
ArrayListString(StringValues.getUSAStates().keySet()); //via proxy
}
};

Here's my dropdown:

add(new DropDownChoice(billingState, dropDownModel, 
new IChoiceRenderer()
{
public String getDisplayValue(Object object)
{
return 
StringValues.getUSAStates().get(object);
}

public String getIdValue(Object object, int 
index)
{
return object.toString();
}
}));

Here's the exception:

13:00:19,000 ERROR [RequestCycle] Unexpected runtime exception [page =
[Page class = com.myapp.ui.AddressInfo, id = 3]]
java.lang.NullPointerException
at 
wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:290)
at wicket.Component.renderComponent(Component.java:1888)
at 
wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
at wicket.Component.render(Component.java:1163)
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1136)
at 
wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:811)
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753)
at wicket.Component.renderComponent(Component.java:1888)
at 
wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
at wicket.markup.html.form.Form.onRender(Form.java:517)
at wicket.Component.render(Component.java:1163)
at 
wicket.markup.html.BodyOnLoadContainer.resolve(BodyOnLoadContainer.java:106)
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1159)
at 
wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:811)
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753)
at wicket.Component.renderComponent(Component.java:1888)
at 
wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
at wicket.Component.render(Component.java:1163)
at wicket.MarkupContainer.autoAdd(MarkupContainer.java:170)
at 
wicket.markup.html.BodyOnLoadResolver.resolve(BodyOnLoadResolver.java:60)
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1146)
at wicket.MarkupContainer.renderAll(MarkupContainer.java:779)
at wicket.Page.onRender(Page.java:788)
at wicket.Component.render(Component.java:1163)
at wicket.Page.doRender(Page.java:251)
at 
wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:276)
at wicket.RequestCycle.respond(RequestCycle.java:934)
at wicket.RequestCycle.request(RequestCycle.java:411)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:208)
at wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:234)
..

It's definitely the dropdown that is the culprit...when I remove it
from the page the
page renders just fine.

Any ideas?

On 4/10/06, Johan Compagner [EMAIL PROTECTED] wrote:
 ok then youre dropdown is wrong.

  IModel dropDownModel = new Model()
 {
 public Object getObject(final Component component)
 {
return new
 ArrayList(StringValues.getUSAStates().keySet()); //via proxy
 }
 };


  add(new DropDownChoice(billingState, dropDownModel, new IChoiceRenderer()
 {
 public String getDisplayValue(Object object)
 {

 return StringValues.getUSAStates().get(object);


 }

 public String getIdValue(Object object, int index)
 {
 return object.toString();
 }
 }));

 I haven't seen many usecases for that because most of the time
 You have a List of States so getUSAStates doesn't return a map but directly
 a list.
 With State objects that has properties like: a key AL and as name
 Alabama.

 That is the most used usecase i know of.

 johan



  On 4/11/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  I'm sorry, I don't think I quite understand.
 
  I have dropDownModel which looks like this:
 
 
  IModel dropDownModel = new Model()
  {
  protected Object load()
  {
 
  return StringValues.getUSAStates(); //via

Re: [Wicket-user] bind Map to DropDownChoice

2006-04-12 Thread Vincent Jenks
Good God...I don't believe I missed that!

Ok, this never happened...and thanks!

BTW - I'm using Wicket 1.1.1

On 4/12/06, Johan Compagner [EMAIL PROTECTED] wrote:
 if you change that strange load method to what i and gwyn are saying does it
 work then
 what wicket version are you using because if i look at 290 of AbstractChoice
 it is nothing.



  On 4/12/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  OK, I did this exactly how you showed me here...and I'm still getting the
 error.

 Here's my model:

 IModel dropDownModel = new Model()
 {
 protected Object load()
 {
 return new
 ArrayListString(StringValues.getUSAStates().keySet()); //via proxy
 }
 };

 Here's my dropdown:

 add(new DropDownChoice(billingState,
 dropDownModel, new IChoiceRenderer()
 {
 public String
 getDisplayValue(Object object)
 {
 return
 StringValues.getUSAStates().get(object);
 }

 public String
 getIdValue(Object object, int index)
 {
 return
 object.toString();
 }
 }));

 Here's the exception:

 13:00:19,000 ERROR [RequestCycle] Unexpected runtime exception [page =
 [Page class = com.myapp.ui.AddressInfo, id = 3]]
 java.lang.NullPointerException
 at
 wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:290)
 at wicket.Component.renderComponent
 (Component.java:1888)
 at
 wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
 at wicket.Component.render(Component.java:1163)
 at
 wicket.MarkupContainer.renderNext(MarkupContainer.java
 :1136)
 at
 wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:811)
 at
 wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753)
 at wicket.Component.renderComponent
 (Component.java:1888)
 at
 wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
 at
 wicket.markup.html.form.Form.onRender(Form.java:517)
 at wicket.Component.render(Component.java :1163)
 at
 wicket.markup.html.BodyOnLoadContainer.resolve(BodyOnLoadContainer.java:106)
 at
 wicket.MarkupContainer.renderNext(MarkupContainer.java:1159)
 at wicket.MarkupContainer.renderComponentTagBody
 (MarkupContainer.java:811)
 at
 wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753)
 at
 wicket.Component.renderComponent(Component.java:1888)
 at wicket.markup.html.WebMarkupContainer.onRender
 (WebMarkupContainer.java:77)
 at wicket.Component.render(Component.java:1163)
 at wicket.MarkupContainer.autoAdd(MarkupContainer.java:170)
 at
 wicket.markup.html.BodyOnLoadResolver.resolve(BodyOnLoadResolver.java
 :60)
 at
 wicket.MarkupContainer.renderNext(MarkupContainer.java:1146)
 at
 wicket.MarkupContainer.renderAll(MarkupContainer.java:779)
 at wicket.Page.onRender(Page.java:788)
 at wicket.Component.render (Component.java:1163)
 at wicket.Page.doRender(Page.java:251)
 at
 wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:276)
 at wicket.RequestCycle.respond(RequestCycle.java:934)
 at wicket.RequestCycle.request(RequestCycle.java:411)
 at
 wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:208)
 at
 wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:234)
 ..

 It's definitely the dropdown that is the culprit...when I remove it
 from the page the
 page renders just fine.

 Any ideas?

 On 4/10/06, Johan Compagner  [EMAIL PROTECTED] wrote:
  ok then youre dropdown is wrong.
 
   IModel dropDownModel = new Model()
  {
  public Object getObject(final Component component)
  {
 return new
  ArrayList(StringValues.getUSAStates().keySet()); //via proxy
  }
  };
 
 
   add(new DropDownChoice(billingState, dropDownModel, new
 IChoiceRenderer()
  {
  public String getDisplayValue(Object object)
  {
 
  return StringValues.getUSAStates().get(object);
 
 
   }
 
  public String getIdValue(Object object, int index)
  {
  return object.toString();
  }
  }));
 
  I haven't seen many usecases for that because most of the time
  You have a List of States so getUSAStates doesn't return a map

Re: [Wicket-user] bind Map to DropDownChoice

2006-04-12 Thread Vincent Jenks
It'd obviously be very helpful to have a more specific exception
message...it was so obvious I looked right over it (and I'm still
getting familiar w/ models.)

What I had done is copied some code where I was using a detachable
model...and just changed it to a regular model...that's where load()
came from...

On 4/12/06, Gwyn Evans [EMAIL PROTECTED] wrote:
 The current equivalent is line 305, i.e.

 protected void onComponentTagBody(final MarkupStream markupStream,
 final ComponentTag openTag)
 {
   List choices = getChoices();
   final AppendingStringBuffer buffer = new
 AppendingStringBuffer((choices.size() * 50) + 16);

 getChoices() is returning null there, as the model is empty and the
 choices.size() causes the NPE.

 Leaving aside the use of 'magic' numbers, should we do something
 explict there, i.e. log something  then use Collections.EMPTY_LIST,
 or even throw a NPE with an explicit message?

 /Gwyn


 On 12/04/06, Johan Compagner [EMAIL PROTECTED] wrote:
  if you change that strange load method to what i and gwyn are saying does it
  work then
  what wicket version are you using because if i look at 290 of AbstractChoice
  it is nothing.
 
 
 
   On 4/12/06, Vincent Jenks [EMAIL PROTECTED] wrote:
   OK, I did this exactly how you showed me here...and I'm still getting the
  error.
  
   Here's my model:
  
   IModel dropDownModel = new Model()
   {
   protected Object load()
   {
   return new
   ArrayListString(StringValues.getUSAStates().keySet()); //via proxy
   }
   };
  
   Here's my dropdown:
  
   add(new DropDownChoice(billingState,
  dropDownModel, new IChoiceRenderer()
   {
   public String
  getDisplayValue(Object object)
   {
   return
  StringValues.getUSAStates().get(object);
   }
  
   public String
  getIdValue(Object object, int index)
   {
   return
  object.toString();
   }
   }));
  
   Here's the exception:
  
   13:00:19,000 ERROR [RequestCycle] Unexpected runtime exception [page =
   [Page class = com.myapp.ui.AddressInfo, id = 3]]
   java.lang.NullPointerException
   at
  wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:290)
   at wicket.Component.renderComponent
  (Component.java:1888)
   at
  wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
   at wicket.Component.render(Component.java:1163)
   at
  wicket.MarkupContainer.renderNext(MarkupContainer.java
  :1136)
   at
  wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:811)
   at
  wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753)
   at wicket.Component.renderComponent
  (Component.java:1888)
   at
  wicket.markup.html.WebMarkupContainer.onRender(WebMarkupContainer.java:77)
   at
  wicket.markup.html.form.Form.onRender(Form.java:517)
   at wicket.Component.render(Component.java :1163)
   at
  wicket.markup.html.BodyOnLoadContainer.resolve(BodyOnLoadContainer.java:106)
   at
  wicket.MarkupContainer.renderNext(MarkupContainer.java:1159)
   at wicket.MarkupContainer.renderComponentTagBody
  (MarkupContainer.java:811)
   at
  wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:753)
   at
  wicket.Component.renderComponent(Component.java:1888)
   at wicket.markup.html.WebMarkupContainer.onRender
  (WebMarkupContainer.java:77)
   at wicket.Component.render(Component.java:1163)
   at wicket.MarkupContainer.autoAdd(MarkupContainer.java:170)
   at
  wicket.markup.html.BodyOnLoadResolver.resolve(BodyOnLoadResolver.java
  :60)
   at
  wicket.MarkupContainer.renderNext(MarkupContainer.java:1146)
   at
  wicket.MarkupContainer.renderAll(MarkupContainer.java:779)
   at wicket.Page.onRender(Page.java:788)
   at wicket.Component.render (Component.java:1163)
   at wicket.Page.doRender(Page.java:251)
   at
  wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:276)
   at wicket.RequestCycle.respond(RequestCycle.java:934)
   at wicket.RequestCycle.request(RequestCycle.java:411)
   at
  wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:208)
   at
  wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:234)
   ..
  
   It's definitely the dropdown that is the culprit...when I remove it
   from the page the
   page renders

Re: [Wicket-user] Wicket 1.2-rc1 available for download

2006-04-17 Thread Vincent Jenks
I just dropped wicket 1.2RC1 into my 1.1.1-based shopping cart and
only had to change two lines to get it working!  Whoo hooo!

I'm going to run some benchmarks against it this weekend to see the
improvements.

On 4/17/06, Gustavo Hexsel [EMAIL PROTECTED] wrote:
   Also, a suggestion: the licenses for ognl and echo2 are still being 
 shipped, although the jars were already removed.

   []s Gus



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Martijn Dashorst
 Sent: April 17, 2006 2:41 PM
 To: Wicket User
 Subject: [Wicket-user] Wicket 1.2-rc1 available for download


 The first release candidate of the 1.2 version of Wicket and its subprojects 
 is available for download.

 You can download the release here:


 http://sourceforge.net/project/showfiles.php?group_id=119783


 Available in this release are:
  o wicket
  o wicket-extensions
  o wicket-examples
  o wicket-auth-roles
  o wicket-auth-roles-examples
  o wicket-spring
  o wicket-spring-examples
  o wicket-spring-annot
  o wicket-spring-annot-examples
  o wicket-quickstart

 This release has several fixes on the beta3 release, so it is highly 
 recommended to update your current development to rc1.

 With this release we are finally in the end game for 1.2. We hope to move 
 quickly with these releases, so please consider upgrading and help test the 
 final stages. We don't expect major and minor changes in the API's, as such 
 subsequent releases should be a drop in replacement (we do keep the 
 possibility open that a bug might require us to break this promise).

 Martijn

 --
 Wicket 1.2 is coming! Write Ajax applications without touching JavaScript!
 -- http://wicketframework.org


 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Wicket 1.2-rc1 available for download

2006-04-17 Thread Vincent Jenks
I'm getting an Object expected javascript error on every page...did
I forget a jar or something?  These pages don't have any of my own
javascript so I'm assuming it has something to do w/ the wicket cookie
scripts I'm seeing while viewing the generated source in the browser.

Those scripts don't exist on the path that's being generated.

On 4/17/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Hi Gustavo,

 Sorry for the inconvenience. What kind of test cases are failing? If
 you use jWebUnit tests, you probably should set

 HttpUnitOptions.setExceptionsThrownOnScriptError(false);

 as jWebUnit does not seem not recognize history as a valid javascript 
 property.

 Could you give more specifics please?

 Eelco


 On 4/17/06, Gustavo Hexsel [EMAIL PROTECTED] wrote:
Argh, my tests don't run anymore.  Is there a place where I can find the 
  detailed changelog between 1.2b3 to 1.2rc1?
 
[]s Gus


 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] RC2 - still have javascript errors

2006-04-20 Thread Vincent Jenks
Using Wicket 1.2RC2, I still get these javascript errors in both
Firefox 1.5.0.2 and IE 6.0:

deleteWicketCookie is not defined
getWicketCookie is not defined


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RC2 - still have javascript errors

2006-04-20 Thread Vincent Jenks
Yep, here's all the js stuff I see in the head:

script type=text/javascript
src=/MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF/script
script type=text/javascriptvar pagemapcookie =
getWicketCookie('pm-null/MyAppProductCatalogApp');
if(!pagemapcookie  pagemapcookie !=
'1'){setWicketCookie('pm-null/MyAppProductCatalogApp',1);}
else {document.location.href =
'/MyApp/products;jsessionid=8D5250BD41A597EBD63C695113E757DF?wicket:bookmarkablePage=wicket-0:com.myapp.ui.ProductCatalog';}
/script

...and in the body tag:

body onUnLoad=deleteWicketCookie('pm-null/MyAppProductCatalogApp');

On 4/20/06, Johan Compagner [EMAIL PROTECTED] wrote:
 how is that possible?
 don't you have a script like:
 script type=text/javascript
 src=/wicket/forminput/resources/wicket.markup.html.WebPage/cookies.js/script

 included in youre page?


 johan


 On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  Using Wicket 1.2RC2, I still get these javascript errors in both
 Firefox 1.5.0.2 and IE 6.0:

 deleteWicketCookie is not defined
 getWicketCookie is not defined


 ---
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RC2 - still have javascript errors

2006-04-20 Thread Vincent Jenks
404 not found

On 4/20/06, Johan Compagner [EMAIL PROTECTED] wrote:
 and what does this link return?


 /MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF

 johan



 On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  Yep, here's all the js stuff I see in the head:

 script type=text/javascript
 src=/MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF/script
 script type=text/javascriptvar pagemapcookie =
 getWicketCookie('pm-null/MyAppProductCatalogApp');
 if(!pagemapcookie  pagemapcookie !=
 '1'){setWicketCookie('pm-null/MyAppProductCatalogApp',1);}
 else {document.location.href =
 '/MyApp/products;jsessionid=8D5250BD41A597EBD63C695113E757DF?wicket:bookmarkablePage=wicket-0:com.myapp.ui.ProductCatalog';}
 /script

 ...and in the body tag:

 body
 onUnLoad=deleteWicketCookie('pm-null/MyAppProductCatalogApp');

 On 4/20/06, Johan Compagner [EMAIL PROTECTED] wrote:
  how is that possible?
  don't you have a script like:
  script type=text/javascript
 
 src=/wicket/forminput/resources/wicket.markup.html.WebPage/cookies.js/script
 
  included in youre page?
 
 
  johan
 
 
  On 4/20/06, Vincent Jenks  [EMAIL PROTECTED] wrote:
  
   Using Wicket 1.2RC2, I still get these javascript errors in both
  Firefox 1.5.0.2 and IE 6.0:
 
  deleteWicketCookie is not defined
  getWicketCookie is not defined
 
 
  ---
  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job
  easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 


 ---

 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RC2 - still have javascript errors

2006-04-20 Thread Vincent Jenks
servlet-classwicket.protocol.http.WicketServlet/servlet-class

On 4/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 what is the servlet mapping you use for the wicket servlet?

 -Igor



 On 4/20/06, Vincent Jenks [EMAIL PROTECTED]  wrote:
  404 not found
 
  On 4/20/06, Johan Compagner  [EMAIL PROTECTED] wrote:
   and what does this link return?
  
  
  
 /MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF
  
   johan
  
  
  
   On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
   
Yep, here's all the js stuff I see in the head:
  
   script type=text/javascript
  
 src=/MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF/script
   script type=text/javascriptvar pagemapcookie =
   getWicketCookie('pm-null/MyAppProductCatalogApp');
   if(!pagemapcookie  pagemapcookie !=
  
 '1'){setWicketCookie('pm-null/MyAppProductCatalogApp',1);}
   else {document.location.href =
  
 '/MyApp/products;jsessionid=8D5250BD41A597EBD63C695113E757DF?wicket:bookmarkablePage=wicket-0:com.myapp.ui.ProductCatalog';}
   /script
  
   ...and in the body tag:
  
   body
  
 onUnLoad=deleteWicketCookie('pm-null/MyAppProductCatalogApp');
  
   On 4/20/06, Johan Compagner [EMAIL PROTECTED] wrote:
how is that possible?
don't you have a script like:
script type=text/javascript
   
  
 src=/wicket/forminput/resources/wicket.markup.html.WebPage/cookies.js/script
   
included in youre page?
   
   
johan
   
   
On 4/20/06, Vincent Jenks  [EMAIL PROTECTED]  wrote:

 Using Wicket 1.2RC2, I still get these javascript errors in both
Firefox 1.5.0.2 and IE 6.0:
   
deleteWicketCookie is not defined
getWicketCookie is not defined
   
   
   
 ---
Using Tomcat but need to do more? Need to support web services,
 security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
   
  
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
   
 https://lists.sourceforge.net/lists/listinfo/wicket-user
   
   
  
  
   ---
  
   Using Tomcat but need to do more? Need to support web services,
 security?
   Get stuff done quickly with pre-integrated technology to make your job
   easier
   Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
  
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
  
 https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
 
  ---
  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job
 easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RC2 - still have javascript errors

2006-04-21 Thread Vincent Jenks
Oh, sorry, here's the whole thing.

  servlet
servlet-nameProductCatalogApp/servlet-name
servlet-classwicket.protocol.http.WicketServlet/servlet-class
init-param
  param-nameapplicationClassName/param-name
  param-valuecom.myapp.ProductCatalogApp/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
servlet-nameProductCatalogApp/servlet-name
url-pattern/products/url-pattern
  /servlet-mapping

...obviously I need to change it to /products/* ??  I guess I must
have missed that in the transition doc, sorry!

On 4/20/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 I think Igor meant what the servlet-mapping element looks like. E.g.
 phonebook has:

 servlet-mapping
 servlet-namephonebook/servlet-name
 url-pattern/app/*/url-pattern
 /servlet-mapping

 if that would be

 servlet-mapping
 servlet-namephonebook/servlet-name
 url-pattern/app//url-pattern
 /servlet-mapping

 (without the *), package resources won't work.

 Eelco


 On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
  servlet-classwicket.protocol.http.WicketServlet/servlet-class
 
  On 4/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
   what is the servlet mapping you use for the wicket servlet?
  
   -Igor
  
  
  
   On 4/20/06, Vincent Jenks [EMAIL PROTECTED]  wrote:
404 not found
   
On 4/20/06, Johan Compagner  [EMAIL PROTECTED] wrote:
 and what does this link return?



   /MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF

 johan



 On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 
  Yep, here's all the js stuff I see in the head:

 script type=text/javascript

   src=/MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF/script
 script type=text/javascriptvar pagemapcookie =
 getWicketCookie('pm-null/MyAppProductCatalogApp');
 if(!pagemapcookie  pagemapcookie !=

   '1'){setWicketCookie('pm-null/MyAppProductCatalogApp',1);}
 else {document.location.href =

   '/MyApp/products;jsessionid=8D5250BD41A597EBD63C695113E757DF?wicket:bookmarkablePage=wicket-0:com.myapp.ui.ProductCatalog';}
 /script

 ...and in the body tag:

 body

   onUnLoad=deleteWicketCookie('pm-null/MyAppProductCatalogApp');

 On 4/20/06, Johan Compagner [EMAIL PROTECTED] wrote:
  how is that possible?
  don't you have a script like:
  script type=text/javascript
 

   src=/wicket/forminput/resources/wicket.markup.html.WebPage/cookies.js/script
 
  included in youre page?
 
 
  johan
 
 
  On 4/20/06, Vincent Jenks  [EMAIL PROTECTED]  wrote:
  
   Using Wicket 1.2RC2, I still get these javascript errors in both
  Firefox 1.5.0.2 and IE 6.0:
 
  deleteWicketCookie is not defined
  getWicketCookie is not defined
 
 
 
   ---
  Using Tomcat but need to do more? Need to support web services,
   security?
  Get stuff done quickly with pre-integrated technology to make your 
  job
  easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache
   Geronimo
 

   http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
 
   https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 


 ---

 Using Tomcat but need to do more? Need to support web services,
   security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache
   Geronimo

   http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net

   https://lists.sourceforge.net/lists/listinfo/wicket-user


   
   
---
Using Tomcat but need to do more? Need to support web services, 
security?
Get stuff done quickly with pre-integrated technology to make your job
   easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache 
Geronimo
   
   http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
  
  
 
 
  ---
  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated

Re: [Wicket-user] RC2 - still have javascript errors

2006-04-21 Thread Vincent Jenks
Finally got around to putting the /* in the mapping and t's all good
now, thanks!

On 4/21/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 Oh, sorry, here's the whole thing.

   servlet
 servlet-nameProductCatalogApp/servlet-name
 servlet-classwicket.protocol.http.WicketServlet/servlet-class
 init-param
   param-nameapplicationClassName/param-name
   param-valuecom.myapp.ProductCatalogApp/param-value
 /init-param
 load-on-startup1/load-on-startup
   /servlet
   servlet-mapping
 servlet-nameProductCatalogApp/servlet-name
 url-pattern/products/url-pattern
   /servlet-mapping

 ...obviously I need to change it to /products/* ??  I guess I must
 have missed that in the transition doc, sorry!

 On 4/20/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
  I think Igor meant what the servlet-mapping element looks like. E.g.
  phonebook has:
 
  servlet-mapping
  servlet-namephonebook/servlet-name
  url-pattern/app/*/url-pattern
  /servlet-mapping
 
  if that would be
 
  servlet-mapping
  servlet-namephonebook/servlet-name
  url-pattern/app//url-pattern
  /servlet-mapping
 
  (without the *), package resources won't work.
 
  Eelco
 
 
  On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
   servlet-classwicket.protocol.http.WicketServlet/servlet-class
  
   On 4/20/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
what is the servlet mapping you use for the wicket servlet?
   
-Igor
   
   
   
On 4/20/06, Vincent Jenks [EMAIL PROTECTED]  wrote:
 404 not found

 On 4/20/06, Johan Compagner  [EMAIL PROTECTED] wrote:
  and what does this link return?
 
 
 
/MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF
 
  johan
 
 
 
  On 4/20/06, Vincent Jenks [EMAIL PROTECTED] wrote:
  
   Yep, here's all the js stuff I see in the head:
 
  script type=text/javascript
 
src=/MyApp/products/resources/wicket.markup.html.WebPage/cookies.js;jsessionid=8D5250BD41A597EBD63C695113E757DF/script
  script type=text/javascriptvar pagemapcookie =
  getWicketCookie('pm-null/MyAppProductCatalogApp');
  if(!pagemapcookie  pagemapcookie !=
 
'1'){setWicketCookie('pm-null/MyAppProductCatalogApp',1);}
  else {document.location.href =
 
'/MyApp/products;jsessionid=8D5250BD41A597EBD63C695113E757DF?wicket:bookmarkablePage=wicket-0:com.myapp.ui.ProductCatalog';}
  /script
 
  ...and in the body tag:
 
  body
 
onUnLoad=deleteWicketCookie('pm-null/MyAppProductCatalogApp');
 
  On 4/20/06, Johan Compagner [EMAIL PROTECTED] wrote:
   how is that possible?
   don't you have a script like:
   script type=text/javascript
  
 
src=/wicket/forminput/resources/wicket.markup.html.WebPage/cookies.js/script
  
   included in youre page?
  
  
   johan
  
  
   On 4/20/06, Vincent Jenks  [EMAIL PROTECTED]  wrote:
   
Using Wicket 1.2RC2, I still get these javascript errors in both
   Firefox 1.5.0.2 and IE 6.0:
  
   deleteWicketCookie is not defined
   getWicketCookie is not defined
  
  
  
---
   Using Tomcat but need to do more? Need to support web services,
security?
   Get stuff done quickly with pre-integrated technology to make 
   your job
   easier
   Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
  
 
http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
  
https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
 
  ---
 
  Using Tomcat but need to do more? Need to support web services,
security?
  Get stuff done quickly with pre-integrated technology to make your 
  job
  easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
 
http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
 
https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 


 ---
 Using Tomcat but need to do more? Need to support web services, 
 security?
 Get stuff done quickly with pre-integrated technology to make your job
easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache 
 Geronimo

http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___
 Wicket-user mailing list

Re: [Wicket-user] migrating to 1.1

2006-04-21 Thread Vincent Jenks
I'd almost say that you might want to consider just using 1.2 since it
is now in RC mode and will be production-grade soon?  Correct me if
I'm wrong, but 1.1.1 will be obsolete soon.

I'm using 1.2RC2 on a project that will go into productin in less than
a month and so far I'm very happy w/ it.  I just upgraded from 1.1.1
and so far, it's solid.

On 4/21/06, Geertjan Wielenga [EMAIL PROTECTED] wrote:

  Yes, I had 1.0.3 samples and now, for the NetBeans support, I'd like to use
 the latest stable major version, which is 1.1. So I don't know what the
 difference was exactly, but I got the 1.1 samples and everything seems to be
 ok now.

  Gj


  Johan Compagner wrote:

 migrating to 1.1? from where 1.0?
  For every release we have a 1-1 relation shipt with our examples or
 extentions (and most wicket-stuff things also)

  johan



 On 4/21/06, Geertjan Wielenga [EMAIL PROTECTED] wrote:
 
 
  I migrated to Wicket 1.1 and found a problem with this method in Guest
  Book (the arrow point to the problematic line):
 
 
  public CommentForm(final String id) {
  // Construct form with no validation listener
  --   super(id, new CompoundPropertyModel(new Comment()),
  null);
 
  // Add text entry widget
  add(new TextArea(text));
  }
 
 
  Does 1.1 come with updated samples? Or can I change the above somehow?
 
  Gj
 
 
  ---
  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job
 easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Index page not loading

2006-04-21 Thread Vincent Jenks
Post your code and the lines from web.xml where you've configured the
Wicket servlet.

On 4/21/06, Rui Pacheco [EMAIL PROTECTED] wrote:
 Hi all

 I am currently writing a HelloWorld application using 1.2RC2.

 My problem is when I deploy the application I see the class that extends
 WebApplication being instantiated by Tomcat (I have a system.err.println
 there) but I can't make my index page appear. Internet Explorer keeps on
 spinning eternally and I see no activity on Tomcat's logs.

 Can anyone help me diagnose whats happening? I am using the latest edition
 of Tomcat and Java 5 as of this writing.

 --
 Cumprimentos,
 Rui Pacheco


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] migrating to 1.1

2006-04-21 Thread Vincent Jenks
And, if I'm not mistaken, the book will be based on 1.2, correct?

On 4/21/06, Martijn Dashorst [EMAIL PROTECTED] wrote:
 we are going to release 1.2 pretty soon, I suppose somewhere in the next two
 weeks, preferrable before 1st of may.

  Wicket 1.2 has many improvements over 1.1 and will be our major release. I
 don't know how long a release cycle for the netbeans module will be, but you
 might want to wait for the 1.2 final release.

  Martijn


 On 4/21/06, Geertjan Wielenga [EMAIL PROTECTED] wrote:
 
 
  Yes, I had 1.0.3 samples and now, for the NetBeans support, I'd like to
 use the latest stable major version, which is 1.1. So I don't know what the
 difference was exactly, but I got the 1.1 samples and everything seems to be
 ok now.
 
  Gj
 
 
 
  Johan Compagner wrote:
 
  migrating to 1.1? from where 1.0?
  For every release we have a 1-1 relation shipt with our examples or
 extentions (and most wicket-stuff things also)
 
  johan
 
 
 
  On 4/21/06, Geertjan Wielenga [EMAIL PROTECTED] wrote:
  
  
   I migrated to Wicket 1.1 and found a problem with this method in Guest
   Book (the arrow point to the problematic line):
  
  
   public CommentForm(final String id) {
   // Construct form with no validation listener
   --   super(id, new CompoundPropertyModel(new Comment()),
   null);
  
   // Add text entry widget
   add(new TextArea(text));
   }
  
  
   Does 1.1 come with updated samples? Or can I change the above somehow?
  
   Gj
 
 
 
 
  ---
  Using Tomcat but need to do more? Need to support web services, security?
  Get stuff done quickly with pre-integrated technology to make your job
 easier
  Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 



 --
 Wicket 1.2 is coming! Write Ajax applications without touching JavaScript!
 -- http://wicketframework.org


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RC2 - still have javascript errors

2006-04-21 Thread Vincent Jenks
Interesting, I had never noticed it before and didn't get the error
while using 1.1.1.  I've only been using wicket for about 1.5 mo. so
I'm still a greenhorn.

On 4/21/06, Gwyn Evans [EMAIL PROTECTED] wrote:
 Just as an aside, to the best of my knowledge, this isn't something
 that's new/changed in 1.2, hence nothing in any transition notes -
 this is been there right from the start, but maybe it's more apparent
 now there tends to be more to Wicket than the basic servlet, if you
 see what I mean.

 /Gwyn

 On 21/04/06, Vincent Jenks [EMAIL PROTECTED] wrote:
  Finally got around to putting the /* in the mapping and t's all good
  now, thanks!
 
  On 4/21/06, Vincent Jenks [EMAIL PROTECTED] wrote:
   Oh, sorry, here's the whole thing.
  
 servlet
   servlet-nameProductCatalogApp/servlet-name
   servlet-classwicket.protocol.http.WicketServlet/servlet-class
   init-param
 param-nameapplicationClassName/param-name
 param-valuecom.myapp.ProductCatalogApp/param-value
   /init-param
   load-on-startup1/load-on-startup
 /servlet
 servlet-mapping
   servlet-nameProductCatalogApp/servlet-name
   url-pattern/products/url-pattern
 /servlet-mapping
  
   ...obviously I need to change it to /products/* ??  I guess I must
   have missed that in the transition doc, sorry!


 ---
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] wicket download links broken

2006-04-22 Thread Vincent Jenks
These give a 500 error:

http://wicket.sourceforge.net/Download.html

...but I can get to these through SF:

http://sourceforge.net/project/showfiles.php?group_id=119783


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] HelloWorldApplication won't show index page

2006-04-22 Thread Vincent Jenks
Webtools is great (considering the price ;)) if you don't want to
purchase MyEclipse.  That'll give you web-based projects that Eclipse
currently does not have out-of-the-box.

On 4/22/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 install maven 2 and inside quickstart folder type

 mvn package

 that will build a deployable war inside the target subfolder. you can see
 that for an example of a war.

 -Igor



  On 4/22/06, Rui Pacheco [EMAIL PROTECTED] wrote:
 
  I can get the QuickStart application to run, but thats it. When I move the
 classes to my application they just stop working.
  One thing: I am deploying the application as a standard web app. I am
 putting my classes and HTML files inside packages and placing the compiled
 classes inside WEB-INF/classes and the wicket .jar inside WEB-INF/lib. I am
 supposed to do this, right?
  The QuickStart example has an empty directory, except for a web.xml file.
 
 
 
 
  On 4/23/06, Rui Pacheco [EMAIL PROTECTED]  wrote:
  
   I have already removed it, as Gwyn sugested. And still just the 404.
  
  
  
   On 4/22/06, Lasse Koskela  [EMAIL PROTECTED]  wrote:
   
  
   On 4/23/06, Rui Pacheco  [EMAIL PROTECTED]  wrote:
Yesterday I sent a message asking wondering why my helloworld
 application
didn't go beyond loading the main class by Tomcat. Someone asked for
 my
source code, I'm sending it in attachment.
  
  
   Why are you overriding newSession() in your Application class? Maybe
   that's the culprit?
  
   -Lasse-
  
  
  
   ---
   Using Tomcat but need to do more? Need to support web services,
 security?
   Get stuff done quickly with pre-integrated technology to make your job
 easier
   Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
  
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
  
 https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
 
 
 
  --
  Cumprimentos,
 
  Rui Pacheco



 --
 Cumprimentos,
 Rui Pacheco


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] image upload

2006-04-26 Thread Vincent Jenks
I'm sure this has been asked before but I couldn't find an example.

I'm using JBoss 4 and Wicket 1.2RC2...and I'm trying to upload images
into a specific folder inside of a deployed .ear project.  The folder
in the web app would be /ear-name/assets/images

However, that folder doesn't exist after I deploy the EAR file, there
technically is no folder to upload *to* - unless you count the stuff
that's created in /tmp and /workand that's not something that can
be hard-coded.

How can I get around this?

Thanks!


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] RE: Resetting a Form

2006-04-26 Thread Vincent Jenks
You could redirect back to the current page.

On 4/26/06, Andrew Strickland [EMAIL PROTECTED] wrote:


 How would I go about resetting a form to a blank state after it validates
 it's data and stores it to a database?  Subsequent visits to the Page the
 form is on still contains the data from the last submission.

 I tried re-initializing the object that backs the BoundCompoundPropertyModel
 but that didn't seem to work.


 The FormComponent(s) inherit their model from the BoundCompoundPropertyModel
 of the Panel they are on, which in turn gets the model object from the Page.

 Andy
 ---
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___ Wicket-user
 mailing list Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Image upload

2006-04-27 Thread Vincent Jenks
I definitely don't want to use blobs

Where can I find an example of doing what I need using
WebDynamicResource?  I don't even see this class listed in the 1.2
Javadoc...

Where do I start?

Thanks!

On 4/21/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 wicket-contrib-examples of wicket-stuff has the cdapp example that
 does this. It uses hibernate and stores uploaded images in the
 database as a blob.

 Eelco


 On 4/21/06, Steve Knight [EMAIL PROTECTED] wrote:
  I am creating a form that will allow users to upload image files that will
  be displayed on other pages.  How should I go about uploading the images so
  that they can be used in Wicket Image components on the other pages?  The
  upload part is not problem, I just don't know where I should put them.
 
  On my view pages, I am using ThumbnailImageResource which takes a
  WebResource in it's contructor to find the image.  Where should I save the
  images to make this work?
 
  Thanks.
 
  Steve
 
 
 


 ---
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


  1   2   3   >