Re: Populate form according to selected item in dropdownchoice

2007-11-26 Thread Dipu Seminlal
there are two ways to do it

override the wantOnSelectionChangedNotifications of the user dropdown
to return true and override onSelectionChanged to do what you want,
but this will result in server round trips ( refer the java of
DropDownChoice )

or use an AjaxFormComponentUpdatingBehavior on the onChange event of
the dropdown.

regards
Dipu

On Nov 26, 2007 7:14 AM, tsuresh [EMAIL PROTECTED] wrote:

 Hello wicketeers,
 I have a form to edit the attributes of User. User has the attributes
 username, mail and role.I have a dropdownchoice filled with list of users.
 When I select the user his mail should be displayed in textfield and his
 role should be displayed in dropdownchoice. And i should be able to edit his
 mail and role. I have already made the form to fill the first drop down
 choice.I have made function view(username) in User class which helps in
 viewing attributes of the user(user selected in dropdown), But I have no
 idea to populate the remaining form components.How to do this? My code for
 form is as below:

 public UserEdit(){

 User user= new user();
 CompoundPropertyModel userEditModel = new
 CompoundPropertyModel(user);
 Form form = new userEditForm(user,userEditModel);
 add(form);
 add(new FeedbackPanel(feedback).setOutputMarkupId(true));
 DropDownChoice ddc = null;
 try{
 ddc = new DropDownChoice(username,user.list());
 }catch(SQLException e){
 String err = e.getMessage();
 }

 TextField mailComp = new TextField(mail);
 DropDownChoice roleDdc =null;
 try{
 roleDdc = new DropDownChoice(role.name,r.list());
 }catch(SQLException e){
 String err = e.getMessage();
 }
 form.add(ddc);
 form.add(mailComp);
 form.add(roleDdc);
 }

 class UserEditForm extends Form {
 public UserEditForm(String id,IModel model) {
 super(id,model);
 }
 --
 View this message in context: 
 http://www.nabble.com/Populate-form-according-to-selected-item-in-dropdownchoice-tf4873352.html#a13944776
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



wicket File downlaod

2007-11-26 Thread mbelarbi

Hi,

I have some code that generates a pdf report file (using jasper reports).
This file is stored somewhere in the project.

What I need to do is be able to provide a link which makes that file
available for download when clicked (downloadLink?). How do i do this using
wicket? and are there any examples.

I've tried this:

File pdfFile = new File(test.txt);
DownloadLink dLink = new DownloadLink(dLink, pdfFile);


This does exactly what i am looking for (bring up a file for download), but
this file is empty, it has no content. This pdf file resides in the same
hierarchy as the source code file.
-- 
View this message in context: 
http://www.nabble.com/wicket-File-downlaod-tf4874269.html#a13946961
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket File downlaod

2007-11-26 Thread mbelarbi

opps, sorry what i meant to write was:
File pdfFile = new File(test.pdf);

But this doesn't really change much and the problem still remains that the
file is empty (whether txt or pdf).


mbelarbi wrote:
 
 Hi,
 
 I have some code that generates a pdf report file (using jasper reports).
 This file is stored somewhere in the project.
 
 What I need to do is be able to provide a link which makes that file
 available for download when clicked (downloadLink?). How do i do this
 using wicket? and are there any examples.
 
 I've tried this:
 
 File pdfFile = new File(test.txt);
 DownloadLink dLink = new DownloadLink(dLink, pdfFile);
 
 
 This does exactly what i am looking for (bring up a file for download),
 but this file is empty, it has no content. This pdf file resides in the
 same hierarchy as the source code file.
 

-- 
View this message in context: 
http://www.nabble.com/wicket-File-downlaod-tf4874269.html#a13946991
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket File downlaod

2007-11-26 Thread kent lai

The file really ought to reside in another location, but anyway...
I think new File(test.pdf) would actually indicate a file named  
test.pdf, at the current working directory of the application server.
Output the file's path with getCanoicalPath/getAbsolutePath (or  
something along that line) to verify that the path of the pdf is  
correct first.



On 26 Nov 2007, at 6:07 PM, mbelarbi wrote:



opps, sorry what i meant to write was:
File pdfFile = new File(test.pdf);

But this doesn't really change much and the problem still remains  
that the

file is empty (whether txt or pdf).


mbelarbi wrote:


Hi,

I have some code that generates a pdf report file (using jasper  
reports).

This file is stored somewhere in the project.

What I need to do is be able to provide a link which makes that file
available for download when clicked (downloadLink?). How do i do this
using wicket? and are there any examples.

I've tried this:

File pdfFile = new File(test.txt);
DownloadLink dLink = new DownloadLink(dLink, pdfFile);


This does exactly what i am looking for (bring up a file for  
download),
but this file is empty, it has no content. This pdf file resides  
in the

same hierarchy as the source code file.



--
View this message in context: http://www.nabble.com/wicket-File- 
downlaod-tf4874269.html#a13946991

Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket File downlaod

2007-11-26 Thread Florian Sperber
Sometime ago this was answered on the list but i cannot find it right 
now :-)


