[Wicket-user] setResponsePage() to a mounted link

2006-03-15 Thread David Leangen

I have links that allow to change the locale, like so:

add(new Link(toEnglishLink)
{
public void onClick()
{
getSession().setLocale( Locale.ENGLISH );
}
});


In principle, this works fine. The only problem is that it messes up my
bookmarkable links (mounted). For instance, instead of pointing to

  /some/mounted/path

as intended, it ends up pointing to:

   /app?someParameterStuff


What is the best way to provide functionality to a link component
without messing up mounted links? Would I absolutely be required all the
time to pass in the locale as a paramter?





---
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


Re: [Wicket-user] IAuthorizationStrategy and TabbedPanel

2006-03-15 Thread R.A

Hi Maurice,

Okey, I successed authentication by using Component#getPath Action#getName
in isActionAuthorized method.
Thanks a lot!!
--
View this message in context: 
http://www.nabble.com/IAuthorizationStrategy-and-TabbedPanel-t1277505.html#a3411746
Sent from the Wicket - User forum at Nabble.com.



---
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


Re: [Wicket-user] validating input

2006-03-15 Thread Andre Matheus
Why can't wicket discover the type using reflection?___Andre MatheusOn 3/14/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:also look at FormComponent.setType(Class). wicket can perform type conversion from the request parameter string to the type of your model object. if the conversion fails it generates a validation error.
so TextField tf=new TextField(id, model);
tf.setType(Integer.class)will only accept values that can be converted to integersfor explanation on how errors are constructed try searching the wiki for validation messages
-Igor
On 3/14/06, Jonathan Cone 
[EMAIL PROTECTED] wrote:








Hey Vincent,

In wicket, validators can be add()ed to components 
like anything else. For example,one way to make a textfield required 
without using the helper class would be to do something like:
TextField tf = new 
TextField(id,...);
tf.add(RequiredValidator.getInstance());

Check out the javadoc for the 
wicket.markup.html.form.validation package,there are some common 
validators in there and its real easy to write a custom one yourself. I 
think you'll find that validation in wicket is as easy as you were 
hoping.

  - Original Message - 
  

From: 
  Vincent Jenks 
  To: 

wicket-user@lists.sourceforge.net 
  
  Sent: Tuesday, March 14, 2006 3:52 
  PM
  Subject: [Wicket-user] validating 
  input
  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? 
  
  

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



-- __André Matheus


Re: [Wicket-user] validating input

2006-03-15 Thread Johan Compagner
I guess we could do that somehow. But then we need to specify that somehow in youre IModel interface.so instead of getObject(Component) we also should have getType(Component)That will effect a lot of things.
johanOn 3/15/06, Andre Matheus [EMAIL PROTECTED] wrote:
Why can't wicket discover the type using reflection?___Andre MatheusOn 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED]
 wrote:also look at FormComponent.setType(Class). wicket can perform type conversion from the request parameter string to the type of your model object. if the conversion fails it generates a validation error.
so TextField tf=new TextField(id, model);
tf.setType(Integer.class)will only accept values that can be converted to integersfor explanation on how errors are constructed try searching the wiki for validation messages
-Igor
On 3/14/06, Jonathan Cone 

[EMAIL PROTECTED] wrote:








Hey Vincent,

In wicket, validators can be add()ed to components 
like anything else. For example,one way to make a textfield required 
without using the helper class would be to do something like:
TextField tf = new 
TextField(id,...);
tf.add(RequiredValidator.getInstance());

Check out the javadoc for the 
wicket.markup.html.form.validation package,there are some common 
validators in there and its real easy to write a custom one yourself. I 
think you'll find that validation in wicket is as easy as you were 
hoping.

  - Original Message - 
  


From: 
  Vincent Jenks 
  To: 


wicket-user@lists.sourceforge.net 
  
  Sent: Tuesday, March 14, 2006 3:52 
  PM
  Subject: [Wicket-user] validating 
  input
  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? 
  
  

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



-- __André Matheus




Re: [Wicket-user] validating input

2006-03-15 Thread Andre Matheus
I agree it will effect lots of things, but in the other side every component would have its value automatically validated to the datatype... it would be nice... :-)___Andre Matheus
On 3/15/06, Johan Compagner [EMAIL PROTECTED] wrote:
I guess we could do that somehow. But then we need to specify that somehow in youre IModel interface.so instead of getObject(Component) we also should have getType(Component)That will effect a lot of things.
johanOn 3/15/06, Andre Matheus 
[EMAIL PROTECTED] wrote:
Why can't wicket discover the type using reflection?___Andre MatheusOn 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED]
 wrote:also look at FormComponent.setType(Class). wicket can perform type conversion from the request parameter string to the type of your model object. if the conversion fails it generates a validation error.
so TextField tf=new TextField(id, model);
tf.setType(Integer.class)will only accept values that can be converted to integersfor explanation on how errors are constructed try searching the wiki for validation messages
-Igor
On 3/14/06, Jonathan Cone 


[EMAIL PROTECTED] wrote:








Hey Vincent,

In wicket, validators can be add()ed to components 
like anything else. For example,one way to make a textfield required 
without using the helper class would be to do something like:
TextField tf = new 
TextField(id,...);
tf.add(RequiredValidator.getInstance());

Check out the javadoc for the 
wicket.markup.html.form.validation package,there are some common 
validators in there and its real easy to write a custom one yourself. I 
think you'll find that validation in wicket is as easy as you were 
hoping.

  - Original Message - 
  



From: 
  Vincent Jenks 
  To: 



wicket-user@lists.sourceforge.net 
  
  Sent: Tuesday, March 14, 2006 3:52 
  PM
  Subject: [Wicket-user] validating 
  input
  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? 
  
  

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



-- __André Matheus



-- __André Matheus


Re: [Wicket-user] setResponsePage() to a mounted link

2006-03-15 Thread David Leangen

On Wed, 2006-03-15 at 10:34 +0100, Johan Compagner wrote:
 redirect again to a bookmarkable/mounted page:
 
 add(new Link(toEnglishLink)
{
public void onClick()
{
getSession().setLocale( Locale.ENGLISH );
 setResponsePage(MyPage.class)
}
});

Yeah, I did:

  setResponsePage( getPage() )

but it had the same effect. It took me to the link /app?
lotsOfFunkyParameterStuff, rather than /my/mounted/path.

Is there a difference between using getPage() and MyPage.class? I
wouldn't think so...

In any case, the above is available to all my pages in a superclass. It
would be a bit cumbersome to have to use the static class parameter in
each page...


Is there a nicer way, perhaps?


Thanks!




---
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


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

2006-03-15 Thread Michael K
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 
		Yahoo! Travel 
Find  
great deals to the top 10 hottest destinations!

Re: [Wicket-user] setResponsePage() to a mounted link

2006-03-15 Thread Johan Compagner
I did say this for a reason:setResponsePage(MyPage.class)so don't dosetResponsePage(new MyPage())because if you make an instance we have to really redirect to that instances.And als we can do a bookmarkable redirect.
So yes there is a difference.johanOn 3/15/06, David Leangen [EMAIL PROTECTED] wrote:
On Wed, 2006-03-15 at 10:34 +0100, Johan Compagner wrote: redirect again to a bookmarkable/mounted page:
 add(new Link(toEnglishLink){public void onClick(){getSession().setLocale( Locale.ENGLISH
 ); setResponsePage(MyPage.class)}});Yeah, I did:setResponsePage( getPage() )but it had the same effect. It took me to the link /app?
lotsOfFunkyParameterStuff, rather than /my/mounted/path.Is there a difference between using getPage() and MyPage.class? Iwouldn't think so...In any case, the above is available to all my pages in a superclass. It
would be a bit cumbersome to have to use the static class parameter ineach page...Is there a nicer way, perhaps?Thanks!---
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?cmd=lnkkid=110944bid=241720dat=121642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



RE: [Wicket-user] setResponsePage() to a mounted link

2006-03-15 Thread David Leangen

Sorry... Below I didn't say new MyPage(), I said getPage().

It didn't work with getPage(), which in theory should return the same glass.
Does this still make any difference?


Thanks for your patience,
Dave





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Johan Compagner
Sent: 15 March 2006 19:25
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] setResponsePage() to a mounted link


I did say this for a reason:
setResponsePage(MyPage.class)
so don't do
setResponsePage(new MyPage())

because if you make an instance we have to really redirect to that
instances.
And als we can do a bookmarkable redirect.
So yes there is a difference.


johan



On 3/15/06, David Leangen [EMAIL PROTECTED] wrote:

On Wed, 2006-03-15 at 10:34 +0100, Johan Compagner wrote:
 redirect again to a bookmarkable/mounted page:

 add(new Link(toEnglishLink)
{
public void onClick()
{
getSession().setLocale( Locale.ENGLISH );
 setResponsePage(MyPage.class)
}
});

Yeah, I did:

  setResponsePage( getPage() )

but it had the same effect. It took me to the link /app?
lotsOfFunkyParameterStuff, rather than /my/mounted/path.

Is there a difference between using getPage() and MyPage.class? I
wouldn't think so...

In any case, the above is available to all my pages in a superclass. It
would be a bit cumbersome to have to use the static class parameter in
each page...


Is there a nicer way, perhaps?


Thanks!




---
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=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] validating input

2006-03-15 Thread Martijn Dashorst
It also adds more magic to the wicket core. I'm not sure if I like more magic. I'm a developer, not a magician.I think the current way is good: specifying your type explicitly, also is a reminder that you need to add a validation message to the resource bundle.
MartijnOn 3/15/06, Andre Matheus [EMAIL PROTECTED] wrote:
I agree it will effect lots of things, but in the other side every component would have its value automatically validated to the datatype... it would be nice... :-)___Andre Matheus

On 3/15/06, Johan Compagner [EMAIL PROTECTED] wrote:

I guess we could do that somehow. But then we need to specify that somehow in youre IModel interface.so instead of getObject(Component) we also should have getType(Component)That will effect a lot of things.
johanOn 3/15/06, Andre Matheus 

[EMAIL PROTECTED] wrote:
Why can't wicket discover the type using reflection?___Andre MatheusOn 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED]
 wrote:also look at FormComponent.setType(Class). wicket can perform type conversion from the request parameter string to the type of your model object. if the conversion fails it generates a validation error.
so TextField tf=new TextField(id, model);
tf.setType(Integer.class)will only accept values that can be converted to integersfor explanation on how errors are constructed try searching the wiki for validation messages
-Igor
On 3/14/06, Jonathan Cone 



[EMAIL PROTECTED] wrote:








Hey Vincent,

In wicket, validators can be add()ed to components 
like anything else. For example,one way to make a textfield required 
without using the helper class would be to do something like:
TextField tf = new 
TextField(id,...);
tf.add(RequiredValidator.getInstance());

Check out the javadoc for the 
wicket.markup.html.form.validation package,there are some common 
validators in there and its real easy to write a custom one yourself. I 
think you'll find that validation in wicket is as easy as you were 
hoping.

  - Original Message - 
  




From: 
  Vincent Jenks 
  To: 




wicket-user@lists.sourceforge.net 
  
  Sent: Tuesday, March 14, 2006 3:52 
  PM
  Subject: [Wicket-user] validating 
  input
  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? 
  
  

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



-- __André Matheus



-- __André Matheus

-- Nominate Wicket for the SourceForge.net's Choice awards!http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php



Re: [Wicket-user] setResponsePage() to a mounted link

