Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread FaRHaN


I want to upload files through Commons FIleUpload API. As Commons FileUpload 
API requires HttpServletRequest for uploading files (e.g. fileItemsList = 
servletFileUpload.parseRequest(httpServletRequest)). 
Parsing HttpServletRequest is the necessary step while uploading in Commons 
FileUpload.

I have got httpServletRequest from RequestCycle. e.g. ((ServletWebRequest) 
getRequest()).getHttpServletRequest() or 
((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this 
request already being parsed automatically in RequestCycle, before reaching 
servletFileUpload.parseRequest(httpServletRequest). So, Request is already 
been parsed... exception occur. 

That's why i want to use Servlet's doGet(request, response) method for getting 
HttpServletRequest(without parsing). 

If not servlets, Is there any other way to handle FileUploading (through Apache 
Commons API) in wicket ?

Thanks...



From: Peter Thomas ptrtho...@gmail.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 11:39:58 AM
Subject: Re: Usage of Servlets in Wicket, How ?

Refer this:

http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

If that doesn't help you should briefly explain what your requirement is.
There may be a better way to achieve it within Wicket instead of hacking
around with servlets.

On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:

 but how can we call it from our wicket web page ?




 
 From: Jeremy Thomerson jer...@wickettraining.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 11:10:49 AM
 Subject: Re: Usage of Servlets in Wicket, How ?

 servlets are totally separate from Wicket - write a servlet and add it to
 your web.xml.  See any servlet example on the web (non-Wicket related) for
 assistance.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com wrote:

  Hi,
 
  Is there any example in Wicket that uses Servlets (doGet()  doPost()). I
  mean how can we configure Servlets in our wicket application and use
  doGet(request, response)  doPost(request, response) methods. I know
 web.xml
  configuration for Servlets but how can we use doGet()  doPost() methods.
 Do
  we need wicket:ids in Servlets ?
  Is there any reference for such type of example ?
 
  Thanks...
 
 
 
 








  

Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread Jeremy Thomerson
Maybe if you mention the specific reason(s) that you want to use Apache
Commons FileUpload API rather than Wicket's built-in forms and file upload
mechanisms, someone on the list will be able to provide you with more help.
It seems that the FileUpload API is intended to help you if you have to
write servlets to handle forms.  But with Wicket, you don't have to do
this.  And if you use ACFU API, then you lose the rest of Wicket's stateful
form handling.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:



 I want to upload files through Commons FIleUpload API. As Commons
 FileUpload API requires HttpServletRequest for uploading files (e.g.
 fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
 Parsing HttpServletRequest is the necessary step while uploading in Commons
 FileUpload.

 I have got httpServletRequest from RequestCycle. e.g. ((ServletWebRequest)
 getRequest()).getHttpServletRequest() or
 ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this
 request already being parsed automatically in RequestCycle, before reaching
 servletFileUpload.parseRequest(httpServletRequest). So, Request is already
 been parsed... exception occur.

 That's why i want to use Servlet's doGet(request, response) method for
 getting HttpServletRequest(without parsing).

 If not servlets, Is there any other way to handle FileUploading (through
 Apache Commons API) in wicket ?

 Thanks...


 
 From: Peter Thomas ptrtho...@gmail.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 11:39:58 AM
 Subject: Re: Usage of Servlets in Wicket, How ?

 Refer this:


 http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

 If that doesn't help you should briefly explain what your requirement is.
 There may be a better way to achieve it within Wicket instead of hacking
 around with servlets.

 On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:

  but how can we call it from our wicket web page ?
 
 
 
 
  
  From: Jeremy Thomerson jer...@wickettraining.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 11:10:49 AM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  servlets are totally separate from Wicket - write a servlet and add it to
  your web.xml.  See any servlet example on the web (non-Wicket related)
 for
  assistance.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com wrote:
 
   Hi,
  
   Is there any example in Wicket that uses Servlets (doGet()  doPost()).
 I
   mean how can we configure Servlets in our wicket application and use
   doGet(request, response)  doPost(request, response) methods. I know
  web.xml
   configuration for Servlets but how can we use doGet()  doPost()
 methods.
  Do
   we need wicket:ids in Servlets ?
   Is there any reference for such type of example ?
  
   Thanks...
  
  
  
  
 
 
 
 
 







Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread FaRHaN
I want to make it a separate API for file uploading. So that i can embed it in 
any of the application regardless of the framework (wicket, JSF, struts etc.). 
The only reason is that, we can use Apache Commons FileUpload API in any of the 
framework. 
Is there any workaround to do this ?





From: Jeremy Thomerson jer...@wickettraining.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 12:44:08 PM
Subject: Re: Usage of Servlets in Wicket, How ?

Maybe if you mention the specific reason(s) that you want to use Apache
Commons FileUpload API rather than Wicket's built-in forms and file upload
mechanisms, someone on the list will be able to provide you with more help.
It seems that the FileUpload API is intended to help you if you have to
write servlets to handle forms.  But with Wicket, you don't have to do
this.  And if you use ACFU API, then you lose the rest of Wicket's stateful
form handling.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:



 I want to upload files through Commons FIleUpload API. As Commons
 FileUpload API requires HttpServletRequest for uploading files (e.g.
 fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
 Parsing HttpServletRequest is the necessary step while uploading in Commons
 FileUpload.

 I have got httpServletRequest from RequestCycle. e.g. ((ServletWebRequest)
 getRequest()).getHttpServletRequest() or
 ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this
 request already being parsed automatically in RequestCycle, before reaching
 servletFileUpload.parseRequest(httpServletRequest). So, Request is already
 been parsed... exception occur.

 That's why i want to use Servlet's doGet(request, response) method for
 getting HttpServletRequest(without parsing).

 If not servlets, Is there any other way to handle FileUploading (through
 Apache Commons API) in wicket ?

 Thanks...


 
 From: Peter Thomas ptrtho...@gmail.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 11:39:58 AM
 Subject: Re: Usage of Servlets in Wicket, How ?

 Refer this:


 http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

 If that doesn't help you should briefly explain what your requirement is.
 There may be a better way to achieve it within Wicket instead of hacking
 around with servlets.

 On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:

  but how can we call it from our wicket web page ?
 
 
 
 
  
  From: Jeremy Thomerson jer...@wickettraining.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 11:10:49 AM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  servlets are totally separate from Wicket - write a servlet and add it to
  your web.xml.  See any servlet example on the web (non-Wicket related)
 for
  assistance.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com wrote:
 
   Hi,
  
   Is there any example in Wicket that uses Servlets (doGet()  doPost()).
 I
   mean how can we configure Servlets in our wicket application and use
   doGet(request, response)  doPost(request, response) methods. I know
  web.xml
   configuration for Servlets but how can we use doGet()  doPost()
 methods.
  Do
   we need wicket:ids in Servlets ?
   Is there any reference for such type of example ?
  
   Thanks...
  
  
  
  
 
 
 
 
 








  

Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread Peter Thomas
On Tue, Sep 8, 2009 at 12:33 PM, FaRHaN farhan.ba...@ymail.com wrote:

 I want to make it a separate API for file uploading. So that i can embed it
 in any of the application regardless of the framework (wicket, JSF, struts
 etc.). The only reason is that, we can use Apache Commons FileUpload API in
 any of the framework.
 Is there any workaround to do this ?



This is very interesting.  When you say embed it in any of the application
regardless of the framework what do you mean ?  A tag library ?  Suppose
you have a multipart form, that contains input fields PLUS a type=file
field, to what URL will you POST it and have the input data also bound /
handled ?

Note that Wicket already has FileUpload built in, that too as a pure Java
API so I'm trying to understand your end-goal better.




 
 From: Jeremy Thomerson jer...@wickettraining.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 12:44:08 PM
 Subject: Re: Usage of Servlets in Wicket, How ?

 Maybe if you mention the specific reason(s) that you want to use Apache
 Commons FileUpload API rather than Wicket's built-in forms and file upload
 mechanisms, someone on the list will be able to provide you with more help.
 It seems that the FileUpload API is intended to help you if you have to
 write servlets to handle forms.  But with Wicket, you don't have to do
 this.  And if you use ACFU API, then you lose the rest of Wicket's stateful
 form handling.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:

 
 
  I want to upload files through Commons FIleUpload API. As Commons
  FileUpload API requires HttpServletRequest for uploading files (e.g.
  fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
  Parsing HttpServletRequest is the necessary step while uploading in
 Commons
  FileUpload.
 
  I have got httpServletRequest from RequestCycle. e.g.
 ((ServletWebRequest)
  getRequest()).getHttpServletRequest() or
  ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this
  request already being parsed automatically in RequestCycle, before
 reaching
  servletFileUpload.parseRequest(httpServletRequest). So, Request is
 already
  been parsed... exception occur.
 
  That's why i want to use Servlet's doGet(request, response) method for
  getting HttpServletRequest(without parsing).
 
  If not servlets, Is there any other way to handle FileUploading (through
  Apache Commons API) in wicket ?
 
  Thanks...
 
 
  
  From: Peter Thomas ptrtho...@gmail.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 11:39:58 AM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  Refer this:
 
 
 
 http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html
 
  If that doesn't help you should briefly explain what your requirement is.
  There may be a better way to achieve it within Wicket instead of hacking
  around with servlets.
 
  On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:
 
   but how can we call it from our wicket web page ?
  
  
  
  
   
   From: Jeremy Thomerson jer...@wickettraining.com
   To: users@wicket.apache.org
   Sent: Tuesday, September 8, 2009 11:10:49 AM
   Subject: Re: Usage of Servlets in Wicket, How ?
  
   servlets are totally separate from Wicket - write a servlet and add it
 to
   your web.xml.  See any servlet example on the web (non-Wicket related)
  for
   assistance.
  
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
  
   On Mon, Sep 7, 2009 at 11:54 PM, FaRHaN farhan.ba...@ymail.com
 wrote:
  
Hi,
   
Is there any example in Wicket that uses Servlets (doGet() 
 doPost()).
  I
mean how can we configure Servlets in our wicket application and use
doGet(request, response)  doPost(request, response) methods. I know
   web.xml
configuration for Servlets but how can we use doGet()  doPost()
  methods.
   Do
we need wicket:ids in Servlets ?
Is there any reference for such type of example ?
   
Thanks...
   
   
   
   
  
  
  
  
  
 
 
 
 
 







Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread FaRHaN
O my dear, i want to make a separate utility method that will take Request and 
other necessary information as a parameter. just like that:

/** Utitlity Method for FileUploading /
public static void doUpload(HttpServletRequest request, FileItem fileItem){
if (ServletFileUpload.isMultipartContent(request)){
ServletFileUpload servletFileUpload = new ServletFileUpload(new 
DiskFileItemFactory());   

List fileItemsList = null;
try {
fileItemsList = servletFileUpload.parseRequest(request);

} catch (FileUploadException ex) {
System.out.println( Exception while Parsing File Upload 
Request + ex);
}

String optionalFileName = ;
Iterator it = fileItemsList.iterator();
while (it.hasNext()){
fileItem = (FileItem)it.next();
if (fileItem.isFormField()){
String fieldName = fileItem.getFieldName();
String fieldValue = fileItem.getString();
if (fileItem.getFieldName().equals(filename))
optionalFileName = fileItem.getString();
...
}
}
}
}
/* End */

And from Wicket Page, call this method when File uploading is required.
public void onSubmit(){
doUpload(httpServletRequest, fileItem);
}

This can happen or not ?
The Problem arises while Parsing request ...






From: Peter Thomas ptrtho...@gmail.com
To: users@wicket.apache.org
Sent: Tuesday, September 8, 2009 1:13:22 PM
Subject: Re: Usage of Servlets in Wicket, How ?

On Tue, Sep 8, 2009 at 12:33 PM, FaRHaN farhan.ba...@ymail.com wrote:

 I want to make it a separate API for file uploading. So that i can embed it
 in any of the application regardless of the framework (wicket, JSF, struts
 etc.). The only reason is that, we can use Apache Commons FileUpload API in
 any of the framework.
 Is there any workaround to do this ?



This is very interesting.  When you say embed it in any of the application
regardless of the framework what do you mean ?  A tag library ?  Suppose
you have a multipart form, that contains input fields PLUS a type=file
field, to what URL will you POST it and have the input data also bound /
handled ?

Note that Wicket already has FileUpload built in, that too as a pure Java
API so I'm trying to understand your end-goal better.




 
 From: Jeremy Thomerson jer...@wickettraining.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 12:44:08 PM
 Subject: Re: Usage of Servlets in Wicket, How ?

 Maybe if you mention the specific reason(s) that you want to use Apache
 Commons FileUpload API rather than Wicket's built-in forms and file upload
 mechanisms, someone on the list will be able to provide you with more help.
 It seems that the FileUpload API is intended to help you if you have to
 write servlets to handle forms.  But with Wicket, you don't have to do
 this.  And if you use ACFU API, then you lose the rest of Wicket's stateful
 form handling.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:

 
 
  I want to upload files through Commons FIleUpload API. As Commons
  FileUpload API requires HttpServletRequest for uploading files (e.g.
  fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
  Parsing HttpServletRequest is the necessary step while uploading in
 Commons
  FileUpload.
 
  I have got httpServletRequest from RequestCycle. e.g.
 ((ServletWebRequest)
  getRequest()).getHttpServletRequest() or
  ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but this
  request already being parsed automatically in RequestCycle, before
 reaching
  servletFileUpload.parseRequest(httpServletRequest). So, Request is
 already
  been parsed... exception occur.
 
  That's why i want to use Servlet's doGet(request, response) method for
  getting HttpServletRequest(without parsing).
 
  If not servlets, Is there any other way to handle FileUploading (through
  Apache Commons API) in wicket ?
 
  Thanks...
 
 
  
  From: Peter Thomas ptrtho...@gmail.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 11:39:58 AM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  Refer this:
 
 
 
 http://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html
 
  If that doesn't help you should briefly explain what your requirement is.
  There may be a better way to achieve it within Wicket instead of hacking
  around with servlets.
 
  On Tue, Sep 8, 2009 at 10:57 AM, FaRHaN farhan.ba...@ymail.com wrote:
 
   but how can we call it from our wicket web 

Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread Joseph Pachod

Jeremy Thomerson wrote:

servlets are totally separate from Wicket - write a servlet and add it to
your web.xml.  See any servlet example on the web (non-Wicket related) for
assistance.

  
I wouldn't say so, cf Igor sentence in this discussion : 
http://www.nabble.com/WicketFilter-td25205475.html#a25210469 :


map WicketSessionFilter in front of those *servlets*, you will get both 
Session.get() and Session.get().getApplication(), and  Application.get()


++

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How test modal windows with wicket tester?

2009-09-08 Thread Denis Kandrov
I have dashboard, that have modal windows for adding comments and view 
dashboard message.


How can I get this modal window for testing with wicket tester?
And how to check that modal window is opened?

Denis.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How test modal windows with wicket tester?

2009-09-08 Thread Martin Makundi
Hi!

There is nothing special in testing modal windows. It is just a panel
with a panel inside. You can use tester.assertVisible...

THe only trick is if you have windowCloseCallbacks.. you need to
invoke those manually using tester.executeBehavior...

**
Martin

2009/9/8 Denis Kandrov dkand...@unipro.ru:
 I have dashboard, that have modal windows for adding comments and view
 dashboard message.

 How can I get this modal window for testing with wicket tester?
 And how to check that modal window is opened?

 Denis.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Usage of Servlets in Wicket, How ?

2009-09-08 Thread Peter Thomas
I'm really not sure and can't help on the parsing request problem,
although I'm not surprised that attempting to unpack a multipart request
twice would result in problems.

One thing you could try is understand the form processing life cycle of
Wicket - so instead of using onSubmit() (because the request has been
already parsed and form fields bound) - you should try over-riding some
other method.  Not sure, but maybe the process() method is a candidate.

I can't help saying that IMO what you are trying is over-complicating
things.  In fact Wicket actually re-uses code from the apache commons
fileupload project, refactored into Wicket classes under:
org.apache.wicket.util.upload.  Does that make sense?

On Tue, Sep 8, 2009 at 1:16 PM, FaRHaN farhan.ba...@ymail.com wrote:

 O my dear, i want to make a separate utility method that will take Request
 and other necessary information as a parameter. just like that:

 /** Utitlity Method for FileUploading /
 public static void doUpload(HttpServletRequest request, FileItem fileItem){
if (ServletFileUpload.isMultipartContent(request)){
ServletFileUpload servletFileUpload = new ServletFileUpload(new
 DiskFileItemFactory());

List fileItemsList = null;
try {
fileItemsList = servletFileUpload.parseRequest(request);
} catch (FileUploadException ex) {
System.out.println( Exception while Parsing File Upload
 Request + ex);
}

String optionalFileName = ;
Iterator it = fileItemsList.iterator();
while (it.hasNext()){
fileItem = (FileItem)it.next();
if (fileItem.isFormField()){
String fieldName = fileItem.getFieldName();
String fieldValue = fileItem.getString();
if (fileItem.getFieldName().equals(filename))
optionalFileName = fileItem.getString();
...
}
}
}
 }
 /* End */

 And from Wicket Page, call this method when File uploading is required.
 public void onSubmit(){
doUpload(httpServletRequest, fileItem);
 }

 This can happen or not ?
 The Problem arises while Parsing request ...





 
 From: Peter Thomas ptrtho...@gmail.com
 To: users@wicket.apache.org
 Sent: Tuesday, September 8, 2009 1:13:22 PM
 Subject: Re: Usage of Servlets in Wicket, How ?

 On Tue, Sep 8, 2009 at 12:33 PM, FaRHaN farhan.ba...@ymail.com wrote:

  I want to make it a separate API for file uploading. So that i can embed
 it
  in any of the application regardless of the framework (wicket, JSF,
 struts
  etc.). The only reason is that, we can use Apache Commons FileUpload API
 in
  any of the framework.
  Is there any workaround to do this ?
 
 
 
 This is very interesting.  When you say embed it in any of the application
 regardless of the framework what do you mean ?  A tag library ?  Suppose
 you have a multipart form, that contains input fields PLUS a type=file
 field, to what URL will you POST it and have the input data also bound /
 handled ?

 Note that Wicket already has FileUpload built in, that too as a pure Java
 API so I'm trying to understand your end-goal better.



 
  
  From: Jeremy Thomerson jer...@wickettraining.com
  To: users@wicket.apache.org
  Sent: Tuesday, September 8, 2009 12:44:08 PM
  Subject: Re: Usage of Servlets in Wicket, How ?
 
  Maybe if you mention the specific reason(s) that you want to use Apache
  Commons FileUpload API rather than Wicket's built-in forms and file
 upload
  mechanisms, someone on the list will be able to provide you with more
 help.
  It seems that the FileUpload API is intended to help you if you have to
  write servlets to handle forms.  But with Wicket, you don't have to do
  this.  And if you use ACFU API, then you lose the rest of Wicket's
 stateful
  form handling.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Tue, Sep 8, 2009 at 1:04 AM, FaRHaN farhan.ba...@ymail.com wrote:
 
  
  
   I want to upload files through Commons FIleUpload API. As Commons
   FileUpload API requires HttpServletRequest for uploading files (e.g.
   fileItemsList = servletFileUpload.parseRequest(httpServletRequest)).
   Parsing HttpServletRequest is the necessary step while uploading in
  Commons
   FileUpload.
  
   I have got httpServletRequest from RequestCycle. e.g.
  ((ServletWebRequest)
   getRequest()).getHttpServletRequest() or
   ((WebRequest)requestCycle.getRequest()).getHttpServletRequest() but
 this
   request already being parsed automatically in RequestCycle, before
  reaching
   servletFileUpload.parseRequest(httpServletRequest). So, Request is
  already
   been parsed... exception occur.
  
   That's why i want to use Servlet's doGet(request, response) method for
   getting 

wicket migration to 1.4.1 - getBodyContainer

2009-09-08 Thread A. Zwaan
Hello all,

 

We are currently trying to move from wicket 1.2.6 to 1.4.1 and so far
it's going well, except for one point.

 

In the constructor of one of our pages we use the
getBodyContainer().getBodyContainer() to add an AjaxEventBehavior for
the onload event, so we can redirect to the application if we only get
one search result on the search page. According to a colleague we did it
this way because with setResponsePage it didn't work as smoothly,
something with the page needing to be constructed first or so.

 

Anyway, how would we go about this now? The migration guide says we
should used renderHead, but it doesn't allow me to add any Ajax stuff
from what I can see.

 

 

Below is a part of the code:

 

 

getBodyContainer().getBodyContainer().add(new
AjaxEventBehavior(onload)

{

  protected void onEvent(AjaxRequestTarget target) 

  {

// open worksheet if there is only one result
and autoforward is enabled.

if (results.size() == 1  autoForward)

{

 SearchViewRow document = results.get(0);

 preOpenWorksheet(document, target);

}

  }

   

  protected IAjaxCallDecorator getAjaxCallDecorator() 

  {

return new
NotificationDecorator(ResourceBundle.getTranslation(language,
ResourceBundle.DEF_ASPECT, LabelTypes.SEARCH_LOADING));

  }

});

 

 

Hope you guys can help me out here, thanks in advance in any case.

 

 

 

Met vriendelijke groet,

 

Arjan Zwaan

F I N A N  F i n a n c i a l   A n a l y s i s 

 
Koggelaan 5-D
8017 JH Zwolle

( Tel. : +31 88 77 88 990

7 E-mail: a.zw...@finan.nl mailto:a.zw...@finan.nl 

: Internet: www.finan.nl http://www.finan.nl/ 
(Findesk BV) KvK nr. 29039392 

 



Re: Mount different page for second parameter

2009-09-08 Thread Daniele Dellafiore
I think right now the only way is to use MixedParamUrlCodingStrategy

Mount a page this way:

 mount(new MixedParamUrlCodingStrategy(collection, CollectionPage.class, new 
 String[] { owner }));

so CollectionPage is mounted at: http://localhost:9090/collection/
now in CollectionPage.java you can call:

 parameters.getString(owner)

to get the first parameters that in case URL is
http://localhost:9090/artivio/collection/ildella returns ildella.

As long as MixedParamUrlCodingStrategy accept a String[] comma
separated, you can have as many parameters as you want, without having
the name of the parameters in the URL.

Btw, would be cool to have a mount mechanism that allows to create
REST url in a more intuitive way, as Igor says maybe in 1.5 :)


On Mon, Sep 7, 2009 at 8:27 PM, Vit Rozkovecrozkovec...@email.cz wrote:
 Hallo,
 which encoding strategy should one use if one would like to achieve this:

 http://somesite/somepath/user1/products -- mounted on ProductsPage.class
 http://somesite/somepath/user1/profile -- mounted on ProfilePage.class

 http://somesite/somepath/user2/products -- mounted on ProductsPage.class
 http://somesite/somepath/user2/profile -- mounted on ProfilePage.class

 on ProductsPage.class and ProfilePage.class you know which user acesses the
 page.

 Thank you for any hints.

 Vit

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Daniele Dellafiore
http://blog.ildella.net
http://twitter.com/ildella

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Attaching a wicket generated page in a multipart MIME message

2009-09-08 Thread Daniele Dellafiore
Hi. I need to sent something like an HTML newsletter and I am
wondering about a nice way to do this with wicket.
The problem is that I need to generated the rendered page without
sending it to the browser, but keep the page server side, get the
generated HTML as String and include it in a multipart mime message.

Any suggestion?

Thanks!

-- 
Daniele Dellafiore
http://blog.ildella.net
http://twitter.com/ildella

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Attaching a wicket generated page in a multipart MIME message

2009-09-08 Thread Martin Makundi
search nabble for email wicket page - or something similar.  you
should be able to find a thread that answers your question.  There
have been quite a few about dumping a Wicket page to a stream or
string to email.

http://www.nabble.com/Generating-email-body-with-wicket-td14042459.html#a14042459

http://www.danwalmsley.com/2008/10/23/sending-html-email-with-wicket-part-ii-converting-links/

http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

**
Martin



2009/9/8 Daniele Dellafiore ilde...@gmail.com:
 Hi. I need to sent something like an HTML newsletter and I am
 wondering about a nice way to do this with wicket.
 The problem is that I need to generated the rendered page without
 sending it to the browser, but keep the page server side, get the
 generated HTML as String and include it in a multipart mime message.

 Any suggestion?

 Thanks!

 --
 Daniele Dellafiore
 http://blog.ildella.net
 http://twitter.com/ildella

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket migration to 1.4.1 - getBodyContainer

2009-09-08 Thread Martijn Dashorst
You could use setResponsePage(Foo.class, PageParameters)

Martijn

On Tue, Sep 8, 2009 at 12:18 PM, A. Zwaana.zw...@finan.nl wrote:
 Hello all,



 We are currently trying to move from wicket 1.2.6 to 1.4.1 and so far
 it's going well, except for one point.



 In the constructor of one of our pages we use the
 getBodyContainer().getBodyContainer() to add an AjaxEventBehavior for
 the onload event, so we can redirect to the application if we only get
 one search result on the search page. According to a colleague we did it
 this way because with setResponsePage it didn't work as smoothly,
 something with the page needing to be constructed first or so.



 Anyway, how would we go about this now? The migration guide says we
 should used renderHead, but it doesn't allow me to add any Ajax stuff
 from what I can see.





 Below is a part of the code:





            getBodyContainer().getBodyContainer().add(new
 AjaxEventBehavior(onload)

            {

                  protected void onEvent(AjaxRequestTarget target)

                  {

                        // open worksheet if there is only one result
 and autoforward is enabled.

                        if (results.size() == 1  autoForward)

                        {

                             SearchViewRow document = results.get(0);

                             preOpenWorksheet(document, target);

                        }

                  }



                  protected IAjaxCallDecorator getAjaxCallDecorator()

                  {

                        return new
 NotificationDecorator(ResourceBundle.getTranslation(language,
 ResourceBundle.DEF_ASPECT, LabelTypes.SEARCH_LOADING));

                  }

            });





 Hope you guys can help me out here, thanks in advance in any case.







 Met vriendelijke groet,



 Arjan Zwaan

 F I N A N  F i n a n c i a l   A n a l y s i s


 Koggelaan 5-D
 8017 JH Zwolle

 ( Tel. : +31 88 77 88 990

 7 E-mail: a.zw...@finan.nl mailto:a.zw...@finan.nl

 : Internet: www.finan.nl http://www.finan.nl/
 (Findesk BV) KvK nr. 29039392







-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket migration to 1.4.1 - getBodyContainer

2009-09-08 Thread Martijn Dashorst
Or throw new RestartResponseException when you determine that you want
to render a different page instead of using ajax.

Martijn

On Tue, Sep 8, 2009 at 12:18 PM, A. Zwaana.zw...@finan.nl wrote:
 Hello all,



 We are currently trying to move from wicket 1.2.6 to 1.4.1 and so far
 it's going well, except for one point.



 In the constructor of one of our pages we use the
 getBodyContainer().getBodyContainer() to add an AjaxEventBehavior for
 the onload event, so we can redirect to the application if we only get
 one search result on the search page. According to a colleague we did it
 this way because with setResponsePage it didn't work as smoothly,
 something with the page needing to be constructed first or so.



 Anyway, how would we go about this now? The migration guide says we
 should used renderHead, but it doesn't allow me to add any Ajax stuff
 from what I can see.





 Below is a part of the code:





            getBodyContainer().getBodyContainer().add(new
 AjaxEventBehavior(onload)

            {

                  protected void onEvent(AjaxRequestTarget target)

                  {

                        // open worksheet if there is only one result
 and autoforward is enabled.

                        if (results.size() == 1  autoForward)

                        {

                             SearchViewRow document = results.get(0);

                             preOpenWorksheet(document, target);

                        }

                  }



                  protected IAjaxCallDecorator getAjaxCallDecorator()

                  {

                        return new
 NotificationDecorator(ResourceBundle.getTranslation(language,
 ResourceBundle.DEF_ASPECT, LabelTypes.SEARCH_LOADING));

                  }

            });





 Hope you guys can help me out here, thanks in advance in any case.







 Met vriendelijke groet,



 Arjan Zwaan

 F I N A N  F i n a n c i a l   A n a l y s i s


 Koggelaan 5-D
 8017 JH Zwolle

 ( Tel. : +31 88 77 88 990

 7 E-mail: a.zw...@finan.nl mailto:a.zw...@finan.nl

 : Internet: www.finan.nl http://www.finan.nl/
 (Findesk BV) KvK nr. 29039392







-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: wicket migration to 1.4.1 - getBodyContainer

2009-09-08 Thread A. Zwaan
Apparently we need to be able to show a ModalWindow in some cases, which in 
turn needs an AjaxRequestTarget, so I somehow need that Ajax event triggered 
somewhere when the page is being rendered.

Wouldn't adding a wicket:id to the body element and then adding the 
AjaxEventBehavior to it give me the same result? Or is there something tricky 
when using the onload event of the body?

-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] 
Sent: dinsdag 8 september 2009 13:24
To: users@wicket.apache.org
Subject: Re: wicket migration to 1.4.1 - getBodyContainer

You could use setResponsePage(Foo.class, PageParameters)

Martijn

On Tue, Sep 8, 2009 at 12:18 PM, A. Zwaana.zw...@finan.nl wrote:
 Hello all,



 We are currently trying to move from wicket 1.2.6 to 1.4.1 and so far
 it's going well, except for one point.



 In the constructor of one of our pages we use the
 getBodyContainer().getBodyContainer() to add an AjaxEventBehavior for
 the onload event, so we can redirect to the application if we only get
 one search result on the search page. According to a colleague we did it
 this way because with setResponsePage it didn't work as smoothly,
 something with the page needing to be constructed first or so.



 Anyway, how would we go about this now? The migration guide says we
 should used renderHead, but it doesn't allow me to add any Ajax stuff
 from what I can see.





 Below is a part of the code:





            getBodyContainer().getBodyContainer().add(new
 AjaxEventBehavior(onload)

            {

                  protected void onEvent(AjaxRequestTarget target)

                  {

                        // open worksheet if there is only one result
 and autoforward is enabled.

                        if (results.size() == 1  autoForward)

                        {

                             SearchViewRow document = results.get(0);

                             preOpenWorksheet(document, target);

                        }

                  }



                  protected IAjaxCallDecorator getAjaxCallDecorator()

                  {

                        return new
 NotificationDecorator(ResourceBundle.getTranslation(language,
 ResourceBundle.DEF_ASPECT, LabelTypes.SEARCH_LOADING));

                  }

            });





 Hope you guys can help me out here, thanks in advance in any case.







 Met vriendelijke groet,



 Arjan Zwaan

 F I N A N  F i n a n c i a l   A n a l y s i s


 Koggelaan 5-D
 8017 JH Zwolle

 ( Tel. : +31 88 77 88 990

 7 E-mail: a.zw...@finan.nl mailto:a.zw...@finan.nl

 : Internet: www.finan.nl http://www.finan.nl/
 (Findesk BV) KvK nr. 29039392







-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Passing parameters from markup to panels

2009-09-08 Thread Chris Colman
 eg you can use IComponentResolver and create a factory panel that can
 create a child based on the attributes of a tag, etc.
 
 -igor

Well it worked well to a point. That point was when I tried to place two
panels of the same type but with different attributes on the same page.

The second panel simply uses the first it seems, pulling it from the
cache based on it's wicket:id value. Because a separate instance of the
panel is not created the attributes set on the second panel are never
read - it is presented as a clone of the first, including the affect any
of its visual attributes had.



There are only 10 types of people in the world: Those who understand
binary, and those who don't.


 -Original Message-
 
 On Mon, Sep 7, 2009 at 5:23 PM, Chris
 Colmanchr...@stepaheadsoftware.com wrote:
  you say it is laughable to require knowledge of code to configure
  this. i agree, but i also think its laughable to require the
knowledge
  of markup, why shouldnt a sysadmin be able to change this? so isnt
a
  property file, or a jndi property, or a database table a better
place
  to configure this?
 
  -igor
 
  Property files, jndi properties and database tables are all in the
  programmer's domain yet control over the 'size' of something, which
is
  what this essentially is, has always and should remain, IMHO, in the
  domain of the graphic art department - heck, we all know they are
  experts at making the eye candy.
 
  The whole object oriented component architecture on which wicket is
  built is all about building web pages from components to make it
easy to
  create something that works but it also visually appealing. There's
a
  lot of experimentation by graphic designers with dimensions, colors,
  shapes, forms etc., and they're used to being able to quickly and
easily
  try different elements and adjust their size fairly easily.
 
  A natural extension to this would be that panels that merely contain
a
  variable number of items (eg., songs or news items or interesting
links)
  should be able to be 'sized' by specifying an item count in the
markup
  that includes them - not via 'remote control' in a configuration
file or
  database or something else that is in the domain of the programmer.
 
  I don't want me or other programmers to have to recompile a Java
file or
  set up a value in the database each time they want to change the
number
  of items appearing in a particular panel - especially when that same
  panel can be used differently in multiple markups.
 
  The decision as to how many items appear in a panel that is merely a
  container of items is a purely visual one - nothing to do with
business
  rules, logic or coding. It should therefore be up to a visually
oriented
  person's point of view - not a programmer's point of view (as a
  programmer I am therefore visually challenged ;) ).
 
  If anything it could be argued that the migration of the control of
such
  a 'visual consideration' out of the model/controller (panel java
class)
  and into the presentation layer (markup) is in fact move *towards*
MVC
  rather than away from it.
 
 
-
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 No virus found in this incoming message.
 Checked by AVG - www.avg.com
 Version: 8.5.409 / Virus Database: 270.13.82/2351 - Release Date:
09/07/09
 18:03:00

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: StackOverFlow (Start.java) Jetty

2009-09-08 Thread David Brown
Hello Martin, thanks for the reply. Sorry about the last post. I have become 
leary of posting code as the inhouse lawyers have admonished me for this 
practice. I realized albeit Panels or WebPage Wicket won't render a different 
class from another class without some type of event such as a link. I solved 
the problem by usurping the methods needed in the target class and putting the 
target method code into the Parent class that renders the menu. My fear was 
with this approach I would be forced to decompose all of my classes that are in 
the same directory. As it turned out this was not the case. I just saw an email 
response posted by Igor where mounted classes can pair up to URLS 
(http://somehost/somepath/someclass) which would have easily solved my 
problem but unfortunately this won't become available until 1.5. Thanks again, 
David.


- Original Message -
From: Martin Makundi martin.maku...@koodaripalvelut.com
To: users@wicket.apache.org
Sent: Monday, September 7, 2009 11:41:14 PM GMT -06:00 US/Canada Central
Subject: Re: StackOverFlow (Start.java) Jetty

Hi!

I did not understand a single word of what you just said :( I have
never had problems with panels.. would you mind posting some code so
we can see what you are trying to accomplish and how?

**
Martin

2009/9/8 David Brown dbr...@sexingtechnologies.com:
 Hello Martin, converting the WebPage to Panel foments no complaints until 
 RunTime where all of the upstream markup is re-included in the downstream 
 onClick() request. the usual complains are made: cannot find the component to 
 the paired wicket markup. The component has already been fired by this point 
 in the navigation process. I tried to add instances of the classes that are 
 being complained about but this is completely ignored by the rendering. I 
 suppose I have too many downstream children hanging off of the original 
 MainMenu class that is now the target of all the complaints about no 
 component matching the markup. Is there a way to accumulate components and 
 re-use them when needed to keep the hierarchy happy? Regards, David.

 - Original Message -
 From: Martin Makundi martin.maku...@koodaripalvelut.com
 To: users@wicket.apache.org
 Sent: Monday, September 7, 2009 12:03:39 PM GMT -06:00 US/Canada Central
 Subject: Re: StackOverFlow (Start.java) Jetty

If you have any suggestions for how to replace just part of a WebPage
  (wicket:extend) with a whole new WebPage please advise. Regards, David.

 Why not use panels? Looks like what you need is panels.

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Using java.util.Date class with CompoundPropertyModel

2009-09-08 Thread shetc

Thanks Igor! You pointed me in the right direction, as usual.
-- 
View this message in context: 
http://www.nabble.com/Using-java.util.Date-class-with-CompoundPropertyModel-tp25338777p25346526.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Help on wizard solution...

2009-09-08 Thread Peter Thomas
I think the comments on this article by Igor may give you some ideas (see
#14)

http://wicketinaction.com/2008/09/building-a-smart-entitymodel/

So having a single page, and swapping out multiple panels for each question
may be the solution.  You can write logic for the previous and next
buttons (or links) to swap in the right panel.


On Tue, Sep 8, 2009 at 7:50 PM, Muro Copenhagen copenha...@gmail.comwrote:

 Hi,

 I could use some input on how to solve a problem i have.

 In my web-app i have some cases, and each cases have several questions.

 And i want the user to flow between the pages in a wizard manner like the
 example in:
 http://www.wicket-library.com/wicket-examples/wizard/

 The only problem i have is that all the questions are database driven, and
 is not a fixed set of pages.

 But the wizard example is in the link is fixed.

 How would i make a dynamic database driven wizard, where the content of the
 wizard pages are database driven?

 Or is the wizard approach not the right way of doing it...?

 What i want to achieve is a user browsing through several question in case,
 with the option of moving backwards between the question.

 Any input from anyone ...?

 Best Regards
 Muro



Re: Help on wizard solution...

2009-09-08 Thread Pedro Santos
I think the wizard is the correct approach... You can try use
DynamicWizardModel on your wizard.

javadoc:
 * Wizard model that is specialized on dynamic wizards. Unlike the default,
static
 * {...@link WizardModel wizard model}, this model isn't very intelligent, but
rather delegates much
 * of the work and knowledge to the {...@link IDynamicWizardStep dynamic wizard
steps} it uses.

on IDynamicWizardStep you can implement the ordering and navegation rules
based on database and page params.

On Tue, Sep 8, 2009 at 11:20 AM, Muro Copenhagen copenha...@gmail.comwrote:

 Hi,

 I could use some input on how to solve a problem i have.

 In my web-app i have some cases, and each cases have several questions.

 And i want the user to flow between the pages in a wizard manner like the
 example in:
 http://www.wicket-library.com/wicket-examples/wizard/

 The only problem i have is that all the questions are database driven, and
 is not a fixed set of pages.

 But the wizard example is in the link is fixed.

 How would i make a dynamic database driven wizard, where the content of the
 wizard pages are database driven?

 Or is the wizard approach not the right way of doing it...?

 What i want to achieve is a user browsing through several question in case,
 with the option of moving backwards between the question.

 Any input from anyone ...?

 Best Regards
 Muro



Re: Help on wizard solution...

2009-09-08 Thread Muro Copenhagen
Thanks Pedro and Peter,

I'll try the DynamicWizardModel, it seems as the right choice.

But a quick google search didn't provide any example, so i must try making
it work.

Hopefully it will...

Best Regards
Muro

On Tue, Sep 8, 2009 at 4:35 PM, Pedro Santos pedros...@gmail.com wrote:

 I think the wizard is the correct approach... You can try use
 DynamicWizardModel on your wizard.

 javadoc:
  * Wizard model that is specialized on dynamic wizards. Unlike the default,
 static
  * {...@link WizardModel wizard model}, this model isn't very intelligent, but
 rather delegates much
  * of the work and knowledge to the {...@link IDynamicWizardStep dynamic
 wizard
 steps} it uses.

 on IDynamicWizardStep you can implement the ordering and navegation rules
 based on database and page params.

 On Tue, Sep 8, 2009 at 11:20 AM, Muro Copenhagen copenha...@gmail.com
 wrote:

  Hi,
 
  I could use some input on how to solve a problem i have.
 
  In my web-app i have some cases, and each cases have several questions.
 
  And i want the user to flow between the pages in a wizard manner like the
  example in:
  http://www.wicket-library.com/wicket-examples/wizard/
 
  The only problem i have is that all the questions are database driven,
 and
  is not a fixed set of pages.
 
  But the wizard example is in the link is fixed.
 
  How would i make a dynamic database driven wizard, where the content of
 the
  wizard pages are database driven?
 
  Or is the wizard approach not the right way of doing it...?
 
  What i want to achieve is a user browsing through several question in
 case,
  with the option of moving backwards between the question.
 
  Any input from anyone ...?
 
  Best Regards
  Muro
 



Re: Passing parameters from markup to panels

2009-09-08 Thread Igor Vaynberg
each panel has to have a different wicket:id and the id should not
exist in component hierarchy yet. component resolvers are only used if
wicket cannot match wicket id to an object in the component hierarchy.

-igor

On Tue, Sep 8, 2009 at 5:51 AM, Chris
Colmanchr...@stepaheadsoftware.com wrote:
 eg you can use IComponentResolver and create a factory panel that can
 create a child based on the attributes of a tag, etc.

 -igor

 Well it worked well to a point. That point was when I tried to place two
 panels of the same type but with different attributes on the same page.

 The second panel simply uses the first it seems, pulling it from the
 cache based on it's wicket:id value. Because a separate instance of the
 panel is not created the attributes set on the second panel are never
 read - it is presented as a clone of the first, including the affect any
 of its visual attributes had.



 There are only 10 types of people in the world: Those who understand
 binary, and those who don't.


 -Original Message-

 On Mon, Sep 7, 2009 at 5:23 PM, Chris
 Colmanchr...@stepaheadsoftware.com wrote:
  you say it is laughable to require knowledge of code to configure
  this. i agree, but i also think its laughable to require the
 knowledge
  of markup, why shouldnt a sysadmin be able to change this? so isnt
 a
  property file, or a jndi property, or a database table a better
 place
  to configure this?
 
  -igor
 
  Property files, jndi properties and database tables are all in the
  programmer's domain yet control over the 'size' of something, which
 is
  what this essentially is, has always and should remain, IMHO, in the
  domain of the graphic art department - heck, we all know they are
  experts at making the eye candy.
 
  The whole object oriented component architecture on which wicket is
  built is all about building web pages from components to make it
 easy to
  create something that works but it also visually appealing. There's
 a
  lot of experimentation by graphic designers with dimensions, colors,
  shapes, forms etc., and they're used to being able to quickly and
 easily
  try different elements and adjust their size fairly easily.
 
  A natural extension to this would be that panels that merely contain
 a
  variable number of items (eg., songs or news items or interesting
 links)
  should be able to be 'sized' by specifying an item count in the
 markup
  that includes them - not via 'remote control' in a configuration
 file or
  database or something else that is in the domain of the programmer.
 
  I don't want me or other programmers to have to recompile a Java
 file or
  set up a value in the database each time they want to change the
 number
  of items appearing in a particular panel - especially when that same
  panel can be used differently in multiple markups.
 
  The decision as to how many items appear in a panel that is merely a
  container of items is a purely visual one - nothing to do with
 business
  rules, logic or coding. It should therefore be up to a visually
 oriented
  person's point of view - not a programmer's point of view (as a
  programmer I am therefore visually challenged ;) ).
 
  If anything it could be argued that the migration of the control of
 such
  a 'visual consideration' out of the model/controller (panel java
 class)
  and into the presentation layer (markup) is in fact move *towards*
 MVC
  rather than away from it.
 
 
 -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 No virus found in this incoming message.
 Checked by AVG - www.avg.com
 Version: 8.5.409 / Virus Database: 270.13.82/2351 - Release Date:
 09/07/09
 18:03:00

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: wicket migration to 1.4.1 - getBodyContainer

2009-09-08 Thread Martijn Dashorst
See IHeaderResponse.renderOnDomReadyJavascript()

Martijn

On Tue, Sep 8, 2009 at 2:42 PM, A. Zwaana.zw...@finan.nl wrote:
 Apparently we need to be able to show a ModalWindow in some cases, which in 
 turn needs an AjaxRequestTarget, so I somehow need that Ajax event triggered 
 somewhere when the page is being rendered.

 Wouldn't adding a wicket:id to the body element and then adding the 
 AjaxEventBehavior to it give me the same result? Or is there something tricky 
 when using the onload event of the body?

 -Original Message-
 From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
 Sent: dinsdag 8 september 2009 13:24
 To: users@wicket.apache.org
 Subject: Re: wicket migration to 1.4.1 - getBodyContainer

 You could use setResponsePage(Foo.class, PageParameters)

 Martijn

 On Tue, Sep 8, 2009 at 12:18 PM, A. Zwaana.zw...@finan.nl wrote:
 Hello all,



 We are currently trying to move from wicket 1.2.6 to 1.4.1 and so far
 it's going well, except for one point.



 In the constructor of one of our pages we use the
 getBodyContainer().getBodyContainer() to add an AjaxEventBehavior for
 the onload event, so we can redirect to the application if we only get
 one search result on the search page. According to a colleague we did it
 this way because with setResponsePage it didn't work as smoothly,
 something with the page needing to be constructed first or so.



 Anyway, how would we go about this now? The migration guide says we
 should used renderHead, but it doesn't allow me to add any Ajax stuff
 from what I can see.





 Below is a part of the code:





            getBodyContainer().getBodyContainer().add(new
 AjaxEventBehavior(onload)

            {

                  protected void onEvent(AjaxRequestTarget target)

                  {

                        // open worksheet if there is only one result
 and autoforward is enabled.

                        if (results.size() == 1  autoForward)

                        {

                             SearchViewRow document = results.get(0);

                             preOpenWorksheet(document, target);

                        }

                  }



                  protected IAjaxCallDecorator getAjaxCallDecorator()

                  {

                        return new
 NotificationDecorator(ResourceBundle.getTranslation(language,
 ResourceBundle.DEF_ASPECT, LabelTypes.SEARCH_LOADING));

                  }

            });





 Hope you guys can help me out here, thanks in advance in any case.







 Met vriendelijke groet,



 Arjan Zwaan

 F I N A N  F i n a n c i a l   A n a l y s i s


 Koggelaan 5-D
 8017 JH Zwolle

 ( Tel. : +31 88 77 88 990

 7 E-mail: a.zw...@finan.nl mailto:a.zw...@finan.nl

 : Internet: www.finan.nl http://www.finan.nl/
 (Findesk BV) KvK nr. 29039392







 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



ajax indicator for all ajax requests blocking page

2009-09-08 Thread tubin gen
I am looking for some indicator for any ajax requests , I dont want to add
the behaviour for every component with ajax behaviour , I want something
which detects for ajax request and starts the indicator blocking the page
for further user actions and vanishess after  response is rendered is there
any?


Re: ajax indicator for all ajax requests blocking page

2009-09-08 Thread Jeremy Thomerson
http://www.google.com/search?q=wicket+ajax+indicator

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Sep 8, 2009 at 10:13 AM, tubin gen fachh...@gmail.com wrote:

 I am looking for some indicator for any ajax requests , I dont want to add
 the behaviour for every component with ajax behaviour , I want something
 which detects for ajax request and starts the indicator blocking the page
 for further user actions and vanishess after  response is rendered is there
 any?



Re: ajax indicator for all ajax requests blocking page

2009-09-08 Thread John Armstrong
I did this in pure Javascript for a recent project. You can insert
this code into your base page or whatnot. Its basically a hidden div
that you hide/show and you can style it however. You can see it in
action at http://www.pnc.net/. In my case its just a quick
'Loading...' text blurb in the top right of the window. I stole this
from 
:http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

html:
---
div id=bysy_indicatorLoading .../div

js:
---
script type=text/javascript
 window.onload = setupFunc;

 function setupFunc() {
   document.getElementsByTagName('body')[0].onclick = clickFunc;
   hideBusysign();
 Wicket.Ajax.registerPreCallHandler(showBusysign);
 Wicket.Ajax.registerPostCallHandler(hideBusysign);
 Wicket.Ajax.registerFailureHandler(hideBusysign);
 }

 function hideBusysign() {
   document.getElementById('bysy_indicator').style.display ='none';
 }

 function showBusysign() {
   document.getElementById('bysy_indicator').style.display ='inline';
 }

 function clickFunc(eventData) {
   var clickedElement = (window.event) ? event.srcElement : eventData.target;
   if (clickedElement.tagName.toUpperCase() == 'BUTTON' ||
clickedElement.tagName.toUpperCase() == 'A' ||
clickedElement.parentNode.tagName.toUpperCase() == 'A'
 || (clickedElement.tagName.toUpperCase() == 'INPUT' 
(clickedElement.type.toUpperCase() == 'BUTTON' ||
clickedElement.type.toUpperCase() == 'SUBMIT'))) {
 showBusysign();
   }
 }
/script



On Tue, Sep 8, 2009 at 8:13 AM, tubin genfachh...@gmail.com wrote:
 I am looking for some indicator for any ajax requests , I dont want to add
 the behaviour for every component with ajax behaviour , I want something
 which detects for ajax request and starts the indicator blocking the page
 for further user actions and vanishess after  response is rendered is there
 any?


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Help on wizard solution...

2009-09-08 Thread Eyal Golan
I had some experience with what you need so i hope I could help you if you
need something.
I implemented the dynamic wizard and it was actually lots of fun :)


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Tue, Sep 8, 2009 at 5:51 PM, Muro Copenhagen copenha...@gmail.comwrote:

 Thanks Pedro and Peter,

 I'll try the DynamicWizardModel, it seems as the right choice.

 But a quick google search didn't provide any example, so i must try making
 it work.

 Hopefully it will...

 Best Regards
 Muro

 On Tue, Sep 8, 2009 at 4:35 PM, Pedro Santos pedros...@gmail.com wrote:

  I think the wizard is the correct approach... You can try use
  DynamicWizardModel on your wizard.
 
  javadoc:
   * Wizard model that is specialized on dynamic wizards. Unlike the
 default,
  static
   * {...@link WizardModel wizard model}, this model isn't very intelligent,
 but
  rather delegates much
   * of the work and knowledge to the {...@link IDynamicWizardStep dynamic
  wizard
  steps} it uses.
 
  on IDynamicWizardStep you can implement the ordering and navegation rules
  based on database and page params.
 
  On Tue, Sep 8, 2009 at 11:20 AM, Muro Copenhagen copenha...@gmail.com
  wrote:
 
   Hi,
  
   I could use some input on how to solve a problem i have.
  
   In my web-app i have some cases, and each cases have several questions.
  
   And i want the user to flow between the pages in a wizard manner like
 the
   example in:
   http://www.wicket-library.com/wicket-examples/wizard/
  
   The only problem i have is that all the questions are database driven,
  and
   is not a fixed set of pages.
  
   But the wizard example is in the link is fixed.
  
   How would i make a dynamic database driven wizard, where the content of
  the
   wizard pages are database driven?
  
   Or is the wizard approach not the right way of doing it...?
  
   What i want to achieve is a user browsing through several question in
  case,
   with the option of moving backwards between the question.
  
   Any input from anyone ...?
  
   Best Regards
   Muro
  
 



Re: Help on wizard solution...

2009-09-08 Thread John Armstrong
I've done this in both DynamicWizards as well as regular wizards and
can pass some code along if you need it.

My rule of thumb is If you can gather all of the content together for
your wizard use a regular wizard (eg: non-dependent configuration
directives), if future wizard steps can change based on a specific
wizard step then use a DynamicWizard (eg: If you pick A on Step 5 then
Step 6 shows D, otherwise Step 6 shows F

I have found that controlling backwards and forwards navigation in a
dynamic wizard very difficult since you are responsible for all of the
logic.

John-

On Tue, Sep 8, 2009 at 8:30 AM, Eyal Golanegola...@gmail.com wrote:
 I had some experience with what you need so i hope I could help you if you
 need something.
 I implemented the dynamic wizard and it was actually lots of fun :)


 Eyal Golan
 egola...@gmail.com

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P  Save a tree. Please don't print this e-mail unless it's really necessary


 On Tue, Sep 8, 2009 at 5:51 PM, Muro Copenhagen copenha...@gmail.comwrote:

 Thanks Pedro and Peter,

 I'll try the DynamicWizardModel, it seems as the right choice.

 But a quick google search didn't provide any example, so i must try making
 it work.

 Hopefully it will...

 Best Regards
 Muro

 On Tue, Sep 8, 2009 at 4:35 PM, Pedro Santos pedros...@gmail.com wrote:

  I think the wizard is the correct approach... You can try use
  DynamicWizardModel on your wizard.
 
  javadoc:
   * Wizard model that is specialized on dynamic wizards. Unlike the
 default,
  static
   * {...@link WizardModel wizard model}, this model isn't very intelligent,
 but
  rather delegates much
   * of the work and knowledge to the {...@link IDynamicWizardStep dynamic
  wizard
  steps} it uses.
 
  on IDynamicWizardStep you can implement the ordering and navegation rules
  based on database and page params.
 
  On Tue, Sep 8, 2009 at 11:20 AM, Muro Copenhagen copenha...@gmail.com
  wrote:
 
   Hi,
  
   I could use some input on how to solve a problem i have.
  
   In my web-app i have some cases, and each cases have several questions.
  
   And i want the user to flow between the pages in a wizard manner like
 the
   example in:
   http://www.wicket-library.com/wicket-examples/wizard/
  
   The only problem i have is that all the questions are database driven,
  and
   is not a fixed set of pages.
  
   But the wizard example is in the link is fixed.
  
   How would i make a dynamic database driven wizard, where the content of
  the
   wizard pages are database driven?
  
   Or is the wizard approach not the right way of doing it...?
  
   What i want to achieve is a user browsing through several question in
  case,
   with the option of moving backwards between the question.
  
   Any input from anyone ...?
  
   Best Regards
   Muro
  
 



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ajax indicator for all ajax requests blocking page

2009-09-08 Thread fachhoch

I also want to mask page   along with loading indication is there anything
available ?

John Armstrong-3 wrote:
 
 I did this in pure Javascript for a recent project. You can insert
 this code into your base page or whatnot. Its basically a hidden div
 that you hide/show and you can style it however. You can see it in
 action at http://www.pnc.net/. In my case its just a quick
 'Loading...' text blurb in the top right of the window. I stole this
 from
 :http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
 
 html:
 ---
 div id=bysy_indicatorLoading .../div
 
 js:
 ---
 script type=text/javascript
  window.onload = setupFunc;
 
  function setupFunc() {
document.getElementsByTagName('body')[0].onclick = clickFunc;
hideBusysign();
  Wicket.Ajax.registerPreCallHandler(showBusysign);
  Wicket.Ajax.registerPostCallHandler(hideBusysign);
  Wicket.Ajax.registerFailureHandler(hideBusysign);
  }
 
  function hideBusysign() {
document.getElementById('bysy_indicator').style.display ='none';
  }
 
  function showBusysign() {
document.getElementById('bysy_indicator').style.display ='inline';
  }
 
  function clickFunc(eventData) {
var clickedElement = (window.event) ? event.srcElement :
 eventData.target;
if (clickedElement.tagName.toUpperCase() == 'BUTTON' ||
 clickedElement.tagName.toUpperCase() == 'A' ||
 clickedElement.parentNode.tagName.toUpperCase() == 'A'
  || (clickedElement.tagName.toUpperCase() == 'INPUT' 
 (clickedElement.type.toUpperCase() == 'BUTTON' ||
 clickedElement.type.toUpperCase() == 'SUBMIT'))) {
  showBusysign();
}
  }
 /script
 
 
 
 On Tue, Sep 8, 2009 at 8:13 AM, tubin genfachh...@gmail.com wrote:
 I am looking for some indicator for any ajax requests , I dont want to
 add
 the behaviour for every component with ajax behaviour , I want something
 which detects for ajax request and starts the indicator blocking the page
 for further user actions and vanishess after  response is rendered is
 there
 any?

 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/ajax-indicator-for-all-ajax-requests-blocking-page-tp25348177p25349567.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ajax indicator for all ajax requests blocking page

2009-09-08 Thread Pedro Santos
try this js:

var mask = new Wicket.Window.Mask(false); mask.show();

the Mask is the use by ModalWindow:
http://www.wicket-library.com/wicket-examples/ajax/modal-window.2

On Tue, Sep 8, 2009 at 1:26 PM, fachhoch fachh...@gmail.com wrote:


 I also want to mask page   along with loading indication is there anything
 available ?

 John Armstrong-3 wrote:
 
  I did this in pure Javascript for a recent project. You can insert
  this code into your base page or whatnot. Its basically a hidden div
  that you hide/show and you can style it however. You can see it in
  action at http://www.pnc.net/. In my case its just a quick
  'Loading...' text blurb in the top right of the window. I stole this
  from
  :
 http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
 
  html:
  ---
  div id=bysy_indicatorLoading .../div
 
  js:
  ---
  script type=text/javascript
   window.onload = setupFunc;
 
   function setupFunc() {
 document.getElementsByTagName('body')[0].onclick = clickFunc;
 hideBusysign();
   Wicket.Ajax.registerPreCallHandler(showBusysign);
   Wicket.Ajax.registerPostCallHandler(hideBusysign);
   Wicket.Ajax.registerFailureHandler(hideBusysign);
   }
 
   function hideBusysign() {
 document.getElementById('bysy_indicator').style.display ='none';
   }
 
   function showBusysign() {
 document.getElementById('bysy_indicator').style.display ='inline';
   }
 
   function clickFunc(eventData) {
 var clickedElement = (window.event) ? event.srcElement :
  eventData.target;
 if (clickedElement.tagName.toUpperCase() == 'BUTTON' ||
  clickedElement.tagName.toUpperCase() == 'A' ||
  clickedElement.parentNode.tagName.toUpperCase() == 'A'
   || (clickedElement.tagName.toUpperCase() == 'INPUT' 
  (clickedElement.type.toUpperCase() == 'BUTTON' ||
  clickedElement.type.toUpperCase() == 'SUBMIT'))) {
   showBusysign();
 }
   }
  /script
 
 
 
  On Tue, Sep 8, 2009 at 8:13 AM, tubin genfachh...@gmail.com wrote:
  I am looking for some indicator for any ajax requests , I dont want to
  add
  the behaviour for every component with ajax behaviour , I want something
  which detects for ajax request and starts the indicator blocking the
 page
  for further user actions and vanishess after  response is rendered is
  there
  any?
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

 --
 View this message in context:
 http://www.nabble.com/ajax-indicator-for-all-ajax-requests-blocking-page-tp25348177p25349567.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




problem with ResourceLink

2009-09-08 Thread Eyal Golan
Hi,
We have the following code:

static public ResourceLink getResourceLink(String id,byte[] data,final
String title,String contentType){
ResourceLink resourceLink = new ResourceLink(id, new
CustomResource(data,contentType,title)){
private static final long serialVersionUID = 1L;

@Override
protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, title);
}
};
//resourceLink.add(new Label(title,new Model(title)));
return resourceLink;
}

and CustomResource is:
public class CustomResource extends Resource{

String filename = ;
ByteArrayResource byteArrayResource = null;


public CustomResource (byte[] data,String contentType,String
filename){
byteArrayResource = new
ByteArrayResource(contentType,data,filename);
this.filename = filename;
}

public IResourceStream getResourceStream() {
return byteArrayResource.getResourceStream();
//return getFile();
//return getAttachment();
}

   }

when the user presses a link of a file named: myFile.doc a save dialog is
opened and the file name is ui.doc
I looked into the code and found that in Resource#onResourceRequested
there's the line: cycle.setRequestTarget(new
ResourceStreamRequestTarget(resourceStream));
When I debugged and changed the value of fileName in
ResourceStreamRequestTarget to bla.doc I got the bla.doc in the save dialog.
We use Wicket 1.3.6

How can I call the constructor of ResourceStreamRequestTarget with the file
name?

Another question,
Is there a way to get the content type out of the file without hard coding?
now we have this:
private String getContentType(String fileName){
fileName = fileName.toLowerCase();
String contentType = null;
if (fileName.endsWith(.doc)) {
contentType = application/msword;
} else if (fileName.endsWith(.html)
|| fileName.endsWith(.txt)
|| fileName.endsWith(.log)
|| fileName.endsWith(.properties))
{
contentType = text/html;
} else if (fileName.endsWith(.pdf)) {
contentType = application/pdf;
} else if (fileName.endsWith(.xls)) {
contentType = application/vnd.ms-excel;
} else if (fileName.endsWith(.pot)
|| fileName.endsWith(.pps)
|| fileName.endsWith(.ppt)) {
contentType = application/vnd.ms-powerpoint;
} else if (fileName.endsWith(.zip)) {
contentType = application/x-zip-compressed;
} else if (fileName.endsWith(.jpg)) {
contentType = image/jpeg;
} else if (fileName.endsWith(.png)) {
contentType = image/png;
} else if (fileName.endsWith(.gif)) {
contentType = image/gif;
} else if (fileName.endsWith(.mp3)) {
contentType = audio/mpeg;
} else if (fileName.endsWith(.bmp)) {
contentType = image/bmp;
} else {
//try {
//contentType
=text/+fileName.substring(fileName.lastIndexOf(.)+1);
//} catch (Exception e) {
//}
}
return contentType;
}


BTW,
I've noticed that there's DownloadLink. Should we use this?

Thanks

Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


Re: Help on wizard solution...

2009-09-08 Thread Eyal Golan
+1 for john

Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


Help on wizard solution...

2009-09-08 Thread Muro Copenhagen
Hi,

I could use some input on how to solve a problem i have.

In my web-app i have some cases, and each cases have several questions.

And i want the user to flow between the pages in a wizard manner like the
example in:
http://www.wicket-library.com/wicket-examples/wizard/

The only problem i have is that all the questions are database driven, and
is not a fixed set of pages.

But the wizard example is in the link is fixed.

How would i make a dynamic database driven wizard, where the content of the
wizard pages are database driven?

Or is the wizard approach not the right way of doing it...?

What i want to achieve is a user browsing through several question in case,
with the option of moving backwards between the question.

Any input from anyone ...?

Best Regards
Muro


Re: ajax indicator for all ajax requests blocking page

2009-09-08 Thread fachhoch

can you tell me more about this script I am totally null with java script 
should I add this   var mask = new Wicket.Window.Mask(false); mask.show();
inside the showBusysign()   function?  and if I want to  remove mask what
function should I call ?


Pedro Santos-6 wrote:
 
 try this js:
 
 var mask = new Wicket.Window.Mask(false); mask.show();
 
 the Mask is the use by ModalWindow:
 http://www.wicket-library.com/wicket-examples/ajax/modal-window.2
 
 On Tue, Sep 8, 2009 at 1:26 PM, fachhoch fachh...@gmail.com wrote:
 

 I also want to mask page   along with loading indication is there
 anything
 available ?

 John Armstrong-3 wrote:
 
  I did this in pure Javascript for a recent project. You can insert
  this code into your base page or whatnot. Its basically a hidden div
  that you hide/show and you can style it however. You can see it in
  action at http://www.pnc.net/. In my case its just a quick
  'Loading...' text blurb in the top right of the window. I stole this
  from
  :
 http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
 
  html:
  ---
  div id=bysy_indicatorLoading .../div
 
  js:
  ---
  script type=text/javascript
   window.onload = setupFunc;
 
   function setupFunc() {
 document.getElementsByTagName('body')[0].onclick = clickFunc;
 hideBusysign();
   Wicket.Ajax.registerPreCallHandler(showBusysign);
   Wicket.Ajax.registerPostCallHandler(hideBusysign);
   Wicket.Ajax.registerFailureHandler(hideBusysign);
   }
 
   function hideBusysign() {
 document.getElementById('bysy_indicator').style.display ='none';
   }
 
   function showBusysign() {
 document.getElementById('bysy_indicator').style.display ='inline';
   }
 
   function clickFunc(eventData) {
 var clickedElement = (window.event) ? event.srcElement :
  eventData.target;
 if (clickedElement.tagName.toUpperCase() == 'BUTTON' ||
  clickedElement.tagName.toUpperCase() == 'A' ||
  clickedElement.parentNode.tagName.toUpperCase() == 'A'
   || (clickedElement.tagName.toUpperCase() == 'INPUT' 
  (clickedElement.type.toUpperCase() == 'BUTTON' ||
  clickedElement.type.toUpperCase() == 'SUBMIT'))) {
   showBusysign();
 }
   }
  /script
 
 
 
  On Tue, Sep 8, 2009 at 8:13 AM, tubin genfachh...@gmail.com wrote:
  I am looking for some indicator for any ajax requests , I dont want to
  add
  the behaviour for every component with ajax behaviour , I want
 something
  which detects for ajax request and starts the indicator blocking the
 page
  for further user actions and vanishess after  response is rendered is
  there
  any?
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

 --
 View this message in context:
 http://www.nabble.com/ajax-indicator-for-all-ajax-requests-blocking-page-tp25348177p25349567.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 
 

-- 
View this message in context: 
http://www.nabble.com/ajax-indicator-for-all-ajax-requests-blocking-page-tp25348177p25350647.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Can't update TextField via Ajax after a validation error

2009-09-08 Thread Neil Curzon
Hi Jason,

Thanks for the tip and explanation. It makes sense, and calling
testInput.clearInput() fixed the issue.

Neil

On Fri, Sep 4, 2009 at 7:20 PM, Jason Lea ja...@kumachan.net.nz wrote:

 When a field is submitted and there is a validation error, it doesn't
 update the model and the field will redisplay with the invalid input.  This
 way the user can see what they typed and can fix the problem.
 With your populate link, you are updating the model, but wicket won't look
 at the model because the field is redisplaying the invalid input (in your
 case an empty field).

 If you want to update the underlying model value and ignore the previous
 failed validation you will need to clear the input.
 You could use Form.clearInput() to clear all invalid fields or
 testInput.clearInput() perhaps.

 Neil Curzon wrote:

 Thanks for the reply.

 It doesn't sound like this is exactly what I want, though. I do need my
 required field to be validated, always. I just don't understand why
 validation works when the link that fills in the Integer behind the
 property
 model is clicked first, but the same link populating and updating the
 field
 stops working after a validation error.

 On Fri, Sep 4, 2009 at 6:11 PM, Pedro Santos pedros...@gmail.com wrote:



 Take a look at:


 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean)http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing%28boolean%29
 
 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing%28boolean%29
 


 On Fri, Sep 4, 2009 at 7:01 PM, Neil Curzon neil.cur...@gmail.com
 wrote:



 Hi all,

 I'm having a weird problem that causes an input to refuse to update with


 an


 AjaxLink click method when there's been a validation error. One field in
 the
 form has a property model pointing to an Integer value. It's set to
 required, and there are other links that set the Integer value.

 What I see is that when I first click a link that populates the Integer
 under the required field, everything works fine. But when I click submit
 first, the populate links stop working. The handlers are still invoked,


 but


 the HTML that comes back in the Ajax Debug shows an input with value=
 (even though the getModelObject() for that TextField returns the proper
 value in debugging statements). This results in the input always being
 showed empty. If I do things in the proper order, I see the correct
 value
 populate in the text field as expected. It's not just a display issue,
 either. The form refuses to submit successfully at all if there was a
 validation error first (and you don't manually enter anything into the
 field).

 Below is a simple application that reproduces the issue I'm seeing. I'm
 using wicket 1.3.7 but I've tried 1.4.1 with the same result. Any help
 would
 be greatly appreciated.

 Thanks
 Neil



 public class HomePage extends WebPage {

   public HomePage() {
   add(new TestForm(testForm));
   }

   class TestForm extends Form {

   private Integer value;
   private FeedbackPanel feedbackPanel;
   private TextField testInput;

   public TestForm(String id) {
   super(id);

   add(feedbackPanel = new FeedbackPanel(feedbackPanel));
   feedbackPanel.setOutputMarkupId(true);

   add(testInput = new TextField(testInput, new
 PropertyModel(this, value)));
   testInput.setRequired(true);
   testInput.setOutputMarkupId(true);

   add(new AjaxButton(submitButton){
   @Override
   protected void onError(AjaxRequestTarget target, Form


 form)


 {
   target.addComponent(feedbackPanel);
   }

   protected void onSubmit(AjaxRequestTarget target, Form


 form)


 {
   info(It worked!);
   target.addComponent(feedbackPanel);
   }
   });

   add(new AjaxLink(chooseOneLink){
   public void onClick(AjaxRequestTarget target) {
   value = 1;
   target.addComponent(testInput);
   target.addComponent(feedbackPanel);
   }
   });
   }
   }
 }

 html
   body
   form wicket:id=testForm
   div wicket:id=feedbackPanel/
   input wicket:id=testInput/
   a wicket:id=chooseOneLinkChoose 1/a
   button wicket:id=submitButtonSubmit/button
   /form
   /body
 /html







 --
 Jason Lea





Re: Property Models

2009-09-08 Thread Pedro Santos
T is the type parameter for the model object (
http://static.ddpoker.com/javadoc/wicket/1.4-m1/org/apache/wicket/model/IModel.html),
if you are creating an PropertyModel to retrieve and access an String
property, so String is the correct type parameter for the PropertyModel...

On Tue, Sep 8, 2009 at 2:13 AM, Douglas Ferguson doug...@douglasferguson.us
 wrote:

 If I have a have this:

 CompoundPropertyModel(Person)

 PropertyModel(Person, name);

 Would this be accurate?

  CompoundPropertyModelPerson
 PropertyModelString -assuming name is a string



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




[Training] Autumn Apache Wicket Schedule For London Amsterdam

2009-09-08 Thread jWeekend
The following dates for jWeekend's 2 day Apache Wicket training 
courses, jw703 [1], are now scheduled and confirmed. 
Course syllabus and student reviews can be found on our site.


London: [2]
Sep23-24(Wed-Thu), Oct8-9(Thu-Fri), Oct10-11(Sat-Sun),   
Nov2-3(Mon-Tue), Nov7-8(Sat-Sun), Nov26-27(Thu-Fri)   


Amsterdam: [3]
Sep28-29, Nov30-Dec1

Contact us [4] regarding customised dates and/or content 
(add-on modules available from our Java, OO/UML, Spring 
and JPA courses) as well as on-site delivery.


Regards - Cemal 
jWeekend 
OO  Java Technologies, Wicket Training and Development 
http://jWeekend.com


[1] http://jweekend.com/dev/JW703/
[2] http://jweekend.com/dev/BookingPage/
[3] http://www.jteam.nl/news/wicket.html
[4] http://jweekend.com/dev/ContactUs




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: maven wicket stuff

2009-09-08 Thread Pedro Santos
sorry, I realize now: just set the artifactIdgmap2/artifactId line

On Tue, Sep 8, 2009 at 5:53 PM, Pedro Santos pedros...@gmail.com wrote:

 Hi, I'm trying to add dependency to my project from wicket stuff like:
 dependency
 groupIdorg.wicketstuff/groupId
 artifactIdgmap2-parent/artifactId
 version1.4-SNAPSHOT/version
 /dependency
 but the artifact is missing... something I can do about?



Re: maven wicket stuff

2009-09-08 Thread Jeremy Thomerson
I think you're going to want to use artifactIdgmap/artifactId.
gmap-parent is a pom-only distribution.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Sep 8, 2009 at 3:53 PM, Pedro Santos pedros...@gmail.com wrote:

 Hi, I'm trying to add dependency to my project from wicket stuff like:
dependency
groupIdorg.wicketstuff/groupId
artifactIdgmap2-parent/artifactId
version1.4-SNAPSHOT/version
/dependency
 but the artifact is missing... something I can do about?



Re: maven wicket stuff

2009-09-08 Thread Jeremy Thomerson
also, make sure that you added the wicketstuff repo to your pom (as
described on the ws wiki somewhere)

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Sep 8, 2009 at 3:57 PM, Jeremy Thomerson
jer...@wickettraining.comwrote:

 I think you're going to want to use artifactIdgmap/artifactId.
 gmap-parent is a pom-only distribution.

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Tue, Sep 8, 2009 at 3:53 PM, Pedro Santos pedros...@gmail.com wrote:

 Hi, I'm trying to add dependency to my project from wicket stuff like:
dependency
groupIdorg.wicketstuff/groupId
artifactIdgmap2-parent/artifactId
version1.4-SNAPSHOT/version
/dependency
 but the artifact is missing... something I can do about?





Re: The alternative to: HeaderContributor.forCss

2009-09-08 Thread David Brown
Hello Jeremy, thanks for the link. This works. Regards, David.


- Original Message -
From: Jeremy Thomerson jer...@wickettraining.com
To: users@wicket.apache.org
Sent: Monday, September 7, 2009 10:44:06 PM GMT -06:00 US/Canada Central
Subject: Re: The alternative to: HeaderContributor.forCss

The replacement for the deprecated method is written in the JavaDocs.

http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/HeaderContributor.html

--
Jeremy Thomerson
http://www.wickettraining.com



On Mon, Sep 7, 2009 at 10:18 PM, David Brown
dbr...@sexingtechnologies.comwrote:

 Hello, something I have been ignoring for a long time is in the subject
 line. Though my IDE tells me it is deprecated I have not see a good
 alternative anywhere (wicketstuff, google, etc.). All of my CSS is in
 several files and directories under one directory named: style. What is a
 good WebPage class by WebPage class way of including the path to the CSS
 files. I would prefer something that easily references the resources
 directory. The entire app gets the same CSS applied. Regards and please
 advise, David.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Passing parameters from markup to panels

2009-09-08 Thread Adrian Wiesmann

Chris Colman wrote:


I've thought of a very ugly way of doing it with the current version of
wicket but it relies on quite a lot of smoke and mirrors and hooking
into the component creation process. I'll give that a go for now.


We went a similar but still different way :) We use our own XML 
formatted files from which we render HTML, Swing, FOP, Excel... Because 
of this the designer can not only change the fields and their bindings 
but also parameters like rowcount in lists.


Cheers,
Adrian


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Flash/ExternalInterface does not work in IE if movie is fetched via Wicket/Ajax

2009-09-08 Thread Heikki Uotinen
There is a bug in wicket-ajax.js:268 (1.4.1) that breaks 
IE+Flash/ExternalInterface:

// place all newly created elements before the old element  
while(tempParent.childNodes.length  0) {
var tempElement = tempParent.childNodes[0];
   tempParent.removeChild(tempElement); 
parent.insertBefore(tempElement, element);
tempElement = null;
}

Calling removeChild is not needed because insertBefore moves element from its 
original place.
If you remove removeChild line and check tempParent.childNodes.length you 
can see that it is 
decreased by one after insertBefore.

This removeChild breaks Flash/ExternalInterface in IE. If removeChild is 
removed then everything 
works fine. IE is more strict here than other browsers.

Demonstration is still at (there is no need for Flash CS4 to test this)

http://download.syncrontech.com/public/quickstart_noname.zip


Could someone confirm this and suggest how to proceed ?


-Heikki


-Original Message-
From: Heikki Uotinen [mailto:heikki.uoti...@syncrontech.com] 
Sent: 7. syyskuuta 2009 9:21
To: users@wicket.apache.org
Subject: RE: Flash/ExternalInterface does not work in IE if movie is fetched 
via Wicket/Ajax

There is a problem with IE/ExternalInterface if movie is added to DOM f.ex 
appendChild
JavaScript functions are called but they do not return any value.

This is clearly MS problem but could IE specific function in wicket-ajax.js be 
adjusted somehow ?

Simple test case has

var flashMovie = 'OBJECT id=testId codeBase=http://fpdownload..

// Works in IE and FF
document.getElementById(testdiv).innerHTML = flashMovie;

// ExternalInterface.call calls JS but does not return value in IE. 
Works in FF
var tempDiv = document.createElement(div);
tempDiv.innerHTML = flashMovie;
document.body.appendChild(tempDiv);

Here is complete code (ajax.swf can be found in zip files)

http://pastebin.com/fbc0aa9a

Here is AS3 code in ajax.fla

http://pastebin.com/d4efd47b


-Heikki

-Original Message-
From: Mikko Pukki [mailto:mikko.pu...@syncrontech.com] 
Sent: 4. syyskuuta 2009 15:33
To: users@wicket.apache.org
Subject: Flash/ExternalInterface does not work in IE if movie is fetched via 
Wicket/Ajax

Hi,

This example demonstrates that ExternalInterface fails with IE only if movie is 
fetched via Wicket/Ajax.

ajaxtest.zip:
(http://download.syncrontech.com/public/ajaxtest.zip)

Page first.html fetches second.html page via Ajax. Second.html has Flash 
movie
that calls JavaScript methods with ExternalInterface and produces output
Start...
ExternalInterface.available:true
ExternalInterface.objectID:testId
fromJs:text from js (first.html)

This works both FF 3.5 and IE 7/IE8


quickstart_noname.zip:
(http://download.syncrontech.com/public/quickstart_noname.zip)

Same demonstration with wicket. This fails with IE

Start...
ExternalInterface.available:true
ExternalInterface.objectID:null
fromJs:null

ObjectId is null and JavaScript call does not return any value.

We are aware about EI/IE problems in past, but any of those does not seem to 
fit here.

Wicket 1.4.1, Flash Player 10, IE 7/8, FF 3.5

Has anyone encountered any similar behavior and/or has found any workaround?
Should I create a Jira issue?


--
Mikko Pukki
Syncron Tech Oy
Laserkatu 6
53850 Lappeenranta
+358 400 757 178


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Flash/ExternalInterface does not work in IE if movie is fetched via Wicket/Ajax

2009-09-08 Thread Matej Knopp
Well, it's not exactly wrong. Looks like an IE quirk to me. But I
suppose we can just move the element anyway.

-Matej

On Tue, Sep 8, 2009 at 11:10 PM, Matej Knoppmatej.kn...@gmail.com wrote:
 Hi,

 can you create jira issue with problem description? The code indeed
 looks wrong I can fix it once the issue is created.

 -Matej

 On Tue, Sep 8, 2009 at 9:59 PM, Heikki
 Uotinenheikki.uoti...@syncrontech.com wrote:
 There is a bug in wicket-ajax.js:268 (1.4.1) that breaks 
 IE+Flash/ExternalInterface:

        // place all newly created elements before the old element
        while(tempParent.childNodes.length  0) {
                var tempElement = tempParent.childNodes[0];
           tempParent.removeChild(tempElement); 
                parent.insertBefore(tempElement, element);
                tempElement = null;
        }

 Calling removeChild is not needed because insertBefore moves element from 
 its original place.
 If you remove removeChild line and check tempParent.childNodes.length 
 you can see that it is
 decreased by one after insertBefore.

 This removeChild breaks Flash/ExternalInterface in IE. If removeChild is 
 removed then everything
 works fine. IE is more strict here than other browsers.

 Demonstration is still at (there is no need for Flash CS4 to test this)

 http://download.syncrontech.com/public/quickstart_noname.zip


 Could someone confirm this and suggest how to proceed ?


 -Heikki


 -Original Message-
 From: Heikki Uotinen [mailto:heikki.uoti...@syncrontech.com]
 Sent: 7. syyskuuta 2009 9:21
 To: users@wicket.apache.org
 Subject: RE: Flash/ExternalInterface does not work in IE if movie is fetched 
 via Wicket/Ajax

 There is a problem with IE/ExternalInterface if movie is added to DOM f.ex 
 appendChild
 JavaScript functions are called but they do not return any value.

 This is clearly MS problem but could IE specific function in wicket-ajax.js 
 be adjusted somehow ?

 Simple test case has

        var flashMovie = 'OBJECT id=testId codeBase=http://fpdownload..

        // Works in IE and FF
                document.getElementById(testdiv).innerHTML = flashMovie;

        // ExternalInterface.call calls JS but does not return value in IE. 
 Works in FF
        var tempDiv = document.createElement(div);
        tempDiv.innerHTML = flashMovie;
        document.body.appendChild(tempDiv);

 Here is complete code (ajax.swf can be found in zip files)

 http://pastebin.com/fbc0aa9a

 Here is AS3 code in ajax.fla

 http://pastebin.com/d4efd47b


 -Heikki

 -Original Message-
 From: Mikko Pukki [mailto:mikko.pu...@syncrontech.com]
 Sent: 4. syyskuuta 2009 15:33
 To: users@wicket.apache.org
 Subject: Flash/ExternalInterface does not work in IE if movie is fetched via 
 Wicket/Ajax

 Hi,

 This example demonstrates that ExternalInterface fails with IE only if movie 
 is fetched via Wicket/Ajax.

 ajaxtest.zip:
 (http://download.syncrontech.com/public/ajaxtest.zip)

 Page first.html fetches second.html page via Ajax. Second.html has Flash 
 movie
 that calls JavaScript methods with ExternalInterface and produces output
 Start...
 ExternalInterface.available:true
 ExternalInterface.objectID:testId
 fromJs:text from js (first.html)

 This works both FF 3.5 and IE 7/IE8


 quickstart_noname.zip:
 (http://download.syncrontech.com/public/quickstart_noname.zip)

 Same demonstration with wicket. This fails with IE

 Start...
 ExternalInterface.available:true
 ExternalInterface.objectID:null
 fromJs:null

 ObjectId is null and JavaScript call does not return any value.

 We are aware about EI/IE problems in past, but any of those does not seem to 
 fit here.

 Wicket 1.4.1, Flash Player 10, IE 7/8, FF 3.5

 Has anyone encountered any similar behavior and/or has found any workaround?
 Should I create a Jira issue?


 --
 Mikko Pukki
 Syncron Tech Oy
 Laserkatu 6
 53850 Lappeenranta
 +358 400 757 178


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Flash/ExternalInterface does not work in IE if movie is fetched via Wicket/Ajax

2009-09-08 Thread Matej Knopp
Hi,

can you create jira issue with problem description? The code indeed
looks wrong I can fix it once the issue is created.

-Matej

On Tue, Sep 8, 2009 at 9:59 PM, Heikki
Uotinenheikki.uoti...@syncrontech.com wrote:
 There is a bug in wicket-ajax.js:268 (1.4.1) that breaks 
 IE+Flash/ExternalInterface:

        // place all newly created elements before the old element
        while(tempParent.childNodes.length  0) {
                var tempElement = tempParent.childNodes[0];
           tempParent.removeChild(tempElement); 
                parent.insertBefore(tempElement, element);
                tempElement = null;
        }

 Calling removeChild is not needed because insertBefore moves element from its 
 original place.
 If you remove removeChild line and check tempParent.childNodes.length you 
 can see that it is
 decreased by one after insertBefore.

 This removeChild breaks Flash/ExternalInterface in IE. If removeChild is 
 removed then everything
 works fine. IE is more strict here than other browsers.

 Demonstration is still at (there is no need for Flash CS4 to test this)

 http://download.syncrontech.com/public/quickstart_noname.zip


 Could someone confirm this and suggest how to proceed ?


 -Heikki


 -Original Message-
 From: Heikki Uotinen [mailto:heikki.uoti...@syncrontech.com]
 Sent: 7. syyskuuta 2009 9:21
 To: users@wicket.apache.org
 Subject: RE: Flash/ExternalInterface does not work in IE if movie is fetched 
 via Wicket/Ajax

 There is a problem with IE/ExternalInterface if movie is added to DOM f.ex 
 appendChild
 JavaScript functions are called but they do not return any value.

 This is clearly MS problem but could IE specific function in wicket-ajax.js 
 be adjusted somehow ?

 Simple test case has

        var flashMovie = 'OBJECT id=testId codeBase=http://fpdownload..

        // Works in IE and FF
                document.getElementById(testdiv).innerHTML = flashMovie;

        // ExternalInterface.call calls JS but does not return value in IE. 
 Works in FF
        var tempDiv = document.createElement(div);
        tempDiv.innerHTML = flashMovie;
        document.body.appendChild(tempDiv);

 Here is complete code (ajax.swf can be found in zip files)

 http://pastebin.com/fbc0aa9a

 Here is AS3 code in ajax.fla

 http://pastebin.com/d4efd47b


 -Heikki

 -Original Message-
 From: Mikko Pukki [mailto:mikko.pu...@syncrontech.com]
 Sent: 4. syyskuuta 2009 15:33
 To: users@wicket.apache.org
 Subject: Flash/ExternalInterface does not work in IE if movie is fetched via 
 Wicket/Ajax

 Hi,

 This example demonstrates that ExternalInterface fails with IE only if movie 
 is fetched via Wicket/Ajax.

 ajaxtest.zip:
 (http://download.syncrontech.com/public/ajaxtest.zip)

 Page first.html fetches second.html page via Ajax. Second.html has Flash 
 movie
 that calls JavaScript methods with ExternalInterface and produces output
 Start...
 ExternalInterface.available:true
 ExternalInterface.objectID:testId
 fromJs:text from js (first.html)

 This works both FF 3.5 and IE 7/IE8


 quickstart_noname.zip:
 (http://download.syncrontech.com/public/quickstart_noname.zip)

 Same demonstration with wicket. This fails with IE

 Start...
 ExternalInterface.available:true
 ExternalInterface.objectID:null
 fromJs:null

 ObjectId is null and JavaScript call does not return any value.

 We are aware about EI/IE problems in past, but any of those does not seem to 
 fit here.

 Wicket 1.4.1, Flash Player 10, IE 7/8, FF 3.5

 Has anyone encountered any similar behavior and/or has found any workaround?
 Should I create a Jira issue?


 --
 Mikko Pukki
 Syncron Tech Oy
 Laserkatu 6
 53850 Lappeenranta
 +358 400 757 178


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket and FileUpload on Google App Engine

2009-09-08 Thread Esteban Masoero
Hi uudashr, I gotta tell you've done terrific work! I tried it in my 
wicket-GAE app and it worked :)


Comments/questions:

About wicket framework:
1- Is it possibly that the MultipartServletWebRequest can have this line:
DiskFileItemFactory factory = new DiskFileItemFactory();
...changed for...
DiskFileItemFactory factory = getFileItemFactory(); // and this would be 
a protected method that would instanciate the DiskFileItemFactory by default
If that change could be done, instead of generate an exact copy of 
MultipartServletWebRequest with that line different, we could just 
extend it and override getFileItemFactory() method.


2- Once this code is properly review, where should be added? I'm not 
sure that the wicket base framework would be the best place. But what 
about some kind of wicket-gae-extension?


About your code:
1- In the classic onSubmit() in a form, what's the way I should store 
the final file?
a) OutputStream fos = new DatastoreOutputStream(fileName); 
fos.write(fileUpload.getInputStream().toByteArray()) (y tried this 
option first and it didn't work, but i'm not sure I used it the right way)
b) FileStorage.instance().write(fileUpload.getInputStream(), filename); 
(this option worked :))


2- I also found an issue related to the DATA_CHUNK_SIZE.
In your code this is declared as DATA_CHUNK_SIZE = 
(int)(Bytes.megabytes(1).bytes() - Bytes.kilobytes(10).bytes());
In development environment worked fine, however, when using in 
production environment (google's magic servers), an error ocurred. I 
didn't copy the stack trace, but it said that the maximun entity (or 
property, can't remember) size had been reached for the field data 
(which of course has the file data). It said the maximun was 100 
characters (actually less than a Megabyte?, which should be 
1024*1024bytes?, maybe google app engine documentation needs a fix, not 
quite sure about this). And strangely, in that case the file uploaded 
had a size of 14Kb.


Finally, we reduced DATA_CHUNK_SIZE to 512Kb, and it worked fine. 
Anyway, I wanted to let you know so you can take a look.



Regards!


Daniele Dellafiore escribió:

Great, seems interesting, I will give this a try. Thanks.

On Sun, Aug 30, 2009 at 6:31 PM, uud ashr uuda...@gmail.com wrote:

  

Hi all
Just want to share.
If you have problem with file upload on Google App Engine, I just done some
experiment and it works.
Use the attached files.
I didn't create this, I just modify from the existing wicket source code.

I create new class, GaeSafeServletWebRequest which is subclass of
ServletWebRequest. Everyting come from here.

The key is remove the thread that clean the ReferenceQueue. So how to clean
it? I use something called FileCleaner.reapFiles(2) that will poll the queue
maximum 2 item. I put those line of code everytime GaeSafeServletWebRequest
created.

to use, you only need to override method *newWebRequest* on your wicket
application

@Override

protected WebRequest newWebRequest(final HttpServletRequest
servletRequest) {

return new GaeSafeServletWebRequest(servletRequest);

}


When you upload something, then write it using *DatastoreOutputStream*, it
will put all the bytes to GAE (Google App Engine) datastore. This
OutputStream already handle the over size, so it will create chunk files in
order to save the big file size.

Please tell me if it works for you (actually it works for me) and maybe we
can refine or create the better code. Or maybe we can add this to wicket? So
wicket can be FULL COMPATIBLE to Google App Engine.

Regards,
uudashr


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






  


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket and FileUpload on Google App Engine

2009-09-08 Thread uud ashr
On Wed, Sep 9, 2009 at 7:41 AM, Esteban Masoero emaso...@getsense.com.arwrote:

 Hi uudashr, I gotta tell you've done terrific work! I tried it in my
 wicket-GAE app and it worked :)

 Comments/questions:

 About wicket framework:
 1- Is it possibly that the MultipartServletWebRequest can have this line:
 DiskFileItemFactory factory = new DiskFileItemFactory();
 ...changed for...
 DiskFileItemFactory factory = getFileItemFactory(); // and this would be a
 protected method that would instanciate the DiskFileItemFactory by default
 If that change could be done, instead of generate an exact copy of
 MultipartServletWebRequest with that line different, we could just extend it
 and override getFileItemFactory() method.

 Yes of course, that would be good idea. To do that we have to modify the
wicket code, you have to ask that to wicket team.


 2- Once this code is properly review, where should be added? I'm not sure
 that the wicket base framework would be the best place. But what about some
 kind of wicket-gae-extension?

 About your code:
 1- In the classic onSubmit() in a form, what's the way I should store the
 final file?
 a) OutputStream fos = new DatastoreOutputStream(fileName);
 fos.write(fileUpload.getInputStream().toByteArray()) (y tried this option
 first and it didn't work, but i'm not sure I used it the right way)

Strange, I didn't have toByteArray() method on InputStream. Just read it
from input stream and write it to DataStoreOutputStream. Doing toByteArray()
might bad idea, you can load big amount data on the memory if it's a big
file size.

b) FileStorage.instance().write(fileUpload.getInputStream(), filename);
 (this option worked :))

 2- I also found an issue related to the DATA_CHUNK_SIZE.
 In your code this is declared as DATA_CHUNK_SIZE =
 (int)(Bytes.megabytes(1).bytes() - Bytes.kilobytes(10).bytes());

In development environment worked fine, however, when using in production
 environment (google's magic servers), an error ocurred. I didn't copy the
 stack trace, but it said that the maximun entity (or property, can't
 remember) size had been reached for the field data (which of course has
 the file data). It said the maximun was 100 characters (actually less
 than a Megabyte?, which should be 1024*1024bytes?, maybe google app engine
 documentation needs a fix, not quite sure about this). And strangely, in
 that case the file uploaded had a size of 14Kb.

 Finally, we reduced DATA_CHUNK_SIZE to 512Kb, and it worked fine. Anyway, I
 wanted to let you know so you can take a look.

 Not sure what happen to you, but it works for me.


 Regards!


 Daniele Dellafiore escribió:

  Great, seems interesting, I will give this a try. Thanks.

 On Sun, Aug 30, 2009 at 6:31 PM, uud ashr uuda...@gmail.com wrote:



 Hi all
 Just want to share.
 If you have problem with file upload on Google App Engine, I just done
 some
 experiment and it works.
 Use the attached files.
 I didn't create this, I just modify from the existing wicket source code.

 I create new class, GaeSafeServletWebRequest which is subclass of
 ServletWebRequest. Everyting come from here.

 The key is remove the thread that clean the ReferenceQueue. So how to
 clean
 it? I use something called FileCleaner.reapFiles(2) that will poll the
 queue
 maximum 2 item. I put those line of code everytime
 GaeSafeServletWebRequest
 created.

 to use, you only need to override method *newWebRequest* on your wicket
 application

@Override

protected WebRequest newWebRequest(final HttpServletRequest
 servletRequest) {

return new GaeSafeServletWebRequest(servletRequest);

}


 When you upload something, then write it using *DatastoreOutputStream*,
 it
 will put all the bytes to GAE (Google App Engine) datastore. This
 OutputStream already handle the over size, so it will create chunk files
 in
 order to save the big file size.

 Please tell me if it works for you (actually it works for me) and maybe
 we
 can refine or create the better code. Or maybe we can add this to wicket?
 So
 wicket can be FULL COMPATIBLE to Google App Engine.

 Regards,
 uudashr


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org









 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org