Maybe the following snippets will help you (it's wicket 1.2.6):

WebResource export = new WebResource() {
private static final long serialVersionUID = 1L;

@Override
public IResourceStream getResourceStream() {
try {
return new FileService(f).getResourceStream();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void setHeaders(WebResponse response) {
super.setHeaders(response);
response.
setAttachmentHeader(attachment.getOriginalFilename());
}
};
export.setCacheable(false);

ResourceLink dlLink = new ResourceLink(attachmentLink, export);

...

public class FileService {

private File file;
private String outputName;
private String contentType = ;

public FileService(File file) {
this.file = file;
this.outputName = this.file.getName();
}

/**
 * sets the output name and returns itself
 * @param outputName
 * @return
 */
public FileService setOutputName(String outputName) {
this.outputName = outputName;
return FileService.this;
}

/**
 * sets the content type and returns itself
 * @param contentType
 * @return
 */
public FileService setContentType(String contentType) {
this.contentType = contentType;
return FileService.this;
}


public IResourceStream getResourceStream() throws IOException {

FileInputStream fi = new FileInputStream(this.file);

return new IResourceStreamImpl(fi, this.contentType, 
this.file.length());
}

/**
 * wrapper which creates the necessary [EMAIL PROTECTED] 
ResourceStreamRequestTarget}
 * @return
 * @throws IOException
 */
	public ResourceStreamRequestTarget getResourceStreamRequestTarget() 
throws IOException {

return new 
ResourceStreamRequestTarget(this.getResourceStream()) {
public String getFileName() {
return (outputName);
}
};
}

}

...
public class IResourceStreamImpl implements IResourceStream {
private static final long serialVersionUID = 1L;

private Locale locale = null;
private String contentType = null;
private InputStream inputStream = null;
private long size;

/**
 * @param fileInputStream
 * @param contentType
 * @param file
 */
public IResourceStreamImpl(InputStream inputStream,
String contentType, long size) {
this.inputStream = inputStream;
this.size = size;
this.contentType = contentType;
}

public void close() throws IOException {
this.inputStream.close();
}

	public InputStream getInputStream() throws 
ResourceStreamNotFoundException {

return this.inputStream;
}

public String getContentType() {
return (this.contentType);
}

public Locale getLocale() {
return (this.locale);
}

public long length() {
return this.size;
}

public void setLocale(Locale locale) {
this.locale = locale;
}

public Time lastModifiedTime() {
return null;
}

}





mbelarbi schrieb:

opps, sorry what i meant to write was:
File pdfFile = new File(test.pdf);

But this doesn't really change much and the problem still remains that the
file is empty (whether txt or pdf).


mbelarbi wrote:

Hi,

I have some code that generates a pdf report file (using jasper reports).
This file is stored somewhere in the project.

What I need to do is be able to provide a link which makes that file
available for download when clicked (downloadLink?). How do i do this
using wicket? and are there any examples.

I've tried this:

File pdfFile = new File(test.txt);
DownloadLink dLink = new DownloadLink(dLink, pdfFile);


This does exactly what i am looking for (bring up a file for download),
but this file is empty, it has no content. This pdf file resides in the
same hierarchy as the source code file.






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket File downlaod

2007-11-26 Thread mbelarbi

thanks Kent lai, a system print for the file's getCanoicalPath seemed to show
that the file path i was passing in was incorrect. Now it's resolved.

Thanks



kent lai wrote:
 
 The file really ought to reside in another location, but anyway...
 I think new File(test.pdf) would actually indicate a file named  
 test.pdf, at the current working directory of the application server.
 Output the file's path with getCanoicalPath/getAbsolutePath (or  
 something along that line) to verify that the path of the pdf is  
 correct first.
 
 
 On 26 Nov 2007, at 6:07 PM, mbelarbi wrote:
 

 opps, sorry what i meant to write was:
 File pdfFile = new File(test.pdf);

 But this doesn't really change much and the problem still remains  
 that the
 file is empty (whether txt or pdf).


 mbelarbi wrote:

 Hi,

 I have some code that generates a pdf report file (using jasper  
 reports).
 This file is stored somewhere in the project.

 What I need to do is be able to provide a link which makes that file
 available for download when clicked (downloadLink?). How do i do this
 using wicket? and are there any examples.

 I've tried this:

 File pdfFile = new File(test.txt);
 DownloadLink dLink = new DownloadLink(dLink, pdfFile);


 This does exactly what i am looking for (bring up a file for  
 download),
 but this file is empty, it has no content. This pdf file resides  
 in the
 same hierarchy as the source code file.


 -- 
 View this message in context: http://www.nabble.com/wicket-File- 
 downlaod-tf4874269.html#a13946991
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/wicket-File-downlaod-tf4874269.html#a13947358
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Ajax Memory Leak in IE

2007-11-26 Thread picknick

I'm using a DataView-Table with an AjaxPagingNavigator listing 100 items per
page. Each item has an AjaxLink to a detail view. When paging through the
list the memory usage of the IE is increased by about 500 KB per page.
Without the ajax link it's doing well.

AjaxDebugMode is disabled. Configuration is set to deployment. Currently I'm
using Wicket 1.3.0-rc1. I tried Wicket 1.2.6, which is working fine.

Any ideas?

Nick
-- 
View this message in context: 
http://www.nabble.com/Ajax-Memory-Leak-in-IE-tf4874611.html#a13947927
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket File downlaod

2007-11-26 Thread German Morales
Hi,

I have never used jasper reports, but a quick search shows me that you can
also generate the file as a byte[] in memory:

http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperExportManager.html#exportReportToPdf(net.sf.jasperreports.engine.JasperPrint)

Class JasperExportManager:
public static byte[] exportReportToPdf(JasperPrint jasperPrint) throws
JRException

In such case you could avoid all the trouble with files by using a
DynamicWebResource instead of the WebResource described by Florian.

Here a quick example:

   public class MyDynamicWebResource extends DynamicWebResource {
  protected ResourceState getResourceState() {
 return new ResourceState() {
public String getContentType() {
   return application/pdf;
}

public byte[] getData() {
   return generatePDFDataUsingJasperOrWhatever();
}
 };
  }

  // this is optional i think
  protected void setHeaders(WebResponse cResponse) {
 super.setHeaders(cResponse);

 cResponse.setAttachmentHeader(test.pdf);
  }
   }

For me this is the most convenient thing to do if you don't need to store
the files for later usage.

Bye,

German


It seems that Florian Sperber wrote:
 Sometime ago this was answered on the list but i cannot find it right
 now :-)

 Maybe the following snippets will help you (it's wicket 1.2.6):

 WebResource export = new WebResource() {
   private static final long serialVersionUID = 1L;

   @Override
   public IResourceStream getResourceStream() {
   try {
   return new FileService(f).getResourceStream();
   } catch (IOException e) {
   e.printStackTrace();
   }
   return null;
   }
   @Override
   protected void setHeaders(WebResponse response) {
   super.setHeaders(response);
   response.
   setAttachmentHeader(attachment.getOriginalFilename());
   }
 };
 export.setCacheable(false);

 ResourceLink dlLink = new ResourceLink(attachmentLink, export);

 ...

 public class FileService {

   private File file;
   private String outputName;
   private String contentType = ;

   public FileService(File file) {
   this.file = file;
   this.outputName = this.file.getName();
   }

   /**
* sets the output name and returns itself
* @param outputName
* @return
*/
   public FileService setOutputName(String outputName) {
   this.outputName = outputName;
   return FileService.this;
   }

   /**
* sets the content type and returns itself
* @param contentType
* @return
*/
   public FileService setContentType(String contentType) {
   this.contentType = contentType;
   return FileService.this;
   }


   public IResourceStream getResourceStream() throws IOException {

   FileInputStream fi = new FileInputStream(this.file);

   return new IResourceStreamImpl(fi, this.contentType,
 this.file.length());
   }

   /**
* wrapper which creates the necessary [EMAIL PROTECTED]
 ResourceStreamRequestTarget}
* @return
* @throws IOException
*/
   public ResourceStreamRequestTarget getResourceStreamRequestTarget()
 throws IOException {
   return new 
 ResourceStreamRequestTarget(this.getResourceStream()) {
   public String getFileName() {
   return (outputName);
   }
   };
   }

 }

 ...
 public class IResourceStreamImpl implements IResourceStream {
   private static final long serialVersionUID = 1L;

   private Locale locale = null;
   private String contentType = null;
   private InputStream inputStream = null;
   private long size;

   /**
* @param fileInputStream
* @param contentType
* @param file
*/
   public IResourceStreamImpl(InputStream inputStream,
   String contentType, long size) {
   this.inputStream = inputStream;
   this.size = size;
   this.contentType = contentType;
   }

   public void close() throws IOException {
   this.inputStream.close();
   }

   public InputStream getInputStream() throws
 ResourceStreamNotFoundException {
   return this.inputStream;
   }

   public String getContentType() {
   return (this.contentType);
   }

   public Locale getLocale() {
   return (this.locale);
   }

   public long length() {
   return this.size;
   }

   public void setLocale(Locale locale) {
   this.locale = locale;
   }

   public Time lastModifiedTime() {
   return 

Re: Wicket + OSGI + Session

2007-11-26 Thread Daniel Stoch
Hi,

You have written: This causes problems with session
serialization/deserialization in an OSGI environment. I don't know is
it a related problem, but I have the following situation (of course
app is running in OSGi environment):
I have a page with DataView displaying products list with images. Each
product has AjaxLink, when I click this link product should be
selected (highlighted). But sometimes after click I have an error with
serialization:

Root cause:
java.io.StreamCorruptedException: invalid type code: 01
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
 at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
 at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:392)
 at 
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:229)
 at 
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:604)
 at 
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:318)
 at org.apache.wicket.Session.getPage(Session.java:741)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:443)
 at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1248)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:343)
 at 
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)

Complete stack:
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
 at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:406)
 at 
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:229)
 at 
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:604)
 at 
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:318)
 at org.apache.wicket.Session.getPage(Session.java:741)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:443)
 at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1248)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:343)

Do you have similar problems with serialization/deserialization?

PS. The strange thing is that in Firefox this is an undeterministic
error but in Opera it occurs every time I've clicked the link.

Best regards,
Daniel

On Nov 21, 2007 10:39 AM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Hi,

 When Wicket pages are serialized/deserialized to the page store, they
 are serialized/deserialized using the IObjectStreamFactory set in the
 Objects class, and (in trunk) the DefaultObjectStreamFactory overrides
 the resolveClass method of ObjectInputStream to consult the
 application's IClassResolver. This is all good. :-)

 But, the problem is the session itself. The ObjectIn/OutputStreams that
 the session is serialized to and deserialized from are the ones provided
 by the container, which do not use the IObjectStreamFactory. This causes
 problems with session serialization/deserialization in an OSGI environment.

 I'm not really deeply into the Wicket code, but it seems to me the only
 way to really solve this is to make sure the Wicket session is not
 directly put in the HTTP session, but instead of it, a SessionHolder
 object with a reference to the Wicket session. The SessionHolder can
 have readObject/writeObject methods which just read/write the session as
 a byte stream using Objects.byteArrayToObject/objectToByteArray.

 That way, when the Session is deserialized the IClassResolver is
 consulted (and if the user provides their own IObjectStreamFactory
 implementation, it too is used).

 Any comments?

 Regards,
 Sebastiaan