2006-03-15 Thread Johan Compagner
no again. then you set an instance. And getPage() is the same as doing nothing because that is thepage where we return to by default.So if you set the response page to a page instances we can't redirect to a mount because a mount is 
a bookmarkable pageWhen targeting a instance the url must be something like wicket:xxx:0johanOn 3/15/06, David Leangen 
[EMAIL PROTECTED] wrote:Sorry... Below I didn't say new MyPage(), I said getPage().
It didn't work with getPage(), which in theory should return the same glass.Does this still make any difference?Thanks for your patience,Dave-Original Message-
From: [EMAIL PROTECTED][mailto:[EMAIL PROTECTED]]On Behalf Of Johan Compagner
Sent: 15 March 2006 19:25To: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] setResponsePage() to a mounted linkI did say this for a reason:
setResponsePage(MyPage.class)so don't dosetResponsePage(new MyPage())because if you make an instance we have to really redirect to thatinstances.And als we can do a bookmarkable redirect.So yes there is a difference.
johanOn 3/15/06, David Leangen [EMAIL PROTECTED] wrote:On Wed, 2006-03-15 at 10:34 +0100, Johan Compagner wrote: redirect again to a bookmarkable/mounted page:
 add(new Link(toEnglishLink){public void onClick(){getSession().setLocale( Locale.ENGLISH
 ); setResponsePage(MyPage.class)}});Yeah, I did:setResponsePage( getPage() )but it had the same effect. It took me to the link /app?
lotsOfFunkyParameterStuff, rather than /my/mounted/path.Is there a difference between using getPage() and MyPage.class? Iwouldn't think so...In any case, the above is available to all my pages in a superclass. It
would be a bit cumbersome to have to use the static class parameter ineach page...Is there a nicer way, perhaps?Thanks!---
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?cmd=lnkkid=110944bid=241720dat=121642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://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 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] Authentication

2006-03-15 Thread Mats Norén
Thanks. We made a utility function in the our session. Works great.

On 3/14/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 There is no build in function for that. If you want to shorten that,
 just provide your own request cycle that passes this function through,
 or make it a utility function somewhere.

 Eelco

 On 3/14/06, Mats Norén [EMAIL PROTECTED] wrote:
  Mmm...ok, I'll rephrase. Is there a way within wicket to obtain the
  logged in user if the user is authenticated by the container with
  basic authentication and writing the user to a wicket session?
 
  Without having to do this:
 
  ((WebRequest)getRequest()).getHttpServletRequest().getUserPrincipal()
 
 
  ---
  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



---
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] wicket:1.1.1 error unknown interface IOnChangeListener?

2006-03-15 Thread Nino Wael
Hi I've

created a control which essentially is a radio button and a listbox, where each 
click on the radio button populates the listbox with values.

I've done or rarther are trying to do this by using the wicket radiochoice and 
a wicket ListMultipleChoice. And are overiding the onSelectionChanged and the 
wantOnSelectionChangedNotifications, so that onSelectionChanged does what I 
want and wantOnSelectionChangedNotifications returns true.

However now I get this error:

[PoolThread-9] ERROR wicket.RequestCycle - Unexpected runtime exception [page = 
null]

wicket.WicketRuntimeException: Attempt to access unknown interface 
IOnChangeListener

And I am a little confussed on why I am getting this error since the 
RadioChoice already implements the interface so it should be known? Only other 
option is that the error conseals another error which is caused by something 
else?

I have a similar control which has this functionality, instead of using a 
radiochoice onselectionchange it uses a button to make something similar. I'll 
be happy to send the code and log, or just give a more detailed explaination.

-regards Nino

 



[Wicket-user] What about Wicket Javascript and Browser errors?

2006-03-15 Thread Ayodeji Aladejebi

Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent
(b); }});
is there some configuration i am not putting in place?


Re: [Wicket-user] wicket:1.1.1 error unknown interface IOnChangeListener?

2006-03-15 Thread Johan Compagner
if you first touch a DropDownChoice class before you use a RadioChoiceis then everything fixed?in 1.2 this is completely fixed because we register all interfaces upfront instead of when we touch a component class.
johanOn 3/15/06, Nino Wael [EMAIL PROTECTED] wrote:
Hi I'vecreated a control which essentially is a radio button and a listbox, where each click on the radio button populates the listbox with values.I've done or rarther are trying to do this by using the wicket radiochoice and a wicket ListMultipleChoice. And are overiding the onSelectionChanged and the wantOnSelectionChangedNotifications, so that onSelectionChanged does what I want and wantOnSelectionChangedNotifications returns true.
However now I get this error:[PoolThread-9] ERROR wicket.RequestCycle - Unexpected runtime exception [page = null]wicket.WicketRuntimeException: Attempt to access unknown interface IOnChangeListener
And I am a little confussed on why I am getting this error since the RadioChoice already implements the interface so it should be known? Only other option is that the error conseals another error which is caused by something else?
I have a similar control which has this functionality, instead of using a radiochoice onselectionchange it uses a button to make something similar. I'll be happy to send the code and log, or just give a more detailed explaination.
-regards Nino


RE: [Wicket-user] DataView (extentions)

2006-03-15 Thread Frank Silbermann








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).



Its 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 Im
finished Ill 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! 








































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] Browser detector available?

2006-03-15 Thread Eelco Hillenius
Thanks a lot. I actually finally ditched Windows last week (in favor
of OSX). But I'll test it with IE when I have a change. Would you mind
reporting an issue in the SF tracker please?

Cheers,

Eelco


On 3/14/06, David Leangen [EMAIL PROTECTED] wrote:

 Just thought I'd mention that something about the check also seems to
 fail for IE.

 Paraphrase of error log:

 wicket.WicketRuntimeException: The component(s) below failed to render:
 xxx
 at wicket.Page.checkRendering(Page.java: 1066)

 This appears to only occur when using the toString() method, though. If
 I'm only trying to fetch the info, it works fine.


 I don't have much access to a Windows machine, so I can't really check
 it any further, but I thought I'd mention this anyway, just in case.

 If I am able to contribute to the mobile detection in a couple of
 months, I'll take more time to look at this if need be. Sorry that I
 can't help much until then.


 Cheers,
 Dave





 On Tue, 2006-03-14 at 20:14 -0800, Eelco Hillenius wrote:
  Darn, I'm dissapointed that the check fails! Yes please, if you have
  ideas on how to improve it, please share. Thanks,
 
  Eelco
 
 
  On 3/14/06, David Leangen [EMAIL PROTECTED] wrote:
 see the hello browser example.
  
  
  
   Nice trick! That's way cool! I think I'll use this a lot.
  
   I tried it with my mobile phone, but it causes a big mess. The phone
   uses i-mode (like most phones in Japan) but does not have javascript.
  
  
   I guess a quick check first to test the type of browser, and then if the
   browser can handle javascript, run the additional diagnostics.
  
  
   If you're interested, I'll let you know how I resolve this.
  
  
  
   Nice job!
  
  
  
   On Tue, 2006-03-14 at 08:22 -0800, Eelco Hillenius wrote:
Yep. I didn't make that trick in HelloBrowser the default as I don't
think everyone would be waiting for the extra overhead in the first
call. Furthermore, the basic information might be fine for a lot of
people. The extended version you can find in HelloBrowser does give
you a whole lot of useful information though, and you can also extend
it or use a similar trick to get more specific information you need.
The polling page has a lot of fallthroughs and even works when
javascript and/ or meta headers are turned off.
   
Eelco
   
   
On 3/14/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 there are two ways to get the info. one is like Dirk mentioned. this 
 will
 get you a lot of info, but if you want more see the hello browser 
 example.
 what it does is setup a redirect which executes a special page in the
 browser that gathers more information. like the screen size, whether 
 or not
 javascript is enabled, etc.

 -Igor



 On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  please see wicket-examples.
 
  Juergen
 
  On 3/14/06, David Leangen [EMAIL PROTECTED] wrote:
  
   Are there any browser detectors available in Wicket?
  
   IIRC, I remember one of the core devz mentioning this a while 
   back...
  
  
  
  
   ---
   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?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] validating input

2006-03-15 Thread Eelco Hillenius
We actually considered this last year, and decided against it. Besides
the argument that it is more expensive - which probably isn't as valid
today due to changes in how we handle those model updates - an
explicit type gives you more flexibility over which converter should
be used.

I'm wondering now whether we should support and/ and in a future
version of Wicket. Andre, if you  please add a feature request to our
SF tracker, we'll consider it for Wicket 1.3

Eelco


On 3/15/06, Andre Matheus [EMAIL PROTECTED] wrote:
 I agree it will effect lots of things, but in the other side every component
 would have its value automatically validated to the datatype... it would be
 nice... :-)

 ___
 Andre Matheus


  On 3/15/06, Johan Compagner [EMAIL PROTECTED] wrote:
  I guess we could do that somehow.
  But then we need to specify that somehow in youre IModel interface.
 
  so instead of getObject(Component) we also should have getType(Component)
  That will effect a lot of things.
 
  johan
 
 
 
 
  On 3/15/06, Andre Matheus  [EMAIL PROTECTED] wrote:
   Why can't wicket discover the type using reflection?
   ___
   Andre Matheus
  
  
  
   On 3/14/06, Igor Vaynberg  [EMAIL PROTECTED]  wrote:
also look at FormComponent.setType(Class). wicket can perform type
 conversion from the request parameter string to the type of your model
 object. if the conversion fails it generates a validation error.
   
so TextField tf=new TextField(id, model);
tf.setType(Integer.class)
   
will only accept values that can be converted to integers
   
for explanation on how errors are constructed try searching the wiki
 for validation messages
   
-Igor
   
   
   
On 3/14/06, Jonathan Cone  [EMAIL PROTECTED] wrote:
   

 Hey Vincent,

 In wicket, validators can be add()ed to components like anything
 else.  For example, one way to make a textfield required without using the
 helper class would be to do something like:
 TextField tf  = new TextField(id,...);
 tf.add(RequiredValidator.getInstance());

 Check out the javadoc for the
 wicket.markup.html.form.validation package, there are some
 common validators in there and its real easy to write a custom one yourself.
  I think you'll find that validation in wicket is as easy as you were
 hoping.


 - Original Message -
 From: Vincent Jenks
 To: wicket-user@lists.sourceforge.net
 Sent: Tuesday, March 14, 2006 3:52 PM
 Subject: [Wicket-user] validating input

 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?


 


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



   
   
  
  
  
   --
   __
   André Matheus
 
 



 --
 __
 André Matheus


---
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] What about Wicket Javascript and Browser errors?

2006-03-15 Thread Igor Vaynberg
you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this
final Label label;add(label=new Label(a, A));label.setOutputMarkupId
(true); === this is important if you want to rerender this component via ajax
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);
 label.getparent().replace(b); ajaxRequestTarget.addComponent
(label); }});-IgorOn 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:

Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent

(b); }});
is there some configuration i am not putting in place?




Re: [Wicket-user] DataView (extentions)

2006-03-15 Thread Igor Vaynberg
I cant speak for Frank's implementation, but when the IDataProvider is implemented correctly you only retrieve the window of data that will be rendered for this request and hold none of it in session. so the performance of the datatable component itself should be great.
-IgorOn 3/15/06, Mats Norén [EMAIL PROTECTED] wrote:
That would be great!btw, how is the performance with large resultsets?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 VaynbergSent: Tuesday, March 14, 2006 5:21 PM
To: wicket-user@lists.sourceforge.netSubject: 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.1Are 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 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 a
List directly?Or, have I done something wrong?Thanks!---
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 

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

