Re: [Wicket-user] possible bug - wicket 1.2 beta2

2006-03-23 Thread Johan Compagner
you have to implement:protected String newValue(final String currentValue, final String replacementValue) {  return replacementValue; }from the attribute modifier and concat the currentValue with the old
On 3/23/06, Dorel Vaida [EMAIL PROTECTED] wrote:
Can anyone check if this is a bugthe following:label.add(new AttributeModifier(class, true, new Model(newClass)));will not add the class attribute to the label's span, but it will
replace it if it's there.---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] Writing to outputstream (Trying to do export)

2006-03-23 Thread Mats Norén
We solved it with a resource and passed an interface IDataSource to
the resource in the constructor and on getResourceState we made a call
for the datasource. It feels like better solution. Thanks for the
input.

On 3/22/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Yeah. Having many options is not always a good thing. Please note that
 request targets are not specifically meant for day-to-day end user
 usage. They are meant to more clearly define the request processing,
 and to have extensibility form a framework's perspective, e.g. to
 implement new things like Ajax etc. You may use request targets for
 your own purposes of course, and that is not bad practice either, but
 my preference would be to handle things like that like resources. Then
 you either have requests components (like pages and their variants
 like bookmarkable pages etc) or to resources (including variants like
 shared resources etc).

 Eelco


 On 3/22/06, Mats Norén [EMAIL PROTECTED] wrote:
  Even better. Thanks for the tip. There are so many options it's quite
  easy to get confused :)
 
  Mats
 
  On 3/22/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
   You don't need a PageRequestTarget as the page doesn't add any value
   here. I would use ResourceStreamRequestTarget and provide your content
   wrapped in a IResourceStream.
  
   Eelco
  
   On 3/22/06, Mats Norén [EMAIL PROTECTED] wrote:
On 3/21/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 why not just push a download request target into the request cycle? 
 it works
 for 1.2. search this list for excel
   
So if I were to use the request target approach I would do:
   
protected void onSubmit() {
 getRequestCycle().setRequestTarget(new PageRequestTarget(new
  ExportPage(data)););
 WebResponse wr=(WebResponse)getResponse();
 wr.setContentType(excel/ms-excel; name= + msExcelFilename);
 wr.setHeader(content-disposition,
   attachment;filename= + msExcelFilename);
}
   
   
   
   
   

 -Igor



 On 3/21/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
  That has to do with the page render strategy. A way around this is 
  to
  change that strategy, but a much better solution is to make your PO
  worksheet a resource instead of a page. Please check out
  wicket-stuff's JasperReports integration for an idea how to do this.
 
  Eelco
 
  On 3/21/06, Mats Norén [EMAIL PROTECTED] wrote:
   Hi,
   I'm trying to export a POI worksheet as a download link in my 
   wicket
 page.
   The link sets the responsepage to a download page in which
   trying to get the outputbuffer to write to. Only problem is that I
   keep getting this:
   java.lang.UnsupportedOperationException: Cannot get
 output stream on
   BufferedResponse
  
   I looked at the  code from the wicket-examples display-tag export 
   the
   only thing I do differently is the way the page is created.
  
   The weird thing is that I only get it if I instantiate my 
   response like:
   setResponsePage(new DownloadPage(data));
  
   if I do
   setResponsePage(DownloadPage.class) it behaves correctly...
  
   I need to be able to pass data into the class...what am I missing 
   here?
  
   /Mats
  
  
   ---
   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?cmdlnkkid0944bid$1720dat1642

[Wicket-user] AjaxFormComponentUpdatingBehavior and tag modification

2006-03-23 Thread Siddharth Agarwal
I add/modify the class attribute through AjaxFormComponentUpdatingBehavior. Is it too late by then? i ask this since it doesn't show up in the ajax response.

textField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
   @Override
   protected void onUpdate(AjaxRequestTarget target) {
if (!getFormComponent().isValid()) {
 getFormComponent().getMarkupAttributes().put(class,
   invalid);
} 
target.addComponent(getFormComponent());
   }

  });

But having it onComponentTag works ..

  textField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
   @Override
   protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(getFormComponent());
   }
   protected void onComponentTag(final ComponentTag tag){
super.onComponentTag(tag);
if (!getFormComponent().isValid()) {
 tag.put(class,invalid);
} else {
 tag.put(class,valid);
}   
   }

  });- Siddharth