-
To unsubscribe, e-mail: [EMAIL 

How can i test if a modal window is presented

2007-11-26 Thread Newgro

Hi *,

i would like to test (WicketTester) if my modal error window is displayed. I
tried isVisible, but it's always true.
While debugging i saw that if the window has to be displayed, the
contentpanel has a generatedMarkupId  0.
But this property is not accessible.

So how can i know that a modal window is displayed?

Thanks 4 your help
Per
-- 
View this message in context: 
http://www.nabble.com/How-can-i-test-if-a-modal-window-is-presented-tf4874626.html#a13947958
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Populate form according to selected item in dropdownchoice

2007-11-26 Thread Gwyn Evans
Indeed - See the Wiki for more info, e.g.
http://cwiki.apache.org/WICKET/dropdownchoice-examples.html

/Gwyn

On 26/11/2007, Dipu Seminlal [EMAIL PROTECTED] wrote:
 there are two ways to do it

 override the wantOnSelectionChangedNotifications of the user dropdown
 to return true and override onSelectionChanged to do what you want,
 but this will result in server round trips ( refer the java of
 DropDownChoice )

 or use an AjaxFormComponentUpdatingBehavior on the onChange event of
 the dropdown.

 regards
 Dipu

 On Nov 26, 2007 7:14 AM, tsuresh [EMAIL PROTECTED] wrote:
 
  Hello wicketeers,
  I have a form to edit the attributes of User. User has the attributes
  username, mail and role.I have a dropdownchoice filled with list of users.
  When I select the user his mail should be displayed in textfield and his
  role should be displayed in dropdownchoice. And i should be able to edit his
  mail and role. I have already made the form to fill the first drop down
  choice.I have made function view(username) in User class which helps in
  viewing attributes of the user(user selected in dropdown), But I have no
  idea to populate the remaining form components.How to do this? My code for
  form is as below:
 
  public UserEdit(){
 
  User user= new user();
  CompoundPropertyModel userEditModel = new
  CompoundPropertyModel(user);
  Form form = new userEditForm(user,userEditModel);
  add(form);
  add(new FeedbackPanel(feedback).setOutputMarkupId(true));
  DropDownChoice ddc = null;
  try{
  ddc = new DropDownChoice(username,user.list());
  }catch(SQLException e){
  String err = e.getMessage();
  }
 
  TextField mailComp = new TextField(mail);
  DropDownChoice roleDdc =null;
  try{
  roleDdc = new DropDownChoice(role.name,r.list());
  }catch(SQLException e){
  String err = e.getMessage();
  }
  form.add(ddc);
  form.add(mailComp);
  form.add(roleDdc);
  }
 
  class UserEditForm extends Form {
  public UserEditForm(String id,IModel model) {
  super(id,model);
  }
  --
  View this message in context: 
  http://www.nabble.com/Populate-form-according-to-selected-item-in-dropdownchoice-tf4873352.html#a13944776
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Download Wicket 1.3.0-rc1 now! - http://wicketframework.org

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket File downlaod

2007-11-26 Thread mbelarbi

Yes I agree, I will later move to providing these reports as streams on the
fly instead of storing them, since there will be many many files generated
so storage could be a problem in the long run.


German Morales-2 wrote:
 
 Hi,
 
 I have never used jasper reports, but a quick search shows me that you can
 also generate the file as a byte[] in memory:
 
 http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperExportManager.html#exportReportToPdf(net.sf.jasperreports.engine.JasperPrint)
 
 Class JasperExportManager:
 public static byte[] exportReportToPdf(JasperPrint jasperPrint) throws
 JRException
 
 In such case you could avoid all the trouble with files by using a
 DynamicWebResource instead of the WebResource described by Florian.
 
 Here a quick example:
 
public class MyDynamicWebResource extends DynamicWebResource {
   protected ResourceState getResourceState() {
  return new ResourceState() {
 public String getContentType() {
return application/pdf;
 }
 
 public byte[] getData() {
return generatePDFDataUsingJasperOrWhatever();
 }
  };
   }
 
   // this is optional i think
   protected void setHeaders(WebResponse cResponse) {
  super.setHeaders(cResponse);
 
  cResponse.setAttachmentHeader(test.pdf);
   }
}
 
 For me this is the most convenient thing to do if you don't need to store
 the files for later usage.
 
 Bye,
 
 German
 
 
 It seems that Florian Sperber wrote:
 Sometime ago this was answered on the list but i cannot find it right
 now :-)

 Maybe the following snippets will help you (it's wicket 1.2.6):

 WebResource export = new WebResource() {
  private static final long serialVersionUID = 1L;

  @Override
  public IResourceStream getResourceStream() {
  try {
  return new FileService(f).getResourceStream();
  } catch (IOException e) {
  e.printStackTrace();
  }
  return null;
  }
  @Override
  protected void setHeaders(WebResponse response) {
  super.setHeaders(response);
  response.
  setAttachmentHeader(attachment.getOriginalFilename());
  }
 };
 export.setCacheable(false);

 ResourceLink dlLink = new ResourceLink(attachmentLink, export);

 ...

 public class FileService {

  private File file;
  private String outputName;
  private String contentType = ;

  public FileService(File file) {
  this.file = file;
  this.outputName = this.file.getName();
  }

  /**
   * sets the output name and returns itself
   * @param outputName
   * @return
   */
  public FileService setOutputName(String outputName) {
  this.outputName = outputName;
  return FileService.this;
  }

  /**
   * sets the content type and returns itself
   * @param contentType
   * @return
   */
  public FileService setContentType(String contentType) {
  this.contentType = contentType;
  return FileService.this;
  }


  public IResourceStream getResourceStream() throws IOException {

  FileInputStream fi = new FileInputStream(this.file);

  return new IResourceStreamImpl(fi, this.contentType,
 this.file.length());
  }

  /**
   * wrapper which creates the necessary [EMAIL PROTECTED]
 ResourceStreamRequestTarget}
   * @return
   * @throws IOException
   */
  public ResourceStreamRequestTarget getResourceStreamRequestTarget()
 throws IOException {
  return new 
 ResourceStreamRequestTarget(this.getResourceStream()) {
  public String getFileName() {
  return (outputName);
  }
  };
  }

 }

 ...
 public class IResourceStreamImpl implements IResourceStream {
  private static final long serialVersionUID = 1L;

  private Locale locale = null;
  private String contentType = null;
  private InputStream inputStream = null;
  private long size;

  /**
   * @param fileInputStream
   * @param contentType
   * @param file
   */
  public IResourceStreamImpl(InputStream inputStream,
  String contentType, long size) {
  this.inputStream = inputStream;
  this.size = size;
  this.contentType = contentType;
  }

  public void close() throws IOException {
  this.inputStream.close();
  }

  public InputStream getInputStream() throws
 ResourceStreamNotFoundException {
  return this.inputStream;
  }

  public String getContentType() {
  return (this.contentType);
  }

  public Locale getLocale() {
  return (this.locale);
  }

  public long length() {
   

Re: Wicket-Seam Integration

2007-11-26 Thread jweekend

Frank,

I have passed on a link to this thread (and to your blog) to a people I know
who use or are interested in Seam.
Did you start a thread on the Seam forum about your contribution? Could you
please send me the link (a search for Wicket on the JBoss forums didn't
return what I was looking for) as I would be interested to see the reaction
of the Seam community to being given the opportunity to use Wicket instead
of JSF.

Regards - Cemal
http://jWeekend.co.uk http://jWeekend.co.uk 



Frank Martínez-3 wrote:
 
 Hi Cemal,
 Thanks for your interest and words!
 
 I am a Seam developer and I started this project because i am
 interested in use Wicket in the view layer, but i already have a lot
 of the logic in Seam components and EJBs.
 
 I am not an expert Wicket user, but is a fact that Wicket is better
 than JSF in my experience.
 
 Regards,
 Frank.
 
 On Nov 22, 2007 7:01 PM, jweekend [EMAIL PROTECTED] wrote:

 Frank,

 This is precisely the type of information I was looking for, thank you.
 It
 may also give a few Wicket users more reason to have a play.

 My initial thoughts are in line with yours; this will probably be a
 bigger
 help to Seam users - who can now choose between Wicket's excellent and
 easy
 to use/extend features and the more cumbersome (but JEE standard) JSF,
 than to the Wicket users.

 However, this new integration possibility is clearly not a bad thing for
 anyone concerned/affected anyway. Eventually, I expect the Wicket
 developers/users will discover/invent ways to benefit from some of Seam's
 features as well, even if it's only for its tight integration with jBPM
 (and
 Drools?) and of course, MDBs and SBs. The webbeans JSR's success will no
 doubt have some influence on this.

 Personally, I appreciate having such options (form a Wicket user
 perspective) and thank you for making such an integration/possibility
 available.

 Regards - Cemal
 http://jWeekend.co.uk http://jWeekend.co.uk





 Frank Martínez-3 wrote:
 
  Hi Eelco,
 
  On Nov 22, 2007 2:44 PM, Eelco Hillenius [EMAIL PROTECTED]
  wrote:
  Thanks for explaining. A few questions...
 
   Why i do not use proxies:
 1. Seam injected Ejbs and JNDI resources are already proxies, so i
   don't want a proxy of the proxy of the proxy ..
 2. Because proxies are not outjection frendly in this case.
 
  Pardon me for maybe not getting it, but I don't really understand how
  outjection would help Wicket developers. After all, everything works
  with regular Java objects, so when I did the first pass of Seam
  integration, I didn't really see the use case for 'exporting back'
  values to the seam context. Isn't it enough to change the values
  (which are passed by reference) if you want to have changes applied? I
  somewhat understand the merit of outjection if you pass around request
  parameters from request to request and if you don't work with a
  construct like Wicket's models, but I'm missing the benefit of
  outjection for Wicket applications.
 
  Would it be possible to give us a short primer on what outjection is
  and what it is good for when building Wicket webapps?
 
 
  Remember that there are many stateful contexts in Seam, not only the
  session or request, but also Business process context and conversation
  context which has no equivalent in other frameworks.
 
  Oujection is the possibility to export references from a component to
  one of the stateful contexts. For example you can export any value
  from a wicket page to a running business process which is accessed by
  other web application too.
 
 3. Because it is important that you can inject/outject null
  references.
 
  Why is that important? If it is memory consumption, those proxies null
  their references at the end of a request.
 
 
  Thanks,
 
  Eelco
 
 
  The injection/outjection of null references importance is not related
  with memory consumption:
  Some times you need to take decisions based on the value of an
  injected resource and sometimes the null value is a meaningful case in
  your logic. Specially if you are using injected values coming form
  other complex components/services. The same applies if you want to
  tell to other external component that it must set to null some shared
  variable.
 
  Maybe wicket-seam integration is more important to Seam users than to
  wicket users :(
  Maybe wicket is very well without seam at all, but i think seam users
  appreciate good alternatives to JSF. And Wicket is a very good
  alternative.
 
  Regards,
  Frank.
 
  --
  Frank D. Martínez M.
  Asimov Technologies Ltda.
  Blog: http://www.ibstaff.net/fmartinez/
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Wicket-Seam-Integration-tf4840640.html#a13905176
 Sent from the Wicket - User mailing list archive at Nabble.com.


 

Re: Ajax Memory Leak in IE

2007-11-26 Thread Matej Knopp
Does it happen for IE6 only or also for IE7? Can you create a jira
issue and attach a  quickstart?

-Matej

On Nov 26, 2007 12:19 PM, picknick [EMAIL PROTECTED] wrote:

 I'm using a DataView-Table with an AjaxPagingNavigator listing 100 items per
 page. Each item has an AjaxLink to a detail view. When paging through the
 list the memory usage of the IE is increased by about 500 KB per page.
 Without the ajax link it's doing well.

 AjaxDebugMode is disabled. Configuration is set to deployment. Currently I'm
 using Wicket 1.3.0-rc1. I tried Wicket 1.2.6, which is working fine.

 Any ideas?

 Nick
 --
 View this message in context: 
 http://www.nabble.com/Ajax-Memory-Leak-in-IE-tf4874611.html#a13947927
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Form with CompounPropertyModel never call onSubmit()

2007-11-26 Thread Gervais

Hi all,

I have this form component :

   public class RegistrationForm extends Form {
  
   private final static long serialVersionUID = 1l;


   public RegistrationForm(String id, StudentFolder studentFolder) {
   super(id, new CompoundPropertyModel(studentFolder));
   add(new RequiredTextField(student.firstName));
   add(new RequiredTextField(student.lastName));
   add(new RequiredTextField(student.dateOfBirth));
   add(new RequiredTextField(student.placeOfBirth));
  
   /*super(id);

   add(new RequiredTextField(student.firstName,new
   Model(fname)));
   add(new RequiredTextField(student.lastName,new
   Model(lname)));
   add(new RequiredTextField(student.dateOfBirth,new
   Model(dob)));
   add(new RequiredTextField(student.placeOfBirth,new
   Model(pob)));*/
   }

   protected void onSubmit() {
   for ( int i=0; i20; i++)
  System.out.println();
  
   System.out.println( submit);
  
   for ( int i=0; i20; i++)

  System.out.println();
   } 
   }


With the usage of CompounPropertyModel the content of onSubmit() never 
run. But if i comment the usage of compoundPropertyModel and use Static 
model it work.


Can you help me ?

Thanks




Re: Form with CompounPropertyModel never call onSubmit()

2007-11-26 Thread Martijn Dashorst
Add a feedback panel to your page and notice the validation errors.
Martijn

On Nov 26, 2007 2:49 PM, Gervais [EMAIL PROTECTED] wrote:

 Hi all,

 I have this form component :

public class RegistrationForm extends Form {

private final static long serialVersionUID = 1l;

public RegistrationForm(String id, StudentFolder studentFolder) {
super(id, new CompoundPropertyModel(studentFolder));
add(new RequiredTextField(student.firstName));
add(new RequiredTextField(student.lastName));
add(new RequiredTextField(student.dateOfBirth));
add(new RequiredTextField(student.placeOfBirth));

/*super(id);
add(new RequiredTextField(student.firstName,new
Model(fname)));
add(new RequiredTextField(student.lastName,new
Model(lname)));
add(new RequiredTextField(student.dateOfBirth,new
Model(dob)));
add(new RequiredTextField(student.placeOfBirth,new
Model(pob)));*/
}

protected void onSubmit() {
for ( int i=0; i20; i++)
   System.out.println();

System.out.println( submit);

for ( int i=0; i20; i++)
   System.out.println();
}
}

 With the usage of CompounPropertyModel the content of onSubmit() never
 run. But if i comment the usage of compoundPropertyModel and use Static
 model it work.

 Can you help me ?

 Thanks





-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/


TabbedPanel + authorization strategy

2007-11-26 Thread Marieke Vandamme

Hello, 

Is it possible to use TabbedPanel from wicket extensions together with the
wicket auth-roles?

Because TabbedPanel contains AbstractTab (which do not extend Component), I
didn't find a way to set the specific roles for each tab.

Thanks !
-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13949910
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to validate a date in a defined format

2007-11-26 Thread Gervais

Hi All


In my form i have added a required text filed for hold a date. My model 
object have a setter..


--
   add(new RequiredTextField(dateOfBirth, java.util.Date.class));
--
   public void setDateOfBirth(Date date) {
  this.date = date;
   }
   public Date getDateOfBirth() {
 return date;
   }
--
But i'm french and users enter date as /mm/dd or YYY-mm-dd  how can 
i tel to wicket how to put the date to my Object ?


Re: Wicket + OSGI + Session

2007-11-26 Thread Sebastiaan van Erk

Yep, I've seen though before.

It's probably a ClassNotFoundException on deserialization which gets 
eaten by ObjectInputStream (there's a bug report at Sun for this). To be 
sure you can debug trapping on ClassNotFoundException (caught and 
uncaught) when this problem occurs.


However, since it's in a page you can easily fix this one: either 
upgrade to trunk and implement your own IClassResolver and register it 
with the application, or write your own IObjectStreamFactory 
implementation and register it with the Objects class.


In either case, have a look at the DefaultObjectStreamFactory to see how 
to write a hook to look up classes in an ObjectInputStream 
implementation (resolveClass method).


Regards,
Sebastiaan

Daniel Stoch wrote:

Hi,

You have written: This causes problems with session
serialization/deserialization in an OSGI environment. I don't know is
it a related problem, but I have the following situation (of course
app is running in OSGi environment):
I have a page with DataView displaying products list with images. Each
product has AjaxLink, when I click this link product should be
selected (highlighted). But sometimes after click I have an error with
serialization:

Root cause:
java.io.StreamCorruptedException: invalid type code: 01
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
 at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
 at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:392)
 at 
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:229)
 at 
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:604)
 at 
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:318)
 at org.apache.wicket.Session.getPage(Session.java:741)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:443)
 at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1248)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:343)
 at 
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)