2006-03-15 Thread Igor Vaynberg
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 Igor Vaynberg
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] 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] trying to understand concept...

2006-03-15 Thread Igor Vaynberg
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] validating input

2006-03-15 Thread Eelco Hillenius
Implementing the getObject method to return the proper type you mean?
Yeah, that wouldn't be the way to go. It would only be feasible  with
special models then, which would suck too. I guess I change my mind;
it's not worth the little extra convenience it might get you
sometimes.

Eelco

On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 yuck. i implement IModel quiet often and it would really suck to have to
 implement this method also eventhough it is only useful for form components.
 besides, what about models that can hold different types of objects? i think
 this is a really bad idea.

 -Igor



 On 3/15/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 
  We actually considered this last year, and decided against it. Besides
 the argument that it is more expensive - which probably isn't as valid
 today due to changes in how we handle those model updates - an
 explicit type gives you more flexibility over which converter should
 be used.

 I'm wondering now whether we should support and/ and in a future
 version of Wicket. Andre, if you  please add a feature request to our
 SF tracker, we'll consider it for Wicket 1.3

 Eelco


 On 3/15/06, Andre Matheus [EMAIL PROTECTED] wrote:
  I agree it will effect lots of things, but in the other side every
 component
  would have its value automatically validated to the datatype... it would
 be
  nice... :-)
 
  ___
  Andre Matheus
 
 
   On 3/15/06, Johan Compagner [EMAIL PROTECTED] wrote:
   I guess we could do that somehow.
   But then we need to specify that somehow in youre IModel interface.
  
   so instead of getObject(Component) we also should have
 getType(Component)
   That will effect a lot of things.
  
   johan
  
  
  
  
   On 3/15/06, Andre Matheus  [EMAIL PROTECTED] wrote:
Why can't wicket discover the type using reflection?
___
Andre Matheus
   
   
   
On 3/14/06, Igor Vaynberg  [EMAIL PROTECTED]  wrote:
 also look at FormComponent.setType(Class). wicket can perform type
  conversion from the request parameter string to the type of your model
  object. if the conversion fails it generates a validation error.

 so TextField tf=new TextField(id, model);
 tf.setType(Integer.class)

 will only accept values that can be converted to integers

 for explanation on how errors are constructed try searching the wiki
  for validation messages

 -Igor



 On 3/14/06, Jonathan Cone  [EMAIL PROTECTED] wrote:

 
  Hey Vincent,
 
  In wicket, validators can be add()ed to components like anything
  else.  For example, one way to make a textfield required without using the
  helper class would be to do something like:
  TextField tf  = new TextField(id,...);
  tf.add(RequiredValidator.getInstance());
 
  Check out the javadoc for the
  wicket.markup.html.form.validation package, there are
 some
  common validators in there and its real easy to write a custom one
 yourself.
   I think you'll find that validation in wicket is as easy as you were
  hoping.
 
 
  - Original Message -
  From: Vincent Jenks
  To: wicket-user@lists.sourceforge.net
  Sent: Tuesday, March 14, 2006 3:52 PM
  Subject: [Wicket-user] validating input
 
  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?
 
 
  
 
 
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.1.385 / Virus Database: 268.2.2/280 - Release Date:
  3/13/2006
 
 
 


   
   
   
--
__
André Matheus
  
  
 
 
 
  --
  __
  André Matheus


 ---
 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
___

Re: [Wicket-user] validating input

2006-03-15 Thread Igor Vaynberg
yeah, implementing the Class getObjectType(). it is nasty if the model can hold different types, and it is only useful for a small subset of models.if you really really really want the automatic typing why not do getModelObject().getClass() - prob wont work very well if you return a null, but you cant have everything :)
-IgorOn 3/15/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
Implementing the getObject method to return the proper type you mean?Yeah, that wouldn't be the way to go. It would only be feasiblewithspecial models then, which would suck too. I guess I change my mind;it's not worth the little extra convenience it might get you
sometimes.EelcoOn 3/15/06, Igor Vaynberg [EMAIL PROTECTED] wrote: yuck. i implement IModel quiet often and it would really suck to have to
 implement this method also eventhough it is only useful for form components. besides, what about models that can hold different types of objects? i think this is a really bad idea. -Igor
 On 3/15/06, Eelco Hillenius [EMAIL PROTECTED] wrote: We actually considered this last year, and decided against it. Besides
 the argument that it is more expensive - which probably isn't as valid today due to changes in how we handle those model updates - an explicit type gives you more flexibility over which converter should
 be used. I'm wondering now whether we should support and/ and in a future version of Wicket. Andre, if youplease add a feature request to our SF tracker, we'll consider it for Wicket 
1.3 Eelco On 3/15/06, Andre Matheus [EMAIL PROTECTED] wrote:  I agree it will effect lots of things, but in the other side every
 component  would have its value automatically validated to the datatype... it would be  nice... :-)   ___  Andre Matheus  
 On 3/15/06, Johan Compagner [EMAIL PROTECTED] wrote:   I guess we could do that somehow.   But then we need to specify that somehow in youre IModel interface.
 so instead of getObject(Component) we also should have getType(Component)   That will effect a lot of things. johan  
 On 3/15/06, Andre Matheus  [EMAIL PROTECTED] wrote:Why can't wicket discover the type using reflection?
___Andre Matheus On 3/14/06, Igor Vaynberg  
[EMAIL PROTECTED]  wrote: also look at FormComponent.setType(Class). wicket can perform type  conversion from the request parameter string to the type of your model
  object. if the conversion fails it generates a validation error. so TextField tf=new TextField(id, model); tf.setType
(Integer.class) will only accept values that can be converted to integers for explanation on how errors are constructed try searching the wiki
  for validation messages -Igor On 3/14/06, Jonathan Cone  
[EMAIL PROTECTED] wrote:   Hey Vincent,   In wicket, validators can be add()ed to components like anything
  else.For example, one way to make a textfield required without using the  helper class would be to do something like:  TextField tf= new TextField(id,...);
  tf.add(RequiredValidator.getInstance());   Check out the javadoc for the  wicket.markup.html.form.validation package, there are
 some  common validators in there and its real easy to write a custom one yourself. I think you'll find that validation in wicket is as easy as you were  hoping. 
   - Original Message -  From: Vincent Jenks  To: 
wicket-user@lists.sourceforge.net  Sent: Tuesday, March 14, 2006 3:52 PM  Subject: [Wicket-user] validating input   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?  
  No virus found in this incoming message.  Checked by AVG Free Edition.  Version: 7.1.385 / Virus Database: 268.2.2/280 - Release Date:
  3/13/2006 
   --__André Matheus --  __
  André Matheus --- 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 

Re: [Wicket-user] validating input

2006-03-15 Thread Igor Vaynberg
type erasure sucks, dont think generics can help us there. and even if there wasnt type erasure what can you do for IModel? extends SomeClass :)-IgorOn 3/15/06, 
Eelco Hillenius [EMAIL PROTECTED] wrote:
For Wicket 2.0 we might be helped with generics. Or we might not, asunfortunately, there is no such thing as T.getClass() or eq is there?EelcoOn 3/15/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote: yeah, implementing the Class getObjectType(). it is nasty if the model can hold different types, and it is only useful for a small subset of models. if you really really really want the automatic typing why not do
 getModelObject().getClass() - prob wont work very well if you return a null, but you cant have everything :) -Igor On 3/15/06, Eelco Hillenius 
[EMAIL PROTECTED] wrote:  Implementing the getObject method to return the proper type you mean?  Yeah, that wouldn't be the way to go. It would only be feasiblewith  special models then, which would suck too. I guess I change my mind;
  it's not worth the little extra convenience it might get you  sometimes.   Eelco   On 3/15/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:   yuck. i implement IModel quiet often and it would really suck to have to   implement this method also eventhough it is only useful for form components.
   besides, what about models that can hold different types of objects? i think   this is a really bad idea. -Igor
 On 3/15/06, Eelco Hillenius [EMAIL PROTECTED] wrote: We actually considered this last year, and decided against it. Besides
   the argument that it is more expensive - which probably isn't as valid   today due to changes in how we handle those model updates - an   explicit type gives you more flexibility over which converter should
   be used. I'm wondering now whether we should support and/ and in a future   version of Wicket. Andre, if youplease add a feature request to our   SF tracker, we'll consider it for Wicket 
1.3 Eelco   On 3/15/06, Andre Matheus [EMAIL PROTECTED] wrote:I agree it will effect lots of things, but in the other side every
   componentwould have its value automatically validated to the datatype... it would   benice... :-)   ___
Andre Matheus On 3/15/06, Johan Compagner [EMAIL PROTECTED] wrote: I guess we could do that somehow.
 But then we need to specify that somehow in youre IModel interface. so instead of getObject(Component) we also should have   getType(Component)
 That will effect a lot of things. johan
 On 3/15/06, Andre Matheus  [EMAIL PROTECTED] wrote:  Why can't wicket discover the type using reflection?
  ___  Andre Matheus On 3/14/06, Igor Vaynberg  
[EMAIL PROTECTED]  wrote:   also look at FormComponent.setType(Class). wicket can perform typeconversion from the request parameter string to the type of your model
object. if the conversion fails it generates a validation error. so TextField tf=new TextField(id, model);
   tf.setType (Integer.class) will only accept values that can be converted to integers  
   for explanation on how errors are constructed try searching the wikifor validation messages -Igor
 On 3/14/06, Jonathan Cone  
[EMAIL PROTECTED] wrote: Hey Vincent,   In wicket, validators can be add()ed to components like
 anythingelse.For example, one way to make a textfield required without using thehelper class would be to do something like:TextField tf= new TextField(id,...);
tf.add(RequiredValidator.getInstance());   Check out the javadoc for the
wicket.markup.html.form.validation package, there are   somecommon validators in there and its real easy to write a custom one   yourself.   I think you'll find that validation in wicket is as easy as you were
hoping.  - Original Message -From: Vincent Jenks
To: wicket-user@lists.sourceforge.netSent: Tuesday, March 14, 2006 3:52 PM
Subject: [Wicket-user] validating input   I just built a form that has a mixture of TextField, TextArea,
 andCheckBox components in it.I am now adding validation to get a feel for   howit works but am confused.   
I found that I could substitute a TextField with a   RequiredTextFieldand validation was *extremely* simple to setupif you're using
 inputform fields.However, it doesn't appear that these helper classes exist   forall types of form widgets...or am I mistaken?   
     No virus found in this incoming message.
Checked by AVG Free Edition.Version: 7.1.385 / Virus Database: 268.2.2/280 - Release Date:3/13/2006   

   --  __  André Matheus   
  --__

Re: [Wicket-user] validating input

2006-03-15 Thread Igor Vaynberg
but i guess if there wasnt typeerasure we wouldnt have the wildmasks...-IgorOn 3/15/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:type erasure sucks, dont think generics can help us there. and even if there wasnt type erasure what can you do for IModel? extends SomeClass :)
-IgorOn 3/15/06, 
Eelco Hillenius [EMAIL PROTECTED] wrote:

For Wicket 2.0 we might be helped with generics. Or we might not, asunfortunately, there is no such thing as T.getClass() or eq is there?EelcoOn 3/15/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote: yeah, implementing the Class getObjectType(). it is nasty if the model can hold different types, and it is only useful for a small subset of models. if you really really really want the automatic typing why not do
 getModelObject().getClass() - prob wont work very well if you return a null, but you cant have everything :) -Igor On 3/15/06, Eelco Hillenius 