[Wicket-user] question about date format for textfield

2006-03-23 Thread Jaime De La Jara
Hi, I've been trying to develop an application with wicket, but I don't  know how to customize the date format for a textfield. I'm using the  DatePickercomponent but I use a different format : dd-MM-, when I  submit the form an exception is thrown because the format is not  recognized, I tried to redefine the getConverter method as follows : TextField fecha = new TextField("fecha", Date.class){public IConverter getConverter() {  return new
 IConverter() {  public Object convert(Object o, Class c)  {  try{ 
  return  new  SimpleDateFormat("dd-MM-").parse((String)o);}catch(ParseException pex) 
   {return null;}} 
   public void setLocale(Locale loc){}public Locale getLocale(){return Locale.getDefault(); 
   }  };   }} ;but a ClassCastException is thrown, since the method is called twice,  once with a String value and once with a Date value. I don't know what  is going on, any help on this would be appreciated or a simpler way to  accomplish what I want to do
 . 
   Thanks.  
		Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.

Re: [Wicket-user] question about date format for textfield

2006-03-23 Thread Johan Compagner
you have to test to which class the converter wants to go to:  public Object convert(Object o, Class c)  {  try{
 if(c == String.class) {   return  new SimpleDateFormat(dd-MM-).format((Date)o);
 } else   return  new SimpleDateFormat(dd-MM-).parse((String)o);}
catch(ParseException pex) 
   {return null;}or test ofcourse if the value is an instanceof date or string.
We are planning to change the converter interface for the next version of wicket.Because the current on is a bit to confusing for most people. johanOn 3/23/06, 
Jaime De La Jara [EMAIL PROTECTED] wrote:
Hi, I've been trying to develop an application with wicket, but I don't  know how to customize the date format for a textfield. I'm using the  DatePickercomponent but I use a different format : dd-MM-, when I  submit the form an exception is thrown because the format is not  recognized, I tried to redefine the getConverter method as follows : 
TextField fecha = new TextField(fecha, Date.class){public IConverter getConverter() {  return new
 IConverter() {  public Object convert(Object o, Class c)  {  try{
 
  return  new  SimpleDateFormat(dd-MM-).parse((String)o);}catch(ParseException pex)
 
   {return null;}} 
   public void setLocale(Locale loc){}public Locale getLocale(){return 
Locale.getDefault(); 
   }  };   }} ;but a ClassCastException is thrown, since the method is called twice,  once with a String value and once with a Date value. I don't know what  is going on, any help on this would be appreciated or a simpler way to  accomplish what I want to do
 . 
   Thanks.  
		Blab-away for as little as 1¢/min. Make 
 PC-to-Phone Calls using Yahoo! Messenger with Voice.



Re: [Wicket-user] question about date format for textfield

2006-03-23 Thread Jaime De La Jara
Hi, thanks for the answer, but I don't understand why the convert  method is called twice. On the other hand, is there any simpler way to  work with a different date format?  Just a comment I can't see my post in the mailing list, does it take too long? or I'm missing something?Thanks,Jaime.  Johan Compagner [EMAIL PROTECTED] wrote:  you have to test to which class the converter wants to go to:  public Object convert(Object o, Class c)  { 
 try{if(c == String.class)  {return new
 SimpleDateFormat("dd-MM-").format((Date)o);}  elsereturn new SimpleDateFormat("dd-MM-").parse((String)o);}   
   catch(ParseException pex){return null;}  
 p;
  or test ofcourse if the value is an instanceof date or string.  We are planning to change the converter interface for the next version of wicket.Because the current on is a bit to confusing for most people. johanOn 3/23/06,   Jaime De La Jara [EMAIL PROTECTED] wrote:  Hi, I've been trying to develop an  application with wicket, but I don't know how to customize the date  format for a textfield. I'm using the DatePickercomponent but I use a  different format : dd-MM-, when I submit the form an exception is  thrown because the format is not recognized, I tried to redefine the  getConverter method as follows : TextField fe
 cha =
 new TextField("fecha", Date.class){public IConverter getConverter() {  return new IConverter() {  public Object convert(Object o, Class c) 
 {  try{ return  new   
   SimpleDateFormat("dd-MM-").parse((String)o);}catch(ParseException pex)  { 
   return null;}}public void setLocale(Locale loc) 
   {}public Locale getLocale(){return Locale.getDefault();   
 }  };   }} ;but a ClassCastException is thrown, since the method is called twice,  once with a String value and once with a Date value. I don't know what  is going on, any help on this would be appreciated or a simpler way to  accomplish what I want to do .  Thanks.  Blab-away for as little as 1¢/min. MakePC-to-Phone Calls using Yahoo! Messenger with Voice.
	
		Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.

Re: [Wicket-user] AjaxFormComponentUpdatingBehavior and tag modification

2006-03-23 Thread Igor Vaynberg
getMarkupAttributes() is transient, it doesnt live across requests thats why it doesnt show up.your solution is correct, but what i would do is add that as a separate behavior instead of merging it into the ajax behavior.
-IgorOn 3/23/06, Siddharth Agarwal [EMAIL PROTECTED] wrote:
I add/modify the class attribute through AjaxFormComponentUpdatingBehavior. Is it too late by then? i ask this since it doesn't show up in the ajax response.

textField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
   @Override
   protected void onUpdate(AjaxRequestTarget target) {
if (!getFormComponent().isValid()) {
 getFormComponent().getMarkupAttributes().put(class,
   invalid);
} 
target.addComponent(getFormComponent());
   }

  });