Complete stack:
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
 at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:406)
 at 
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:229)
 at 
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:604)
 at 
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:318)
 at org.apache.wicket.Session.getPage(Session.java:741)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:443)
 at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1248)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:343)

Do you have similar problems with serialization/deserialization?

PS. The strange thing is that in Firefox this is an undeterministic
error but in Opera it occurs every time I've clicked the link.

Best regards,
Daniel

On Nov 21, 2007 10:39 AM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

Hi,

When Wicket pages are serialized/deserialized to the page store, they
are serialized/deserialized using the IObjectStreamFactory set in the
Objects class, and (in trunk) the DefaultObjectStreamFactory overrides
the resolveClass method of ObjectInputStream to consult the
application's IClassResolver. This is all good. :-)

But, the problem is the session itself. The ObjectIn/OutputStreams that
the session is serialized to and deserialized from are the ones provided
by the container, which do not use the IObjectStreamFactory. This causes
problems with session serialization/deserialization in an OSGI 

wicketstuff-dojo : supported dojo versions, and/or IE nonsecure items complaint?

2007-11-26 Thread Timo Rantalaiho
Hello,

We run into the good old this page contains both secure and
non-secure items warning on IE 6 when updating
DojoOrderableListContainer components via Ajax. 

We're using Dojo packaged with the wicketstuff-dojo
1.3.0-SNAPSHOT, and I understand that it's version 0.4. So
this bug

  http://trac.dojotoolkit.org/ticket/2390

might be relevant, and I thought of building my custom dojo 

  
http://wicketstuff.org/confluence/display/STUFFWIKI/Build+a+custom+dojo+to+fit+to+your+application

on a newer version. 

So if anyone can tell

1) which dojo versions should work with current
wicketstuff-dojo, or even

2) whether this might fix our non-secure items warning

we'd greatly appreciate it!


Meanwhile, I'll go and try it out and report back.

Cheers,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Fridolin Jackstadt

Marieke Vandamme schrieb:
Hello, 


Is it possible to use TabbedPanel from wicket extensions together with the
wicket auth-roles?

Because TabbedPanel contains AbstractTab (which do not extend Component), I
didn't find a way to set the specific roles for each tab.

Thanks !
  

Hello,
AbstractTab contains a Panel that extends Components. Try adding the 
annotation to the Panel.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Marieke Vandamme

Hello, 

Thanks for the idea, but I already tried that..
The problem is that the panel is only created when the user clicks on the
according tab, which in my case is too late. I don't want the tab to be
printed if the user is not authorized.


Fridolin Jackstadt wrote:
 
 Marieke Vandamme schrieb:
 Hello, 

 Is it possible to use TabbedPanel from wicket extensions together with
 the
 wicket auth-roles?

 Because TabbedPanel contains AbstractTab (which do not extend Component),
 I
 didn't find a way to set the specific roles for each tab.

 Thanks !
   
 Hello,
 AbstractTab contains a Panel that extends Components. Try adding the 
 annotation to the Panel.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13951278
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



NPE in FormTester.submit

2007-11-26 Thread Jason Anderson
Am i doing something wrong here? i couldn't find much docs on testing
besides the javadoc and a page on the wiki...




tester = new WicketTester(new MyApplication());



public void testLogin() throws Exception {
tester.startPage(HomePage.class);
tester.assertRenderedPage(LoginPage.class);

FormTester form = tester.newFormTester(form);
form.setValue(username, **);
form.setValue(password, **);
form.submit();

tester.assertRenderedPage(HomePage.class);
}


this gives the following exception:

java.lang.NullPointerException
at 
org.apache.wicket.protocol.http.MockHttpServletResponse.sendRedirect(MockHttpServletResponse.java:534)
at 
org.apache.wicket.protocol.http.WebResponse.redirect(WebResponse.java:232)
at 
org.apache.wicket.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:66)
at 
org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:386)
at org.apache.wicket.util.tester.FormTester.submit(FormTester.java:588)

(wicket 1.3.0-rc1)

 from a quick peek thru the code it looks like the request cycle is
detaching the threadlocal before the response uses it in close()

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to update a label on a tree node selection

2007-11-26 Thread rik rik
Hi Timo
You're right, the code format is horrible, but I had already had the answer 
from Florian into the first post (this post is a duplicate caused by 
hotmail...),
so I thought that this post was not considered anymore...
Sorry and thanks for the comment :-)
Regards

Rik



 Date: Sat, 24 Nov 2007 11:20:17 +0200
 From: [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Subject: Re: how to update a label on a tree node selection
 
 On Fri, 23 Nov 2007, rik rik wrote:
  Hi to all!I'm starting to use wicket and I'm happy using it :-)But I'm not 
  able to update a label on a tree node selection, my code is this Label 
  labelNode=new Label(labelNode,label value); LinkTree tree=new 
  LinkTree(tree,dtm) {@Overridepublic void 
  onNodeLinkClicked(javax.swing.tree.TreeNode node, BaseTree tree, 
  AjaxRequestTarget target){String s1 = 
  ((String)((DefaultMutableTreeNode)node).getUserObject());
  labelNode.getModel().setObject(node: + s1);
  //addOrReplace(labelNode);//Label label=new 
  Label(labelNode,node: + s1);//addOrReplace(label);  
//labelNode.modelChanged();
  System.out.println( AFTER CLICK 
  model=+labelNode.getModelObjectAsString());}   
   }; The output string indicates that the model of the label has correctly 
  changed, but nothing change in rendering... the value of the labeldoesn't 
  change...The commented lines are all not working attemptsI've searched in 
  the mailinglist for a similar problem, but I didn't find anything, when I 
  wrong?Anyway, in the html the label is into a table, in the same or 
  different row from the tree nothing changes...Thanks in advance! 
 
 Now that's the longest line in a while :)
 
 Please use some minutes to format your post before sending
 it to us hundreds reading this mailing list. Your chances of
 getting useful answers are also improved if each of us 
 doesn't need to open your text in an editor and format it 
 just to even be able to read it, not to mention think 
 about its subject matter.
 
 Best wishes,
 
 Timo
 
 -- 
 Timo Rantalaiho   
 Reaktor Innovations OyURL: http://www.ri.fi/ 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
Scarica GRATIS 30 emoticon per Messenger!
http://www.emoticons-livemessenger.com/pages/msnit/index.htm