[EMAIL PROTECTED] wrote:  Implementing the getObject method to return the proper type you mean?  Yeah, that wouldn't be the way to go. It would only be feasiblewith  special models then, which would suck too. I guess I change my mind;
  it's not worth the little extra convenience it might get you  sometimes.   Eelco   On 3/15/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:   yuck. i implement IModel quiet often and it would really suck to have to   implement this method also eventhough it is only useful for form components.
   besides, what about models that can hold different types of objects? i think   this is a really bad idea. -Igor
 On 3/15/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 We actually considered this last year, and decided against it. Besides
   the argument that it is more expensive - which probably isn't as valid   today due to changes in how we handle those model updates - an   explicit type gives you more flexibility over which converter should
   be used. I'm wondering now whether we should support and/ and in a future   version of Wicket. Andre, if youplease add a feature request to our
   SF tracker, we'll consider it for Wicket 
1.3 Eelco   On 3/15/06, Andre Matheus 
[EMAIL PROTECTED] wrote:I agree it will effect lots of things, but in the other side every
   componentwould have its value automatically validated to the datatype... it would   benice... :-)   ___
Andre Matheus On 3/15/06, Johan Compagner 
[EMAIL PROTECTED] wrote: I guess we could do that somehow.
 But then we need to specify that somehow in youre IModel interface. so instead of getObject(Component) we also should have   getType(Component)
 That will effect a lot of things. johan
 On 3/15/06, Andre Matheus  [EMAIL PROTECTED] wrote:  Why can't wicket discover the type using reflection?
  ___  Andre Matheus On 3/14/06, Igor Vaynberg  
[EMAIL PROTECTED]  wrote:   also look at FormComponent.setType
(Class). wicket can perform typeconversion from the request parameter string to the type of your model
object. if the conversion fails it generates a validation error. so TextField tf=new TextField(id, model);

   tf.setType (Integer.class) will only accept values that can be converted to integers  
   for explanation on how errors are constructed try searching the wikifor validation messages -Igor
 On 3/14/06, Jonathan Cone  

[EMAIL PROTECTED] wrote: Hey Vincent,   In wicket, validators can be add()ed to components like
 anythingelse.For example, one way to make a textfield required without using thehelper class would be to do something like:TextField tf= new TextField(id,...);
tf.add(RequiredValidator.getInstance());   Check out the javadoc for the
wicket.markup.html.form.validation package, there are   somecommon validators in there and its real easy to write a custom one   yourself.   I think you'll find that validation in wicket is as easy as you were
hoping.  - Original Message -From: Vincent Jenks
To: wicket-user@lists.sourceforge.netSent: Tuesday, March 14, 2006 3:52 PM

Subject: [Wicket-user] validating input   I just built a form that has a mixture of TextField, TextArea,
 andCheckBox components in it.I am now adding validation to get a feel for   howit works but am confused.   
I found that I could substitute a TextField with a   RequiredTextFieldand validation was *extremely* simple to setupif you're using

 inputform fields.However, it doesn't appear that these helper classes exist   forall types of form widgets...or am I mistaken?   
     No virus found in this incoming message.
Checked by AVG Free Edition.Version: 7.1.385 / Virus Database: 268.2.2/280 - Release 

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 Jonathan Cone




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] 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




[Wicket-user] basic CompoundPropertyModel problem

2006-03-15 Thread karthik Guru
Ok its pretty basic but I havent been able to figure out why i am not able to get CompoundPropertyModel work for me.Class BasePage{ Account getAccount( ){ }}Class MyPage extends BasePage{
  MyPage(){ Form form = new Form(); form.setModel(new CompoundPropertyModel(this)); form.add(new Label(account.username));  form.add(new PasswordTextField(account.password
)); form.add(new AccountFieldsPanel(accountFields));   }}public class AccountFieldsPanel extends Panel {   public AccountFieldsPanel(String id) {  super(id);
  add(new Label(account.firstName));  add(new Label(account.lastName));  add(new Label(account.email));  add(new Label(account.phone));
 }}Fields in the AccountFieldsPanel are showing up blank. The fields in MyPage (account.username  account.password) show up just fine. The AccountFieldsPanel is not calling getAccount( ).getFirstName( ) for example - i checked this thro debugger. Account object has all the attributes and it is being picked from the Session. For some reason am not able to get the AccountFieldsPanel  to use the MyPage as its Compound model.
Any idea where i might be going wrong?-- karthik -- 


[Wicket-user] Accessing Wicket Session

2006-03-15 Thread Steve_Thompson
I'm in the process of writing a servlet filter to secure an area of my site 
that is nothing more than static web pages.  This is my first servlet filter 
though, and what I need it to do is use the authentication information in my 
Wicket session.  My problem is that stepping out of the Wicket world, I have 
no idea how to access the Wicket session in doFilter.  Is there an easy way?  
And what's with WicketServletFilter - could I just extend this class to serve 
my needs?

Thanks and best regards as always,


Steve

-- 


---
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


Re: [Wicket-user] basic CompoundPropertyModel problem

2006-03-15 Thread Igor Vaynberg
this line is wrong:form.setModel(new CompoundPropertyModel(this));in this case this refers to the form, you want it to refer to the pagechange to form.setModel(new CompoundPropertyModel(BasePage.this
));-IgorOn 3/15/06, karthik Guru [EMAIL PROTECTED] wrote:
Ok its pretty basic but I havent been able to figure out why i am not able to get CompoundPropertyModel work for me.Class BasePage{ Account getAccount( ){ }}Class MyPage extends BasePage{

  MyPage(){ Form form = new Form(); form.setModel(new CompoundPropertyModel(this)); form.add(new Label(account.username));  form.add(new PasswordTextField(account.password

)); form.add(new AccountFieldsPanel(accountFields));   }}public class AccountFieldsPanel extends Panel {   public AccountFieldsPanel(String id) {  super(id);
  add(new Label(account.firstName));  add(new Label(account.lastName));  add(new Label(account.email));  add(new Label(account.phone));
 }}Fields in the AccountFieldsPanel are showing up blank. The fields in MyPage (account.username  account.password) show up just fine. The AccountFieldsPanel is not calling getAccount( ).getFirstName( ) for example - i checked this thro debugger. Account object has all the attributes and it is being picked from the Session. For some reason am not able to get the AccountFieldsPanel  to use the MyPage as its Compound model.
Any idea where i might be going wrong?-- karthik -- 




Re: [Wicket-user] What about Wicket Javascript and Browser errors?

2006-03-15 Thread Ayodeji Aladejebi
i get your point right igor but my headache is is even more of the fact that i always get this 
Error : Object Expected 
from browser _javascript_ console even when i reused the example source letter for letter. This is error is common not just with AJAX but also with most other wicket extensions that use _javascript_s



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

you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this 

final Label label;
add(label=new Label(a, A));
label.setOutputMarkupId (true); === this is important if you want to rerender this component via ajax

add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);


 label.getparent().replace(b);
 ajaxRequestTarget.addComponent (label); }});
-Igor

On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent
 (b); }});
is there some configuration i am not putting in place?


Re: [Wicket-user] Accessing Wicket Session

2006-03-15 Thread Igor Vaynberg
you mean WicketSessionFilter?do you really need to extend it? what it does is set the wicket.Session threadlocal to the wicket session so that it is available outside of wicket world. so if you setup your security filter to run after the wicketsessionfilter, in your security filter you can get to the wicket session by simply doing 
Session.get()-IgorOn 3/15/06, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:I'm in the process of writing a servlet filter to secure an area of my site
that is nothing more than static web pages.This is my first servlet filterthough, and what I need it to do is use the authentication information in myWicket session.My problem is that stepping out of the Wicket world, I have
no idea how to access the Wicket session in doFilter.Is there an easy way?And what's with WicketServletFilter - could I just extend this class to servemy needs?Thanks and best regards as always,
Steve-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] What about Wicket Javascript and Browser errors?

2006-03-15 Thread Igor Vaynberg
what browser/version do you use?-IgorOn 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:
i get your point right igor but my headache is is even more of the fact that i always get this 

Error : Object Expected 
from browser _javascript_ console even when i reused the example source letter for letter. This is error is common not just with AJAX but also with most other wicket extensions that use _javascript_s




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

you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this 

final Label label;
add(label=new Label(a, A));
label.setOutputMarkupId (true); === this is important if you want to rerender this component via ajax

add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);



 label.getparent().replace(b);
 ajaxRequestTarget.addComponent (label); }});
-Igor

On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent

 (b); }});
is there some configuration i am not putting in place?




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

2006-03-15 Thread Igor Vaynberg
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
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!
















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

2006-03-15 Thread Igor Vaynberg
ahh, so EditProduct is your home page! thats the crucial missing piece of information :)your homepage /is/ a bookmarkable page because all you give application is a class (setHomePage(Class)) so when wicket needs to instantiate it it will either use PageParameters or the default constructor.
-IgorOn 3/15/06, Vincent Jenks [EMAIL PROTECTED] wrote:
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* 

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

2006-03-15 Thread Jonathan Cone

Vincent,

I'm not sure I understand your question.  The Label objects are used to
render some value field of your model object. In my opinion, its easiest to
understand the ListView as a black box that takes a list of domain objects,
wires up the proper rendering components for the elements you desire to
render and outputs the result.  The populateItem(ListItem item) method is
the 'programmer directions' on how to do this for each element in the list.
More simply, populateItem is called for each item in the list.  Does this
help?

- Original Message - 
From: Vincent Jenks

To: wicket-user@lists.sourceforge.net
Sent: Wednesday, March 15, 2006 11:49 AM
Subject: Re: [Wicket-user] Newbie question: applying dynamic form component
with ListView


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?


---
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


Re: [Wicket-user] DataView (extensions)

2006-03-15 Thread Igor Vaynberg
the question was about large datasets, in which case it is not a good idea to keep that stuff in session. but i am glad to see IDataProvider is flexible enough for you to adopt to your usecase.-Igor
On 3/15/06, Frank Silbermann [EMAIL PROTECTED] wrote:

















The DataTable in
Wicket Extensions allows for both paging and sorting. The API provides a partial implementation of IDataProvider, i.e. SortableDataProvider,
which you can extend – or you can create your own from scratch. There are classes used SortableDataProvider
and also available for your own implementations to allow you to record the
sorting requests which arrive each time the user clicks the heading of a sortable column in the DataTable.



The IDataProvider
method "Iterator iterator(int
first, int count)" -- which you must implement
-- requests one page worth of data rows, specifying where to begin among the
set of all rows, and how many are needed for the current page. It is up to the implementer to ensure that
the rows returned are sorted according to the history of sort requests.



(Presumably, your most recent request
dictates the primary sort level, the previous sort
request would be the secondary sort level, and so on. For example, if the user clicked the header
for first-name and then the header for last-name, the list would be sorted by
last-name, but among people with the same last-name they would appear in
first-name order.)



I believe the creators of DataTable assumed that in the usual case, every invocation
of IDataProvider.Iterator(first, count) would result
in a new request of rows from the database, and the accumulated sort criteria would
be used to build the SQL "ORDER BY" clause. This approach avoids burdening the session
storage, but requires lots of database calls.
It also requires complex custom code to generate the SQL query command taking
into account both the required ORDER BY clause and also to select the proper
subset of rows needed for that page only.