But having it onComponentTag works ..

  textField.add(new AjaxFormComponentUpdatingBehavior(onblur) {
   @Override
   protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(getFormComponent());
   }
   protected void onComponentTag(final ComponentTag tag){
super.onComponentTag(tag);
if (!getFormComponent().isValid()) {
 tag.put(class,invalid);
} else {
 tag.put(class,valid);
}   
   }

  });- Siddharth




Re: [Wicket-user] question about date format for textfield

2006-03-23 Thread Eelco Hillenius
IConverter is a generic interface which is called for the ingoing and
outgoing values. Last week, I added a convenience base class, and it's
usage looks like this (from FormInput):

add(new TextField(urlProperty, URL.class)
{
  public IConverter getConverter()
  {
return new SimpleConverterAdapter()
{

  public String toString(Object value)
  {
return value != null ? value.toString() : null;
  }

  public Object toObject(String value)
  {
try
{
  return new URL(value.toString());
}
catch (MalformedURLException e)
{
  throw new ConversionException(' + value + ' is not a valid URL);
}
  }
  };
}
});

Another option is to use the Converter class and register both

add(new TextField(urlProperty, URL.class)
{
  public IConverter getConverter()
  {
Converter c = new Converter();
DateConverter dc = new DateConverter();
dc.setDateFormat(...)
c.set(Date.class, dc);
StringConverter sc = new StringConverter();
sc.set(new DateToStringConverter(new SimpleDateFormat(...));
c.set(String.class, sc);
  }
}

OR use IConverter and an instanceof if/else.

Yeah, our conversion mechanism is clearly in need of some simplification.

Eelco


On 3/23/06, Jaime De La Jara [EMAIL PROTECTED] wrote:
 Hi, thanks for the answer, but I don't understand why the convert method is
 called twice. On the other hand, is there any simpler way to work with a
 different date format?
  Just a comment I can't see my post in the mailing list, does it take too
 long? or I'm missing something?

  Thanks,

  Jaime.



 Johan Compagner [EMAIL PROTECTED] wrote:

  you have to test to which class the converter wants to go to:

  public Object convert(Object o, Class c)
  {
try
 {
 if(c == String.class)
 {
 return new
 SimpleDateFormat(dd-MM-).format((Date)o);
  }
 else
 return new
 SimpleDateFormat(dd-MM-).parse((String)o);

}
catch(ParseException pex)
 {
   return null;
 } nbs p;


 or test ofcourse if the value is an instanceof date or string.

 We are planning to change the converter interface for the next version of
 wicket.
 Because the current on is a bit to confusing for most people.

 johan



 On 3/23/06, Jaime De La Jara [EMAIL PROTECTED] wrote:
 
 
  Hi, I've been trying to develop an application with wicket, but I don't
 know how to customize the date format for a textfield. I'm using the
 DatePickercomponent but I use a different format : dd-MM-, when I submit
 the form an exception is thrown because the format is not recognized, I
 tried to redefine the getConverter method as follows :
 
 
  TextField fe cha = new TextField(fecha, Date.class)
 
  {
   public IConverter getConverter()
   {
 return new IConverter()
 {
  public Object convert(Object o, Class c)
  {
try
 {
  return new
 
 SimpleDateFormat(dd-MM-).parse((String)o);
}
catch(ParseException pex)
 {
   return null;
 }
  }
 public void setLocale(Locale loc)
 {}
 public Locale getLocale()
  {
   return Locale.getDefault();
   }
  };
}
  } ;
 
  but a ClassCastException is thrown, since the method is called twice, once
 with a String value and once with a Date value. I don't know what is going
 on, any help on this would be appreciated or a simpler way to accomplish
 what I want to do .
 
  Thanks.
 
 


  
 Blab-away for as little as 1�/min. Make PC-to-Phone Calls using Yahoo!
 Messenger with Voice.






  
 Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.




[Wicket-user] Last chance to Vote for Wicket in the CCA'06

2006-03-23 Thread Martijn Dashorst
This is your last chance to vote in the SourceForge.net 2006 Community Choice Awards!Cast your vote for Wicket in the Development category (multiple browsers can be used :-) 
http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php
Don't postpone your vote: vote now!Martijn-- Cast your final vote for Wicket in the SourceForge.net 2006 Community Choice Awards!
http://www.wilsonresearch.com/2006/ostgawards06/ostgawards4.php


[Wicket-user] Adding Feedback messages

2006-03-23 Thread John Patterson
Hi,

I have added a FeedbackMessages instance to my session class so that I can add 
messages that will be displayed on the next page shown to the user.  After 
being displayed they will be cleared.

It looks to me as if the I should be able to override the 
newFeedbackMessageModel() method to return an instance that combines my 
session messages with any page specific messages.


FeedbackPanel feedback = new FeedbackPanel(feedback)
{
@Override
protected FeedbackMessagesModel 
newFeedbackMessagesModel()
{
return new FeedbackMessagesModel()
{
protected List processMessages(final 
List messages)
{
return messages;
}   
};
}
};

However the FeedbackMessagesModel is final.

The comment for processMessages() is:


/**
 * Override this method to post process to the FeedbackMessage list.
 * 
 * @param messages
 *List of sorted and filtered FeedbackMessages for further
 *processing
 * @return The processed FeedbackMessage list
 */

John


---
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] Adding Feedback messages

2006-03-23 Thread Eelco Hillenius
Igor is refactoring feedbackmessages currently. You might want to wait
for the result and/ or file a feature request.

Eelco


On 3/23/06, John Patterson [EMAIL PROTECTED] wrote:
 Hi,

 I have added a FeedbackMessages instance to my session class so that I can add
 messages that will be displayed on the next page shown to the user.  After
 being displayed they will be cleared.

 It looks to me as if the I should be able to override the
 newFeedbackMessageModel() method to return an instance that combines my
 session messages with any page specific messages.


 FeedbackPanel feedback = new FeedbackPanel(feedback)
 {
 @Override
 protected FeedbackMessagesModel 
 newFeedbackMessagesModel()
 {
 return new FeedbackMessagesModel()
 {
 protected List processMessages(final 
 List messages)
 {
 return messages;
 }
 };
 }
 };

 However the FeedbackMessagesModel is final.

 The comment for processMessages() is:


 /**
  * Override this method to post process to the FeedbackMessage list.
  *
  * @param messages
  *List of sorted and filtered FeedbackMessages for further
  *processing
  * @return The processed FeedbackMessage list
  */

 John


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


[Wicket-user] CompoundPropertyModel in 1.2-beta2

2006-03-23 Thread Steve Knight
Before I upgraded to Wicket 1.2, I was doing something like this:CompoundPropertyModel model = new CompoundPropertyModel(summary);add(new Label(surfaceCount, model));add(new Label(unknownCount, model));
And Wicket would properly bind the properties of my model to the labels. However, after upgrading to Wicket 1.2-beta2, this no longer works and instead of binding the individual properties of my model class, it simply uses toString(), which I assume is the default when it can't find the properties.
If I use this, it works as expected:CompoundPropertyModel model = new CompoundPropertyModel(summary);setModel(model);add(new Label(surfaceCount, model));add(new Label(unknownCount));
So, I guess I'm a little confused. Was I not using the CompundPropertyModel correctly before?Steve


Re: [Wicket-user] Adding Feedback messages

2006-03-23 Thread Igor Vaynberg
this is the exact usecase i am working on, should be done by tonight at some point.

-Igor
On 3/23/06, John Patterson [EMAIL PROTECTED] wrote:
Hi,I have added a FeedbackMessages instance to my session class so that I can addmessages that will be displayed on the next page shown to the user.Afterbeing displayed they will be cleared.It looks to me as if the I should be able to override the
newFeedbackMessageModel() method to return an instance that combines mysession messages with any page specific messages.FeedbackPanel
feedback = new FeedbackPanel(feedback){@Overrideprotected
FeedbackMessagesModel newFeedbackMessagesModel(){return
new FeedbackMessagesModel(){protected
List processMessages(final List messages){return
messages;}};}};However the FeedbackMessagesModel is final.The comment for processMessages() is:
/** * Override this method to post process to the FeedbackMessage list. * * @param messages
*List
of sorted and filtered FeedbackMessages for further
*processing * @return The processed FeedbackMessage list */John---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Fwd: [ wicket-Bugs-1442757 ] Ajax errors in a Border

2006-03-23 Thread Juergen Donnerstag
When you override you MUST override remove, replace and especially
autoAdd as well. Because this is far to error prone, they are all made
final in head (I hope they still are). If something doesn't work as
expected, please prepare a unit test (see src/test) and I'll look
after it.

Juergen

On 3/24/06, Geoffrey Ellis [EMAIL PROTECTED] wrote:

 I have experienced the same error.
 It is because the border is not being added correctly.  But it WILL happen
 when you added it as described in the wiki
 http://www.wicket-wiki.org.uk/wiki/index.php/Migrate-1.2
 The page renders correctly however when an ajax request is send the markup
 id does not matching the component map id. Then an infinite loop occurs in
 public abstract class Component implements Serializable
 private final MarkupStream initializeMarkupStream()
 
   while (markupStream == null)

 Presently my work around is to have my applications base page class from
 which all pages are entered from include not just
 border = new foo.Border(border);
 border.setTransparentResolver(true);
 super.add(border);
 as show in the wicket but I override the add with

 public MarkupContainer add(Component arg0) {
 if(border==null)
 return super.add(arg0);
 else{
 border.add(arg0);
 return this;
 }
 }


 The infinite loop needs to be resolved/trapped and I'm not sure that
 wicket.markup.html.border.Border is behaving as expected since my override
 with the add is part of how the border worked in 1.1 which perhaps
 border.setTransparentResolver(true); was supposed to change/handle???

 --
 View this message in context: 
 http://www.nabble.com/Fwd%3A-wicket-Bugs-1442757-Ajax-errors-in-a-Border-t1241784.html#a3565528
 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



---
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] Fwd: [ wicket-Bugs-1442757 ] Ajax errors in a Border

2006-03-23 Thread Igor Vaynberg
i just made add() final again.-IgorOn 3/23/06, Juergen Donnerstag [EMAIL PROTECTED]
 wrote:When you override you MUST override remove, replace and especially
autoAdd as well. Because this is far to error prone, they are all madefinal in head (I hope they still are). If something doesn't work asexpected, please prepare a unit test (see src/test) and I'll lookafter it.
JuergenOn 3/24/06, Geoffrey Ellis [EMAIL PROTECTED] wrote: I have experienced the same error. It is because the border is not being added correctly.But it WILL happen
 when you added it as described in the wiki http://www.wicket-wiki.org.uk/wiki/index.php/Migrate-1.2 The page renders correctly however when an ajax request is send the markup
 id does not matching the component map id. Then an infinite loop occurs in public abstract class Component implements Serializable private final MarkupStream initializeMarkupStream() 
 while (markupStream == null) Presently my work around is to have my applications base page class from which all pages are entered from include not just border = new 
foo.Border(border); border.setTransparentResolver(true); super.add(border); as show in the wicket but I override the add with public MarkupContainer add(Component arg0) {
 if(border==null) return super.add(arg0); else{ border.add(arg0); return this;
 } } The infinite loop needs to be resolved/trapped and I'm not sure that wicket.markup.html.border.Border is behaving as expected since my override
 with the add is part of how the border worked in 1.1 which perhaps border.setTransparentResolver(true); was supposed to change/handle??? -- View this message in context: 
http://www.nabble.com/Fwd%3A-wicket-Bugs-1442757-Ajax-errors-in-a-Border-t1241784.html#a3565528 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
---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding Feedback messages

2006-03-23 Thread Igor Vaynberg
first pass is doneyou have Session.info/error that work the same as Component.info/errorthe messages in session are cleared out at the end of request /if/ they have been marked rendered (which is done when they are displayed using a feedbackpanel)
we can add more features as we explore the usecase.-IgorOn 3/23/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:this is the exact usecase i am working on, should be done by tonight at some point.


-Igor
On 3/23/06, John Patterson 
[EMAIL PROTECTED] wrote:

Hi,I have added a FeedbackMessages instance to my session class so that I can addmessages that will be displayed on the next page shown to the user.Afterbeing displayed they will be cleared.It looks to me as if the I should be able to override the
newFeedbackMessageModel() method to return an instance that combines mysession messages with any page specific messages.FeedbackPanel
feedback = new FeedbackPanel(feedback){@Overrideprotected
FeedbackMessagesModel newFeedbackMessagesModel(){return
new FeedbackMessagesModel(){protected
List processMessages(final List messages){return
messages;}};}};However the FeedbackMessagesModel is final.The comment for processMessages() is:
/** * Override this method to post process to the FeedbackMessage list. * * @param messages
*List
of sorted and filtered FeedbackMessages for further
*processing * @return The processed FeedbackMessage list */John---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!

http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list

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





[Wicket-user] feedback messages

2006-03-23 Thread Igor Vaynberg
just out of curioisity, is anyone out there using feedback methods other then info/error ?-Igor


Re: [Wicket-user] CompoundPropertyModel in 1.2-beta2

2006-03-23 Thread karthik Guru
great explanation on how CompoundPropertyModel works...

-- Forwarded message --
From: Igor Vaynberg [EMAIL PROTECTED]
Date: Jan 19, 2006 6:36 AM
Subject: Re: [Wicket-user] IModel
To: wicket-user@lists.sourceforge.net


the CompoundPropertyModel is one of the trickest to understand. in its
essence it is a very cool model that can save you a lot of work.

basically what it allows you to do is use the component id as the
property-path expression of your model as well as allow child
components to user parent's model.

for example...page constructor...

Person p=new Person();

Form form=new Form(form, new CompoundPropertyModel( p ));
form.add(new TextField(name));
form.add(new TextField( address.line1));
form.add(new TextField(address.zip));

notice that the text field components ive added to the form do not
have a model associated with them. when a component does not have a
model (model==null) it will try to search up its hierarchy to find any
parent's model that implements ICompoundModel interface, and if it
finds it it will use that as its own model.

so in essense every textfield i added to the form will use the form's
compoundpropertymodel as its own because its the first in the upwords
hierarchy that implements ICompoundModel

so when the textfield needs to retrieve the value it will ask its
model. the getter/setter in the model is implemented with a Component
param: IModel.getObject(Component c), this may seem strange at first,
but it allows the compound property model to function.

so what the compound property model getter looks like is this

getObject(Component c) {
   Object nestedObject=getnestedmodel(); // in our case retrieves the
person object
  // property resolver is a helper that evaluates ognl-like expressions
 Object value=PropertyResolver(c.getId(), nestedObject());
 }

the key above is that the property resolver's expression is the
component id. notice in the form add(new TextField(address.zip));
the component's id is the property-expression that will be used on the
person object.

so this is a really great shortcut when building forms
without it you would have to do something like this:
add(new TextField(zip, new PropertyModel(form.getModelObject(),
address.zip)));
which is much longer.

there are more uses but this is the more common one. it also allows
one to create panels and populate the form very quickly. ie, i can
group those form components into a panel and if i have a form bean
with two person objects i can represent both of those with an instance
of my panel and its easy to connect them to the actual model using
compound models.

wicket also supports model chaining. so per your example you wanted to
edit person which is a property of the page. to do that i would change
the example above like this

Form form=new Form(id, new CompoundPropertyModel(new
PropertyModel(this, person)));

i hope you are still awake.


-Igor



On 3/24/06, Steve Knight [EMAIL PROTECTED] wrote:
 Before I upgraded to Wicket 1.2, I was doing something like this:

 CompoundPropertyModel model = new CompoundPropertyModel(summary);
 add(new Label(surfaceCount, model));
 add(new Label(unknownCount, model));

 And Wicket would properly bind the properties of my model to the labels.
 However, after upgrading to Wicket 1.2-beta2, this no longer works and
 instead of binding the individual properties of my model class, it simply
 uses toString(), which I assume is the default when it can't find the
 properties.

 If I use this, it works as expected:

 CompoundPropertyModel model = new CompoundPropertyModel(summary);
 setModel(model);
 add(new Label(surfaceCount, model));
 add(new Label(unknownCount));

 So, I guess I'm a little confused.  Was I not using the CompundPropertyModel
 correctly before?

 Steve





--
 -- karthik --


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


Re: [Wicket-user] CompoundPropertyModel in 1.2-beta2

2006-03-23 Thread Johan Compagner
yes this is wrong.I don't know why that worked in 1.1 because i also believe it shouldn't have worked there also but maybe this behaviour was onlyintroduced in 1.2If you give the component its onw model. Then that component is the Root model object 
And if that is the case a getModelObject() call to that component will return the real object inside the compoundmodel.this way you can get the real object (summary) back. Else this wouldn't be possible.you can do stuff like this:
Form form = new Form(x, new CompoundPropertyModel(new Person())form.add(new TextField(name))  this displays/edits the name property of the personform.submit(){ form.getModelObject
()  this will return the person itself so that you can save it.}johanOn 3/23/06, Steve Knight 
[EMAIL PROTECTED] wrote:Before I upgraded to Wicket 
1.2, I was doing something like this:CompoundPropertyModel model = new CompoundPropertyModel(summary);add(new Label(surfaceCount, model));add(new Label(unknownCount, model));
And Wicket would properly bind the properties of my model to the labels. However, after upgrading to Wicket 1.2-beta2, this no longer works and instead of binding the individual properties of my model class, it simply uses toString(), which I assume is the default when it can't find the properties.
If I use this, it works as expected:CompoundPropertyModel model = new CompoundPropertyModel(summary);setModel(model);add(new Label(surfaceCount, model));add(new Label(unknownCount));
So, I guess I'm a little confused. Was I not using the CompundPropertyModel correctly before?Steve




Re: [Wicket-user] displaying java.sql.Timestamp

2006-03-23 Thread Johan Compagner
add youre own type converter to the Converter of wicket for timestamp.classpublic ITypeConverter set(final Class c, final ITypeConverter converter)johanOn 3/23/06, 
Frank Silbermann [EMAIL PROTECTED] wrote:

















I have an application that displays an
arbitrary java.sql.ResultSet in a DataTable. To read each column value I simply call "ResultSet.getObject(index)"
varying index over the number of columns as given in the
java.sql.ResultSetMetadata. I rely
on the DataTable to create sensible display strings when displaying any of the
basic RDBMS data types.



When the column type is a
java.sql.Timestamp, Java's built-in .toString() method displays a date
and time in a reasonable format (-mm-dd hh.mm.ss.xxx"). However, it seems that DataTable does
not rely on Java's .toString() method; it displays the date portion only
when the datatype is java.sql.Timestamp.



My work-around is to check the type of each
Object I read, and if it is java.sql.Timestamp my IDataProvider computes myResultSet.getTimestamp(index).toString()
instead of simply providing the result of myResultSet.getObject() as I do for
all the other types. Is this my
best solution, or is there a way to configure Wicket or DataTable to use Java's
default .toString() method when displaying a java.sql.Timestamp?