Re: How to validate a date in a defined format

2007-11-26 Thread Igor Vaynberg
see DateField in extensions and in wicket-datetime modules, they take
care of this...

-igor


On Nov 26, 2007 6:16 AM, Gervais [EMAIL PROTECTED] wrote:
 Hi All


 In my form i have added a required text filed for hold a date. My model
 object have a setter..

 --
 add(new RequiredTextField(dateOfBirth, java.util.Date.class));
 --
 public void setDateOfBirth(Date date) {
this.date = date;
 }
 public Date getDateOfBirth() {
   return date;
 }
 --
 But i'm french and users enter date as /mm/dd or YYY-mm-dd  how can
 i tel to wicket how to put the date to my Object ?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Igor Vaynberg
On Nov 26, 2007 6:56 AM, Marieke Vandamme [EMAIL PROTECTED] wrote:

 I don't want the tab to be
 printed if the user is not authorized.

so dont add it to the list of itabs you give the panel... ?

-igor




 Fridolin Jackstadt wrote:
 
  Marieke Vandamme schrieb:
  Hello,
 
  Is it possible to use TabbedPanel from wicket extensions together with
  the
  wicket auth-roles?
 
  Because TabbedPanel contains AbstractTab (which do not extend Component),
  I
  didn't find a way to set the specific roles for each tab.
 
  Thanks !
 
  Hello,
  AbstractTab contains a Panel that extends Components. Try adding the
  annotation to the Panel.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context: 
 http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13951278
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problems in beta3

2007-11-26 Thread Mats Norén
Hi,
We've got a problem in our application when using the back button.
The click trail goes something like this:
- User clicks on search documents, which is a BookmarkablePageLink
- User enters a couple of criteria and hits the search button =
setResponsePage(SearchDocument.class, params = encoded
searchcriteria)
Application displays a paginated list of documents with
bookmarkablepagelinks to display detailed content about each document.
User clicks on page two of n pages and then decides to look closer at
a document by following the link to the detailed view.
Application displays an overview of the document

Now if the user presses the back button in the application to go back
to the search page, the page displays correctly but any following
click result in this error message:

Root cause:

java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:402)
at org.apache.wicket.proxy.$Proxy76.searchDocuments(Unknown Source)
at 
x.document.page.document.search.AdvancedSearchDocument.search(AdvancedSearchDocument.java:156)
at 
x.document.page.document.search.AbstractSearchDocument$1.load(AbstractSearchDocument.java:77)
at 
org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:111)
at x.document.component.ListDocumentPanel$2.isVisible(ListDocumentPanel.java:84)
at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:1794)
at org.apache.wicket.markup.html.form.Form$3.onFormComponent(Form.java:726)
at 
org.apache.wicket.markup.html.form.FormComponent$AbstractVisitor.formComponent(FormComponent.java:94)
at 
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:403)
at 
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:390)
at 
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper(FormComponent.java:390)
at 
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:368)
at 
org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1004)
at 
org.apache.wicket.markup.html.form.Form.loadPersistentFormComponentValues(Form.java:716)
at org.apache.wicket.Page$9.component(Page.java:1502)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:833)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:848)
at org.apache.wicket.Page.setFormComponentValuesFromCookies(Page.java:1497)
at org.apache.wicket.Page.renderPage(Page.java:859)
at 
org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:64)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1038)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1108)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1177)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:500)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:261)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:127)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at 
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at 
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at 
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at 
org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:175)
at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
at 
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at 
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
at 

Re: Ajax Memory Leak in IE

2007-11-26 Thread picknick

Here's the jira issue. Currently i can't say anything about IE7.

https://issues.apache.org/jira/browse/WICKET-1186
https://issues.apache.org/jira/browse/WICKET-1186 


Matej Knopp-2 wrote:
 
 Does it happen for IE6 only or also for IE7? Can you create a jira
 issue and attach a  quickstart?
 
 -Matej
 
 On Nov 26, 2007 12:19 PM, picknick [EMAIL PROTECTED] wrote:

 I'm using a DataView-Table with an AjaxPagingNavigator listing 100 items
 per
 page. Each item has an AjaxLink to a detail view. When paging through the
 list the memory usage of the IE is increased by about 500 KB per page.
 Without the ajax link it's doing well.

 AjaxDebugMode is disabled. Configuration is set to deployment. Currently
 I'm
 using Wicket 1.3.0-rc1. I tried Wicket 1.2.6, which is working fine.

 Any ideas?

 Nick
 --
 View this message in context:
 http://www.nabble.com/Ajax-Memory-Leak-in-IE-tf4874611.html#a13947927
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Ajax-Memory-Leak-in-IE-tf4874611.html#a13953000
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wicket (advanced) Calendar?

2007-11-26 Thread V. Jenks

I'm beginning a new commercial project with a partner that has good chances
of landing some investment funding in the next year.  We've set out using
Wicket, JPA, Glassfish, and Netbeans as our toolbox and platform(s) as it
is what we're experienced in and enjoy building applications with.  We're
not interested in alternative frameworks and solutions...but rather a
widget, if one doesn't already exist.

The central focus of the application will be an editable calendar, a la
Google Calendar.  Everything else is built around the concept of a rich,
preferably Ajax-driven, calendar.  Has anyone written such a control for
Wicket, commercial or free?  Has someone integrated another framework with
Wicket that provides this type of base functionality?  We'd definitely be
interested in purchasing such a component, if the quality and price is
right, and if one does not exist, currently.

Can anyone provide any info on this?

Thanks much!
-- 
View this message in context: 
http://www.nabble.com/Wicket-%28advanced%29-Calendar--tf4876158.html#a13953001
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problems adding nodes to a BaseTree

2007-11-26 Thread Thomas Krause
Hello,

since a few days I'm struggling with a problem I didn't find any solution yet.

I have two pages containing some Panels and a BaseTree (I'm using my
own node panel) each. setLinkType(BaseTree.LinkType.REGULAR) is used.
What I want is that the tree is updated every time the page is updated
due to some actions done by the user. This works correctly for page
number one but not for the other one. Page 2 shows the updated tree
(all nodes are expanded) but there is no visual feedback when a node
is selected even if the selection on the code side works. It is not
possible for the user to collapse a node as well.

I have some questions related with the problem. Before I forget to
mention it: I use 1.3.0 RC1.

1) Is it OK using onBeforeRender() (overridden at the page, super is
called *after* I updated everything) to update the model of the tree?

2) Should I update the model of the tree by removing and adding nodes
to the root-node and then calling reload() on the DefaultTreeModel?
The more I think about it I would say no since this is a method from
the Swing-API. But it works on page 1 (would't work if it is not
there). Calling updateTree() on the AbstractTree has no effect since i
don't use AJAX.

If you need any code or more explanation I will provide it of course.
I hope somebody has an idea what I'm doing wrong.

Thank you for your help.

Thomas Krause

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Eelco Hillenius
On Nov 26, 2007 6:56 AM, Marieke Vandamme [EMAIL PROTECTED] wrote:

 Hello,

 Thanks for the idea, but I already tried that..
 The problem is that the panel is only created when the user clicks on the
 according tab, which in my case is too late. I don't want the tab to be
 printed if the user is not authorized.

Did you try something like:

@AuthorizeAction(action = Action.RENDER, roles = Roles.ADMIN)

on the tab?

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FormComponentPanel doesn't get the Model set on Page

2007-11-26 Thread Franklin Antony

Dear Friends,
  I have a situation where in which I have a FormComponentPanel. This
FormComponentPanel  is placed on Form and the Form in turn placed on a Page.
Now when I instantiate the page I set a model on the page using setModel(new
CompoundPropertyModel(myModel)). Further I DO NOT  pass this model in to  my
Form or FormComponentPanel. The problem I am facing is that I cannot access
the model in the FormComponentPanel  but I can access it on the Form . On
the mailing list I have come across the convertInput() but not sure what it
actually does. Can someone please help in this context.


Thanks,
Franklin.


-- 
View this message in context: 
http://www.nabble.com/FormComponentPanel-doesn%27t-get-the-Model-set-on-Page-tf4876640.html#a13954695
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket (advanced) Calendar?

2007-11-26 Thread Gerolf Seitz
maybe you could team up with the webical team (webical.org).

  Gerolf

On Nov 26, 2007 5:25 PM, V. Jenks [EMAIL PROTECTED] wrote:


 I'm beginning a new commercial project with a partner that has good
 chances
 of landing some investment funding in the next year.  We've set out using
 Wicket, JPA, Glassfish, and Netbeans as our toolbox and platform(s) as
 it
 is what we're experienced in and enjoy building applications with.  We're
 not interested in alternative frameworks and solutions...but rather a
 widget, if one doesn't already exist.

 The central focus of the application will be an editable calendar, a la
 Google Calendar.  Everything else is built around the concept of a rich,
 preferably Ajax-driven, calendar.  Has anyone written such a control for
 Wicket, commercial or free?  Has someone integrated another framework with
 Wicket that provides this type of base functionality?  We'd definitely be
 interested in purchasing such a component, if the quality and price is
 right, and if one does not exist, currently.

 Can anyone provide any info on this?

 Thanks much!
 --
 View this message in context:
 http://www.nabble.com/Wicket-%28advanced%29-Calendar--tf4876158.html#a13953001
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




wicket success stories

2007-11-26 Thread Jonathan Locke

i'm starting an IT consulting business which will (of course) include lots of
wicket work.  i know there are a number of success stories out there and a
few have been sent to mailing lists or published on our wiki or even in
places like eweek magazine...  now, it may be that we've already exhausted
these stories and i just need to go mine them from the web, but if you've
got a wicket success story (particularly a new one) that you'd be willing to
share with the world on the marketing page for my IT consulting business,
please post away...

http://web.mac.com/jonathan.locke/iWeb/JonathanLocke/Blog/88959EC1-877D-4A89-826A-315B1DDE9EF5.html

