Re: Gant like component in wicket

2009-01-09 Thread Martin Makundi
Just a Wicket WebMarkupContainer will do.

Put it in a listview.

t. Martin

2009/1/9 lizz elisabeth.thor...@bouvet.no:

 Yes I know but this should be displayed in a wicket web page and the number
 of tasks types is not static (it is based on the page datamodel
 (CompundPropertyModel), so I think i need a wicket component for generating
 the html when the page is created).


 lizz wrote:

 Has anyone made a gant like chart component in wicket?
 I want to create a gantlike component where all the tasks are links and
 are of html input type button. You should be able to click on them to
 display specific information for that task and change the task button
 background color based on some criteria. (I.e. make all the tasks that is
 within a sertain time period red.) There will be more than one task
 button per task type (or row).

 Thought about using a list in a list (Property list view). But not really
 sure ow to position the the task buttons (the row) since they need a
 specific position and width.





 --
 View this message in context: 
 http://www.nabble.com/Gant-like-component-in-wicket-tp21366378p21366761.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



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



Re: Get all sessions

2009-01-09 Thread Peter Ertl

implement javax.servlet.http.HttpSessionListener

Am 09.01.2009 um 08:07 schrieb Eunice:



Hi,

Is there any methods or functions in wicket that can give me

numbers of users/sessions that is currently active and viewing/ 
opening a

page?

I've been googling and read on the API, still cannot get any clues and
unable to work it out..

Can i get number of sessions from my application by using  
ISessionStore or


HttpSessions, since the session will be keep in HttpSessions..

I do really appreciate your reply..

Eunice
--
View this message in context: 
http://www.nabble.com/Get-all-sessions-tp21367229p21367229.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



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



Re: Get all sessions/users for a web application

2009-01-09 Thread Jonathan Locke


Take a look at RequestLogger and the InspectorBug


Eunice wrote:
 
 Hi,
 
 Is there any methods or functions in wicket that can give me
 
 numbers of users/sessions that is currently active and viewing/opening a
 page?
 
 I've been googling and read on the API, still cannot get any clues and
 unable to work it out..
 
 Can i get number of sessions from my application by using ISessionStore or
 
 HttpSessions, since the session will be keep in HttpSessions..
 
 I do really appreciate your reply..
 
 Eunice
 

-- 
View this message in context: 
http://www.nabble.com/Get-all-sessions-users-for-a-web-application-tp21367229p21372161.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: Gant like component in wicket

2009-01-09 Thread Rodolfo Hansen
If you want, you can also extend WebMarkupContainer, and share those
components through wicketstuff for example.

On Fri, Jan 9, 2009 at 6:15 AM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Just a Wicket WebMarkupContainer will do.

 Put it in a listview.

 t. Martin

 2009/1/9 lizz elisabeth.thor...@bouvet.no:
 
  Yes I know but this should be displayed in a wicket web page and the
 number
  of tasks types is not static (it is based on the page datamodel
  (CompundPropertyModel), so I think i need a wicket component for
 generating
  the html when the page is created).
 
 
  lizz wrote:
 
  Has anyone made a gant like chart component in wicket?
  I want to create a gantlike component where all the tasks are links
 and
  are of html input type button. You should be able to click on them to
  display specific information for that task and change the task button
  background color based on some criteria. (I.e. make all the tasks that
 is
  within a sertain time period red.) There will be more than one task
  button per task type (or row).
 
  Thought about using a list in a list (Property list view). But not
 really
  sure ow to position the the task buttons (the row) since they need a
  specific position and width.
 
 
 
 
 
  --
  View this message in context:
 http://www.nabble.com/Gant-like-component-in-wicket-tp21366378p21366761.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
 
 

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




Re: Multiple Copies of One Wicket App

2009-01-09 Thread Sean W

path:
/ContextPath/wicket/BookmarkablePage

It appears to me that using Wicket you cannot place anything in the path
between the context path and the mounted name except for wicket, which is
defined as your url-pattern. In other words, a mounted page cannot be
referenced from more than one path. This also means Wicket can't support
sub contexts.

Perhaps I'll have to try and deploy a single app 200 times in tomcat with
the same WAR. :-S
-- 
View this message in context: 
http://www.nabble.com/Multiple-Copies-of-One-Wicket-App-tp21355510p21372369.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



FileUpload broken in Firefox 3.0.5

2009-01-09 Thread Steve Swinsburg

Hi all,

Just testing an application I have written which works perfectly fine  
in Safari 3.2.1, but in Firefox 3.0.5 the FileUpload is failing.


Some code:

in form:

//upload form component
FileUploadField uploadField = new FileUploadField(picture);
form.add(uploadField);


in onSubmit() of form:

//get file that was uploaded
FileUpload upload = uploadField.getFileUpload();
if (upload == null) {
log.error(upload was null.);
return;
} else if (upload.getSize() == 0) {
log.error(upload was empty.);
return;
} else if (!checkContentTypeForImage(upload.getContentType())) {
log.error(invalid file type uploaded);
return;
} else {
String mimeType = upload.getContentType();
String fileName = upload.getClientFileName();

//get bytes, etc
byte[] imageBytes = upload.getBytes();
}