I suppose if you wrapped the ResultSet in a pageable RowSet and kept that 
RowSet in
session storage, then until the sorting order changed you could use the same RowSet each time a new page is requested. If the RowSet
caches the data, then the RowSet will be a huge
object in your session storage. If you
find a RowSet implementation which reconnects to the
database for each subset of rows you request, that might simplify your code
without burdening session storage. (Of
course, if your RowSet maintained a connection to the
database, you'd be tying up a DBConnection –
not a good idea.)



My problem is to display mostly small
result sets containing not raw data but rather statistics, which may be
time-consuming for the database to compute.
I have about fifty different SQL select queries (not counting variations
in the WHERE clause according to parameters chosen by the user). Usually, these results must be presented in
tables with sortable columns. This is not an e-commerce application;
rather, it provides information to a small group of process engineers. With few users and small result sets, I am
not so worried about session storage. With
about fifty different DataTables to present -- and I'm
not sure we have the _right_ set
of queries, either -- I _am_
greatly concerned about flexibility and ease of programming.



Therefore, I have chosen to allow the
table's data to remain in session storage, re-sorted in memory whenever
the user requests, and replaced with new data when the user changes the values
of request parameters. The data does not
leave session storage until the page containing it expires -- this is clearly
not a general approach for every kind of production system. The main advantage is that all I have to do
for each table is override the method that generates the SQL SELECT query
string, and I can display the results in a DataTable easily
configured for sorting and/or paging.
(Only a very few of my DataTables are large
enough to require paging.)



When I'm finished, I'll post
my code; even if it's not suitable for most production applications my
classes might serve as a useful prototyping tool.



-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of 
Igor Vaynberg
Sent: Wednesday, March 15, 2006
10:59 AM
To:
wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user]
DataView (extentions)



I cant speak for Frank's implementation, but when the
IDataProvider is implemented correctly you only retrieve the window of data
that will be rendered for this request and hold none of it in session. so the
performance of the datatable component itself should be great. 

-Igor





On 3/15/06, Mats Norén 
[EMAIL PROTECTED] wrote:

That would be great!

btw, how is the performance with large resultsets?



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 

[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] wicket:preview feature

2006-03-15 Thread Juergen Donnerstag
I set up the dir structure similar to the one on your blog (root:
wicket.examples.preview) but I'm having some problems. The text which
is meant to be replaced is not. And dont get any error message or the
like. What shall I do?

Juergen

On 3/15/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
 Do you need anything else from my side?  I'll go ahead and just attach
 the javascript files to this email.  I'd create a patch, but i have
 *no* idea where these files should be put in the codebase.
 just for reference:
 * wicket-preview.js is the bootstrapping javascript that dynamically
 includes the other files
 * wicket-preview-behaviour.js does the actual work of parsing
 wicet:preview attributes
 * dojo.js is the lightweight dojo.io.* javascript.  It's not the
 complete dojo toolkit

 On 3/15/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  now implemented:
 
  1.  update the DTD to support the wicket:preview attribute
  2.  make sure that wicket can strip the wicket:preview attribute at
  runtime (just like wicket:id)
 
  Juergen
 
  On 3/14/06, Joni Suominen [EMAIL PROTECTED] wrote:
   It uses the native browser of the os by default. I've tested some AJAX
   enabled wicket components with eclipse's browser, so your implementation
   should work just fine. Just now i'm busy but i'll take a deeper look at
   it later this week. This feature is scheduled for 0.4.0 version but if
   its easy to drop in, it may get to the 0.3.0.
  
   https://www.laughingpanda.org/jira/browse/WB-24
  
   Joni
  
   On Tue, 2006-03-14 at 10:30 -0600, Ryan Sonnek wrote:
I haven't used wicket-bench yet, but if they're using an internal
browser, it should work as long as it supports javascript.  i'm not
sure what eclipse uses internally to view html files.
   