thanks,

  jon


-- 
View this message in context: 
http://www.nabble.com/wicket-success-stories-tf4877640.html#a13957669
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ModalWindow Positioning

2007-11-26 Thread Clay Lehman
Hey everyone,

 

I was wondering if there is a way to specify ModalWindow's initial
positioning.  I have left the cookie name as null, so the postion is not
remembered, but I would like to be able to set a nice default.  I have
tried postion:absolute, and setting TOP and LEFt, but it always seems to
put my ModalWindow directly in the middle (up/down and left/right) of
the page.

 

Is there a way to specify the position? 

 

Thanks for any help!!

-Clay

 



Re: Problems in beta3

2007-11-26 Thread Johan Compagner
somehow proxy is getting an instance of a class which isn't build for :

at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(
LazyInitProxyFactory.java:402)
at org.apache.wicket.proxy.$Proxy76.searchDocuments(Unknown Source)
at x.document.page.document.search.AdvancedSearchDocument.search(
AdvancedSearchDocument.java:156)
So it sounds to me that the wicket proxy resolves a wrong object when it
deserializes..
Or maybe it suddenly resolves to a diffect class of that object, but i don't
know how likely that is..

johan


On Nov 26, 2007 5:05 PM, Mats Norén [EMAIL PROTECTED] wrote:

 Hi,
 We've got a problem in our application when using the back button.
 The click trail goes something like this:
 - User clicks on search documents, which is a BookmarkablePageLink
 - User enters a couple of criteria and hits the search button =
 setResponsePage(SearchDocument.class, params = encoded
 searchcriteria)
 Application displays a paginated list of documents with
 bookmarkablepagelinks to display detailed content about each document.
 User clicks on page two of n pages and then decides to look closer at
 a document by following the link to the detailed view.
 Application displays an overview of the document

 Now if the user presses the back button in the application to go back
 to the search page, the page displays correctly but any following
 click result in this error message:

 Root cause:

 java.lang.IllegalArgumentException: object is not an instance of declaring
 class
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(
 NativeMethodAccessorImpl.java:39)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(
 LazyInitProxyFactory.java:402)
 at org.apache.wicket.proxy.$Proxy76.searchDocuments(Unknown Source)
 at x.document.page.document.search.AdvancedSearchDocument.search(
 AdvancedSearchDocument.java:156)
 at x.document.page.document.search.AbstractSearchDocument$1.load(
 AbstractSearchDocument.java:77)
 at org.apache.wicket.model.LoadableDetachableModel.getObject(
 LoadableDetachableModel.java:111)
 at x.document.component.ListDocumentPanel$2.isVisible(
 ListDocumentPanel.java:84)
 at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:1794)
 at org.apache.wicket.markup.html.form.Form$3.onFormComponent(Form.java
 :726)
 at
 org.apache.wicket.markup.html.form.FormComponent$AbstractVisitor.formComponent
 (FormComponent.java:94)
 at
 org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
 (FormComponent.java:403)
 at
 org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
 (FormComponent.java:390)
 at
 org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
 (FormComponent.java:390)
 at
 org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder
 (FormComponent.java:368)
 at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(
 Form.java:1004)
 at
 org.apache.wicket.markup.html.form.Form.loadPersistentFormComponentValues(
 Form.java:716)
 at org.apache.wicket.Page$9.component(Page.java:1502)
 at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java
 :833)
 at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java
 :848)
 at org.apache.wicket.Page.setFormComponentValuesFromCookies(Page.java
 :1497)
 at org.apache.wicket.Page.renderPage(Page.java:859)
 at org.apache.wicket.request.target.component.PageRequestTarget.respond(
 PageRequestTarget.java:64)
 at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(
 AbstractRequestCycleProcessor.java:103)
 at org.apache.wicket.RequestCycle.processEventsAndRespond(
 RequestCycle.java:1038)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1108)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1177)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:500)
 at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java
 :261)
 at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
 :127)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
 ServletHandler.java:1084)
 at
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
 (OpenSessionInViewFilter.java:174)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(
 OncePerRequestFilter.java:77)
 at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
 ServletHandler.java:1084)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
 FilterChainProxy.java:265)
 at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(
 FilterSecurityInterceptor.java:107)
 at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(
 FilterSecurityInterceptor.java:72)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
 FilterChainProxy.java:275)
 at 

howto include wicket in a JSP page with version 1.3-rc1