in Safari 3.2.1 the upload works fine
in Camino 1.6.6 the upload works fine also
in Firefox 3.0.5, the upload is null.

This bit of code hasn't changed for quite some time and last time I  
tested it it was working fine. Latest Firefox update seems to have  
killed it.





cheers,
Steve









smime.p7s
Description: S/MIME cryptographic signature


Re: Multiple Copies of One Wicket App

2009-01-09 Thread Steve Swinsburg
You're doing it backwards. Have one webapp which accepts the parameter  
at the end of the URL, not before.



cheers,
Steve





On 9 Jan 2009, at 13:36, Sean W wrote:



path:
/ContextPath/wicket/BookmarkablePage

It appears to me that using Wicket you cannot place anything in the  
path
between the context path and the mounted name except for wicket,  
which is
defined as your url-pattern. In other words, a mounted page cannot  
be
referenced from more than one path. This also means Wicket can't  
support

sub contexts.

Perhaps I'll have to try and deploy a single app 200 times in tomcat  
with

the same WAR. :-S
--
View this message in context: 
http://www.nabble.com/Multiple-Copies-of-One-Wicket-App-tp21355510p21372369.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





smime.p7s
Description: S/MIME cryptographic signature


Re: FileUpload broken in Firefox 3.0.5

2009-01-09 Thread Steve Swinsburg


I can confirm that the same code works on Firefox 3.0.4 - I just ran  
it up on the older version. So its definitely the 3.0.5 update which  
has the issue.

Any ideas?

cheers,
Steve







On 9 Jan 2009, at 13:36, Steve Swinsburg wrote:


Hi all,

Just testing an application I have written which works perfectly  
fine in Safari 3.2.1, but in Firefox 3.0.5 the FileUpload is failing.


Some code:

in form:

//upload form component
FileUploadField uploadField = new FileUploadField(picture);
form.add(uploadField);


in onSubmit() of form:

//get file that was uploaded
FileUpload upload = uploadField.getFileUpload();
if (upload == null) {
log.error(upload was null.);
return;
} else if (upload.getSize() == 0) {
log.error(upload was empty.);
return;
} else if (!checkContentTypeForImage(upload.getContentType())) {
log.error(invalid file type uploaded);
return;
} else {
String mimeType = upload.getContentType();
String fileName = upload.getClientFileName();

//get bytes, etc
byte[] imageBytes = upload.getBytes();
}


in Safari 3.2.1 the upload works fine
in Camino 1.6.6 the upload works fine also
in Firefox 3.0.5, the upload is null.

This bit of code hasn't changed for quite some time and last time I  
tested it it was working fine. Latest Firefox update seems to have  
killed it.





cheers,
Steve











smime.p7s
Description: S/MIME cryptographic signature


Re: Multiple Copies of One Wicket App

2009-01-09 Thread Serkan Camurcuoglu
I know this would be very difficult to create by hand, but if you 
automatically create a web.xml which includes 200 such filter 
definitions (replacing Application1 and dbfile1 with other values) I 
think that would do what you want. Note that here you obtain the db 
configuration file name as a filter init parameter, you should modify 
your application's init method accordingly..


   filter
   filter-nameApplication1/filter-name
   
filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class

   init-param
   param-nameapplicationClassName/param-name
   param-valuecom.mycompany.MyApplication/param-value
   /init-param
   init-param
   param-namedbFileName/param-name
   param-valuedbfile1.properties/param-value
   /init-param
   /filter

   filter-mapping
   filter-nameApplication1/filter-name
   url-pattern/dbfile1/*/url-pattern
   dispatcherREQUEST/dispatcher
   dispatcherINCLUDE/dispatcher
   /filter-mapping



Sean W wrote:

path:
/ContextPath/wicket/BookmarkablePage

It appears to me that using Wicket you cannot place anything in the path
between the context path and the mounted name except for wicket, which is
defined as your url-pattern. In other words, a mounted page cannot be
referenced from more than one path. This also means Wicket can't support
sub contexts.

Perhaps I'll have to try and deploy a single app 200 times in tomcat with
the same WAR. :-S
  



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



Empty File Upload field breaks validation of other fields in WicketTester

2009-01-09 Thread Martin Makundi
Hi!

Empty File Upload field breaks validation of other fields in WicketTester.

The form processes a simple MockHttp..Request but the tester sends
Multipart...Request.

Wicket quickstart attached to jira:
https://issues.apache.org/jira/browse/WICKET-2015

Anybody familiar with the necessary internals? More related discussion
can be found here:
http://www.nabble.com/FormTester-and-FileUploadField-td18566869.html

**
Martin

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



RE: AjaxCheckBox not working

2009-01-09 Thread wicketworker

Its working now .. I had to put the panel inside another div tag and create a
WebMarkupContainer for that..



Serkan Camurcuoglu-3 wrote:
 
 did you call setOutputMarkupId(true) and
 setOutputMarkupPlaceHolderTag(true) on your panel? setOutputMarkupId(true)
 is required for the panel to have an id, and
 setOutputMarkupPlaceHolderTag(true) is required if it will be initially
 invisible..
 
 
 -Original Message-
 From: wicketworker [mailto:siva.mad...@gmail.com]
 Sent: Thu 1/8/2009 10:22 PM
 To: users@wicket.apache.org
 Subject: AjaxCheckBox not working
  
 
 I am trying to display a panel when the user clicks on the check box. Ajax
 request is getting fired and response is not getting processed by the
 browsder with an error.
 
 
 INFO: Received ajax response (2681 characters)
 INFO: 
 ?xml version=1.0 encoding=UTF-8?ajax-responsecomponent
 id=preReleasePanel2b ![CDATA[ 
 div id=preReleaseGroupBox2c class=ricGroupbox
 ric:collapsible=collapsed ric:title=Pre-Release 
 table align=center 
  tr id=comments_id 
 tdlabel id=commentsLabelComments
 :/label/td 
 td align=lefttextarea cols=50
 name=preReleasePanel:preReleaseGroupBox:comments ric:maxchars=250
 rows=3Adding Comments/textarea/td 
 /tr 
  /table 
 /div 
 ]]/componentevaluate![CDATA[Ricola.init( $('#preReleasePanel2b')
 );]]/evaluateevaluate![CDATA[Ricola.page.hidePleaseWait();]]/evaluate/ajax-response
 
 INFO: Response parsed. Now invoking steps...
 ERROR: Component with id [[preReleasePanel2b]] a was not found while
 trying
 to perform markup update. Make sure you called
 component.setOutputMarkupId(true) on the component whose markup you are
 trying to update.
 INFO: Response processed successfully.
 
 I can clearly see that preReleasePanel2b is there in the response, can
 anyone please tell me why i am getting this error.
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/AjaxCheckBox-not-working-tp21360165p21360165.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
 
 
 
 
 -
 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/AjaxCheckBox-not-working-tp21360165p21373053.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: AjaxCheckBox not working

2009-01-09 Thread Piller Sébastien

Hi,

wicketworker a écrit :

Its working now .. I had to put the panel inside another div tag and create a
WebMarkupContainer for that..
  

sure, this is very common when using wicket  ajax


Serkan Camurcuoglu-3 wrote:
  

did you call setOutputMarkupId(true) and
setOutputMarkupPlaceHolderTag(true) on your panel? setOutputMarkupId(true)
is required for the panel to have an id, and
setOutputMarkupPlaceHolderTag(true) is required if it will be initially
invisible..


-Original Message-
From: wicketworker [mailto:siva.mad...@gmail.com]
Sent: Thu 1/8/2009 10:22 PM
To: users@wicket.apache.org
Subject: AjaxCheckBox not working 




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



Preserving mount point in URLs

2009-01-09 Thread John Krasnay
Hi Wicketeers,

My client has a web security infrastructure in place where a transparent
proxy sits in front of the application server and filters requests based
on URL pattern. I am trying to fit their first Wicket-based application
into this infrastructure. We would like to allow requests based on URL
pattern and authentication level and block all unrecognized requests.

I'm using HybridUrlCodingStrategy to try and preserve the mount point
in subsequent links and form URLs. This works well in some cases, but
falls down when I pass parameters to a page. For example, a page mounted
on mypage with no parameters results in a URL like this...

  http://host/myapp/mypage

...and links on the page are rendered like this...

  ?:wicket:interface:...

...which the browser recognizes as something like this...

  http://host/myapp/mypage.4?:wicket:interface:...

...which is great, since we can still implement our security policy
based on the mypage portion of the URL. The problem is, if I pass a
parameter to the page, the URL looks like this...

  http://host/myapp/mypage/key/value/

...and links on the page look like this...

  ../../../?:wicket:interface:...
  
...which the browser reduces to this...

  http://host/myapp/?:wicket:interface:...

This is no longer good, because we've lost the mount point. The problem
appears to be the trailing slash added by
AbstractRequestTargetUrlCodingStrategy.appendValue, which triggers an
extra ../ to be added to the link URL. And if the mount point as a
slash inside it, e.g. foo/bar, then neither case works properly.

It's starting to feel that it will be difficult to preserve the mount
point across requests. I know this has been discussed before on this
list, usually in the context of pretty URLs, but I haven't seen a good
solution. Has anyone been able to get something like this to work well?

jk


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



ModalWindow width as %

2009-01-09 Thread Emanuele Gesuato

Hi there,


In ModalWindow as defined in wicket-extension the width has a fixed 
length expressed in pixel (600px). I would like to have the width in % 
but the widthUnit is available only when the the component is not 
resizable.



In fact in ModalWindow.getWindowOpenJavascript() there is the following:

..
if (isResizable() == false)
{
buffer.append(settings.widthUnit=\ + getWidthUnit() + \;\n);
buffer.append(settings.heightUnit=\ + getHeightUnit() + \;\n);
}
...


How could i setting the width as % and mantain the resizability of the 
component ?


And why this behaviour is present ?


Thanks,
Emanuele


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



Re: ModalWindow width as %

2009-01-09 Thread Nino Martinez

if getWidthUnit() arent final then override?

Emanuele Gesuato wrote:

Hi there,


In ModalWindow as defined in wicket-extension the width has a fixed 
length expressed in pixel (600px). I would like to have the width in 
% but the widthUnit is available only when the the component is not 
resizable.



In fact in ModalWindow.getWindowOpenJavascript() there is the following:

..
if (isResizable() == false)
{
buffer.append(settings.widthUnit=\ + getWidthUnit() + \;\n);
buffer.append(settings.heightUnit=\ + getHeightUnit() + \;\n);
}
...


How could i setting the width as % and mantain the resizability of 
the component ?


And why this behaviour is present ?


Thanks,
Emanuele


-
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: Preserving mount point in URLs

2009-01-09 Thread Igor Vaynberg
change the coding strategy to use query string to encode params. see
querystringcodingstrategy for necessary code.

-igor

On Fri, Jan 9, 2009 at 6:36 AM, John Krasnay j...@krasnay.ca wrote:
 Hi Wicketeers,

 My client has a web security infrastructure in place where a transparent
 proxy sits in front of the application server and filters requests based
 on URL pattern. I am trying to fit their first Wicket-based application
 into this infrastructure. We would like to allow requests based on URL
 pattern and authentication level and block all unrecognized requests.

 I'm using HybridUrlCodingStrategy to try and preserve the mount point
 in subsequent links and form URLs. This works well in some cases, but
 falls down when I pass parameters to a page. For example, a page mounted
 on mypage with no parameters results in a URL like this...

  http://host/myapp/mypage

 ...and links on the page are rendered like this...

  ?:wicket:interface:...

 ...which the browser recognizes as something like this...

  http://host/myapp/mypage.4?:wicket:interface:...

 ...which is great, since we can still implement our security policy
 based on the mypage portion of the URL. The problem is, if I pass a
 parameter to the page, the URL looks like this...

  http://host/myapp/mypage/key/value/

 ...and links on the page look like this...

  ../../../?:wicket:interface:...

 ...which the browser reduces to this...

  http://host/myapp/?:wicket:interface:...

 This is no longer good, because we've lost the mount point. The problem
 appears to be the trailing slash added by
 AbstractRequestTargetUrlCodingStrategy.appendValue, which triggers an
 extra ../ to be added to the link URL. And if the mount point as a
 slash inside it, e.g. foo/bar, then neither case works properly.

 It's starting to feel that it will be difficult to preserve the mount
 point across requests. I know this has been discussed before on this
 list, usually in the context of pretty URLs, but I haven't seen a good
 solution. Has anyone been able to get something like this to work well?

 jk


 -
 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: ModalWindow width as %

2009-01-09 Thread Emanuele Gesuato

getWidthUnit() is not considered if the ModalWindow is resizable.

Nino Martinez wrote:

if getWidthUnit() arent final then override?

Emanuele Gesuato wrote:

Hi there,


In ModalWindow as defined in wicket-extension the width has a fixed 
length expressed in pixel (600px). I would like to have the width in 
% but the widthUnit is available only when the the component is not 
resizable.



In fact in ModalWindow.getWindowOpenJavascript() there is the following:

..
if (isResizable() == false)
{
buffer.append(settings.widthUnit=\ + getWidthUnit() + \;\n);
buffer.append(settings.heightUnit=\ + getHeightUnit() + \;\n);
}
...


How could i setting the width as % and mantain the resizability of 
the component ?


And why this behaviour is present ?


Thanks,
Emanuele


-
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: ModalWindow width as %

2009-01-09 Thread Matthew Hanlon
If I'm correct, the modal window uses js to determine the resizing in px.
 If you want it to resize in % of screen, you'd probably have to override
modal.js to determine the appropriate % to set the window width.
However, if you want the window to be some percentage wide, you don't really
want it resizeable, you want it to be some percentage wide.  If you want the
window to start at 50% width and then be resizeable after the fact, you
could just detect the client screen width and set the modal window width to
half of that to start.

Regards,
Matt.

On Fri, Jan 9, 2009 at 10:57 AM, Emanuele Gesuato egesu...@ibc.it wrote:

 getWidthUnit() is not considered if the ModalWindow is resizable.


 Nino Martinez wrote:

 if getWidthUnit() arent final then override?

 Emanuele Gesuato wrote:

 Hi there,


 In ModalWindow as defined in wicket-extension the width has a fixed
 length expressed in pixel (600px). I would like to have the width in % but
 the widthUnit is available only when the the component is not resizable.


 In fact in ModalWindow.getWindowOpenJavascript() there is the following:

 ..
 if (isResizable() == false)
 {
 buffer.append(settings.widthUnit=\ + getWidthUnit() + \;\n);
 buffer.append(settings.heightUnit=\ + getHeightUnit() + \;\n);
 }
 ...


 How could i setting the width as % and mantain the resizability of the
 component ?

 And why this behaviour is present ?


 Thanks,
 Emanuele


 -
 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




-- 
Matthew Rollins Hanlon
http://squareoftwo.org
_
Hanlon's Razor:
Never attribute to malice that which can be adequately explained by
stupidity.
http://wikipedia.org/wiki/Hanlon's_razor


Dynamic PDF Creation

2009-01-09 Thread jeredm

I am using FOP to create a PDF dynamically based on user input into a web
form.  I don't have a problem creating the PDF only with the display of it. 
I need that PDF to be immediately sent to the user via a redirect or
download.  so something like this 

@Override
public void onClick(){
  validateUserDataFromForm();

  if(!hasErrorMessage()){
 ByteArrayOutputStream pdfData =
factory.createPDF(startDateThatIsSetViaTheForm, endDateThatIsSetViaTheForm,
reportType);

 // Output the steam to a page I can redirect to.
 // I can use a File if ByteArrayOutputStream is making things tough.
 // I am fine if the user gets prompted like a download link, but I want
a single click to create and prompt for download.
  }
}


 Here is what I have tried.
1) Making the PDF a resource:  This worked initially as I needed it to, but
I was having problems with the resource being reused and while the report
needed to vary on each generation.  Basically, I need to create the PDF,
give it to the user, and then destroy the copy on the server.  Every time
the user clicks the create button a new PDF needs to be built and sent to
the user.  I also don't like this option as I don't want to waste memory by
adding too many resources that are not re-used.  I need the user data to
update the display of the PDF when it is built, so I need the link to pass
in new values to the createPDF function every time.

2) Something like this...
final Response response = getRequestCycle().getResponse();
response.setContentType(application/pdf);
response.setContentLength(pdfout.size());

try{
  OutputStream stream = response.getOutputStream();
  stream.write(pdfData.toByteArray());
  stream.flush();
}catch(Exception ex){
  throw new RuntimeException(ex);
}

That results in an error like so...
[org.apache.wicket.protocol.http.WicketFilter] - closing the buffer error...

Any help would be appreciated!  Thanks!

Jered

-- 
View this message in context: 
http://www.nabble.com/Dynamic-PDF-Creation-tp21377725p21377725.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: Dynamic PDF Creation

2009-01-09 Thread Sébastien Piller

Have a look at RequestCycle#setRequestTarget.

Additionnaly, you may have a look at SubmitLink, since the validation 
step has nothing to do in the onClick of a link


jeredm wrote:

I am using FOP to create a PDF dynamically based on user input into a web
form.  I don't have a problem creating the PDF only with the display of it. 
I need that PDF to be immediately sent to the user via a redirect or

download.  so something like this 

@Override
public void onClick(){
  validateUserDataFromForm();

  if(!hasErrorMessage()){
 ByteArrayOutputStream pdfData =
factory.createPDF(startDateThatIsSetViaTheForm, endDateThatIsSetViaTheForm,
reportType);

 // Output the steam to a page I can redirect to.
 // I can use a File if ByteArrayOutputStream is making things tough.
 // I am fine if the user gets prompted like a download link, but I want
a single click to create and prompt for download.
  }
}


 Here is what I have tried.
1) Making the PDF a resource:  This worked initially as I needed it to, but
I was having problems with the resource being reused and while the report
needed to vary on each generation.  Basically, I need to create the PDF,
give it to the user, and then destroy the copy on the server.  Every time
the user clicks the create button a new PDF needs to be built and sent to
the user.  I also don't like this option as I don't want to waste memory by
adding too many resources that are not re-used.  I need the user data to
update the display of the PDF when it is built, so I need the link to pass
in new values to the createPDF function every time.

2) Something like this...
final Response response = getRequestCycle().getResponse();
response.setContentType(application/pdf);
response.setContentLength(pdfout.size());

try{
  OutputStream stream = response.getOutputStream();
  stream.write(pdfData.toByteArray());
  stream.flush();
}catch(Exception ex){
  throw new RuntimeException(ex);
}

That results in an error like so...
[org.apache.wicket.protocol.http.WicketFilter] - closing the buffer error...

Any help would be appreciated!  Thanks!

Jered

  



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



Re: Dynamic PDF Creation

2009-01-09 Thread jeredm

Thanks for the response!  It seems to be working well.  I am posting what I
ended up with.  Please let me know if you see anything that is a really bad
idea.

@Override
public void onSubmit(){

validateCriteria();
if(!hasErrorMessage()){
MyReportFactory pdfRef = new MyReportFactory();
final ByteArrayOutputStream pdfout = pdfRef.createPDF(startDt, 
endDt,
reportType);

final Response response = getRequestCycle().getResponse();
response.setContentType(application/pdf);
response.setContentLength(pdfout.size());
getRequestCycle().setRequestTarget(new IRequestTarget(){

@Override
public void detach(RequestCycle requestCycle) {
// No need to do anything here as I already 
closed the stream...I think
}

@Override
public void respond(RequestCycle requestCycle) {
try{
  OutputStream stream = 
response.getOutputStream();
  stream.write(pdfout.toByteArray());
  stream.flush();
  pdfout.close();
}catch(IOException ex){
  throw new RuntimeException(ex);
}
}

});
}
}

Pills wrote:
 
 Have a look at RequestCycle#setRequestTarget.
 
 Additionnaly, you may have a look at SubmitLink, since the validation 
 step has nothing to do in the onClick of a link
 
 jeredm wrote:
 I am using FOP to create a PDF dynamically based on user input into a web
 form.  I don't have a problem creating the PDF only with the display of
 it. 
 I need that PDF to be immediately sent to the user via a redirect or
 download.  so something like this 

 @Override
 public void onClick(){
   validateUserDataFromForm();

   if(!hasErrorMessage()){
  ByteArrayOutputStream pdfData =
 factory.createPDF(startDateThatIsSetViaTheForm,
 endDateThatIsSetViaTheForm,
 reportType);

  // Output the steam to a page I can redirect to.
  // I can use a File if ByteArrayOutputStream is making things tough.
  // I am fine if the user gets prompted like a download link, but I
 want
 a single click to create and prompt for download.
   }
 }


  Here is what I have tried.
 1) Making the PDF a resource:  This worked initially as I needed it to,
 but
 I was having problems with the resource being reused and while the report
 needed to vary on each generation.  Basically, I need to create the PDF,
 give it to the user, and then destroy the copy on the server.  Every time
 the user clicks the create button a new PDF needs to be built and sent to
 the user.  I also don't like this option as I don't want to waste memory
 by
 adding too many resources that are not re-used.  I need the user data to
 update the display of the PDF when it is built, so I need the link to
 pass
 in new values to the createPDF function every time.

 2) Something like this...
 final Response response = getRequestCycle().getResponse();
 response.setContentType(application/pdf);
 response.setContentLength(pdfout.size());
  
 try{
   OutputStream stream = response.getOutputStream();
   stream.write(pdfData.toByteArray());
   stream.flush();
 }catch(Exception ex){
   throw new RuntimeException(ex);
 }

 That results in an error like so...
 [org.apache.wicket.protocol.http.WicketFilter] - closing the buffer
 error...

 Any help would be appreciated!  Thanks!

 Jered

   
 
 
 -
 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/Dynamic-PDF-Creation-tp21377725p21379301.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



generalized way to ignore mouse input during screen refresh?

2009-01-09 Thread Kirk Israel
So one problem we've seen in a few places occurs when a (somewhat
slow) request happens that refreshes the page or component, but then
the user clicks on a link on the pre-refresh screen, and ends up
getting a nasty exception thrown, since the component clicked on no
longer exists

Is there a single, easy workaround for this? Obviously you can try to
limit the situations where this occurs, like my redrawing as little as
possible, or otherwise making things less time consuming, but it still
seems like it would be good if there was a general mechanism for
ignoring inputs once some kind of Ajaxy-process is started...

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



Re: Dynamic PDF Creation

2009-01-09 Thread Sébastien Piller

Some little points:

- on the onsubmit of a form (or any onsubmit like in button, 
submitlink, ajaxfallbackbutton, etc.) you don't need to verify the 
validity: wicket does it for you, it firsts validate the form and then 
call onsubmit if there is no error. Thus it means you can remove your 
validateCriteria and if(!haserrormessage)
- you don't need to implement the whole IRequestTarget interface 
yourself, instead you may use some existant implementation (this 
requires less work for you) for exemple ResourceStreamRequestTarget 
(which is the most usefull in your case). There are dozens 
implementation of IRequestTarget in the framework, just have a look to 
find one which fit your needs.
- this is often dangerous/expensive to add non-static inner classes 
(like you do with your anonymous implementation), because of 
serialisation of pages (reference to your top level class is hold in the 
inner class, and thus gets serialized if the inner instance needs to). 
Be aware of your session size, it is really important under heavy load.


jeredm wrote:

Thanks for the response!  It seems to be working well.  I am posting what I
ended up with.  Please let me know if you see anything that is a really bad
idea.

@Override
public void onSubmit(){

validateCriteria();
if(!hasErrorMessage()){
MyReportFactory pdfRef = new MyReportFactory();
final ByteArrayOutputStream pdfout = pdfRef.createPDF(startDt, 
endDt,
reportType);

final Response response = getRequestCycle().getResponse();
response.setContentType(application/pdf);
response.setContentLength(pdfout.size());
getRequestCycle().setRequestTarget(new IRequestTarget(){

@Override
public void detach(RequestCycle requestCycle) {
// No need to do anything here as I already 
closed the stream...I think
}

@Override
public void respond(RequestCycle requestCycle) {
try{
  OutputStream stream = 
response.getOutputStream();
  stream.write(pdfout.toByteArray());
  stream.flush();
  pdfout.close();
}catch(IOException ex){
  throw new RuntimeException(ex);
}
}

});
}
}

Pills wrote:
  

Have a look at RequestCycle#setRequestTarget.

Additionnaly, you may have a look at SubmitLink, since the validation 
step has nothing to do in the onClick of a link


jeredm wrote:


I am using FOP to create a PDF dynamically based on user input into a web
form.  I don't have a problem creating the PDF only with the display of
it. 
I need that PDF to be immediately sent to the user via a redirect or

download.  so something like this 

@Override
public void onClick(){
  validateUserDataFromForm();

  if(!hasErrorMessage()){
 ByteArrayOutputStream pdfData =
factory.createPDF(startDateThatIsSetViaTheForm,
endDateThatIsSetViaTheForm,
reportType);

 // Output the steam to a page I can redirect to.
 // I can use a File if ByteArrayOutputStream is making things tough.
 // I am fine if the user gets prompted like a download link, but I
want
a single click to create and prompt for download.
  }
}


 Here is what I have tried.
1) Making the PDF a resource:  This worked initially as I needed it to,
but
I was having problems with the resource being reused and while the report
needed to vary on each generation.  Basically, I need to create the PDF,
give it to the user, and then destroy the copy on the server.  Every time
the user clicks the create button a new PDF needs to be built and sent to
the user.  I also don't like this option as I don't want to waste memory
by
adding too many resources that are not re-used.  I need the user data to
update the display of the PDF when it is built, so I need the link to
pass
in new values to the createPDF function every time.

2) Something like this...
final Response response = getRequestCycle().getResponse();
response.setContentType(application/pdf);
response.setContentLength(pdfout.size());

try{
  OutputStream stream = response.getOutputStream();
  stream.write(pdfData.toByteArray());
  stream.flush();
}catch(Exception ex){
  throw new RuntimeException(ex);
}

That results in an error like so...
[org.apache.wicket.protocol.http.WicketFilter] - closing the buffer
error...

Any help would be appreciated!  Thanks!

Jered

  
  

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






  




Re: Preserving mount point in URLs

2009-01-09 Thread John Krasnay
Cool, thanks. I'll give it a try.

jk

On Fri, Jan 09, 2009 at 08:52:44AM -0800, Igor Vaynberg wrote:
 change the coding strategy to use query string to encode params. see
 querystringcodingstrategy for necessary code.
 
 -igor
 

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



Re: generalized way to ignore mouse input during screen refresh?

2009-01-09 Thread Valentine2008

I created a reusable component, PanelWithAjaxBusyIndicatingMask, which
extends Panel.

The functions it has:

It will add a transparent mask layer to the current page to prevent further
UI interactivity when there are any busy Ajax activities.

The mask layer will have an animation gif and a configurable display text
(the default is: Please wait…).

Both the display text and the animation gif file are configurable in the
constructors.

I am proposing it to the Wicket developers. Hope they will incorporate it
into the next release.


Kirk Israel-2 wrote:
 
 So one problem we've seen in a few places occurs when a (somewhat
 slow) request happens that refreshes the page or component, but then
 the user clicks on a link on the pre-refresh screen, and ends up
 getting a nasty exception thrown, since the component clicked on no
 longer exists
 
 Is there a single, easy workaround for this? Obviously you can try to
 limit the situations where this occurs, like my redrawing as little as
 possible, or otherwise making things less time consuming, but it still
 seems like it would be good if there was a general mechanism for
 ignoring inputs once some kind of Ajaxy-process is started...
 
 -
 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/generalized-way-to-ignore-mouse-input-during-screen-refresh--tp21379945p21381260.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: generalized way to ignore mouse input during screen refresh?

2009-01-09 Thread Kirk Is
Could you share the code, or at least the core idea of how it hooks
into a normal page/component, in the meanwhile

On Fri, Jan 9, 2009 at 4:55 PM, Valentine2008
valentine...@alumni.sfu.ca wrote:

 I created a reusable component, PanelWithAjaxBusyIndicatingMask, which
 extends Panel.

 The functions it has:

 It will add a transparent mask layer to the current page to prevent further
 UI interactivity when there are any busy Ajax activities.

 The mask layer will have an animation gif and a configurable display text
 (the default is: Please wait…).

 Both the display text and the animation gif file are configurable in the
 constructors.

 I am proposing it to the Wicket developers. Hope they will incorporate it
 into the next release.


 Kirk Israel-2 wrote:

 So one problem we've seen in a few places occurs when a (somewhat
 slow) request happens that refreshes the page or component, but then
 the user clicks on a link on the pre-refresh screen, and ends up
 getting a nasty exception thrown, since the component clicked on no
 longer exists

 Is there a single, easy workaround for this? Obviously you can try to
 limit the situations where this occurs, like my redrawing as little as
 possible, or otherwise making things less time consuming, but it still
 seems like it would be good if there was a general mechanism for
 ignoring inputs once some kind of Ajaxy-process is started...

 -
 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/generalized-way-to-ignore-mouse-input-during-screen-refresh--tp21379945p21381260.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



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



How / where can I contribute my source code to the wicket?

2009-01-09 Thread Valentine2008

Hi,

I have several reusable components that I want to contribute to the Wicket.

Do you know where/how I can contribute?

Thanks,
Valentine
-- 
View this message in context: 
http://www.nabble.com/How---where-can-I-contribute-my-source-code-to-the-wicket--tp21381608p21381608.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: How / where can I contribute my source code to the wicket?

2009-01-09 Thread Jeremy Thomerson
You're very welcome to start a Wicket Stuff project (wicketstuff.org) or
contribute it to one that already exists, depending on where it would fit,
perhaps one noted below [1].  If you believe it is something that belongs in
core, you should open a JIRA [2].  Prepare yourself - it's not likely to be
accepted.  Depending on the type of component, it'd probably go into
wicket-extensions.  The core developers don't add a lot of rich components
to core because of the obvious maintenance issues of maintaining someone
else's code.  Instead, they focus on giving an extremely powerful, easy to
extend framework that has all of the primary components needed that just
work (tm).

[1] - Minis:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/minis-parent/minis/
Misc:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/misc/

[2] Jira: https://issues.apache.org/jira/browse/WICKET


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

On Fri, Jan 9, 2009 at 4:19 PM, Valentine2008 valentine.wic...@gmail.comwrote:


 Hi,

 I have several reusable components that I want to contribute to the Wicket.

 Do you know where/how I can contribute?

 Thanks,
 Valentine
 --
 View this message in context:
 http://www.nabble.com/How---where-can-I-contribute-my-source-code-to-the-wicket--tp21381608p21381608.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: How / where can I contribute my source code to the wicket?

2009-01-09 Thread Jeremy Thomerson
Oh, and if you want to add it to wicket stuff, just ask here for commit
rights by supplying your SF ID.
Read thoroughly: http://wicketstuff.org/confluence/display/STUFFWEB/Home

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


On Fri, Jan 9, 2009 at 6:38 PM, Jeremy Thomerson
jer...@wickettraining.comwrote:

 You're very welcome to start a Wicket Stuff project (wicketstuff.org) or
 contribute it to one that already exists, depending on where it would fit,
 perhaps one noted below [1].  If you believe it is something that belongs in
 core, you should open a JIRA [2].  Prepare yourself - it's not likely to be
 accepted.  Depending on the type of component, it'd probably go into
 wicket-extensions.  The core developers don't add a lot of rich components
 to core because of the obvious maintenance issues of maintaining someone
 else's code.  Instead, they focus on giving an extremely powerful, easy to
 extend framework that has all of the primary components needed that just
 work (tm).

 [1] - Minis:
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/minis-parent/minis/
 Misc:
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/misc/

 [2] Jira: https://issues.apache.org/jira/browse/WICKET


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


 On Fri, Jan 9, 2009 at 4:19 PM, Valentine2008 
 valentine.wic...@gmail.comwrote:


 Hi,

 I have several reusable components that I want to contribute to the
 Wicket.

 Do you know where/how I can contribute?

 Thanks,
 Valentine
 --
 View this message in context:
 http://www.nabble.com/How---where-can-I-contribute-my-source-code-to-the-wicket--tp21381608p21381608.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







ReUse Your Swing table models in Wicket

2009-01-09 Thread Ayodeji Aladejebi
Hi,
If you have existing legacy Swing tables model code  that you want to test
on the web without re-writing all the TableModel logic, try this wicket
component.

WebTable myTable = new WebTable(tableTest, new SimpleTableModel());

add(myTable);

class SimpleTableModel extends javax.swing.table.AbstractTableModel


div wicket:id=tableTest/div

javadoc at http://www.dabarobjects.com/wicketx-tables/javadoc/
binaries at http://www.dabarobjects.com/wicketx-tables/wicketx-tables.jar



or is there any published wicket component in existence like this?

i wont mind contributing to wicket-stuff


wicketx-tables.jar
Description: application/java-archive
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

FileUpload in a Panel

2009-01-09 Thread Ed _


Is it possible to do a file upload within a Panel ?

Or can it only be done in a WebPage?  I have seen some solutions using IFrames 
within panels to get around this.


ERROR [http-8080-1] (RequestCycle.java:1072) - there was an error cleaning up 
target 
org.apache.wicket.request.target.component.listener.listenerinterfacerequesttar...@654004161[page
 class = com.mydomain.admin.Admin, id = 0, version = 0]-fileUpload-interface 
org.apache.wicket.markup.html.form.IFormSubmitListener.IFormSubmitListener 
(request paramaters: [RequestParameters  componentPath=0:xPanel:fileUpload 
pageMapName=null versionNumber=0 interfaceName=IFormSubmitListener 
componentId=null behaviorId=null urlDepth=-1 parameters={} 
onlyProcessIfPathActive=false]).
java.lang.IllegalStateException: Attempt to set model object on null model of 
component: xPanel:fileUpload:fileInput
at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933)

thanks,

Ed

_
Windows Live™ Hotmail®: Chat. Store. Share. Do more with mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_hm_justgotbetter_howitworks_012009

Re: FileUpload in a Panel

2009-01-09 Thread Jeremy Thomerson
Yes - a FileUpload can be in any component (though it will need to be nested
in some parent multi-part form).  Your error below has nothing to do with it
being in a panel.  In later versions of 1.4, there was a change that
requires a FileUpload component to have a model to store it's data.  You
need to call the constructor like new FileUpload(ID, new Model())


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

On Fri, Jan 9, 2009 at 8:05 PM, Ed _ ed_b...@hotmail.com wrote:



 Is it possible to do a file upload within a Panel ?

 Or can it only be done in a WebPage?  I have seen some solutions using
 IFrames within panels to get around this.


 ERROR [http-8080-1] (RequestCycle.java:1072) - there was an error cleaning
 up target
 org.apache.wicket.request.target.component.listener.listenerinterfacerequesttar...@654004161[page
 class = com.mydomain.admin.Admin, id = 0, version =
 0]-fileUpload-interface
 org.apache.wicket.markup.html.form.IFormSubmitListener.IFormSubmitListener
 (request paramaters: [RequestParameters  componentPath=0:xPanel:fileUpload
 pageMapName=null versionNumber=0 interfaceName=IFormSubmitListener
 componentId=null behaviorId=null urlDepth=-1 parameters={}
 onlyProcessIfPathActive=false]).
 java.lang.IllegalStateException: Attempt to set model object on null model
 of component: xPanel:fileUpload:fileInput
at
 org.apache.wicket.Component.setDefaultModelObject(Component.java:2933)

 thanks,

 Ed

 _
 Windows Live™ Hotmail(R): Chat. Store. Share. Do more with mail.

 http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_hm_justgotbetter_howitworks_012009