On 3/14/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Furthermore, this is something that the people that are working on IDE
 support might want to support out of the box. Laughing Panda dudes,
 Geert, you reading with us?

 Eelco


 On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  On 3/14/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
   I think that's a good question.  What would be the best way to
   distribute this feature to users?  I've commented on my blog the 
   steps
   I believe are necessary for this to be integrated into wicket, 
   but I'd
   appreciate any feedback on it
   (http://jroller.com/page/wireframe?entry=wicket_preview_with_one_javascript).
  
 
  I'll check it tonight (hopefully)
 
   There are a couple changes to wicket to support this:
   1.  update the DTD to support the wicket:preview attribute
   2.  make sure that wicket can strip the wicket:preview attribute 
   at
   runtime (just like wicket:id)
  
 
  both should be easy to accomplish
 
  Juergen
 
   Then it's just a question of how to package this for users?  I 
   think
   it would make sense to distribute the javascript files for this
   feature in a seperate folder so that users could upgrade the whole
   suite of javascript when updates are released...
  
   On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
I am interested to do it, but got only very little time 
currently.
What do you want me to do?
   
Juergen
   
On 3/14/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
 I've updated the wicket:preview feature with new 
 functionality.  I
 think it pretty much covers the use cases people have 
 provided, and I
 would like to work with the wicket developers to integrate 
 this (if
 it's still wanted).

 main selling points
 * uses html and ajax to dynamically include components into 
 page for
 offline preview (outside of wicket)
 * only need to include one javascript file (all others are 
 dynamically
 included at runtime)
 * previewing of nested components is now supported!  that 
 means you
 can preview a page that imports a component which imports 
 another
 componetetc

 http://jroller.com/page/wireframe?entry=preview_multiple_levels_of_components


 ---
 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

   

Re: [Wicket-user] wicket:preview feature

2006-03-15 Thread Ryan Sonnek
Juergen, are you using the javascript from my blog or the one I
attached to the last email?  If you copied the javascript from the
blog, I'm guessing there's some issue with html escaping.  Try the
files I included in my email.

This info could go up on the wiki, but it will really mirror what's
already at my blog.  I don't object to someone putting it up on the
wiki for consistent documentation though...

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

 Any chance you cam write up a short Wiki entry on how to use it?

 Gili

 Ryan Sonnek wrote:
  Do you need anything else from my side?  I'll go ahead and just attach
  the javascript files to this email.  I'd create a patch, but i have
  *no* idea where these files should be put in the codebase.
  just for reference:
  * wicket-preview.js is the bootstrapping javascript that dynamically
  includes the other files
  * wicket-preview-behaviour.js does the actual work of parsing
  wicet:preview attributes
  * dojo.js is the lightweight dojo.io.* javascript.  It's not the
  complete dojo toolkit
 
  On 3/15/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  now implemented:
 
  1.  update the DTD to support the wicket:preview attribute
  2.  make sure that wicket can strip the wicket:preview attribute at
  runtime (just like wicket:id)
 
  Juergen
 
  On 3/14/06, Joni Suominen [EMAIL PROTECTED] wrote:
  It uses the native browser of the os by default. I've tested some AJAX
  enabled wicket components with eclipse's browser, so your implementation
  should work just fine. Just now i'm busy but i'll take a deeper look at
  it later this week. This feature is scheduled for 0.4.0 version but if
  its easy to drop in, it may get to the 0.3.0.
 
  https://www.laughingpanda.org/jira/browse/WB-24
 
  Joni
 
  On Tue, 2006-03-14 at 10:30 -0600, Ryan Sonnek wrote:
  I haven't used wicket-bench yet, but if they're using an internal
  browser, it should work as long as it supports javascript.  i'm not
  sure what eclipse uses internally to view html files.
 
  On 3/14/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
  Furthermore, this is something that the people that are working on IDE
  support might want to support out of the box. Laughing Panda dudes,
  Geert, you reading with us?
 
  Eelco
 
 
  On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  On 3/14/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
  I think that's a good question.  What would be the best way to
  distribute this feature to users?  I've commented on my blog the steps
  I believe are necessary for this to be integrated into wicket, but I'd
  appreciate any feedback on it
  (http://jroller.com/page/wireframe?entry=wicket_preview_with_one_javascript).
 
  I'll check it tonight (hopefully)
 
  There are a couple changes to wicket to support this:
  1.  update the DTD to support the wicket:preview attribute
  2.  make sure that wicket can strip the wicket:preview attribute at
  runtime (just like wicket:id)
 
  both should be easy to accomplish
 
  Juergen
 
  Then it's just a question of how to package this for users?  I think
  it would make sense to distribute the javascript files for this
  feature in a seperate folder so that users could upgrade the whole
  suite of javascript when updates are released...
 
  On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  I am interested to do it, but got only very little time currently.
  What do you want me to do?
 
  Juergen
 
  On 3/14/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
  I've updated the wicket:preview feature with new functionality.  I
  think it pretty much covers the use cases people have provided, and 
  I
  would like to work with the wicket developers to integrate this (if
  it's still wanted).
 
  main selling points
  * uses html and ajax to dynamically include components into page for
  offline preview (outside of wicket)
  * only need to include one javascript file (all others are 
  dynamically
  included at runtime)
  * previewing of nested components is now supported!  that means you
  can preview a page that imports a component which imports another
  componetetc
 
  http://jroller.com/page/wireframe?entry=preview_multiple_levels_of_components
 
 
  ---
  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 

Re: [Wicket-user] wicket:preview feature

2006-03-15 Thread Juergen Donnerstag
ok, works now. Missed to download behaviour.js

Gili:: please see
http://jroller.com/page/wireframe?entry=preview_multiple_levels_of_components


Juergen

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

 Any chance you cam write up a short Wiki entry on how to use it?

 Gili

 Ryan Sonnek wrote:
  Do you need anything else from my side?  I'll go ahead and just attach
  the javascript files to this email.  I'd create a patch, but i have
  *no* idea where these files should be put in the codebase.
  just for reference:
  * wicket-preview.js is the bootstrapping javascript that dynamically
  includes the other files
  * wicket-preview-behaviour.js does the actual work of parsing
  wicet:preview attributes
  * dojo.js is the lightweight dojo.io.* javascript.  It's not the
  complete dojo toolkit
 
  On 3/15/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  now implemented:
 
  1.  update the DTD to support the wicket:preview attribute
  2.  make sure that wicket can strip the wicket:preview attribute at
  runtime (just like wicket:id)
 
  Juergen
 
  On 3/14/06, Joni Suominen [EMAIL PROTECTED] wrote:
  It uses the native browser of the os by default. I've tested some AJAX
  enabled wicket components with eclipse's browser, so your implementation
  should work just fine. Just now i'm busy but i'll take a deeper look at
  it later this week. This feature is scheduled for 0.4.0 version but if
  its easy to drop in, it may get to the 0.3.0.
 
  https://www.laughingpanda.org/jira/browse/WB-24
 
  Joni
 
  On Tue, 2006-03-14 at 10:30 -0600, Ryan Sonnek wrote:
  I haven't used wicket-bench yet, but if they're using an internal
  browser, it should work as long as it supports javascript.  i'm not
  sure what eclipse uses internally to view html files.
 
  On 3/14/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
  Furthermore, this is something that the people that are working on IDE
  support might want to support out of the box. Laughing Panda dudes,
  Geert, you reading with us?
 
  Eelco
 
 
  On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  On 3/14/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
  I think that's a good question.  What would be the best way to
  distribute this feature to users?  I've commented on my blog the steps
  I believe are necessary for this to be integrated into wicket, but I'd
  appreciate any feedback on it
  (http://jroller.com/page/wireframe?entry=wicket_preview_with_one_javascript).
 
  I'll check it tonight (hopefully)
 
  There are a couple changes to wicket to support this:
  1.  update the DTD to support the wicket:preview attribute
  2.  make sure that wicket can strip the wicket:preview attribute at
  runtime (just like wicket:id)
 
  both should be easy to accomplish
 
  Juergen
 
  Then it's just a question of how to package this for users?  I think
  it would make sense to distribute the javascript files for this
  feature in a seperate folder so that users could upgrade the whole
  suite of javascript when updates are released...
 
  On 3/14/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
  I am interested to do it, but got only very little time currently.
  What do you want me to do?
 
  Juergen
 
  On 3/14/06, Ryan Sonnek [EMAIL PROTECTED] wrote:
  I've updated the wicket:preview feature with new functionality.  I
  think it pretty much covers the use cases people have provided, and 
  I
  would like to work with the wicket developers to integrate this (if
  it's still wanted).
 
  main selling points
  * uses html and ajax to dynamically include components into page for
  offline preview (outside of wicket)
  * only need to include one javascript file (all others are 
  dynamically
  included at runtime)
  * previewing of nested components is now supported!  that means you
  can preview a page that imports a component which imports another
  componetetc
 
  http://jroller.com/page/wireframe?entry=preview_multiple_levels_of_components
 
 
  ---
  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
  

Re: [Wicket-user] formatting

2006-03-15 Thread Igor Vaynberg
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!




Re: [Wicket-user] wicket:preview feature

2006-03-15 Thread Juergen Donnerstag
I just committed your example to wicket-example

Juergen


---
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:preview feature

2006-03-15 Thread Ryan Sonnek
Woo Hoo!  Thanks Juergen!

On 3/15/06, Juergen Donnerstag [EMAIL PROTECTED] wrote:
 I just committed your example to wicket-example

 Juergen


 ---
 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] 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] Problems migrating my old web application to Wicket

2006-03-15 Thread Matthias Albert
After some reading and experimenting with wicket, I am just trying to 
collect the steps that would be necessary to migrate  an web application 
(that used XSLT transformations) to wicket. There are several questions 
that I would like to ask.


I surely do not understand Wicket enough, these are all beginner's 
questions.


The main characteristics are:

1. There are ca. 200 static HTML-Pages without any header and navigation 
elements. They are distributed over several subdirectories, the root 
being WEBAPP/content.


My Question: How can the single root directory for all HTML pages be 
configured? I found a IResourcePath and WebApplicationPath class, but no 
usage of it.


2. So far there were several XML pipelines to insert a header block and 
a navigation block on the left via XSLT transformations. The navigation 
block has links to all pages in a subdirectory and is the same for all 
pages in this subdirectory and is defined in a XML file siteindex.xml.


Question: Do I really have to write a class for every HTML page? That 
means about 200 classes that are all nearly the same! They all could 
extend a common base class and add nothing apart from their classname.
I would be happy to write a class per subdirectory that could evaluate 
the siteindex.xml file and create a dynamic navigation component. This 
class could even be the same for all pages, if it could be configured.


The HTML pages should remain unchanged. There should be no wicket:id in 
every HTML page for the header and navigation block, this should rather 
be done outside the pages. Maybe, I could write a XSLT preprocessor 
stage to achieve that.


3. There will be some Java classes to do real work, some protected pages 
 visible only to registered users and a lot more which I believe Wicket 
is suited very well for.



I hope anyone can give me some hints where to find additional information.

Thanks in advance

Matthias Albert





---
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


Re: [Wicket-user] Problems migrating my old web application to Wicket

2006-03-15 Thread Guillermo Castro
Matthias,I'm also in the early stages of learning wicket, but I thought I'd throw my 2c.If the 200+ pages are static, why can't you just keep them that way? Wicket doesn't preclude you from having static pages/images/resources. You can use Wicket only for the dynamic part of the website and leave the rest as it is.
regards.On 3/15/06, Matthias Albert [EMAIL PROTECTED] wrote:
After some reading and experimenting with wicket, I am just trying tocollect the steps that would be necessary to migratean web application(that used XSLT transformations) to wicket. There are several questions
that I would like to ask.I surely do not understand Wicket enough, these are all beginner'squestions.The main characteristics are:1. There are ca. 200 static HTML-Pages without any header and navigation
elements. They are distributed over several subdirectories, the rootbeing WEBAPP/content.My Question: How can the single root directory for all HTML pages beconfigured? I found a IResourcePath and WebApplicationPath class, but no
usage of it.2. So far there were several XML pipelines to insert a header block anda navigation block on the left via XSLT transformations. The navigationblock has links to all pages in a subdirectory and is the same for all
pages in this subdirectory and is defined in a XML file siteindex.xml.Question: Do I really have to write a class for every HTML page? Thatmeans about 200 classes that are all nearly the same! They all could
extend a common base class and add nothing apart from their classname.I would be happy to write a class per subdirectory that could evaluatethe siteindex.xml file and create a dynamic navigation component. This
class could even be the same for all pages, if it could be configured.The HTML pages should remain unchanged. There should be no wicket:id inevery HTML page for the header and navigation block, this should rather
be done outside the pages. Maybe, I could write a XSLT preprocessorstage to achieve that.3. There will be some Java classes to do real work, some protected pagesvisible only to registered users and a lot more which I believe Wicket
is suited very well for.I hope anyone can give me some hints where to find additional information.Thanks in advanceMatthias Albert---
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?cmd=lnkkid=110944bid=241720dat=121642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
-- Guillermo Castro [EMAIL PROTECTED]Monterrey NL, Mexico 
http://www.javageek.org/


Re: [Wicket-user] Problems migrating my old web application to Wicket

2006-03-15 Thread Igor Vaynberg
i would create a page that has the layout, add a label to that page with a model that streams the appropriate static page. that way you only have one wicket page that can display all the static ones.-Igor
On 3/15/06, Guillermo Castro [EMAIL PROTECTED] wrote:
Matthias,I'm also in the early stages of learning wicket, but I thought I'd throw my 2c.If the 200+ pages are static, why can't you just keep them that way? Wicket doesn't preclude you from having static pages/images/resources. You can use Wicket only for the dynamic part of the website and leave the rest as it is.
regards.On 3/15/06, Matthias Albert 
[EMAIL PROTECTED] wrote:
After some reading and experimenting with wicket, I am just trying tocollect the steps that would be necessary to migratean web application(that used XSLT transformations) to wicket. There are several questions

that I would like to ask.I surely do not understand Wicket enough, these are all beginner'squestions.The main characteristics are:1. There are ca. 200 static HTML-Pages without any header and navigation
elements. They are distributed over several subdirectories, the rootbeing WEBAPP/content.My Question: How can the single root directory for all HTML pages beconfigured? I found a IResourcePath and WebApplicationPath class, but no
usage of it.2. So far there were several XML pipelines to insert a header block anda navigation block on the left via XSLT transformations. The navigationblock has links to all pages in a subdirectory and is the same for all
pages in this subdirectory and is defined in a XML file siteindex.xml.Question: Do I really have to write a class for every HTML page? Thatmeans about 200 classes that are all nearly the same! They all could
extend a common base class and add nothing apart from their classname.I would be happy to write a class per subdirectory that could evaluatethe siteindex.xml file and create a dynamic navigation component. This
class could even be the same for all pages, if it could be configured.The HTML pages should remain unchanged. There should be no wicket:id inevery HTML page for the header and navigation block, this should rather
be done outside the pages. Maybe, I could write a XSLT preprocessorstage to achieve that.3. There will be some Java classes to do real work, some protected pagesvisible only to registered users and a lot more which I believe Wicket
is suited very well for.I hope anyone can give me some hints where to find additional information.Thanks in advanceMatthias Albert---
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?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-- Guillermo Castro 
[EMAIL PROTECTED]Monterrey NL, Mexico 
http://www.javageek.org/




Re: [Wicket-user] formatting

2006-03-15 Thread Johan Compagner
thats plain java. You could use a converter for that.johanOn 3/15/06, Vincent Jenks [EMAIL PROTECTED]
 wrote: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!








Re: [Wicket-user] validating input

2006-03-15 Thread Johan Compagner
if we want to support this then we don't want a IModel.getObjectType() ofcoursebut a IModel.getObjectType(Component)A model doesn't return one thing for a text field!think about compound models.. So you can't type the IModel itself because that doesn't help
if the model can return multiply things.Also getModelObject().getClass() doesn't really work because when you edit for example a new Person()object that returns for its properties all null. Then suddenly types don't work but if they have a property then 
it works? That looks really inconsistent to me.I guess if we want to support it we need getObjectType(Component) and then walk the complete class property pathBut i am not a big fan of this if i think about it, the developer knows it much better upfront.
johanOn 3/15/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
but i guess if there wasnt typeerasure we wouldnt have the wildmasks...-Igor
On 3/15/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
type erasure sucks, dont think generics can help us there. and even if there wasnt type erasure what can you do for IModel? extends SomeClass :)
-IgorOn 3/15/06, 

Eelco Hillenius [EMAIL PROTECTED] wrote:


For Wicket 2.0 we might be helped with generics. Or we might not, asunfortunately, there is no such thing as T.getClass() or eq is there?EelcoOn 3/15/06, Igor Vaynberg 


[EMAIL PROTECTED] wrote: yeah, implementing the Class getObjectType(). it is nasty if the model can hold different types, and it is only useful for a small subset of models. if you really really really want the automatic typing why not do
 getModelObject().getClass() - prob wont work very well if you return a null, but you cant have everything :) -Igor On 3/15/06, Eelco Hillenius 


[EMAIL PROTECTED] wrote:  Implementing the getObject method to return the proper type you mean?  Yeah, that wouldn't be the way to go. It would only be feasiblewith  special models then, which would suck too. I guess I change my mind;
  it's not worth the little extra convenience it might get you  sometimes.   Eelco   On 3/15/06, Igor Vaynberg 


[EMAIL PROTECTED] wrote:   yuck. i implement IModel quiet often and it would really suck to have to   implement this method also eventhough it is only useful for form components.
   besides, what about models that can hold different types of objects? i think   this is a really bad idea. -Igor
 On 3/15/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 We actually considered this last year, and decided against it. Besides
   the argument that it is more expensive - which probably isn't as valid   today due to changes in how we handle those model updates - an   explicit type gives you more flexibility over which converter should
   be used. I'm wondering now whether we should support and/ and in a future   version of Wicket. Andre, if youplease add a feature request to our

   SF tracker, we'll consider it for Wicket 
1.3 Eelco   On 3/15/06, Andre Matheus 

[EMAIL PROTECTED] wrote:I agree it will effect lots of things, but in the other side every
   componentwould have its value automatically validated to the datatype... it would   benice... :-)   ___
Andre Matheus On 3/15/06, Johan Compagner 

[EMAIL PROTECTED] wrote: I guess we could do that somehow.
 But then we need to specify that somehow in youre IModel interface. so instead of getObject(Component) we also should have   getType(Component)
 That will effect a lot of things. johan
 On 3/15/06, Andre Matheus  [EMAIL PROTECTED] wrote:  Why can't wicket discover the type using reflection?
  ___  Andre Matheus On 3/14/06, Igor Vaynberg  
[EMAIL PROTECTED]  wrote:   also look at FormComponent.setType

(Class). wicket can perform typeconversion from the request parameter string to the type of your model
object. if the conversion fails it generates a validation error. so TextField tf=new TextField(id, model);


   tf.setType (Integer.class) will only accept values that can be converted to integers  
   for explanation on how errors are constructed try searching the wikifor validation messages -Igor
 On 3/14/06, Jonathan Cone  


[EMAIL PROTECTED] wrote: Hey Vincent,   In wicket, validators can be add()ed to components like
 anythingelse.For example, one way to make a textfield required without using thehelper class would be to do something like:TextField tf= new TextField(id,...);
tf.add(RequiredValidator.getInstance());   Check out the javadoc for the
wicket.markup.html.form.validation package, there are   somecommon validators in there and its real easy to write a custom one   yourself.   I think you'll find that validation in wicket is as easy as you were
hoping.  - Original Message -From: Vincent Jenks

Re: [Wicket-user] basic CompoundPropertyModel problem

2006-03-15 Thread Johan Compagner
can you follow in the debugger where Label.onComponentTagBody() and then the call getModelObjectAsString()is going to and what model is taken from the parent?johanOn 3/15/06, 
karthik Guru [EMAIL PROTECTED] wrote:
Ok its pretty basic but I havent been able to figure out why i am not able to get CompoundPropertyModel work for me.Class BasePage{ Account getAccount( ){ }}Class MyPage extends BasePage{

  MyPage(){ Form form = new Form(); form.setModel(new CompoundPropertyModel(this)); form.add(new Label(account.username));  form.add(new PasswordTextField(account.password

)); form.add(new AccountFieldsPanel(accountFields));   }}public class AccountFieldsPanel extends Panel {   public AccountFieldsPanel(String id) {  super(id);
  add(new Label(account.firstName));  add(new Label(account.lastName));  add(new Label(account.email));  add(new Label(account.phone));
 }}Fields in the AccountFieldsPanel are showing up blank. The fields in MyPage (account.username  account.password) show up just fine. The AccountFieldsPanel is not calling getAccount( ).getFirstName( ) for example - i checked this thro debugger. Account object has all the attributes and it is being picked from the Session. For some reason am not able to get the AccountFieldsPanel  to use the MyPage as its Compound model.
Any idea where i might be going wrong?-- karthik -- 




Re: [Wicket-user] setResponsePage() to a mounted link

2006-03-15 Thread David Leangen

Ah!

A stupid typo on my part. Rather than getPageClass(), I kept writing
getPage().

That works as I expected because that's what I (erroneously) thought I
was doing all along.


Thanks again!


On Wed, 2006-03-15 at 12:23 +0100, Johan Compagner wrote:
 no again. then you set an instance. And getPage() is the same as doing
 nothing because that is the
 page where we return to by default.
 
 So if you set the response page to a page instances we can't redirect
 to a mount because a mount is 
 a bookmarkable page
 
 When targeting a instance the url must be something like wicket:xxx:0
 
 johan
 
 
 On 3/15/06, David Leangen [EMAIL PROTECTED] wrote:
 
 Sorry... Below I didn't say new MyPage(), I said getPage
 (). 
 
 It didn't work with getPage(), which in theory should return
 the same glass.
 Does this still make any difference?
 
 
 Thanks for your patience,
 Dave
 
 
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 Johan Compagner 
 Sent: 15 March 2006 19:25
 To: wicket-user@lists.sourceforge.net
 Subject: Re: [Wicket-user] setResponsePage() to a mounted link
 
 
 I did say this for a reason: 
 setResponsePage(MyPage.class)
 so don't do
 setResponsePage(new MyPage())
 
 because if you make an instance we have to really redirect to
 that
 instances.
 And als we can do a bookmarkable redirect.
 So yes there is a difference. 
 
 
 johan
 
 
 
 On 3/15/06, David Leangen [EMAIL PROTECTED] wrote:
 
 On Wed, 2006-03-15 at 10:34 +0100, Johan Compagner wrote:
  redirect again to a bookmarkable/mounted page: 
 
  add(new Link(toEnglishLink)
 {
 public void onClick()
 {
 getSession().setLocale
 ( Locale.ENGLISH );
  setResponsePage(MyPage.class)
 }
 });
 
 Yeah, I did:
 
   setResponsePage( getPage() )
 
 but it had the same effect. It took me to the link /app? 
 lotsOfFunkyParameterStuff, rather than /my/mounted/path.
 
 Is there a difference between using getPage() and
 MyPage.class? I
 wouldn't think so...
 
 In any case, the above is available to all my pages in a
 superclass. It 
 would be a bit cumbersome to have to use the static class
 parameter in
 each page...
 
 
 Is there a nicer way, perhaps?
 
 
 Thanks!
 
 
 
 
 --- 
 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=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=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


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

2006-03-15 Thread Michael K
mmhh It did struck me for a while to understand the underlying concept of Wicket's model and the relationship with various components. One thing I notice, It seems that Struts deal with form backing model more transparent than Wicket does in terms of accessing the model object (or may be I'm just being bias :). Or perhaps it just the way model 2 was implemented. However I agree in long run Wicket provides better reusability and scalability once I get used to with the concept. Thanks for your thorough explanation I really appreciate it.MichaelJonathan 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 th
 at 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 ListSent: Wednesday, March 15, 2006 4:22AM   Subject: [Wicket-user] Newbie question:applying dynamic form component with ListView   Hi,Which type should I define in POJO Model to hold thevalue of the array of TextField/DropDownChoice when populated by ListView?Should I define it as String[] or ArrayList o
 r
 something else? I haveattached the following example to explain mysituation: public class DetailForm extends Form{ private java.util.List ageList= Arrays.asList(new String[]{ "10", "20", "30"}); public DetailForm(Stringstring){super(string);DetailModel dm = newDetailModel();setModel(newCompoundPropertyModel(dm));ListView listView = new ListView("detailList", new PropertyModel(this,"detailData")){public void
 populateItem(final ListItemlistItem){final String detail = (String)listItem.getModelObject();listItem.add(newLabel("code",detail));listItem.add(newDropDownChoice("age",ageList));listItem.add(newTextField("name"));}};   
 add(listView);} public ListgetDetailData(){java.util.List hm = new ArrayList();  // Should get the data from DB,for simplicity I use hardcodevaluehm.add("");hm.add("");hm.add("");return hm;} }nbsp; // Model class public class DetailModel implementsSerializable
 { privateString[] age = new ArrayList(); //  Not sure about the

[Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-15 Thread David Leangen

This approach used to work for me under 1.1, but no longer in 1.2.

I have a BookmarkablePageLink that I want to disable when its target is
a subclass of a given page.

I used to do something like this:

  protected void onRender( final MarkupStream markupStream )
  {
  setEnabled( ! m_parentClass.isAssignableFrom( 
   getPage().getClass() ) );
  super.onRender( markupStream );
  }


But this now throws an exception:

wicket.WicketRuntimeException: Cannot modify component hierarchy during
render phase
 at wicket.Page.checkHierarchyChange(Page.java:1001)
 at wicket.Page.componentStateChanging(Page.java:934)
 at wicket.Component.addStateChange(Component.java:2118)
 at wicket.Component.setEnabled(Component.java:1732)

...


How should I go about creating the same effect? Where should I set the link's 
enabled value based on the above criterion?


Thanks!
Dave





---
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


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

2006-03-15 Thread Eelco Hillenius
Struts might be more transparent in that it delivers you a flat model.
There's just that request and that one form comming in, and the form
is populated by matching incomming request parameters with formbean
properties. Furthermore, that formbean IS your model (and your only
one), instead of a facade like Wicket's models are. It's surely
simpler in that respect, but quite limited too.

Eelco


On 3/15/06, Michael K [EMAIL PROTECTED] wrote:
 mmhh It did struck me for a while to understand the underlying concept of
 Wicket's model and the relationship with various components. One thing I
 notice, It seems that Struts deal with form backing model more transparent
 than Wicket does in terms of accessing the model object (or may be I'm just
 being bias :). Or perhaps it just the way model 2 was implemented.
 However I agree in long run Wicket provides better reusability and
 scalability once I get used to with the concept.

 Thanks for your thorough explanation I really appreciate it.


 Michael



 Jonathan Cone [EMAIL PROTECTED] wrote:


 Hi Michael,

 One thing that I personally think 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 a ListView
 takes a 'list' of model objects and displays each one independent of the
 other.  One of the cool things about wicket is that your model object
 instance fields can 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 DetailModels
   ListView 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.
  @Override
  protected 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;
   }

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

 }

 Good luck, I hope this helps you understand.  Just remember th at 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 o r 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, 

Re: [Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-15 Thread Eelco Hillenius
Just override isEnabled. That's why it's not final.

Eelco


On 3/15/06, David Leangen [EMAIL PROTECTED] wrote:

 This approach used to work for me under 1.1, but no longer in 1.2.

 I have a BookmarkablePageLink that I want to disable when its target is
 a subclass of a given page.

 I used to do something like this:

   protected void onRender( final MarkupStream markupStream )
   {
   setEnabled( ! m_parentClass.isAssignableFrom(
getPage().getClass() ) );
   super.onRender( markupStream );
   }


 But this now throws an exception:

 wicket.WicketRuntimeException: Cannot modify component hierarchy during
 render phase
  at wicket.Page.checkHierarchyChange(Page.java:1001)
  at wicket.Page.componentStateChanging(Page.java:934)
  at wicket.Component.addStateChange(Component.java:2118)
  at wicket.Component.setEnabled(Component.java:1732)

 ...


 How should I go about creating the same effect? Where should I set the link's 
 enabled value based on the above criterion?


 Thanks!
 Dave





 ---
 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] Problems migrating my old web application to Wicket

2006-03-15 Thread Matthias Albert


Igor Vaynberg schrieb:
i would create a page that has the layout, add a label to that page with 
a model that streams the appropriate static page. that way you only have 
one wicket page that can display all the static ones.



But this layout page should be able to modify the static source pages to 
inject a common top area and a menu-like link list (like in the 
navomatic example) common only for each subdirectory.


Is this possible with Wicket?



-Igor


On 3/15/06, *Guillermo Castro* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Matthias,

I'm also in the early stages of learning wicket, but I thought I'd
throw my 2c.

If the 200+ pages are static, why can't you just keep them that way?
Wicket doesn't preclude you from having static
pages/images/resources. You can use Wicket only for the dynamic part
of the website and leave the rest as it is.

regards.


On 3/15/06, *Matthias Albert*  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:

After some reading and experimenting with wicket, I am just
trying to
collect the steps that would be necessary to migrate  an web
application
(that used XSLT transformations) to wicket. There are several
questions
that I would like to ask.

I surely do not understand Wicket enough, these are all beginner's
questions.

The main characteristics are:

1. There are ca. 200 static HTML-Pages without any header and
navigation
elements. They are distributed over several subdirectories, the root
being WEBAPP/content.

My Question: How can the single root directory for all HTML pages be
configured? I found a IResourcePath and WebApplicationPath
class, but no
usage of it.

2. So far there were several XML pipelines to insert a header
block and
a navigation block on the left via XSLT transformations. The
navigation
block has links to all pages in a subdirectory and is the same
for all
pages in this subdirectory and is defined in a XML file
siteindex.xml.

Question: Do I really have to write a class for every HTML page?
That
means about 200 classes that are all nearly the same! They all
could
extend a common base class and add nothing apart from their
classname.
I would be happy to write a class per subdirectory that could
evaluate
the siteindex.xml file and create a dynamic navigation
component. This
class could even be the same for all pages, if it could be
configured.

The HTML pages should remain unchanged. There should be no
wicket:id in
every HTML page for the header and navigation block, this should
rather
be done outside the pages. Maybe, I could write a XSLT preprocessor
stage to achieve that.

3. There will be some Java classes to do real work, some
protected pages
  visible only to registered users and a lot more which I
believe Wicket
is suited very well for.


I hope anyone can give me some hints where to find additional
information.

Thanks in advance

Matthias Albert





---
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

http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
https://lists.sourceforge.net/lists/listinfo/wicket-user




-- 
Guillermo Castro [EMAIL PROTECTED]

mailto:[EMAIL PROTECTED]
Monterrey NL, Mexico http://www.javageek.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?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] basic CompoundPropertyModel problem

2006-03-15 Thread karthik Guru
I apologize! The fields on the template were of type 'text'. They were never labels/span.
I changed to wicket.TextField in the Panel and its working fine now. I sdn't be working late i guess :)But normally i have seen wicket complain - about such mismatch. Oh may be its because Label does not have checkComponentTag - 
unlike other widgets that can make certain assumptions about the enclosing tag.On 3/16/06, Johan Compagner 
[EMAIL PROTECTED] wrote:can you follow in the debugger where 
Label.onComponentTagBody() and then the call getModelObjectAsString()is going to and what model is taken from the parent?johan
On 3/15/06, 
karthik Guru [EMAIL PROTECTED] wrote:

Ok its pretty basic but I havent been able to figure out why i am not able to get CompoundPropertyModel work for me.Class BasePage{ Account getAccount( ){ }}
Class MyPage extends BasePage{

  MyPage(){ Form form = new Form(); form.setModel(new CompoundPropertyModel(this)); form.add(new Label(account.username));  form.add(new PasswordTextField(account.password


)); form.add(new AccountFieldsPanel(accountFields));   }}public class AccountFieldsPanel extends Panel {   public AccountFieldsPanel(String id) {  super(id);
  add(new Label(account.firstName));  add(new Label(account.lastName));  add(new Label(account.email));  add(new Label(account.phone));
 }}Fields in the AccountFieldsPanel are showing up blank. The fields in MyPage (account.username  account.password) show up just fine. The AccountFieldsPanel is not calling getAccount( ).getFirstName( ) for example - i checked this thro debugger. Account object has all the attributes and it is being picked from the Session. For some reason am not able to get the AccountFieldsPanel  to use the MyPage as its Compound model.
Any idea where i might be going wrong?-- karthik -- 



--  -- karthik -- 


Re: [Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-15 Thread David Leangen
 Just override isEnabled. That's why it's not final.

Well, of course it would have to be that simple...

You guys are going to have to stop designing Wicket so well if you want
to attract more users. ;-P





---
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


Re: [Wicket-user] Problems migrating my old web application to Wicket

2006-03-15 Thread Igor Vaynberg
wicket is very flexible, you just have to get used to it. composition is especially easy due to wicket's component oriented nature.-IgorOn 3/15/06, 
Matthias Albert [EMAIL PROTECTED] wrote:
Igor Vaynberg schrieb: i would create a page that has the layout, add a label to that page with a model that streams the appropriate static page. that way you only have one wicket page that can display all the static ones.
But this layout page should be able to modify the static source pages toinject a common top area and a menu-like link list (like in thenavomatic example) common only for each subdirectory.Is this possible with Wicket?
 -Igor On 3/15/06, *Guillermo Castro* [EMAIL PROTECTED] mailto:
[EMAIL PROTECTED] wrote: Matthias, I'm also in the early stages of learning wicket, but I thought I'd throw my 2c. If the 200+ pages are static, why can't you just keep them that way?
 Wicket doesn't preclude you from having static pages/images/resources. You can use Wicket only for the dynamic part of the website and leave the rest as it is. regards.
 On 3/15/06, *Matthias Albert*  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: After some reading and experimenting with wicket, I am just
 trying to collect the steps that would be necessary to migratean web application (that used XSLT transformations) to wicket. There are several questions
 that I would like to ask. I surely do not understand Wicket enough, these are all beginner's questions. The main characteristics are:
 1. There are ca. 200 static HTML-Pages without any header and navigation elements. They are distributed over several subdirectories, the root being WEBAPP/content.
 My Question: How can the single root directory for all HTML pages be configured? I found a IResourcePath and WebApplicationPath class, but no usage of it.
 2. So far there were several XML pipelines to insert a header block and a navigation block on the left via XSLT transformations. The navigation block has links to all pages in a subdirectory and is the same
 for all pages in this subdirectory and is defined in a XML file siteindex.xml. Question: Do I really have to write a class for every HTML page?
 That means about 200 classes that are all nearly the same! They all could extend a common base class and add nothing apart from their classname.
 I would be happy to write a class per subdirectory that could evaluate the siteindex.xml file and create a dynamic navigation component. This class could even be the same for all pages, if it could be
 configured. The HTML pages should remain unchanged. There should be no wicket:id in every HTML page for the header and navigation block, this should
 rather be done outside the pages. Maybe, I could write a XSLT preprocessor stage to achieve that. 3. There will be some Java classes to do real work, some
 protected pages visible only to registered users and a lot more which I believe Wicket is suited very well for. I hope anyone can give me some hints where to find additional
 information. Thanks in advance Matthias Albert ---
 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
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___
 Wicket-user mailing list Wicket-user@lists.sourceforge.net mailto:
Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user 
https://lists.sourceforge.net/lists/listinfo/wicket-user -- Guillermo Castro [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] Monterrey NL, Mexico http://www.javageek.org/
---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] Problems migrating my old web application to Wicket

2006-03-15 Thread Johan Compagner
no the layout page has all that common stuff. And it injects the static part into itself from the static pages.johanOn 3/16/06, Matthias Albert
 [EMAIL PROTECTED] wrote:Igor Vaynberg schrieb:
 i would create a page that has the layout, add a label to that page with a model that streams the appropriate static page. that way you only have one wicket page that can display all the static ones.
But this layout page should be able to modify the static source pages toinject a common top area and a menu-like link list (like in thenavomatic example) common only for each subdirectory.Is this possible with Wicket?
 -Igor On 3/15/06, *Guillermo Castro* [EMAIL PROTECTED] mailto:
[EMAIL PROTECTED] wrote: Matthias, I'm also in the early stages of learning wicket, but I thought I'd throw my 2c. If the 200+ pages are static, why can't you just keep them that way?
 Wicket doesn't preclude you from having static pages/images/resources. You can use Wicket only for the dynamic part of the website and leave the rest as it is. regards.
 On 3/15/06, *Matthias Albert*  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: After some reading and experimenting with wicket, I am just
 trying to collect the steps that would be necessary to migratean web application (that used XSLT transformations) to wicket. There are several questions
 that I would like to ask. I surely do not understand Wicket enough, these are all beginner's questions. The main characteristics are:
 1. There are ca. 200 static HTML-Pages without any header and navigation elements. They are distributed over several subdirectories, the root being WEBAPP/content.
 My Question: How can the single root directory for all HTML pages be configured? I found a IResourcePath and WebApplicationPath class, but no usage of it.
 2. So far there were several XML pipelines to insert a header block and a navigation block on the left via XSLT transformations. The navigation block has links to all pages in a subdirectory and is the same
 for all pages in this subdirectory and is defined in a XML file siteindex.xml. Question: Do I really have to write a class for every HTML page?
 That means about 200 classes that are all nearly the same! They all could extend a common base class and add nothing apart from their classname.
 I would be happy to write a class per subdirectory that could evaluate the siteindex.xml file and create a dynamic navigation component. This class could even be the same for all pages, if it could be
 configured. The HTML pages should remain unchanged. There should be no wicket:id in every HTML page for the header and navigation block, this should
 rather be done outside the pages. Maybe, I could write a XSLT preprocessor stage to achieve that. 3. There will be some Java classes to do real work, some
 protected pages visible only to registered users and a lot more which I believe Wicket is suited very well for. I hope anyone can give me some hints where to find additional
 information. Thanks in advance Matthias Albert ---
 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
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___
 Wicket-user mailing list Wicket-user@lists.sourceforge.net mailto:
Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user 
https://lists.sourceforge.net/lists/listinfo/wicket-user -- Guillermo Castro [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] Monterrey NL, Mexico http://www.javageek.org/
---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


SV: [Wicket-user] wicket:1.1.1 error unknown interface IOnChangeListener?

2006-03-15 Thread Nino Wael
Hi Johan
 
It worked to touch DropDownChoice class, thanks.
 
-regards Nino

-Oprindelig meddelelse- 
Fra: [EMAIL PROTECTED] på vegne af Johan Compagner 
Sendt: on 15-03-2006 14:47 
Til: wicket-user@lists.sourceforge.net 
Cc: 
Emne: Re: [Wicket-user] wicket:1.1.1 error unknown interface IOnChangeListener?



if you first touch a DropDownChoice class before you use a RadioChoice
is then everything fixed?

in 1.2 this is completely fixed because we register all interfaces 
upfront instead of when we touch a component class. 

johan



On 3/15/06, Nino Wael [EMAIL PROTECTED] wrote: 

Hi I've

created a control which essentially is a radio button and a 
listbox, where each click on the radio button populates the listbox with values.

I've done or rarther are trying to do this by using the wicket 
radiochoice and a wicket ListMultipleChoice. And are overiding the 
onSelectionChanged and the wantOnSelectionChangedNotifications, so that 
onSelectionChanged does what I want and wantOnSelectionChangedNotifications 
returns true. 

However now I get this error:

[PoolThread-9] ERROR wicket.RequestCycle - Unexpected runtime 
exception [page = null]

wicket.WicketRuntimeException: Attempt to access unknown 
interface IOnChangeListener 

And I am a little confussed on why I am getting this error 
since the RadioChoice already implements the interface so it should be known? 
Only other option is that the error conseals another error which is caused by 
something else? 

I have a similar control which has this functionality, instead 
of using a radiochoice onselectionchange it uses a button to make something 
similar. I'll be happy to send the code and log, or just give a more detailed 
explaination. 

-regards Nino






winmail.dat

[Wicket-user] Problems with panels on page reload.

2006-03-15 Thread Fabre Florian
Hi,

Using a adaptation of TabbedPanel ( wicket 1.2 ) with wicket 1.1 , I had
some problems with sub-panels update.
First I select a subpanel in a page that contains TabbedPanel and
multiple subpanels without using PanelCachingTab.
When I go back with the browser on a previous tab on same page and
reload , their constructors wont't be called and so I get this exception
from TabbedPanel :

wicket.markup.MarkupException: Unable to find component with id 'sub-panel' in 
[MarkupContainer [Component id = bankPanelList, page = 
sbs.pages.properties.PropertyPage, path = 
4:PropertyPanelList:sub-panel:tabbedPanel:sub-panel:bankPanelList.PanelList, 
isVisible = true, isVersioned = true]]. This means that you declared 
wicket:id=sub-panel in your markup, but that you either did not add the 
component to your page at all, or that the hierarchy does not match.
[markup = file:/mnt/shared/Dev/Java/bin/application/panels/PanelList.html, 
index = 2, current = 'span wicket:id=sub-panel class=tab-panel' (line 2, 
column 2)]
at wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:277)

Is there an option in wicket 1.1 that allows to recreate all panels of a page 
during reload,
or is this only possible in wicket 1.2 ?

Joe





---
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