2007-11-26 Thread Seif
Hi, i'm a new wicket user, and i'm trying to execute a helloworld exemple
included in a JSP page
My problem is that wicket become a javax.servlet.Filter and not a Servlet in
the 1.3-rc1 version :(

to explain my problem here is some code:
The file web.xml:
-
...
filter
filter-nameHelloWorldApplication/filter-name
filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name
param-valuenet.lebonchoix.web.HelloWorldApplication/param-value
/init-param
/filter
filter-mapping
filter-nameHelloWorldApplication/filter-name
url-pattern/Wicket/HelloWorld/*/url-pattern
/filter-mapping
...
-

The file index.jsp
-
%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;
html
head
meta http-equiv=Content-Type content=text/html; charset=UTF-8
titletest wicket/title
/head
body
jsp:include page=/Wicket/HelloWorld /
/body
/html
-

When i launch my browser with the url:
http://localhost:58080/TestWicket/Wicket/HelloWorld it works fine but when i
try http://localhost:58080/TestWicket/ or
http://localhost:58080/TestWicket/index.jsp i get a exception:
-
[#|2007-11-26T22:04:
19.437+0100|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpSSLWorkerThread-58080-1;_RequestID=e78d3242-d891-421e-904b-e6f43cbe9715;|StandardWrapperValve[jsp]:
PWC1406 : servlet.service() pour le servlet jsp a émis une exception.
java.io.FileNotFoundException: /TestWicket/Wicket/HelloWorld
at org.apache.catalina.servlets.DefaultServlet.serveResource(
DefaultServlet.java:732)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java
:384)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(
ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(
ApplicationDispatcher.java:855)
at org.apache.catalina.core.ApplicationDispatcher.invoke(
ApplicationDispatcher.java:703)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(
ApplicationDispatcher.java:660)
at org.apache.catalina.core.ApplicationDispatcher.include(
ApplicationDispatcher.java:578)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(
JspRuntimeLibrary.java:997)
at org.apache.jsp.index_jsp._jspService(index_jsp.java from :55)
  ...
|#]
-

I have asked in the IRC channel and the only answer i got is look at
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/ which
explain how to include/use JSP in Wicket and not the reverse :(

So does anyone have an idea how to solve this problem or any other solution.



-- 
Cordialement
---
Seif


Re: Wicket meetup in San Francisco

2007-11-26 Thread Orion Letizi
Cool.  If you go, stop by and say hello to Jonas Bonér.  He's giving a  
presentation on Terracotta.


I'm thinking that sometime in the first or second week of December  
looks pretty good.


--Orion

On Nov 26, 2007, at 1:36 PM, David Sean Taylor wrote:


Thanks.
I am going to be in Amsterdam on Friday. There is a chance I might  
be able to attend the Wicket meetup there before heading home


On Nov 26, 2007, at 7:14 PM, Orion Letizi wrote:


Cool.  I've added your name to the wiki page:

http://cwiki.apache.org/confluence/display/WICKET/Community+meetups#Communitymeetups-UnitedStates

Cheers,
Orion

On Nov 25, 2007, at 9:44 AM, David Sean Taylor wrote:


I am interested in joining your Wicket meetup in SF

Thanks,

--
David Sean Taylor
Bluesunrise Software
[EMAIL PROTECTED]
[office] +01 707 773-4646
[mobile] +01 707 529 9194


bsr.jpg






--
David Sean Taylor
Bluesunrise Software
[EMAIL PROTECTED]
[office] +01 707 773-4646
[mobile] +01 707 529 9194





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ModalWindow Positioning

2007-11-26 Thread Matej Knopp
Hi,

there is currently no way to alter the position. It's always centered
first time it shows.

-Matej

On Nov 26, 2007 9:12 PM, Clay Lehman [EMAIL PROTECTED] wrote:
 Hey everyone,



 I was wondering if there is a way to specify ModalWindow's initial
 positioning.  I have left the cookie name as null, so the postion is not
 remembered, but I would like to be able to set a nice default.  I have
 tried postion:absolute, and setting TOP and LEFt, but it always seems to
 put my ModalWindow directly in the middle (up/down and left/right) of
 the page.



 Is there a way to specify the position?



 Thanks for any help!!

 -Clay





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problems adding nodes to a BaseTree

2007-11-26 Thread Matej Knopp
It's hard to tell without any code. Basically, if you have proper
listeners fired in your model the tree should update itself.
Alternatively, you can try calling invalidateAll() in your page
onBeforeRender() (before calling super.onBeforeRender).

Can you post a quickstart?

-Matej

On Nov 26, 2007 6:33 PM, Thomas Krause [EMAIL PROTECTED] wrote:
 Hello,

 since a few days I'm struggling with a problem I didn't find any solution yet.

 I have two pages containing some Panels and a BaseTree (I'm using my
 own node panel) each. setLinkType(BaseTree.LinkType.REGULAR) is used.
 What I want is that the tree is updated every time the page is updated
 due to some actions done by the user. This works correctly for page
 number one but not for the other one. Page 2 shows the updated tree
 (all nodes are expanded) but there is no visual feedback when a node
 is selected even if the selection on the code side works. It is not
 possible for the user to collapse a node as well.

 I have some questions related with the problem. Before I forget to
 mention it: I use 1.3.0 RC1.

 1) Is it OK using onBeforeRender() (overridden at the page, super is
 called *after* I updated everything) to update the model of the tree?

 2) Should I update the model of the tree by removing and adding nodes
 to the root-node and then calling reload() on the DefaultTreeModel?
 The more I think about it I would say no since this is a method from
 the Swing-API. But it works on page 1 (would't work if it is not
 there). Calling updateTree() on the AbstractTree has no effect since i
 don't use AJAX.

 If you need any code or more explanation I will provide it of course.
 I hope somebody has an idea what I'm doing wrong.

 Thank you for your help.

 Thomas Krause

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



IDataProvider Best Practice for multiple POJOs

2007-11-26 Thread pwillemann

All the IDataProvider implementations I have seen use a single POJO.  What
about an example with multiple POJOs?

For a single POJO I normally have a DataProvider object that gets data from
my DAO object.   For multiple POJOs would it be best to have a DataProvider
object that gets data from a DAO which is based on a query of multiple POJOs
(tables in my case) ?  I am not immediately sure of the ramifications of
doing this.  Is there a better way that I just don't realize?
-- 
View this message in context: 
http://www.nabble.com/IDataProvider-Best-Practice-for-multiple-POJOs-tf4879377.html#a13963492
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NPE in FormTester.submit

2007-11-26 Thread Timo Rantalaiho
On Mon, 26 Nov 2007, Jason Anderson wrote:
 tester.startPage(HomePage.class);

I'm not sure if it changes anything here, but we've 
typically done tester.startPage(new ITestPageSource()...
instead.

  from a quick peek thru the code it looks like the request cycle is
 detaching the threadlocal before the response uses it in close()

Your code seems straight forward. But in more complex cases
this sometimes comes up with WicketTester, and at times,
WicketTester.setupRequestAndResponse() helps. You might also
try storing RequestCycle.get() earlier and putting it back 
with RequestCycle.set() just before submit.

Your form isn't ajax, is it? I think that ajax submits 
typically have to be submitted with WicketTester.executeAjaxEvent() 
instead of FOrmTester.submit().

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FormComponentPanel doesn't get the Model set on Page

2007-11-26 Thread Timo Rantalaiho
On Mon, 26 Nov 2007, Franklin Antony wrote:
   I have a situation where in which I have a FormComponentPanel. This
 FormComponentPanel  is placed on Form and the Form in turn placed on a Page.
 Now when I instantiate the page I set a model on the page using setModel(new
 CompoundPropertyModel(myModel)). Further I DO NOT  pass this model in to  my
 Form or FormComponentPanel. The problem I am facing is that I cannot access
 the model in the FormComponentPanel  but I can access it on the Form . On
 the mailing list I have come across the convertInput() but not sure what it
 actually does. Can someone please help in this context.

Maybe you should read and try things out more -- or tell more 
about what are you trying to achieve, as at least I don't
completely understand it here :)

If you want to use a model in a component, just pass the 
model there.

CompoundPropertyModel is one of the more automagic-containing 
models that come with Wicket, so at the beginning it might 
be better to use the more barebones-models to see better
what's going on.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: howto include wicket in a JSP page with version 1.3-rc1

2007-11-26 Thread Timo Rantalaiho
On Mon, 26 Nov 2007, Seif wrote:
 Hi, i'm a new wicket user, and i'm trying to execute a helloworld exemple
 included in a JSP page

You might be better off first trying stuff out in a simpler
setting, without the JSP.

 My problem is that wicket become a javax.servlet.Filter and not a Servlet in
 the 1.3-rc1 version :(

You can still use the servlet.

 I have asked in the IRC channel and the only answer i got is look at
 http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/ which
 explain how to include/use JSP in Wicket and not the reverse :(

Search these mailing lists in Nabble (put wicket nabble in 
Google), this has come up sometimes.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NPE in FormTester.submit

2007-11-26 Thread Jason Anderson
the form is not ajax, its pretty much a standard form with just login
and password fields and an onsubmit callback to send the page back to
the originally requested url or homepage much like you would find in
the login page included with the wicket-auth-roles classes

i'm not sure that storing the request would help as it is bound before
entering the submit();

here is the code in MockWebApplication.java

public void processRequestCycle(WebRequestCycle cycle)
{
try
{
cycle.request();   //  - RequestCycle exists 
and is
unbound at the end of this method after all the steps() have run in
threadDetach();
}
finally
{
cycle.getResponse().close();  // -
MockHttpServletResponse.sendRedirect is called by this which calls
RequestCycle.get() after the above has already detached the
threadlocal
}
postProcessRequestCycle(cycle);
}


and the code for MockHttpServletResponse:

public void sendRedirect(String location) throws IOException
{
// If the location starts with ../
if (location.startsWith(../))
{
// Test if the current url has a / in it. (a mount)
String url = RequestCycle.get().getRequest().getURL();


I really can't see any way the threadlocal can possibly live long
enough to exist in this method.





On Nov 26, 2007 7:58 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote:
 On Mon, 26 Nov 2007, Jason Anderson wrote:
  tester.startPage(HomePage.class);

 I'm not sure if it changes anything here, but we've
 typically done tester.startPage(new ITestPageSource()...
 instead.

   from a quick peek thru the code it looks like the request cycle is
  detaching the threadlocal before the response uses it in close()

 Your code seems straight forward. But in more complex cases
 this sometimes comes up with WicketTester, and at times,
 WicketTester.setupRequestAndResponse() helps. You might also
 try storing RequestCycle.get() earlier and putting it back
 with RequestCycle.set() just before submit.

 Your form isn't ajax, is it? I think that ajax submits
 typically have to be submitted with WicketTester.executeAjaxEvent()
 instead of FOrmTester.submit().

 Best wishes,
 Timo

 --
 Timo Rantalaiho
 Reaktor Innovations OyURL: http://www.ri.fi/ 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Date should return null

2007-11-26 Thread freak182

When im working with datefield,when i do not put a date to a
textfield/datefield input from a datepicker it returns the current
date/time.Now my problem is,I want it to return NULL when there is no or
blank input from a textfield.Thanks a lot
-- 
View this message in context: 
http://www.nabble.com/Date-should-return-null-tf4879813.html#a13964813
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NPE in FormTester.submit

2007-11-26 Thread Timo Rantalaiho
On Mon, 26 Nov 2007, Jason Anderson wrote:
 and the code for MockHttpServletResponse:
 
   public void sendRedirect(String location) throws IOException
   {
   // If the location starts with ../
   if (location.startsWith(../))
   {
   // Test if the current url has a / in it. (a mount)
   String url = RequestCycle.get().getRequest().getURL();
 
 
 I really can't see any way the threadlocal can possibly live long
 enough to exist in this method.

OK, so maybe it's just that WicketTester cannot handle these
redirects.

Maybe you could create a minimal quickstart reproducing 
this, or better yet a patch with a crashing WicketTester
test, and attach it to Jira.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NPE in FormTester.submit

2007-11-26 Thread Jason Anderson
i made a quickstart and attached it to the following issue

https://issues.apache.org/jira/browse/WICKET-1187

thanks for the help

On Nov 26, 2007 8:57 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote:
 On Mon, 26 Nov 2007, Jason Anderson wrote:
  and the code for MockHttpServletResponse:
 
public void sendRedirect(String location) throws IOException
{
// If the location starts with ../
if (location.startsWith(../))
{
// Test if the current url has a / in it. (a mount)
String url = RequestCycle.get().getRequest().getURL();
 
 
  I really can't see any way the threadlocal can possibly live long
  enough to exist in this method.

 OK, so maybe it's just that WicketTester cannot handle these
 redirects.

 Maybe you could create a minimal quickstart reproducing
 this, or better yet a patch with a crashing WicketTester
 test, and attach it to Jira.


 Best wishes,
 Timo

 --
 Timo Rantalaiho
 Reaktor Innovations OyURL: http://www.ri.fi/ 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Date should return null

2007-11-26 Thread Eelco Hillenius
On Nov 26, 2007 8:55 PM, freak182 [EMAIL PROTECTED] wrote:

 When im working with datefield,when i do not put a date to a
 textfield/datefield input from a datepicker it returns the current
 date/time.Now my problem is,I want it to return NULL when there is no or
 blank input from a textfield.Thanks a lot

It does set to null as far as I know. Go for instance to
http://wicketstuff.org/wicket13/dates/ and remove the value there and
it will report that the date was set to null. If you have a case where
this doesn't work, please open a JIRA issue with a test case or
quickstart that shows your problem.

Cheers,

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Marieke Vandamme

That was my last solution, because i hoped it could be integrated with the
auth-roles so i didn't have to check the role myself. Because if i'm right,
before adding the tab to the list, i check with the role from the user's
session?


igor.vaynberg wrote:
 
 On Nov 26, 2007 6:56 AM, Marieke Vandamme [EMAIL PROTECTED] wrote:
 
 I don't want the tab to be
 printed if the user is not authorized.
 
 so dont add it to the list of itabs you give the panel... ?
 
 -igor
 



 Fridolin Jackstadt wrote:
 
  Marieke Vandamme schrieb:
  Hello,
 
  Is it possible to use TabbedPanel from wicket extensions together with
  the
  wicket auth-roles?
 
  Because TabbedPanel contains AbstractTab (which do not extend
 Component),
  I
  didn't find a way to set the specific roles for each tab.
 
  Thanks !
 
  Hello,
  AbstractTab contains a Panel that extends Components. Try adding the
  annotation to the Panel.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13951278
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13965570
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Eelco Hillenius
On Nov 26, 2007 10:38 PM, Marieke Vandamme [EMAIL PROTECTED] wrote:

 That was my last solution, because i hoped it could be integrated with the
 auth-roles so i didn't have to check the role myself. Because if i'm right,
 before adding the tab to the list, i check with the role from the user's
 session?

So did you try using @AuthorizeAction(action = Action.RENDER, roles =
Roles.ADMIN)? That way you could just add the panels and they wouldn't
be rendered when the user isn't authorized. And you can keep the
actual authorization code out of your normal component construction
code.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Marieke Vandamme

That won't compile.. I guess because AbstractTab doesn't extends Component..


Eelco Hillenius wrote:
 
 On Nov 26, 2007 6:56 AM, Marieke Vandamme [EMAIL PROTECTED] wrote:

 Hello,

 Thanks for the idea, but I already tried that..
 The problem is that the panel is only created when the user clicks on the
 according tab, which in my case is too late. I don't want the tab to be
 printed if the user is not authorized.
 
 Did you try something like:
 
 @AuthorizeAction(action = Action.RENDER, roles = Roles.ADMIN)
 
 on the tab?
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13965618
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel + authorization strategy

2007-11-26 Thread Marieke Vandamme

I tried that, but it won't compile. Maybe because AbstractTab doesn't extends
Component?
I can't add the @AuthorizeAction to the panel, because the panel is only
created when the specific tab is clicked.


Eelco Hillenius wrote:
 
 On Nov 26, 2007 10:38 PM, Marieke Vandamme [EMAIL PROTECTED] wrote:

 That was my last solution, because i hoped it could be integrated with
 the
 auth-roles so i didn't have to check the role myself. Because if i'm
 right,
 before adding the tab to the list, i check with the role from the user's
 session?
 
 So did you try using @AuthorizeAction(action = Action.RENDER, roles =
 Roles.ADMIN)? That way you could just add the panels and they wouldn't
 be rendered when the user isn't authorized. And you can keep the
 actual authorization code out of your normal component construction
 code.
 
 Eelco
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-%2B-authorization-strategy-tf4875256.html#a13965770
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Leaf menus stop responding after collapse and expand

2007-11-26 Thread yadubi


Eelco Hillenius wrote:
 
 On Nov 13, 2007 3:31 PM, yadubi [EMAIL PROTECTED] wrote:

 I have an application which is modeled on ajax SimpleTreePage example.
 Navigation is handled by overriding
 the onNodeLinkClicked of the LinkTree class.
 There are tree levels of nesting in the menu, the second level has
 multiple
 leaf nodes.
 Everything works as expected until I collapse and expand the second level
 menu. Thereafter,
 the highest leaf node under that node stops responding to mouse clicks,
 but
 other leaf nodes still work.
 This might be a bug.
 
 Did you check what happens in the Ajax debug panel and/ or with
 FireFox's Firebug?
 
 Eelco
 
 Sorry for the late response, but I solved my problem by setting the link
 type to REGULAR from AJAX, so maybe it's the case of improper use, but the
 confusing fact is that it worked intermittently. For example,
 expand-collapse-expand sequence made the nodes responsive again. Firebug
 reported no activity as far as I can tell; some nodes appeared dead.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Leaf-menus-stop-responding-after-collapse-and-expand-tf4801262.html#a13965800
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Populate form according to selected item in dropdownchoice

2007-11-26 Thread tsuresh

Hi Dipu,
  Could you please tell me what to write in the method
onSelecitionChanged(). It would be easier for me to understand if you 
provide the code example. I studied the link
http://cwiki.apache.org/WICKET/dropdownchoice-examples.html but could not
understand it.
thanks

Dipu Seminlal wrote:
 
 there are two ways to do it
 
 override the wantOnSelectionChangedNotifications of the user dropdown
 to return true and override onSelectionChanged to do what you want,
 but this will result in server round trips ( refer the java of
 DropDownChoice )
 
 or use an AjaxFormComponentUpdatingBehavior on the onChange event of
 the dropdown.
 
 regards
 Dipu
 
 On Nov 26, 2007 7:14 AM, tsuresh [EMAIL PROTECTED] wrote:

 Hello wicketeers,
 I have a form to edit the attributes of User. User has the attributes
 username, mail and role.I have a dropdownchoice filled with list of
 users.
 When I select the user his mail should be displayed in textfield and his
 role should be displayed in dropdownchoice. And i should be able to edit
 his
 mail and role. I have already made the form to fill the first drop down
 choice.I have made function view(username) in User class which helps in
 viewing attributes of the user(user selected in dropdown), But I have no
 idea to populate the remaining form components.How to do this? My code
 for
 form is as below:

 public UserEdit(){

 User user= new user();
 CompoundPropertyModel userEditModel = new
 CompoundPropertyModel(user);
 Form form = new userEditForm(user,userEditModel);
 add(form);
 add(new FeedbackPanel(feedback).setOutputMarkupId(true));
 DropDownChoice ddc = null;
 try{
 ddc = new DropDownChoice(username,user.list());
 }catch(SQLException e){
 String err = e.getMessage();
 }

 TextField mailComp = new TextField(mail);
 DropDownChoice roleDdc =null;
 try{
 roleDdc = new DropDownChoice(role.name,r.list());
 }catch(SQLException e){
 String err = e.getMessage();
 }
 form.add(ddc);
 form.add(mailComp);
 form.add(roleDdc);
 }

 class UserEditForm extends Form {
 public UserEditForm(String id,IModel model) {
 super(id,model);
 }
 --
 View this message in context:
 http://www.nabble.com/Populate-form-according-to-selected-item-in-dropdownchoice-tf4873352.html#a13944776
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Populate-form-according-to-selected-item-in-dropdownchoice-tf4873352.html#a13965803
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: howto JSON Wicket works?

2007-11-26 Thread Pen


I am not really understanding your question? we are not creating any json
object in browser. I believe that 's what we want to do in the normal form 
submit create the json object. 
This is just a simple example to demonstrate the Ajax round trip. Here
bascially you get the updated data back. This can happen if we have form
submit and a grid which gets updated on the form submit.

Can you please look into the below example and provide some solution. I have
copied both the html and java code. If you can tell me how to handle the
data in wicket and send it back in the below example that would be great. I
am not receving the form post data in the request object in wicket.

Thanks
~Pen


Johan Compagner wrote:
 
 Again, why do you try to generate a json object in the browser??
 Why not create a normal wicket form that you post to the server and
 then in the form submit method you create the json object
 
 On 11/24/07, Pen [EMAIL PROTECTED] wrote:


 I don't know how to get the postdata from the request object in wicket. I
 do
 see the request being sent. As you see from the example I am struck
 there, I
 don't know how to proceed further.
 This is just a basic example of round trip using Json, AJax and wicket
 through form submit. You get the Json data modify it update back the
 form.
 There will be more complicated of this like grid update.
 Also there can be normal form submit of Json object. In either case I
 don't
 know how to handle on the server in wicket. I have done lot using JSP, it
 looks bit different here. And no good documentation.
 If you can provide some coding example or some pointer it would be great.

 ~Pen





 Johan Compagner wrote:
 
  Which part goes wrong?
  Do you see the request being send?
  Why do this though json? If you need json objects on the server why
  not using  a normal form post and create the json object on the
  server?
 
  2007/11/24, Pen [EMAIL PROTECTED]:
 
  Greetings,
 
  I want to know how to handle the Jquery, JSon data in the wicket. What
 is
  the best way to do it.
  I have created simple form which sends the json data across to server
 and
  replies back to the form.
  I am not sure how to handle the request and response in wicket. I am
  using
  Json-lib 2.1 for jdk1.5
  Can anybody analyze the below program and suggest me what is wrong.
 
  demo.html
  head
script src=scripts/jquery-1.2.1.js type=text/javascript
  charset=utf-8/script 
script type=text/javascript charset=utf-8
$(document).ready(function() {
$(#testForm).submit(sendForm);
});

function sendForm(e) {
e.preventDefault();
var data = {
field1: $(#field1).val(),
field2: $(#field2).val(),
field3: $(#field3).val(),
};

$(#sent .content).html(data.toSource());
$.post(demo, message=[ + data.toSource() + ];, 
  receiveForm,
  json);
};  

 function receiveForm(data) {
$(#field1).val(data.field1);
$(#field2).val(data.field2);
$(#field3).val(data.field3);

$(#received .content).html(data.toSource());
};
/script

  /head
  body
 
  form wicket:id=testForm  
h1 id=formForm/h1

label for=field1Field One:/label
input type=text id=field1 /

label for=field2Field Two:/label
input type=text id=field2 /

label for=field3Field Three:/label
input type=text id=field3 /

input type=submit id=submitter value=Post the data /
  /form
 
  div id=sent class=readout
h1 id=sent_data:Sent Data:/h1
div class=content

/div
  /div
  div id=received class=readout
 
h1 id=received_dataReceived Data:/h1
div class=content

/div
  /div
  /body
  /html
 
  Here is the wicket program to handle this
 
  demo.java
  public class Demo extends BasePage {
public Demo() {

Form form = new Form(testForm,new 
  CompoundPropertyModel(this));
add(form);
form.add(new AjaxFormSubmitBehavior(form,onsubmit){
private static final long serialVersionUID = 1L;
  
 
protected void onSubmit(AjaxRequestTarget target) {
Request request = getRequest();
String data = request.getParameter(data); 
  
try {
JSONObject jsonData = new JSONObject();
JSONObject selectedNode = 
  jsonData.getJSONObject(data); 
} catch (Exception e) {
throw new 

Upgrading ResourceModel to 1.3.0-rc1

2007-11-26 Thread mraible

I'm trying to upgrade an application from 1.2.6 to 1.3.0-rc1. I've read the
documentation, upgrade guide and mailing list archives. However, I don't
seem to grasp how to upgrade the following class to 1.3.0:

import org.apache.wicket.Component;
import org.apache.wicket.model.AbstractReadOnlyModel;

/**
 * A simple model that represents a resource by its key
 * 
 * @author ivaynberg
 */
public class ResourceModel extends AbstractReadOnlyModel {
private String key;

/**
 * Constructor
 * 
 * @param key of the resource this model represents
 */
public ResourceModel(String key) {
this.key = key;
}

/**
 * @see wicket.model.AbstractReadOnlyModel#getObject(wicket.Component)
 */
public Object getObject(Component component) {
return component.getLocalizer().getString(key, component);
}
}

Most of the documentation seems to indicate I don't need this class anymore.
Is that true?

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Upgrading-ResourceModel-to-1.3.0-rc1-tf4880269.html#a13966244
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]