Re: Mount URL to another host?

2008-10-13 Thread Johan Compagner
Dont try to do that in a constructor of a page, way better is throwing
an exception

On 10/12/08, Uwe Schäfer [EMAIL PROTECTED] wrote:
 Zach Cox schrieb:
 I need the browser to actually redirect the user to http://othersite.com
 if
 they go to http://mysite.com/something, regardless of if they click a link
 or type it into the address bar.

 doesn´t this work there?

 class SomethingPage extends WebPage { // mounted accordingly
 public SomethingPage (){
 setResponsePage(new RedirectPage(http://othersite.com;));
 }}

 cu uwe

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



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



Re: Presentation web with some stateful components - removing jsessionid+ all PageExpired exceptions

2008-10-13 Thread Stefan Simik

Http session is created, because there are stateful components on that page.
URL of that page is bookmarkable, but the page itself is not stateless
(there is ajax Gmap2 component).


why is session created on the first request? If that page was
stateless there would be no session created...

-Igor
-- 
View this message in context: 
http://www.nabble.com/Presentation-web%3A-jsessionid---page-expired-exceptions-tp19943729p19953896.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Wicket Merchandise store back in action

2008-10-13 Thread Nino Saturnino Martinez Vazquez Wael

Hi Guys

The store are open again, now with permission from Apache. And yes the 
BIB are back:) Please say if there are missing some products or something..


Knock yourself out:
http://www.cafepress.com/apachewicket

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Encoding lsot when submitting a form on Tomcat 4.1.37

2008-10-13 Thread Kenneth Holm Nielsen
I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,

my encoding to ISO-8859-1 is working fine until I submit a form.

The text 'æbleø' is presented fine until I submit, afterwards the encoding
for the entire document is lost and the text becomes 'æbleÃ',

in a BasePage.java that all pages implement I have configured the response
with ISO-8859-1 encoding.

protected void configureResponse() {
final String encoding = text/html; charset=ISO-8859-1;

getResponse().setContentType(encoding);
}

On the BasePage.html I have added the following.

?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;
html lang=da
head
title wicket:id=pagetitle/title
meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1

The intial request, before submitting the form, has the correct Response
headers.

url = http://localhost:8080/PGUI/?wicket:interface=:3
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 2241
Date: Mon, 13 Oct 2008 09:36:00 GMT

but the Response from a submit does not set the content-type:

url =
http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener::
Server: Apache-Coyote/1.1
Location: http://localhost:8080/PGUI/?wicket:interface=:3
Content-Length: 0
Date: Mon, 13 Oct 2008 09:36:00 GMT

In the conf/server.xml in tomcat I've even added 'URIEncoding=*ISO-8859-1*'
to the connector on port 8080.

Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
the encoding.

What am I missing?

-- 
regards,

Kenneth Holm Nielsen

khAn Computing

http://www.kennethhn.dk
http://www.kennethhn.blogspot.com
http://www.linkedin.com/in/kennethhn


Form model update with ajax using AutoCompleteTextField

2008-10-13 Thread kerim bey

Hi!

I have problems with using an AutoCompleteText field.
Loading the choice Objects works fine, but when I select an entry the
ModelObject (using a CompoundPropertyModel) of the Form is not updated.
Calling setModelObject() doesn't seem to have any effect.

Using a DropDownChoice the same way works.

What is missing?
-- 
View this message in context: 
http://www.nabble.com/Form-model-update-with-ajax-using-AutoCompleteTextField-tp19954381p19954381.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Form model update with ajax using AutoCompleteTextField

2008-10-13 Thread Ryan Gravener
You can search the archives for the answer to this one. Essentially
the model object for autocomplete is just a string.
On 10/13/08, kerim bey [EMAIL PROTECTED] wrote:

 Hi!

 I have problems with using an AutoCompleteText field.
 Loading the choice Objects works fine, but when I select an entry the
 ModelObject (using a CompoundPropertyModel) of the Form is not updated.
 Calling setModelObject() doesn't seem to have any effect.

 Using a DropDownChoice the same way works.

 What is missing?
 --
 View this message in context:
 http://www.nabble.com/Form-model-update-with-ajax-using-AutoCompleteTextField-tp19954381p19954381.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Ryan Gravener
http://twitter.com/ryangravener

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



Re: Downloading a BLOB

2008-10-13 Thread Johan Compagner
Deleting a file right after a first download also has its problems,
My HP network printer/scanner does that, i can scan to an image, but
firefox displayes then that image and what ever i do then to save it
to disk, i get nothing because FF seems to want to get it again for
saving bu hp doesnt serve it anymore, i have to use IE7 for that to
get my scanned image. HP really should do more testing! And serve the
resource differently.

On 10/13/08, Bruno Borges [EMAIL PROTECTED] wrote:
 I think is better to create a temporary file and set DownloadLink to delete
 it after download is complete. I don't think is a good idea to let the user
 download directly from the database as you proposed. See, downloads can take
 some time and letting that InputStream open, might be a problem. The latency
 of an external download is bigger than downloading from a local database.

 Cheers,
 Bruno Borges
 blog.brunoborges.com.br
 +55 21 76727099

 The glory of great men should always be
 measured by the means they have used to
 acquire it.
 - Francois de La Rochefoucauld


 On Fri, Oct 10, 2008 at 10:04 PM, Dane Laverty
 [EMAIL PROTECTED]wrote:

 Thank you for the advice. Here's the solution I came up with, in case
 it's useful to anyone else.

 First I used the DownloadLink as a template for my blobDownloadLink.
 Then I created an InputStreamResourceStream, which is essentially a
 barely modified version of Wicket's FileResourceStream, taking an
 InputStream as the constructor parameter instead of a File. The code for
 both of those is below.

 While this solution works, the two issues still hanging in my mind are:
 1. I'm sure there's an easier way to get the InputStream into an
 IResourceStream than to create an InputStreamResourceStream class...I
 just couldn't figure out what it is.
 2. When I get the Blob from the database like this,

rs.getBinaryStream(1);

 the returned BinaryStream doesn't work. Doing this,

java.sql.Blob blob = rs.getBlob(1);
return blob.getBinaryStream();

 doesn't work either. So I ended up doing,

java.sql.Blob blob = rs.getBlob(1);
byte[] bytes = new byte[(int)blob.length()];
try {
blob.getBinaryStream().read(bytes);
} catch (IOException ioe) {
// handle it
}
return new ByteArrayInputStream(bytes);

 Not pretty, but it works.

 ***
 // Relevant code for blobDownloadLink

 Link blobDownloadLink = new Link(blobDownloadLink) {
@Override
public void onClick() {
InputStream inputStream =
 //getBlobAsInputStreamFromDatabase();

IResourceStream resourceStream =
 new InputStreamResourceStream(inputStream);

 getRequestCycle().setRequestTarget(new
 ResourceStreamRequestTarget(resourceStream)
{
public String
 getFileName()
{
return
 //theFileNameYouWantAssociatedWithThisDownload;
}

public void
 respond(RequestCycle requestCycle)
{

 super.respond(requestCycle);

}
});

try {
inputStream.close();
} catch (IOException ioe) {
logger.error(Error
 attempting to close inputStream in blobDownloadLink., ioe);
}
};
};

 
 // Relevant code for InputStreamResourceStream

 import java.io.IOException;
 import java.io.InputStream;
 import org.apache.wicket.util.resource.AbstractResourceStream;
 import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

 /**
  * An InputStreamResourceStream is an IResource implementation for
 files.
  *
  * @see org.apache.wicket.util.resource.IResourceStream
  * @see org.apache.wicket.util.watch.IModifiable
  * @author Dane Laverty
  */
 public class InputStreamResourceStream extends AbstractResourceStream
 {
private static final long serialVersionUID = 1L;

/** Resource stream */
private transient InputStream inputStream;

/**
 * Constructor.
 *
 * @param inputStream
 *[EMAIL PROTECTED] InputStream} containing resource
 */
public InputStreamResourceStream(InputStream inputStream)
{
this.inputStream = inputStream;
}

/**
 * Closes this resource.
 *
 * @throws IOException
 */

Re: Encoding lsot when submitting a form on Tomcat 4.1.37

2008-10-13 Thread Johan Compagner
You shouldnt set the response like that i think. Please use the
request setting default encoding. So that wicket also knows what you
are using when the form comes back in (form submit)

Why use that iso encoding, please, all the people of this world, start
using only utf8 everywhere and drop all those other stupid encodings.


On 10/13/08, Kenneth Holm Nielsen [EMAIL PROTECTED] wrote:
 I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,

 my encoding to ISO-8859-1 is working fine until I submit a form.

 The text 'æbleø' is presented fine until I submit, afterwards the encoding
 for the entire document is lost and the text becomes 'æbleÃ',

 in a BasePage.java that all pages implement I have configured the response
 with ISO-8859-1 encoding.

 protected void configureResponse() {
 final String encoding = text/html; charset=ISO-8859-1;

 getResponse().setContentType(encoding);
 }

 On the BasePage.html I have added the following.

 ?xml version=1.0 encoding=ISO-8859-1?
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
 http://www.w3.org/TR/html4/loose.dtd;
 html lang=da
 head
 title wicket:id=pagetitle/title
 meta http-equiv=Content-Type content=text/html;
 charset=ISO-8859-1

 The intial request, before submitting the form, has the correct Response
 headers.

 url = http://localhost:8080/PGUI/?wicket:interface=:3
 Server: Apache-Coyote/1.1
 Content-Type: text/html;charset=ISO-8859-1
 Content-Length: 2241
 Date: Mon, 13 Oct 2008 09:36:00 GMT

 but the Response from a submit does not set the content-type:

 url =
 http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener::
 Server: Apache-Coyote/1.1
 Location: http://localhost:8080/PGUI/?wicket:interface=:3
 Content-Length: 0
 Date: Mon, 13 Oct 2008 09:36:00 GMT

 In the conf/server.xml in tomcat I've even added
 'URIEncoding=*ISO-8859-1*'
 to the connector on port 8080.

 Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
 the encoding.

 What am I missing?

 --
 regards,

 Kenneth Holm Nielsen

 khAn Computing

 http://www.kennethhn.dk
 http://www.kennethhn.blogspot.com
 http://www.linkedin.com/in/kennethhn


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



RE: Form model update with ajax using AutoCompleteTextField

2008-10-13 Thread Hoover, William
or you can use this one-
http://cwiki.apache.org/confluence/display/WICKET/Autocomplete+using+a+W
icket+model 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan
Gravener
Sent: Monday, October 13, 2008 9:17 AM
To: users@wicket.apache.org
Subject: Re: Form model update with ajax using AutoCompleteTextField

You can search the archives for the answer to this one. Essentially the
model object for autocomplete is just a string.
On 10/13/08, kerim bey [EMAIL PROTECTED] wrote:

 Hi!

 I have problems with using an AutoCompleteText field.
 Loading the choice Objects works fine, but when I select an entry the 
 ModelObject (using a CompoundPropertyModel) of the Form is not
updated.
 Calling setModelObject() doesn't seem to have any effect.

 Using a DropDownChoice the same way works.

 What is missing?
 --
 View this message in context:
 http://www.nabble.com/Form-model-update-with-ajax-using-AutoCompleteTe
 xtField-tp19954381p19954381.html Sent from the Wicket - User mailing 
 list archive at Nabble.com.


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




--
Ryan Gravener
http://twitter.com/ryangravener

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



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



Re: Uploading a file: no path information available

2008-10-13 Thread Johan Compagner
Dont know about the java doc, but i guess we want to be browser
independend, so that call should result in the same thing no matter
what browser is used.

I find it by the way very strange that you get thr full path, what do
you want with it? And why does IE send it, it shouldnt a website
shouldnt know any thing about the filesystem of the browsers pc.

On 10/13/08, rnieuw [EMAIL PROTECTED] wrote:

 When using the FileUploadField component for uploading files i cannot get
 the
 full path on the client system 'd:\temp\myFile.pdf' instead i only get the
 file name 'myFile.pdf'.

 According to FileItem.getName() Javadoc i should get the full path name if
 the browser supports it. I'm using IE7 and i know that IE sends the full
 path (when using JSF i can obtain the full path) But unfortunately with
 Wicket i cannot get to this information.
 I did a little debugging and i see that the path information is stripped in
 the FileUploadBase.getFileName() method. So the browser sends the full path
 in its header, but i cannot access this information.

 Am i doing something wrong or is the Javadoc not correct?
 --
 View this message in context:
 http://www.nabble.com/Uploading-a-file%3A-no-path-information-available-tp19951376p19951376.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



How to change field values in a validator?

2008-10-13 Thread Matthias Keller

Hi

I've got a custom validator here which needs to dynamically change some 
other input field's value to a new value.

Here's the scenario with two radios and a pulldown:
( ) I don't need anything
( ) I need: [ pulldown with options ]

Now if I need is selected, everything works as expected, the pulldown 
value gets stored to the model.
Now if 'I dont need anything' is selected, another value for the 
pulldown needs to be stored in the model. Let's say a marker entry like 
'nothing'. I can't have 'nothing' directly in the pulldown as it would 
make no sense (and the customer explicitly doesn't want that). So in the 
validator I need to check the status of the radios and if the first 
option is selected, set the pulldown model's value to my custom value, 
ignoring any possible input value.


I tried it with .setModelObject() and .setConvertedInput() but it 
appears that the input fields are initialized again later from the 
parameters, overriding my value...


Is there anything I can do?

Thanks

Matt

--
[EMAIL PROTECTED]  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Re: 1.4M4?

2008-10-13 Thread Lutz Müller
/push

On Friday 19 September 2008 12:10:24 Stefan Lindner wrote:
 Wicket in Action is out, the open issues for 1.4 are constantly decreasing.
 Is a 1.4M4 in sight?

 Stefan



Re: Form model update with ajax using AutoCompleteTextField

2008-10-13 Thread Lutz Müller
i also do it in convertInput(). So even if it should be the wrong place, it 
does work, and you are not alone with this solution ;)

On Monday 13 October 2008 15:40:22 kerim bey wrote:
 While debugging I noticed it is a string.
 That's why I'm iterating through the choice objects to get back the object
 represented by the string in the autocomplete and then call
 setModelObject() with the one that matches.
 I override convertInput() for this but maybe this is the wrong place?

 Ryan Gravener-3 wrote:
  You can search the archives for the answer to this one. Essentially
  the model object for autocomplete is just a string.
 
  On 10/13/08, kerim bey [EMAIL PROTECTED] wrote:
  Hi!
 
  I have problems with using an AutoCompleteText field.
  Loading the choice Objects works fine, but when I select an entry the
  ModelObject (using a CompoundPropertyModel) of the Form is not updated.
  Calling setModelObject() doesn't seem to have any effect.
 
  Using a DropDownChoice the same way works.
 
  What is missing?
  --
  View this message in context:
  http://www.nabble.com/Form-model-update-with-ajax-using-AutoCompleteText
 Field-tp19954381p19954381.html Sent from the Wicket - User mailing list
  archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  --
  Ryan Gravener
  http://twitter.com/ryangravener
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Downloading a BLOB

2008-10-13 Thread bruno . borges
Right click on that image and click on Copy image and then past it  
somewhere like Gimp or Photoshop. :D


Anyway, if you use a LoadableDetachableModel, it is possible and actually,  
recommended, to delete the file right after the download. Just make sure it  
is not a file that will be download several times. If this is the case,  
think on something else like a timer, to keep that file in disk for a while.


Cheers,
Bruno

On Oct 13, 2008 10:17am, Johan Compagner [EMAIL PROTECTED] wrote:

Deleting a file right after a first download also has its problems,

My HP network printer/scanner does that, i can scan to an image, but

firefox displayes then that image and what ever i do then to save it

to disk, i get nothing because FF seems to want to get it again for

saving bu hp doesnt serve it anymore, i have to use IE7 for that to

get my scanned image. HP really should do more testing! And serve the

resource differently.



On 10/13/08, Bruno Borges wrote:

 I think is better to create a temporary file and set DownloadLink to  

delete


 it after download is complete. I don't think is a good idea to let the  

user


 download directly from the database as you proposed. See, downloads can  

take


 some time and letting that InputStream open, might be a problem. The  

latency


 of an external download is bigger than downloading from a local  

database.




 Cheers,

 Bruno Borges

 blog.brunoborges.com.br

 +55 21 76727099



 The glory of great men should always be

 measured by the means they have used to

 acquire it.

 - Francois de La Rochefoucauld





 On Fri, Oct 10, 2008 at 10:04 PM, Dane Laverty

 wrote:



 Thank you for the advice. Here's the solution I came up with, in case

 it's useful to anyone else.



 First I used the DownloadLink as a template for my blobDownloadLink.

 Then I created an InputStreamResourceStream, which is essentially a

 barely modified version of Wicket's FileResourceStream, taking an

 InputStream as the constructor parameter instead of a File. The code  

for


 both of those is below.



 While this solution works, the two issues still hanging in my mind are:

 1. I'm sure there's an easier way to get the InputStream into an

 IResourceStream than to create an InputStreamResourceStream class...I

 just couldn't figure out what it is.

 2. When I get the Blob from the database like this,



 rs.getBinaryStream(1);



 the returned BinaryStream doesn't work. Doing this,



 java.sql.Blob blob = rs.getBlob(1);

 return blob.getBinaryStream();



 doesn't work either. So I ended up doing,



 java.sql.Blob blob = rs.getBlob(1);

 byte[] bytes = new byte[(int)blob.length()];

 try {

 blob.getBinaryStream().read(bytes);

 } catch (IOException ioe) {

 // handle it

 }

 return new ByteArrayInputStream(bytes);



 Not pretty, but it works.



 ***

 // Relevant code for blobDownloadLink



 Link blobDownloadLink = new Link(blobDownloadLink) {

 @Override

 public void onClick() {

 InputStream inputStream =

 //getBlobAsInputStreamFromDatabase();



 IResourceStream resourceStream =

 new InputStreamResourceStream(inputStream);



 getRequestCycle().setRequestTarget(new

 ResourceStreamRequestTarget(resourceStream)

 {

 public String

 getFileName()

 {

 return

 //theFileNameYouWantAssociatedWithThisDownload;

 }



 public void

 respond(RequestCycle requestCycle)

 {



 super.respond(requestCycle);



 }

 });



 try {

 inputStream.close();

 } catch (IOException ioe) {

 logger.error(Error

 attempting to close inputStream in blobDownloadLink., ioe);

 }

 };

 };



 

 // Relevant code for InputStreamResourceStream



 import java.io.IOException;

 import java.io.InputStream;

 import org.apache.wicket.util.resource.AbstractResourceStream;

 import org.apache.wicket.util.resource.ResourceStreamNotFoundException;



 /**

 * An InputStreamResourceStream is an IResource implementation for

 files.

 *

 * @see org.apache.wicket.util.resource.IResourceStream

 * @see org.apache.wicket.util.watch.IModifiable

 * @author Dane Laverty

 */

 public class InputStreamResourceStream extends AbstractResourceStream

 {

 private static final long serialVersionUID = 1L;



 /** Resource stream */

 private transient InputStream inputStream;



 /**

 * Constructor.

 *

 * @param inputStream

 * [EMAIL PROTECTED] InputStream} containing resource

 */

 public InputStreamResourceStream(InputStream inputStream)

 {

 this.inputStream = inputStream;

 }



 /**

 * Closes this resource.

 *

 * @throws IOException

 */

 public void close() throws IOException

 {

 if (inputStream != null)

 {

 inputStream.close();

 inputStream = null;

 }

 }



 /**

 * @see IResourceStream#getContentType()

 */

 public String getContentType()

 {

 // Let ResourceStreamRequestTarget handle content-type

 automatically

 return null;

 }



 /**

 * @return A readable input stream for this resource. The same

 input stream is returned until

 * 

Re: How to change field values in a validator?

2008-10-13 Thread Timo Rantalaiho
On Mon, 13 Oct 2008, Matthias Keller wrote:
 Here's the scenario with two radios and a pulldown:
 ( ) I don't need anything
 ( ) I need: [ pulldown with options ]
 
 Now if I need is selected, everything works as expected, the pulldown 
 value gets stored to the model.
 Now if 'I dont need anything' is selected, another value for the 
 pulldown needs to be stored in the model. Let's say a marker entry like 
 'nothing'. I can't have 'nothing' directly in the pulldown as it would 
 make no sense (and the customer explicitly doesn't want that). So in the 
 validator I need to check the status of the radios and if the first 
 option is selected, set the pulldown model's value to my custom value, 
 ignoring any possible input value.

I think that you should do it with ajax and custom models
instead of validators. It seems like a kludge or at least a
strange side effect for a validator to do something like
that.

Best wishes,
Timo

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

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



retrieveing page parameters

2008-10-13 Thread miro

I am using 

setRedirect(true);
setResponsePage(MyPage.class,pageParameters);

in Mypage how can I retrieve pageParameters ? 
-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19956410.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Form model update with ajax using AutoCompleteTextField

2008-10-13 Thread kerim bey

Still does not work!

When I submit the form the object is null and the amount of is 0 even I
selected an Object and type an valid amount.
I'm not quite shure which components I have to add to the target for
onchange Event.
Right now I just added the form-component to the ajax target.


Lutz Müller wrote:
 
 i also do it in convertInput(). So even if it should be the wrong place,
 it 
 does work, and you are not alone with this solution ;)
 
 On Monday 13 October 2008 15:40:22 kerim bey wrote:
 While debugging I noticed it is a string.
 That's why I'm iterating through the choice objects to get back the
 object
 represented by the string in the autocomplete and then call
 setModelObject() with the one that matches.
 I override convertInput() for this but maybe this is the wrong place?

 Ryan Gravener-3 wrote:
  You can search the archives for the answer to this one. Essentially
  the model object for autocomplete is just a string.
 
  On 10/13/08, kerim bey [EMAIL PROTECTED] wrote:
  Hi!
 
  I have problems with using an AutoCompleteText field.
  Loading the choice Objects works fine, but when I select an entry the
  ModelObject (using a CompoundPropertyModel) of the Form is not
 updated.
  Calling setModelObject() doesn't seem to have any effect.
 
  Using a DropDownChoice the same way works.
 
  What is missing?
  --
  View this message in context:
 
 http://www.nabble.com/Form-model-update-with-ajax-using-AutoCompleteText
 Field-tp19954381p19954381.html Sent from the Wicket - User mailing list
  archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  --
  Ryan Gravener
  http://twitter.com/ryangravener
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Form-model-update-with-ajax-using-AutoCompleteTextField-tp19954381p19956343.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to change field values in a validator?

2008-10-13 Thread Matthias Keller

Timo Rantalaiho wrote:

On Mon, 13 Oct 2008, Matthias Keller wrote:
  

Here's the scenario with two radios and a pulldown:
( ) I don't need anything
( ) I need: [ pulldown with options ]

Now if I need is selected, everything works as expected, the pulldown 
value gets stored to the model.
Now if 'I dont need anything' is selected, another value for the 
pulldown needs to be stored in the model. Let's say a marker entry like 
'nothing'. I can't have 'nothing' directly in the pulldown as it would 
make no sense (and the customer explicitly doesn't want that). So in the 
validator I need to check the status of the radios and if the first 
option is selected, set the pulldown model's value to my custom value, 
ignoring any possible input value.



I think that you should do it with ajax and custom models
instead of validators. It seems like a kludge or at least a
strange side effect for a validator to do something like
that.

Best wishes,
Timo
  

Hi Timo

AJAX is not an option, as it is client side.
Another scenario would be: User has to enter some data which needs to be 
stored in a certain way. For example a number needs leading zeros or 
whatever, it would be good for a validator to a) check that the value is 
a number and b) on the fly update the value with leading zeros as needed 
- I guess a converter could do the job but I think that's overkill...?
A custom model also is not that easy, at least to my understanding as 
the model values come from two different components..


Matt

--
[EMAIL PROTECTED]  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Jackrabbit APi thorugh Apache wicket

2008-10-13 Thread Nayak Vishal

Hello everyone,

Is it possible to access Jackrabbit API(talking to Alfresco ) thorugh
Apache wicket.

Regards
Vishal

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



Re: retrieveing page parameters

2008-10-13 Thread Per Newgro
Am Montag, 13. Oktober 2008 16:53:30 schrieb miro:
 I am using

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ?

public MyPage(PageParameters params) not working?

Cheers
Per

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



Re: retrieveing page parameters

2008-10-13 Thread Piller Sébastien

Implement one-arg constructor:

class MyPage extends WebPage {

 public MyPage(PageParameters params) {
   super(params);
   // here you get the params
 }


miro a écrit :
I am using 


setRedirect(true);
setResponsePage(MyPage.class,pageParameters);

in Mypage how can I retrieve pageParameters ? 
  



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



Re: Possible bug in FormComponent$MessageSource regarding resource string lookups

2008-10-13 Thread Per Newgro
Am Montag, 13. Oktober 2008 11:28:07 schrieb Christian Oldiges:
 Hello!

 First here is my setup and the situation in which I discovered the problem
 which might be a bug in FormComponent$MessageSource:

 I am using v1.3.4 and I have a problem placing a resource string for a
 customized subclass of CheckBox.

 My component tree looks like this:

 page.form.main.data

 -page is a subclass of WebPage, the page.html file contains several
 wicket:fragment tags which are used to create a wizard style UI
 -form is a Form object
 -main is a Fragment object
 -data is a customized subclass of CheckBox

 Now my problem:

 We have created the CheckBox subclass because it contains spezialized
 behaviour and we need customized error messages, especially for the case
 when the checkbox is NOT marked by the user when the form is submitted.

 For that reason we created a data.xml next to the data.class which is
 supposed to contain the error messages. Now, the data component marks
 itself as required and thus triggers a Required error resource key lookup
 upon form validation when the checkbox wasnt checked.

 I was surprised to find that the Required key is never ever tried on the
 data.xml resource file, so I fired up the debugger to check out whats
 happening and I think the problem is located in

 FormComponent$MessageSource.getMessage(String key):

 ---
--- public String getMessage(String key)
   {
   final FormComponent formComponent = FormComponent.this;

   // retrieve prefix that will be used to construct 
 message keys
   String prefix = formComponent.getValidatorKeyPrefix();
   if (Strings.isEmpty(prefix))
   {
   prefix = ;
   }

   final Localizer localizer = 
 formComponent.getLocalizer();

   String resource = prefix + getId() + . + key;

   // First use the parent for resolving so that
   // form1.textfield1.Required can be used.

   // Note: It is important that the default value of  
 is provided
   // to getString() not to throw a 
 MissingResourceException or to
   // return a default string like [Warning: String ...
   String message = getString(localizer, resource,
 formComponent.getParent());

   // If not found, than ...
   if (Strings.isEmpty(message))
   {
   // Try a variation of the resource key

   resource = prefix + key;

   message = getString(localizer, resource, 
 formComponent.getParent());
   }
 ---
---

 This method is called with key=Required on the instance belonging to the
 data FormComponent.

 At first the id of the FormComponent is prefixed and getString() is called
 for the parent of the FormComponent. This would be data.Required and the
 component would be the main Fragment. That call doesnt return any useful
 value, which is expected.

 Now, the second call of the getString() method doesnt include any component
 id anymore in the resource key, so it is Required and is called again for
 the parent of the FormComponent. The getString() at some point gets into
 the ComponentStringResourceLoader class to the
 loadStringResource(component,key) method.

 key = Required and component is again the main Fragment and that is the
 problem IMO.

 The component stack created in loadStringResource contains:

 page, form and main but NOT the data component, so the key
 Required is never tried on the resource file data.xml.

 If the second getString call

   message = getString(localizer, resource, 
 formComponent.getParent());

 were changed like this:

   message = getString(localizer, resource, 
 formComponent);

 the component stack would go all the way down to the component itself and
 would not stop at the parent.


 Is this a bug or am I missing something regarding the lookup mechanism???



 BTW: Great job on the WiA book!!!

Small question for understanding: Did you set your own localizer? AFAIK wicket 
uses property files for localization and if it finds no file on the 
appropriate place it goes up the component hirarchie. So you would need a 
Data.properties file with the strings in it. Maybe im missed something.

Cheers
Per

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



Re: retrieveing page parameters

2008-10-13 Thread Michael Sparer

getPageParameters()? Didn't you look at the API before posting? ;-)


miro wrote:
 
 I am using 
 
 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);
 
 in Mypage how can I retrieve pageParameters ? 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19956420.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Possible bug in FormComponent$MessageSource regarding resource string lookups

2008-10-13 Thread Igor Vaynberg
first thing to get is that each getstring() traverses the hierarchy.
so first we try with id and then without just in case the user forgot.

the problem here is that formcomponents do not provide their own
resource bundles. you need to add an rfe to support this.
traditionally only top-level markup containers provide bundles, eg
page and panel.

-igor

On Mon, Oct 13, 2008 at 2:28 AM, Christian Oldiges [EMAIL PROTECTED] wrote:

 Hello!

 First here is my setup and the situation in which I discovered the problem
 which might be a bug in FormComponent$MessageSource:

 I am using v1.3.4 and I have a problem placing a resource string for a
 customized subclass of CheckBox.

 My component tree looks like this:

 page.form.main.data

 -page is a subclass of WebPage, the page.html file contains several
 wicket:fragment tags which are used to create a wizard style UI
 -form is a Form object
 -main is a Fragment object
 -data is a customized subclass of CheckBox

 Now my problem:

 We have created the CheckBox subclass because it contains spezialized
 behaviour and we need customized error messages, especially for the case
 when the checkbox is NOT marked by the user when the form is submitted.

 For that reason we created a data.xml next to the data.class which is
 supposed to contain the error messages. Now, the data component marks itself
 as required and thus triggers a Required error resource key lookup upon
 form validation when the checkbox wasnt checked.

 I was surprised to find that the Required key is never ever tried on the
 data.xml resource file, so I fired up the debugger to check out whats
 happening and I think the problem is located in

 FormComponent$MessageSource.getMessage(String key):

 --
public String getMessage(String key)
{
final FormComponent formComponent = FormComponent.this;

// retrieve prefix that will be used to construct 
 message keys
String prefix = formComponent.getValidatorKeyPrefix();
if (Strings.isEmpty(prefix))
{
prefix = ;
}

final Localizer localizer = 
 formComponent.getLocalizer();

String resource = prefix + getId() + . + key;

// First use the parent for resolving so that
// form1.textfield1.Required can be used.

// Note: It is important that the default value of  
 is provided
// to getString() not to throw a 
 MissingResourceException or to
// return a default string like [Warning: String ...
String message = getString(localizer, resource,
 formComponent.getParent());

// If not found, than ...
if (Strings.isEmpty(message))
{
// Try a variation of the resource key

resource = prefix + key;

message = getString(localizer, resource, 
 formComponent.getParent());
}
 --

 This method is called with key=Required on the instance belonging to the
 data FormComponent.

 At first the id of the FormComponent is prefixed and getString() is called
 for the parent of the FormComponent. This would be data.Required and the
 component would be the main Fragment. That call doesnt return any useful
 value, which is expected.

 Now, the second call of the getString() method doesnt include any component
 id anymore in the resource key, so it is Required and is called again for
 the parent of the FormComponent. The getString() at some point gets into the
 ComponentStringResourceLoader class to the loadStringResource(component,key)
 method.

 key = Required and component is again the main Fragment and that is the
 problem IMO.

 The component stack created in loadStringResource contains:

 page, form and main but NOT the data component, so the key
 Required is never tried on the resource file data.xml.

 If the second getString call

message = getString(localizer, resource, 
 formComponent.getParent());

 were changed like this:

message = getString(localizer, resource, 
 formComponent);

 the component stack would go all the way down to the component itself and
 would not stop at the parent.


 Is this a bug or am I missing something regarding the lookup mechanism???



 BTW: Great job on the WiA book!!!
 --
 View this message in context: 
 http://www.nabble.com/Possible-bug-in-FormComponent%24MessageSource-regarding-resource-string-lookups-tp19951394p19951394.html
 Sent from 

Re: retrieveing page parameters

2008-10-13 Thread miro

I tried that , getPageParameters() was returning null .

Michael Sparer wrote:
 
 getPageParameters()? Didn't you look at the API before posting? ;-)
 
 
 miro wrote:
 
 I am using 
 
 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);
 
 in Mypage how can I retrieve pageParameters ? 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19956428.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread Michael Sparer

then there either weren't any pageparams or you missed to call super(params)

regards,
Michael


miro wrote:
 
 I tried that , getPageParameters() was returning null .
 
 Michael Sparer wrote:
 
 getPageParameters()? Didn't you look at the API before posting? ;-)
 
 
 miro wrote:
 
 I am using 
 
 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);
 
 in Mypage how can I retrieve pageParameters ? 
 
 
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19956431.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread miro

where should I call super(params)  ?

Michael Sparer wrote:
 
 then there either weren't any pageparams or you missed to call
 super(params)
 
 regards,
 Michael
 
 
 miro wrote:
 
 I tried that , getPageParameters() was returning null .
 
 Michael Sparer wrote:
 
 getPageParameters()? Didn't you look at the API before posting? ;-)
 
 
 miro wrote:
 
 I am using 
 
 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);
 
 in Mypage how can I retrieve pageParameters ? 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19956433.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Jackrabbit APi thorugh Apache wicket

2008-10-13 Thread Edmund Urbani
Nayak Vishal wrote:
 Hello everyone,
 
 Is it possible to access Jackrabbit API(talking to Alfresco ) thorugh
 Apache wicket.
 
 Regards
 Vishal
 
Well, I don't know of any out-of-the-box components that integrate Wicket with
JCR (or Jackrabbit in particular), but you can always write your own. I have
myself written some Wicket models and data providers to access items in a
Jackrabbit repository (very specific to my repository and my node types). It's
not too difficult if you're familiar with both Wicket and JCR.

Cheers
 Edmund

-- 
Liland ...does IT better

Liland IT GmbH
Software Architekt
email: [EMAIL PROTECTED]

office: +43 (0)463 220-111  | fax: +43 (0)463 220-288
http://www.Liland.at

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



Re: Downloading a BLOB

2008-10-13 Thread Johan Compagner
That really doesnt work, what ever i do in FF i get a 1kb file, the
conten being something like resource not found, somehow FF really
doesnt give you the  image out of the cache. (i guess no cache
settings in the headers are done at all by HP)

On 10/13/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Right click on that image and click on Copy image and then past it
 somewhere like Gimp or Photoshop. :D

 Anyway, if you use a LoadableDetachableModel, it is possible and actually,
 recommended, to delete the file right after the download. Just make sure it
 is not a file that will be download several times. If this is the case,
 think on something else like a timer, to keep that file in disk for a while.

 Cheers,
 Bruno

 On Oct 13, 2008 10:17am, Johan Compagner [EMAIL PROTECTED] wrote:
 Deleting a file right after a first download also has its problems,

 My HP network printer/scanner does that, i can scan to an image, but

 firefox displayes then that image and what ever i do then to save it

 to disk, i get nothing because FF seems to want to get it again for

 saving bu hp doesnt serve it anymore, i have to use IE7 for that to

 get my scanned image. HP really should do more testing! And serve the

 resource differently.



 On 10/13/08, Bruno Borges wrote:

  I think is better to create a temporary file and set DownloadLink to
 delete

  it after download is complete. I don't think is a good idea to let the
 user

  download directly from the database as you proposed. See, downloads can
 
 take

  some time and letting that InputStream open, might be a problem. The
 latency

  of an external download is bigger than downloading from a local
 database.

 

  Cheers,

  Bruno Borges

  blog.brunoborges.com.br

  +55 21 76727099

 

  The glory of great men should always be

  measured by the means they have used to

  acquire it.

  - Francois de La Rochefoucauld

 

 

  On Fri, Oct 10, 2008 at 10:04 PM, Dane Laverty

  wrote:

 

  Thank you for the advice. Here's the solution I came up with, in case

  it's useful to anyone else.

 

  First I used the DownloadLink as a template for my blobDownloadLink.

  Then I created an InputStreamResourceStream, which is essentially a

  barely modified version of Wicket's FileResourceStream, taking an

  InputStream as the constructor parameter instead of a File. The code
 for

  both of those is below.

 

  While this solution works, the two issues still hanging in my mind are:

  1. I'm sure there's an easier way to get the InputStream into an

  IResourceStream than to create an InputStreamResourceStream class...I

  just couldn't figure out what it is.

  2. When I get the Blob from the database like this,

 

  rs.getBinaryStream(1);

 

  the returned BinaryStream doesn't work. Doing this,

 

  java.sql.Blob blob = rs.getBlob(1);

  return blob.getBinaryStream();

 

  doesn't work either. So I ended up doing,

 

  java.sql.Blob blob = rs.getBlob(1);

  byte[] bytes = new byte[(int)blob.length()];

  try {

  blob.getBinaryStream().read(bytes);

  } catch (IOException ioe) {

  // handle it

  }

  return new ByteArrayInputStream(bytes);

 

  Not pretty, but it works.

 

  ***

  // Relevant code for blobDownloadLink

 

  Link blobDownloadLink = new Link(blobDownloadLink) {

  @Override

  public void onClick() {

  InputStream inputStream =

  //getBlobAsInputStreamFromDatabase();

 

  IResourceStream resourceStream =

  new InputStreamResourceStream(inputStream);

 

  getRequestCycle().setRequestTarget(new

  ResourceStreamRequestTarget(resourceStream)

  {

  public String

  getFileName()

  {

  return

  //theFileNameYouWantAssociatedWithThisDownload;

  }

 

  public void

  respond(RequestCycle requestCycle)

  {

 

  super.respond(requestCycle);

 

  }

  });

 

  try {

  inputStream.close();

  } catch (IOException ioe) {

  logger.error(Error

  attempting to close inputStream in blobDownloadLink., ioe);

  }

  };

  };

 

  

  // Relevant code for InputStreamResourceStream

 

  import java.io.IOException;

  import java.io.InputStream;

  import org.apache.wicket.util.resource.AbstractResourceStream;

  import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

 

  /**

  * An InputStreamResourceStream is an IResource implementation for

  files.

  *

  * @see org.apache.wicket.util.resource.IResourceStream

  * @see org.apache.wicket.util.watch.IModifiable

  * @author Dane Laverty

  */

  public class InputStreamResourceStream extends AbstractResourceStream

  {

  private static final long serialVersionUID = 1L;

 

  /** Resource stream */

  private transient InputStream inputStream;

 

  /**

  * Constructor.

  *

  * @param inputStream

  * [EMAIL PROTECTED] InputStream} containing resource

  */

  public InputStreamResourceStream(InputStream inputStream)

  {

  this.inputStream = inputStream;

  }

 

  /**

  * Closes this resource.

  *

  * @throws IOException

  */

  public void 

Re: retrieveing page parameters

2008-10-13 Thread miro

here more description

I have a bookmarkable page  and an link to this page .
   mountBookmarkablePage(/createStorageLocation,
CreateNewStorageLocation.class);

Now  I want to call this page using setResponsePage()
and passing some parameters for which I am doing this 

PageParameters  pageParameters= new PageParameters();
pageParameters.add(param1, testparam);
setRedirect(true);
setResponsePage(CreateNewStorageLocation.class,pageParameters);


api says the parameters will get  appended to the url .
I am assunming the url  will be 
http://localhost/csr/secure/index.jas/createStorageLocation?cicr7=sai

but this is what is happening
http://localhost/csr/secure/index.jas/createStorageLocation/cicr7/sai/
 
Please help me understand hot to pass parameters to a page using 
setResponsePage(APAge.class,PageParameters);


miro wrote:
 
 I am using 
 
 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);
 
 in Mypage how can I retrieve pageParameters ? 
 

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19957051.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread Piller Sébastien

in your constructor that has a parameter PageParameters...


miro a écrit :

where should I call super(params)  ?

Michael Sparer wrote:
  

then there either weren't any pageparams or you missed to call
super(params)

regards,
Michael


miro wrote:


I tried that , getPageParameters() was returning null .

Michael Sparer wrote:
  

getPageParameters()? Didn't you look at the API before posting? ;-)


miro wrote:

I am using 


setRedirect(true);
setResponsePage(MyPage.class,pageParameters);

in Mypage how can I retrieve pageParameters ? 

  

  



  



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



Re: Possible bug in FormComponent$MessageSource regarding resource string lookups

2008-10-13 Thread Christian Oldiges

Hi!

Wicket also supports .xml files instead of .properties, so that is not
the problem.
I was able to follow Wicket trying both X.properties and X.xml for any
location.

So, that is not the problem.



Newgro wrote:
 
 Am Montag, 13. Oktober 2008 11:28:07 schrieb Christian Oldiges:
 Hello!

 First here is my setup and the situation in which I discovered the
 problem
 which might be a bug in FormComponent$MessageSource:

 I am using v1.3.4 and I have a problem placing a resource string for a
 customized subclass of CheckBox.

 My component tree looks like this:

 page.form.main.data

 -page is a subclass of WebPage, the page.html file contains several
 wicket:fragment tags which are used to create a wizard style UI
 -form is a Form object
 -main is a Fragment object
 -data is a customized subclass of CheckBox

 Now my problem:

 We have created the CheckBox subclass because it contains spezialized
 behaviour and we need customized error messages, especially for the case
 when the checkbox is NOT marked by the user when the form is submitted.

 For that reason we created a data.xml next to the data.class which is
 supposed to contain the error messages. Now, the data component marks
 itself as required and thus triggers a Required error resource key
 lookup
 upon form validation when the checkbox wasnt checked.

 I was surprised to find that the Required key is never ever tried on
 the
 data.xml resource file, so I fired up the debugger to check out whats
 happening and I think the problem is located in

 FormComponent$MessageSource.getMessage(String key):

 ---
--- public String getMessage(String key)
  {
  final FormComponent formComponent = FormComponent.this;

  // retrieve prefix that will be used to construct 
 message keys
  String prefix = formComponent.getValidatorKeyPrefix();
  if (Strings.isEmpty(prefix))
  {
  prefix = ;
  }

  final Localizer localizer = 
 formComponent.getLocalizer();

  String resource = prefix + getId() + . + key;

  // First use the parent for resolving so that
  // form1.textfield1.Required can be used.

  // Note: It is important that the default value of  
 is provided
  // to getString() not to throw a 
 MissingResourceException or to
  // return a default string like [Warning: String ...
  String message = getString(localizer, resource,
 formComponent.getParent());

  // If not found, than ...
  if (Strings.isEmpty(message))
  {
  // Try a variation of the resource key

  resource = prefix + key;

  message = getString(localizer, resource, 
 formComponent.getParent());
  }
 ---
---

 This method is called with key=Required on the instance belonging to
 the
 data FormComponent.

 At first the id of the FormComponent is prefixed and getString() is
 called
 for the parent of the FormComponent. This would be data.Required and
 the
 component would be the main Fragment. That call doesnt return any
 useful
 value, which is expected.

 Now, the second call of the getString() method doesnt include any
 component
 id anymore in the resource key, so it is Required and is called again
 for
 the parent of the FormComponent. The getString() at some point gets into
 the ComponentStringResourceLoader class to the
 loadStringResource(component,key) method.

 key = Required and component is again the main Fragment and that is
 the
 problem IMO.

 The component stack created in loadStringResource contains:

 page, form and main but NOT the data component, so the key
 Required is never tried on the resource file data.xml.

 If the second getString call

  message = getString(localizer, resource, 
 formComponent.getParent());

 were changed like this:

  message = getString(localizer, resource, 
 formComponent);

 the component stack would go all the way down to the component itself and
 would not stop at the parent.


 Is this a bug or am I missing something regarding the lookup mechanism???



 BTW: Great job on the WiA book!!!
 
 Small question for understanding: Did you set your own localizer? AFAIK
 wicket 
 uses property files for localization and if it finds no file on the 
 appropriate place it goes up the component hirarchie. So you would need a 
 Data.properties file with the strings in it. Maybe im missed something.
 
 Cheers
 Per
 
 

Re: Possible bug in FormComponent$MessageSource regarding resource string lookups

2008-10-13 Thread Christian Oldiges

Hm, but then the JavaDoc for ComponentStringResourceLoader needs to be
updated, because the following example taken from that JavaDoc clearly
states it will try to lookup Required in the input1.properties file:



 In addition to the above search order, each key will be pre-pended with
 the relative path of the current component related to the component that
 is being searched. E.g. assume a component hierarchy like
 page1.form1.input1 and your are requesting a key named 'Required'. Wicket
 will search the property in the following order:
 
 page1.properties = form1.input1.Required
 page1.properties = Required
 form1.properties = input1.Required
 form1.properties = Required
 input1.properties = Required
 myApplication.properties = page1.form1.input1.Required
 myApplication.properties = Required
 
 
This would work just fine, once the 2nd getString call gets the
formComponent itself, but not its parent as a parameter.

Eh, what is an rfe? Request for Extension?



igor.vaynberg wrote:
 
 first thing to get is that each getstring() traverses the hierarchy.
 so first we try with id and then without just in case the user forgot.
 
 the problem here is that formcomponents do not provide their own
 resource bundles. you need to add an rfe to support this.
 traditionally only top-level markup containers provide bundles, eg
 page and panel.
 
 -igor
 
 On Mon, Oct 13, 2008 at 2:28 AM, Christian Oldiges [EMAIL PROTECTED]
 wrote:

 Hello!

 First here is my setup and the situation in which I discovered the
 problem
 which might be a bug in FormComponent$MessageSource:

 I am using v1.3.4 and I have a problem placing a resource string for a
 customized subclass of CheckBox.

 My component tree looks like this:

 page.form.main.data

 -page is a subclass of WebPage, the page.html file contains several
 wicket:fragment tags which are used to create a wizard style UI
 -form is a Form object
 -main is a Fragment object
 -data is a customized subclass of CheckBox

 Now my problem:

 We have created the CheckBox subclass because it contains spezialized
 behaviour and we need customized error messages, especially for the case
 when the checkbox is NOT marked by the user when the form is submitted.

 For that reason we created a data.xml next to the data.class which is
 supposed to contain the error messages. Now, the data component marks
 itself
 as required and thus triggers a Required error resource key lookup upon
 form validation when the checkbox wasnt checked.

 I was surprised to find that the Required key is never ever tried on
 the
 data.xml resource file, so I fired up the debugger to check out whats
 happening and I think the problem is located in

 FormComponent$MessageSource.getMessage(String key):

 --
public String getMessage(String key)
{
final FormComponent formComponent =
 FormComponent.this;

// retrieve prefix that will be used to construct
 message keys
String prefix =
 formComponent.getValidatorKeyPrefix();
if (Strings.isEmpty(prefix))
{
prefix = ;
}

final Localizer localizer =
 formComponent.getLocalizer();

String resource = prefix + getId() + . + key;

// First use the parent for resolving so that
// form1.textfield1.Required can be used.

// Note: It is important that the default value of
  is provided
// to getString() not to throw a
 MissingResourceException or to
// return a default string like [Warning: String
 ...
String message = getString(localizer, resource,
 formComponent.getParent());

// If not found, than ...
if (Strings.isEmpty(message))
{
// Try a variation of the resource key

resource = prefix + key;

message = getString(localizer, resource,
 formComponent.getParent());
}
 --

 This method is called with key=Required on the instance belonging to
 the
 data FormComponent.

 At first the id of the FormComponent is prefixed and getString() is
 called
 for the parent of the FormComponent. This would be data.Required and
 the
 component would be the main Fragment. That call doesnt return any
 useful
 value, which is expected.

 Now, the second call of the getString() method doesnt include any
 component
 id anymore in the resource key, so it is Required and is called again
 for
 the 

Re: Encoding lsot when submitting a form on Tomcat 4.1.37

2008-10-13 Thread Kenneth Holm Nielsen
Hehe, yeah I know,

I forgot to mention that I also override init in Application like so:

protected void init() {
this.getMarkupSettings().setDefaultMarkupEncoding(ISO-8859-1);

I guess I'll just have to inform the customer that the chosen framework does
not support latin-1.

On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner [EMAIL PROTECTED]wrote:

 You shouldnt set the response like that i think. Please use the
 request setting default encoding. So that wicket also knows what you
 are using when the form comes back in (form submit)

 Why use that iso encoding, please, all the people of this world, start
 using only utf8 everywhere and drop all those other stupid encodings.


 On 10/13/08, Kenneth Holm Nielsen [EMAIL PROTECTED] wrote:
  I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
 
  my encoding to ISO-8859-1 is working fine until I submit a form.
 
  The text 'æbleø' is presented fine until I submit, afterwards the
 encoding
  for the entire document is lost and the text becomes 'æbleÃ',
 
  in a BasePage.java that all pages implement I have configured the
 response
  with ISO-8859-1 encoding.
 
  protected void configureResponse() {
  final String encoding = text/html; charset=ISO-8859-1;
 
  getResponse().setContentType(encoding);
  }
 
  On the BasePage.html I have added the following.
 
  ?xml version=1.0 encoding=ISO-8859-1?
  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
  http://www.w3.org/TR/html4/loose.dtd;
  html lang=da
  head
  title wicket:id=pagetitle/title
  meta http-equiv=Content-Type content=text/html;
  charset=ISO-8859-1
 
  The intial request, before submitting the form, has the correct Response
  headers.
 
  url = http://localhost:8080/PGUI/?wicket:interface=:3
  Server: Apache-Coyote/1.1
  Content-Type: text/html;charset=ISO-8859-1
  Content-Length: 2241
  Date: Mon, 13 Oct 2008 09:36:00 GMT
 
  but the Response from a submit does not set the content-type:
 
  url =
 
 http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
 ::
  Server: Apache-Coyote/1.1
  Location: http://localhost:8080/PGUI/?wicket:interface=:3
  Content-Length: 0
  Date: Mon, 13 Oct 2008 09:36:00 GMT
 
  In the conf/server.xml in tomcat I've even added
  'URIEncoding=*ISO-8859-1*'
  to the connector on port 8080.
 
  Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
  the encoding.
 
  What am I missing?
 
  --
  regards,
 
  Kenneth Holm Nielsen
 
  khAn Computing
 
  http://www.kennethhn.dk
  http://www.kennethhn.blogspot.com
  http://www.linkedin.com/in/kennethhn
 

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




-- 
regards,

Kenneth Holm Nielsen

khAn Computing

http://www.kennethhn.dk
http://www.kennethhn.blogspot.com
http://www.linkedin.com/in/kennethhn


Re: Possible bug in FormComponent$MessageSource regarding resource string lookups

2008-10-13 Thread Igor Vaynberg
request for enhancement. add it to our jria.

-igor

On Mon, Oct 13, 2008 at 8:32 AM, Christian Oldiges [EMAIL PROTECTED] wrote:

 Hm, but then the JavaDoc for ComponentStringResourceLoader needs to be
 updated, because the following example taken from that JavaDoc clearly
 states it will try to lookup Required in the input1.properties file:



 In addition to the above search order, each key will be pre-pended with
 the relative path of the current component related to the component that
 is being searched. E.g. assume a component hierarchy like
 page1.form1.input1 and your are requesting a key named 'Required'. Wicket
 will search the property in the following order:

 page1.properties = form1.input1.Required
 page1.properties = Required
 form1.properties = input1.Required
 form1.properties = Required
 input1.properties = Required
 myApplication.properties = page1.form1.input1.Required
 myApplication.properties = Required


 This would work just fine, once the 2nd getString call gets the
 formComponent itself, but not its parent as a parameter.

 Eh, what is an rfe? Request for Extension?



 igor.vaynberg wrote:

 first thing to get is that each getstring() traverses the hierarchy.
 so first we try with id and then without just in case the user forgot.

 the problem here is that formcomponents do not provide their own
 resource bundles. you need to add an rfe to support this.
 traditionally only top-level markup containers provide bundles, eg
 page and panel.

 -igor

 On Mon, Oct 13, 2008 at 2:28 AM, Christian Oldiges [EMAIL PROTECTED]
 wrote:

 Hello!

 First here is my setup and the situation in which I discovered the
 problem
 which might be a bug in FormComponent$MessageSource:

 I am using v1.3.4 and I have a problem placing a resource string for a
 customized subclass of CheckBox.

 My component tree looks like this:

 page.form.main.data

 -page is a subclass of WebPage, the page.html file contains several
 wicket:fragment tags which are used to create a wizard style UI
 -form is a Form object
 -main is a Fragment object
 -data is a customized subclass of CheckBox

 Now my problem:

 We have created the CheckBox subclass because it contains spezialized
 behaviour and we need customized error messages, especially for the case
 when the checkbox is NOT marked by the user when the form is submitted.

 For that reason we created a data.xml next to the data.class which is
 supposed to contain the error messages. Now, the data component marks
 itself
 as required and thus triggers a Required error resource key lookup upon
 form validation when the checkbox wasnt checked.

 I was surprised to find that the Required key is never ever tried on
 the
 data.xml resource file, so I fired up the debugger to check out whats
 happening and I think the problem is located in

 FormComponent$MessageSource.getMessage(String key):

 --
public String getMessage(String key)
{
final FormComponent formComponent =
 FormComponent.this;

// retrieve prefix that will be used to construct
 message keys
String prefix =
 formComponent.getValidatorKeyPrefix();
if (Strings.isEmpty(prefix))
{
prefix = ;
}

final Localizer localizer =
 formComponent.getLocalizer();

String resource = prefix + getId() + . + key;

// First use the parent for resolving so that
// form1.textfield1.Required can be used.

// Note: It is important that the default value of
  is provided
// to getString() not to throw a
 MissingResourceException or to
// return a default string like [Warning: String
 ...
String message = getString(localizer, resource,
 formComponent.getParent());

// If not found, than ...
if (Strings.isEmpty(message))
{
// Try a variation of the resource key

resource = prefix + key;

message = getString(localizer, resource,
 formComponent.getParent());
}
 --

 This method is called with key=Required on the instance belonging to
 the
 data FormComponent.

 At first the id of the FormComponent is prefixed and getString() is
 called
 for the parent of the FormComponent. This would be data.Required and
 the
 component would be the main Fragment. That call doesnt return any
 useful
 value, which is expected.

 Now, the second call of the 

Re: retrieveing page parameters

2008-10-13 Thread Piller Sébastien

this is right, this is the way it works...

*/cicr/bla* and *?cicr=bla* are just two different ways of passing 
attributes... the second is much better, imo


did you only try what i've written to you on your 2nd reply?


miro a écrit :

here more description

I have a bookmarkable page  and an link to this page .
   mountBookmarkablePage(/createStorageLocation,
CreateNewStorageLocation.class);

Now  I want to call this page using setResponsePage()
and passing some parameters for which I am doing this 


PageParameters  pageParameters= new PageParameters();
pageParameters.add(param1, testparam);
setRedirect(true);
setResponsePage(CreateNewStorageLocation.class,pageParameters);


api says the parameters will get  appended to the url .
I am assunming the url  will be 
http://localhost/csr/secure/index.jas/createStorageLocation?cicr7=sai


but this is what is happening
http://localhost/csr/secure/index.jas/createStorageLocation/cicr7/sai/
 
Please help me understand hot to pass parameters to a page using 
		setResponsePage(APAge.class,PageParameters);



miro wrote:
  
I am using 


setRedirect(true);
setResponsePage(MyPage.class,pageParameters);

in Mypage how can I retrieve pageParameters ? 




  



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



Possible bug in FormComponent$MessageSource regarding resource string lookups

2008-10-13 Thread Christian Oldiges

Hello!

First here is my setup and the situation in which I discovered the problem
which might be a bug in FormComponent$MessageSource:

I am using v1.3.4 and I have a problem placing a resource string for a
customized subclass of CheckBox.

My component tree looks like this:

page.form.main.data

-page is a subclass of WebPage, the page.html file contains several
wicket:fragment tags which are used to create a wizard style UI
-form is a Form object
-main is a Fragment object
-data is a customized subclass of CheckBox

Now my problem:

We have created the CheckBox subclass because it contains spezialized
behaviour and we need customized error messages, especially for the case
when the checkbox is NOT marked by the user when the form is submitted.

For that reason we created a data.xml next to the data.class which is
supposed to contain the error messages. Now, the data component marks itself
as required and thus triggers a Required error resource key lookup upon
form validation when the checkbox wasnt checked.

I was surprised to find that the Required key is never ever tried on the
data.xml resource file, so I fired up the debugger to check out whats
happening and I think the problem is located in 

FormComponent$MessageSource.getMessage(String key):

--
public String getMessage(String key)
{
final FormComponent formComponent = FormComponent.this;

// retrieve prefix that will be used to construct 
message keys
String prefix = formComponent.getValidatorKeyPrefix();
if (Strings.isEmpty(prefix))
{
prefix = ;
}

final Localizer localizer = 
formComponent.getLocalizer();

String resource = prefix + getId() + . + key;

// First use the parent for resolving so that
// form1.textfield1.Required can be used.

// Note: It is important that the default value of  
is provided
// to getString() not to throw a 
MissingResourceException or to
// return a default string like [Warning: String ...
String message = getString(localizer, resource,
formComponent.getParent());

// If not found, than ...
if (Strings.isEmpty(message))
{
// Try a variation of the resource key

resource = prefix + key;

message = getString(localizer, resource, 
formComponent.getParent());
}
--

This method is called with key=Required on the instance belonging to the
data FormComponent.

At first the id of the FormComponent is prefixed and getString() is called
for the parent of the FormComponent. This would be data.Required and the
component would be the main Fragment. That call doesnt return any useful
value, which is expected.

Now, the second call of the getString() method doesnt include any component
id anymore in the resource key, so it is Required and is called again for
the parent of the FormComponent. The getString() at some point gets into the
ComponentStringResourceLoader class to the loadStringResource(component,key)
method.

key = Required and component is again the main Fragment and that is the
problem IMO.

The component stack created in loadStringResource contains:

page, form and main but NOT the data component, so the key
Required is never tried on the resource file data.xml.

If the second getString call

message = getString(localizer, resource, 
formComponent.getParent());

were changed like this:

message = getString(localizer, resource, 
formComponent);

the component stack would go all the way down to the component itself and
would not stop at the parent.


Is this a bug or am I missing something regarding the lookup mechanism???



BTW: Great job on the WiA book!!!
-- 
View this message in context: 
http://www.nabble.com/Possible-bug-in-FormComponent%24MessageSource-regarding-resource-string-lookups-tp19951394p19951394.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Uploading a file: no path information available

2008-10-13 Thread rnieuw

When using the FileUploadField component for uploading files i cannot get the
full path on the client system 'd:\temp\myFile.pdf' instead i only get the
file name 'myFile.pdf'. 

According to FileItem.getName() Javadoc i should get the full path name if
the browser supports it. I'm using IE7 and i know that IE sends the full
path (when using JSF i can obtain the full path) But unfortunately with
Wicket i cannot get to this information. 
I did a little debugging and i see that the path information is stripped in
the FileUploadBase.getFileName() method. So the browser sends the full path
in its header, but i cannot access this information.

Am i doing something wrong or is the Javadoc not correct?
-- 
View this message in context: 
http://www.nabble.com/Uploading-a-file%3A-no-path-information-available-tp19951376p19951376.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread miro

I haven't tried   what you wrote in second reply , I see the parameters in
url in the first way  which i dont want and switch to second way  which is  
*?cicr=bla*   how can I ? ,still getPageParameters returns null ?

Pills wrote:
 
 this is right, this is the way it works...
 
 */cicr/bla* and *?cicr=bla* are just two different ways of passing 
 attributes... the second is much better, imo
 
 did you only try what i've written to you on your 2nd reply?
 
 
 miro a écrit :
 here more description

 I have a bookmarkable page  and an link to this page .
mountBookmarkablePage(/createStorageLocation,
 CreateNewStorageLocation.class);

 Now  I want to call this page using setResponsePage()
 and passing some parameters for which I am doing this 

  PageParameters  pageParameters= new PageParameters();
  pageParameters.add(param1, testparam);
  setRedirect(true);
  setResponsePage(CreateNewStorageLocation.class,pageParameters);


 api says the parameters will get  appended to the url .
 I am assunming the url  will be 
 http://localhost/csr/secure/index.jas/createStorageLocation?cicr7=sai

 but this is what is happening
 http://localhost/csr/secure/index.jas/createStorageLocation/cicr7/sai/
  
 Please help me understand hot to pass parameters to a page using 
  setResponsePage(APAge.class,PageParameters);


 miro wrote:
   
 I am using 

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ? 

 

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

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19957384.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread Piller Sébastien
* sorry, I would have say the first is much better, the one with 
slashes (/cicr/bla/)



Piller Sébastien a écrit :

this is right, this is the way it works...

*/cicr/bla* and *?cicr=bla* are just two different ways of passing 
attributes... the second is much better, imo


did you only try what i've written to you on your 2nd reply?


miro a écrit :

here more description

I have a bookmarkable page  and an link to this page .
   mountBookmarkablePage(/createStorageLocation,
CreateNewStorageLocation.class);

Now  I want to call this page using setResponsePage()
and passing some parameters for which I am doing this
PageParameters  pageParameters= new PageParameters();
pageParameters.add(param1, testparam);
setRedirect(true);
setResponsePage(CreateNewStorageLocation.class,pageParameters);


api says the parameters will get  appended to the url .
I am assunming the url  will be 
http://localhost/csr/secure/index.jas/createStorageLocation?cicr7=sai


but this is what is happening
http://localhost/csr/secure/index.jas/createStorageLocation/cicr7/sai/
 
Please help me understand hot to pass parameters to a page using 
setResponsePage(APAge.class,PageParameters);



miro wrote:
 

I am using
setRedirect(true);
setResponsePage(MyPage.class,pageParameters);

in Mypage how can I retrieve pageParameters ?



  



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





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



Re: retrieveing page parameters

2008-10-13 Thread miro

I dont have a constructor with PageParameters.Do I need one? , becasue if itr
appended to the url I can retrieve it from request or getPageParameters()   

Pills wrote:
 
 in your constructor that has a parameter PageParameters...
 
 
 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:
   
 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:
 
 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:
   
 getPageParameters()? Didn't you look at the API before posting? ;-)


 miro wrote:
 
 I am using 

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ? 

   
 
   
 

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

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19957474.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread miro

Is there a way to switch to the second becasue it is more readable ?

Pills wrote:
 
 * sorry, I would have say the first is much better, the one with 
 slashes (/cicr/bla/)
 
 
 Piller Sébastien a écrit :
 this is right, this is the way it works...

 */cicr/bla* and *?cicr=bla* are just two different ways of passing 
 attributes... the second is much better, imo

 did you only try what i've written to you on your 2nd reply?


 miro a écrit :
 here more description

 I have a bookmarkable page  and an link to this page .
mountBookmarkablePage(/createStorageLocation,
 CreateNewStorageLocation.class);

 Now  I want to call this page using setResponsePage()
 and passing some parameters for which I am doing this
 PageParameters  pageParameters= new PageParameters();
 pageParameters.add(param1, testparam);
 setRedirect(true);
 setResponsePage(CreateNewStorageLocation.class,pageParameters);


 api says the parameters will get  appended to the url .
 I am assunming the url  will be 
 http://localhost/csr/secure/index.jas/createStorageLocation?cicr7=sai

 but this is what is happening
 http://localhost/csr/secure/index.jas/createStorageLocation/cicr7/sai/
  
 Please help me understand hot to pass parameters to a page using 
 setResponsePage(APAge.class,PageParameters);


 miro wrote:
  
 I am using
 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ?
 

   


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


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

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19957506.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread Michael Sparer

Yepp you need one if you want your mounting strategies work ... and for
getPageParameters not returning null ;-)


miro wrote:
 
 I dont have a constructor with PageParameters.Do I need one? , becasue if
 itr appended to the url I can retrieve it from request or
 getPageParameters()   
 
 Pills wrote:
 
 in your constructor that has a parameter PageParameters...
 
 
 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:
   
 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:
 
 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:
   
 getPageParameters()? Didn't you look at the API before posting? ;-)


 miro wrote:
 
 I am using 

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ? 

   
 
   
 

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


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19957601.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread Piller Sébastien

yes, it's mandatory.

How would wicket build your page without that, to make the parameters 
available from everywhere, even from the constructor?


miro a écrit :

I dont have a constructor with PageParameters.Do I need one? , becasue if itr
appended to the url I can retrieve it from request or getPageParameters()   


Pills wrote:
  

in your constructor that has a parameter PageParameters...


miro a écrit :


where should I call super(params)  ?

Michael Sparer wrote:
  
  

then there either weren't any pageparams or you missed to call
super(params)

regards,
Michael


miro wrote:



I tried that , getPageParameters() was returning null .

Michael Sparer wrote:
  
  

getPageParameters()? Didn't you look at the API before posting? ;-)


miro wrote:


I am using 


setRedirect(true);
setResponsePage(MyPage.class,pageParameters);

in Mypage how can I retrieve pageParameters ? 

  
  


  
  


  
  

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






  



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



Re: prepulating a form and changing behaviour

2008-10-13 Thread Michael Sparer

What about trying out first and then ask if something doesn't work as
desired?


miro wrote:
 
 I have  a Page which has a form   , I assume prepopulating is just 
 setting model object to my form which has the same properties as the form
 is this right ?
 Second   If I want to  change the   construction   of the page with
 extending this class   and overriding some methods   in this case do I
 have to create a new bookmark ?
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/prepulating-a--form--and-changing-behaviour-tp19923467p19952321.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Presentation web with some stateful components - removing jsessionid+ all PageExpired exceptions

2008-10-13 Thread Stefan Simik

jj, you are right. My mistake. I tested this, and jsessionid in bookmarkable
URL never causes page-expired exception.
.



Johan Compagner wrote:
 
 A bookmarkabke url with a jsession id will not give you an page expired.
 
 

-- 
View this message in context: 
http://www.nabble.com/Presentation-web%3A-jsessionid---page-expired-exceptions-tp19943729p19958061.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: retrieveing page parameters

2008-10-13 Thread miro

now are there  ways to hide   parameters from  url ie I want to pass 
parameters but wont show them  in url ?  also   I doing a redirect from the
caller.

Michael Sparer wrote:
 
 Yepp you need one if you want your mounting strategies work ... and for
 getPageParameters not returning null ;-)
 
 
 miro wrote:
 
 I dont have a constructor with PageParameters.Do I need one? , becasue if
 itr appended to the url I can retrieve it from request or
 getPageParameters()   
 
 Pills wrote:
 
 in your constructor that has a parameter PageParameters...
 
 
 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:
   
 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:
 
 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:
   
 getPageParameters()? Didn't you look at the API before posting? ;-)


 miro wrote:
 
 I am using 

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ? 

   
 
   
 

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

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19958208.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Presentation web with some stateful components - removing jsessionid+ all PageExpired exceptions

2008-10-13 Thread Johan Compagner
A bookmarkabke url with a jsession id will not give you an page expired.

So if you have only bookmarkable urls in the browser bar but the page
is because of statefull components statefull. Then if a browser does
refresh you get another new page of that bookmarkable page the
jsessionid doesnt really do anything expect if you access the wicket
session. But for a page request its not needed. Except if you use the
HybridUrlEncoding.

If you are saying that the internal statefull links are a problem
because the can have a page expired. Then yes thats just how it works,
for that you have to create Stateless components

On 10/12/08, Stefan Simik [EMAIL PROTECTED] wrote:

 We are creating website. One part is standard presentation web, second part
 is administration site, where we take all advantages of wicket's state
 management.

 The important part here, is first presentation part.
 Here, all the URLs must be bookmarkable. On some special pages, we use
 stateful components (Gmap2). but URL of these pages are also bookmarkable.
 Usage of these stateful components forces http-session creation on these
 pages.

 AT THE VERY FIRST REQUEST - this makes all our bookmarkable pages
 not-bookmarkable,
 because of jsessionid added by servlet container.

 This is serious problem because of:
   - At the very first page - all links have jsessionid, so if the
 user bookmarks any of the links, he gets Session-Expired error.

   - Bots as Google bot, Yahoo remember pages with jsessionid, ... - but
 solution for this is very easy:
   - a) Use special filter,
   - b) or use special Response
   which cuts out the existing jsessionid string. No problem so far.




 After reading this article:
 http://www.nabble.com/Removing-the-jsessionid-for-SEO-td16464534i20.html#a16646137
 we thought about all possible solutions and we found this way as the best
 for our web site.
 Remember please, that it is for standard presentation web, where
   - no jsessionid should appear
   - no session-expired errors are acceptable

 I think, this will be common use case for many others.


 1. use filter/response, that cuts off the jsessionid if bot is detected in
 User-Agent header
 This solves problem for all search result URLs.

 2. use our custom SessionExpiredPage, which has its own logic:
 a) if it detects bookmarkable page - cuts off jsessionid and redirects
 to the standard bookmarkable URL
 b) if it detects, that it is stateful page (by introspecting URL - for
 example contains ILinkListener and path
to pagemap - then redirect to the home page.

We think that it is quite acceptable solution for presentation web-
 see example:
You have a homepage. This page has bookmarkable URL, but has some
 stateful components - for example Gmap2 map,
which is ajax component. This stateful components forces http-session
 creation and makes all links with jsessionid
at the very first request. When user bookmarks some URL, he saves
 stateful bookmark (with jsessionid). When user
clicks on the bookmark later, he gets Session expired error - which
 causes calling of our custom Page-Expired page.
This page introspects original Request, and detects, that it is
 standard bookmarkable page, so cuts off the jsessionid,
and redirect to the normal URL, without problematic jsessionid.


In case 2 - where the session actually expired on some stateful page
 with non-bookmarkable URL - user will be redirected to the home page.
In case 3 - where presentation web works with user accounts and user
 must be logged on some secure pages - here, session really expired - then
 special UserNotLoggedException can be thrown, and
 handled by redirecting to the login page.



What do you think about this solution (for eliminating PageExpired
 and jsessionid on presentation web sites) ?
Are there any further pros and cons of this solution ?

 --
 View this message in context:
 http://www.nabble.com/Presentation-web-with-some-stateful-components---removing-jsessionid%2B-all-PageExpired-exceptions-tp19943729p19943729.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: retrieveing page parameters

2008-10-13 Thread Michael Sparer

yepp, use the setResponsePage(Page page) instead of setResponsePage(Class
pageClass) method - but be aware that the resulting page is bound to the
session and not reusable for other sessions, aka bookmarkable



miro wrote:
 
 now are there  ways to hide   parameters from  url ie I want to pass 
 parameters but wont show them  in url ?  also   I doing a redirect from
 the caller.
 
 Michael Sparer wrote:
 
 Yepp you need one if you want your mounting strategies work ... and for
 getPageParameters not returning null ;-)
 
 
 miro wrote:
 
 I dont have a constructor with PageParameters.Do I need one? , becasue
 if itr appended to the url I can retrieve it from request or
 getPageParameters()   
 
 Pills wrote:
 
 in your constructor that has a parameter PageParameters...
 
 
 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:
   
 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:
 
 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:
   
 getPageParameters()? Didn't you look at the API before posting? ;-)


 miro wrote:
 
 I am using 

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ? 

   
 
   
 

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


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19958393.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Downloading a BLOB

2008-10-13 Thread Bruno Borges
I think is better to create a temporary file and set DownloadLink to delete
it after download is complete. I don't think is a good idea to let the user
download directly from the database as you proposed. See, downloads can take
some time and letting that InputStream open, might be a problem. The latency
of an external download is bigger than downloading from a local database.

Cheers,
Bruno Borges
blog.brunoborges.com.br
+55 21 76727099

The glory of great men should always be
measured by the means they have used to
acquire it.
- Francois de La Rochefoucauld


On Fri, Oct 10, 2008 at 10:04 PM, Dane Laverty [EMAIL PROTECTED]wrote:

 Thank you for the advice. Here's the solution I came up with, in case
 it's useful to anyone else.

 First I used the DownloadLink as a template for my blobDownloadLink.
 Then I created an InputStreamResourceStream, which is essentially a
 barely modified version of Wicket's FileResourceStream, taking an
 InputStream as the constructor parameter instead of a File. The code for
 both of those is below.

 While this solution works, the two issues still hanging in my mind are:
 1. I'm sure there's an easier way to get the InputStream into an
 IResourceStream than to create an InputStreamResourceStream class...I
 just couldn't figure out what it is.
 2. When I get the Blob from the database like this,

rs.getBinaryStream(1);

 the returned BinaryStream doesn't work. Doing this,

java.sql.Blob blob = rs.getBlob(1);
return blob.getBinaryStream();

 doesn't work either. So I ended up doing,

java.sql.Blob blob = rs.getBlob(1);
byte[] bytes = new byte[(int)blob.length()];
try {
blob.getBinaryStream().read(bytes);
} catch (IOException ioe) {
// handle it
}
return new ByteArrayInputStream(bytes);

 Not pretty, but it works.

 ***
 // Relevant code for blobDownloadLink

 Link blobDownloadLink = new Link(blobDownloadLink) {
@Override
public void onClick() {
InputStream inputStream =
 //getBlobAsInputStreamFromDatabase();

IResourceStream resourceStream =
 new InputStreamResourceStream(inputStream);

 getRequestCycle().setRequestTarget(new
 ResourceStreamRequestTarget(resourceStream)
{
public String
 getFileName()
{
return
 //theFileNameYouWantAssociatedWithThisDownload;
}

public void
 respond(RequestCycle requestCycle)
{

 super.respond(requestCycle);

}
});

try {
inputStream.close();
} catch (IOException ioe) {
logger.error(Error
 attempting to close inputStream in blobDownloadLink., ioe);
}
};
};

 
 // Relevant code for InputStreamResourceStream

 import java.io.IOException;
 import java.io.InputStream;
 import org.apache.wicket.util.resource.AbstractResourceStream;
 import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

 /**
  * An InputStreamResourceStream is an IResource implementation for
 files.
  *
  * @see org.apache.wicket.util.resource.IResourceStream
  * @see org.apache.wicket.util.watch.IModifiable
  * @author Dane Laverty
  */
 public class InputStreamResourceStream extends AbstractResourceStream
 {
private static final long serialVersionUID = 1L;

/** Resource stream */
private transient InputStream inputStream;

/**
 * Constructor.
 *
 * @param inputStream
 *[EMAIL PROTECTED] InputStream} containing resource
 */
public InputStreamResourceStream(InputStream inputStream)
{
this.inputStream = inputStream;
}

/**
 * Closes this resource.
 *
 * @throws IOException
 */
public void close() throws IOException
{
if (inputStream != null)
{
inputStream.close();
inputStream = null;
}
}

/**
 * @see IResourceStream#getContentType()
 */
public String getContentType()
{
// Let ResourceStreamRequestTarget handle content-type
 automatically
return null;
}

/**
   

Re: How to change field values in a validator?

2008-10-13 Thread Johan Compagner
You have simple Behaviors that can alter values through java script in
the browser and you have converters that converts a value at the
server side, validators are ment for validation of a value that is
converted by a convertor not for changing data.

On 10/13/08, Matthias Keller [EMAIL PROTECTED] wrote:
 Timo Rantalaiho wrote:
 On Mon, 13 Oct 2008, Matthias Keller wrote:

 Here's the scenario with two radios and a pulldown:
 ( ) I don't need anything
 ( ) I need: [ pulldown with options ]

 Now if I need is selected, everything works as expected, the pulldown
 value gets stored to the model.
 Now if 'I dont need anything' is selected, another value for the
 pulldown needs to be stored in the model. Let's say a marker entry like
 'nothing'. I can't have 'nothing' directly in the pulldown as it would
 make no sense (and the customer explicitly doesn't want that). So in the
 validator I need to check the status of the radios and if the first
 option is selected, set the pulldown model's value to my custom value,
 ignoring any possible input value.


 I think that you should do it with ajax and custom models
 instead of validators. It seems like a kludge or at least a
 strange side effect for a validator to do something like
 that.

 Best wishes,
 Timo

 Hi Timo

 AJAX is not an option, as it is client side.
 Another scenario would be: User has to enter some data which needs to be
 stored in a certain way. For example a number needs leading zeros or
 whatever, it would be good for a validator to a) check that the value is
 a number and b) on the fly update the value with leading zeros as needed
 - I guess a converter could do the job but I think that's overkill...?
 A custom model also is not that easy, at least to my understanding as
 the model values come from two different components..

 Matt

 --
 [EMAIL PROTECTED]  +41 44 268 83 98
 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
 http://www.ergon.ch
 __
 e r g o nsmart people - smart software




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



Re: retrieveing page parameters

2008-10-13 Thread miro

I created a new class  Test extending   CreateNewStorageLocation   (this page
is   bookmarked 
as mountBookmarkablePage(/createStorageLocation,
CreateNewStorageLocation.class);
just to override a method , 
clicking on a link I call a page which redirects to Test  and 
 wicket creates some new url  
http://localhost/csr/secure/index.jas/?wicket:interface=:2

is there a way I can ask wicket to use the same  path   as of its super
class becasue I might have several classes extedning from the same class
overring some methods ?




Michael Sparer wrote:
 
 yepp, use the setResponsePage(Page page) instead of setResponsePage(Class
 pageClass) method - but be aware that the resulting page is bound to the
 session and not reusable for other sessions, aka bookmarkable
 
 
 
 miro wrote:
 
 now are there  ways to hide   parameters from  url ie I want to pass 
 parameters but wont show them  in url ?  also   I doing a redirect from
 the caller.
 
 Michael Sparer wrote:
 
 Yepp you need one if you want your mounting strategies work ... and for
 getPageParameters not returning null ;-)
 
 
 miro wrote:
 
 I dont have a constructor with PageParameters.Do I need one? , becasue
 if itr appended to the url I can retrieve it from request or
 getPageParameters()   
 
 Pills wrote:
 
 in your constructor that has a parameter PageParameters...
 
 
 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:
   
 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:
 
 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:
   
 getPageParameters()? Didn't you look at the API before posting?
 ;-)


 miro wrote:
 
 I am using 

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ? 

   
 
   
 

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

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19958664.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Encoding lsot when submitting a form on Tomcat 4.1.37

2008-10-13 Thread Johan Compagner
That should work fine then. You shouldnt have to do that in your page configure.
What does the browser page info really give you back? Whay kind of
content type does the page have there?

By the way why does a client care about what content type is used?
(except that he could have a requirement that he wants to support any
character..)

Johan

On 10/13/08, Kenneth Holm Nielsen [EMAIL PROTECTED] wrote:
 Hehe, yeah I know,

 I forgot to mention that I also override init in Application like so:

 protected void init() {
 this.getMarkupSettings().setDefaultMarkupEncoding(ISO-8859-1);

 I guess I'll just have to inform the customer that the chosen framework does
 not support latin-1.

 On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner
 [EMAIL PROTECTED]wrote:

 You shouldnt set the response like that i think. Please use the
 request setting default encoding. So that wicket also knows what you
 are using when the form comes back in (form submit)

 Why use that iso encoding, please, all the people of this world, start
 using only utf8 everywhere and drop all those other stupid encodings.


 On 10/13/08, Kenneth Holm Nielsen [EMAIL PROTECTED] wrote:
  I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,
 
  my encoding to ISO-8859-1 is working fine until I submit a form.
 
  The text 'æbleø' is presented fine until I submit, afterwards the
 encoding
  for the entire document is lost and the text becomes 'æbleÃ',
 
  in a BasePage.java that all pages implement I have configured the
 response
  with ISO-8859-1 encoding.
 
  protected void configureResponse() {
  final String encoding = text/html; charset=ISO-8859-1;
 
  getResponse().setContentType(encoding);
  }
 
  On the BasePage.html I have added the following.
 
  ?xml version=1.0 encoding=ISO-8859-1?
  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
  http://www.w3.org/TR/html4/loose.dtd;
  html lang=da
  head
  title wicket:id=pagetitle/title
  meta http-equiv=Content-Type content=text/html;
  charset=ISO-8859-1
 
  The intial request, before submitting the form, has the correct Response
  headers.
 
  url = http://localhost:8080/PGUI/?wicket:interface=:3
  Server: Apache-Coyote/1.1
  Content-Type: text/html;charset=ISO-8859-1
  Content-Length: 2241
  Date: Mon, 13 Oct 2008 09:36:00 GMT
 
  but the Response from a submit does not set the content-type:
 
  url =
 
 http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
 ::
  Server: Apache-Coyote/1.1
  Location: http://localhost:8080/PGUI/?wicket:interface=:3
  Content-Length: 0
  Date: Mon, 13 Oct 2008 09:36:00 GMT
 
  In the conf/server.xml in tomcat I've even added
  'URIEncoding=*ISO-8859-1*'
  to the connector on port 8080.
 
  Despite all these hints, the browsers IE 7 and firefox 3, won't
  recognize
  the encoding.
 
  What am I missing?
 
  --
  regards,
 
  Kenneth Holm Nielsen
 
  khAn Computing
 
  http://www.kennethhn.dk
  http://www.kennethhn.blogspot.com
  http://www.linkedin.com/in/kennethhn
 

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




 --
 regards,

 Kenneth Holm Nielsen

 khAn Computing

 http://www.kennethhn.dk
 http://www.kennethhn.blogspot.com
 http://www.linkedin.com/in/kennethhn


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



Re: retrieveing page parameters

2008-10-13 Thread Johan Compagner
If we would say base class mounted to xxx then also all the subs are
mounted to xxx how on earth do we know then which we should construct
when xxx is hit?

Also if you dont want /xx/yyy/zzz but xx?yyy=zzz then use a different
url encoding because the first on is default look for
QueryXUrlEncoder.

Yes you have to have a pageparam constructor if you use bookmarkable
pages with parameters.

On 10/13/08, miro [EMAIL PROTECTED] wrote:

 I created a new class  Test extending   CreateNewStorageLocation   (this
 page
 is   bookmarked
 as mountBookmarkablePage(/createStorageLocation,
 CreateNewStorageLocation.class);
 just to override a method ,
 clicking on a link I call a page which redirects to Test  and
  wicket creates some new url
 http://localhost/csr/secure/index.jas/?wicket:interface=:2

 is there a way I can ask wicket to use the same  path   as of its super
 class becasue I might have several classes extedning from the same class
 overring some methods ?




 Michael Sparer wrote:

 yepp, use the setResponsePage(Page page) instead of setResponsePage(Class
 pageClass) method - but be aware that the resulting page is bound to the
 session and not reusable for other sessions, aka bookmarkable



 miro wrote:

 now are there  ways to hide   parameters from  url ie I want to pass
 parameters but wont show them  in url ?  also   I doing a redirect from
 the caller.

 Michael Sparer wrote:

 Yepp you need one if you want your mounting strategies work ... and for
 getPageParameters not returning null ;-)


 miro wrote:

 I dont have a constructor with PageParameters.Do I need one? , becasue
 if itr appended to the url I can retrieve it from request or
 getPageParameters()

 Pills wrote:

 in your constructor that has a parameter PageParameters...


 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:

 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:

 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:

 getPageParameters()? Didn't you look at the API before posting?
 ;-)


 miro wrote:

 I am using

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ?









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












 --
 View this message in context:
 http://www.nabble.com/retrieveing-page-parameters-tp19956410p19958664.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: retrieveing page parameters

2008-10-13 Thread miro

but if   a  sub class  is the response page and no mount path  is found   can
wicket use the super class mountpath or is there a way to override some
method in my sub class to return the mount path of base class ?

Johan Compagner wrote:
 
 If we would say base class mounted to xxx then also all the subs are
 mounted to xxx how on earth do we know then which we should construct
 when xxx is hit?
 
 Also if you dont want /xx/yyy/zzz but xx?yyy=zzz then use a different
 url encoding because the first on is default look for
 QueryXUrlEncoder.
 
 Yes you have to have a pageparam constructor if you use bookmarkable
 pages with parameters.
 
 On 10/13/08, miro [EMAIL PROTECTED] wrote:

 I created a new class  Test extending   CreateNewStorageLocation   (this
 page
 is   bookmarked
 as mountBookmarkablePage(/createStorageLocation,
 CreateNewStorageLocation.class);
 just to override a method ,
 clicking on a link I call a page which redirects to Test  and
  wicket creates some new url
 http://localhost/csr/secure/index.jas/?wicket:interface=:2

 is there a way I can ask wicket to use the same  path   as of its super
 class becasue I might have several classes extedning from the same class
 overring some methods ?




 Michael Sparer wrote:

 yepp, use the setResponsePage(Page page) instead of
 setResponsePage(Class
 pageClass) method - but be aware that the resulting page is bound to the
 session and not reusable for other sessions, aka bookmarkable



 miro wrote:

 now are there  ways to hide   parameters from  url ie I want to pass
 parameters but wont show them  in url ?  also   I doing a redirect from
 the caller.

 Michael Sparer wrote:

 Yepp you need one if you want your mounting strategies work ... and
 for
 getPageParameters not returning null ;-)


 miro wrote:

 I dont have a constructor with PageParameters.Do I need one? ,
 becasue
 if itr appended to the url I can retrieve it from request or
 getPageParameters()

 Pills wrote:

 in your constructor that has a parameter PageParameters...


 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:

 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:

 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:

 getPageParameters()? Didn't you look at the API before posting?
 ;-)


 miro wrote:

 I am using

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ?









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












 --
 View this message in context:
 http://www.nabble.com/retrieveing-page-parameters-tp19956410p19958664.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/retrieveing-page-parameters-tp19956410p19959672.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Encoding lsot when submitting a form on Tomcat 4.1.37

2008-10-13 Thread Nino Saturnino Martinez Vazquez Wael

Hi Kenneth

I've seen on some occasions that IE 6 will loose content type if you 
specify UTF-8 as I remember it..


And yeah why not use utf-8 ?

Kenneth Holm Nielsen wrote:

Hehe, yeah I know,

I forgot to mention that I also override init in Application like so:

protected void init() {
this.getMarkupSettings().setDefaultMarkupEncoding(ISO-8859-1);

I guess I'll just have to inform the customer that the chosen framework does
not support latin-1.

On Mon, Oct 13, 2008 at 3:23 PM, Johan Compagner [EMAIL PROTECTED]wrote:

  

You shouldnt set the response like that i think. Please use the
request setting default encoding. So that wicket also knows what you
are using when the form comes back in (form submit)

Why use that iso encoding, please, all the people of this world, start
using only utf8 everywhere and drop all those other stupid encodings.


On 10/13/08, Kenneth Holm Nielsen [EMAIL PROTECTED] wrote:


I'm using the wicket distribution for java 1.4 on a Tomcat 4.1.37,

my encoding to ISO-8859-1 is working fine until I submit a form.

The text 'æbleø' is presented fine until I submit, afterwards the
  

encoding


for the entire document is lost and the text becomes 'æbleÃ',

in a BasePage.java that all pages implement I have configured the
  

response


with ISO-8859-1 encoding.

protected void configureResponse() {
final String encoding = text/html; charset=ISO-8859-1;

getResponse().setContentType(encoding);
}

On the BasePage.html I have added the following.

?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;
html lang=da
head
title wicket:id=pagetitle/title
meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1

The intial request, before submitting the form, has the correct Response
headers.

url = http://localhost:8080/PGUI/?wicket:interface=:3
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 2241
Date: Mon, 13 Oct 2008 09:36:00 GMT

but the Response from a submit does not set the content-type:

url =

  

http://localhost:8080/PGUI/?wicket:interface=:3:form::IFormSubmitListener
::


Server: Apache-Coyote/1.1
Location: http://localhost:8080/PGUI/?wicket:interface=:3
Content-Length: 0
Date: Mon, 13 Oct 2008 09:36:00 GMT

In the conf/server.xml in tomcat I've even added
'URIEncoding=*ISO-8859-1*'
to the connector on port 8080.

Despite all these hints, the browsers IE 7 and firefox 3, won't recognize
the encoding.

What am I missing?

--
regards,

Kenneth Holm Nielsen

khAn Computing

http://www.kennethhn.dk
http://www.kennethhn.blogspot.com
http://www.linkedin.com/in/kennethhn

  

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






  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



FileUploadField - value not stored in session?

2008-10-13 Thread V. Jenks

I'm using the FileUploadField and the name of the field is image.  When the
form model loads, all other form fields appear but the upload field remains
blank.  Why is that?  Any way around it?
-- 
View this message in context: 
http://www.nabble.com/FileUploadField---value-not-stored-in-session--tp19960105p19960105.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to change field values in a validator?

2008-10-13 Thread Timo Rantalaiho
On Mon, 13 Oct 2008, Matthias Keller wrote:
 AJAX is not an option, as it is client side.

Sorry, what do you mean exactly? Javax is server-side. But 
do you need a pure javascript solution?

 Another scenario would be: User has to enter some data which needs to be 
 stored in a certain way. For example a number needs leading zeros or 
 whatever, it would be good for a validator to a) check that the value is 
 a number and b) on the fly update the value with leading zeros as needed 
 - I guess a converter could do the job but I think that's overkill...?

Not at all, why? Having the validator do that would be very
strange.

add(new TextField(numberWithLeadingZeroes) {
@Override
protected IConverter getConverter() {
return new ZeroPaddingConverter();
}
});

Also remember that Form.process() does (you can easily
check this out in its source code)

1) convert raw input to converted input, or report error 
   if this fails

2) validate converted input and update model with it, or 
   report error if this fails

 A custom model also is not that easy, at least to my understanding as 
 the model values come from two different components..

Quite the contrary, I think that by explicitly fleshing out
your models the logic often comes a lot clearer (if more
verbose).

For example, you could have the model of the radio button
set the value chosen by the select box by
1) if the upper button is chosen, set directly the default
   value to your domain object
2) if the lower button is chosen, set the selected value
   (getModelObject() or getConvertedInput()) from the select
   box to your domain object

All this in IModel.setObject().

Without code this is a bit abstract, if you show code maybe
we can see where the code would go (I never remember how the
radio models go and I think that there are two ways to do
them anyway).

Best wishes,
Timo

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

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



Re: FileUploadField - value not stored in session?

2008-10-13 Thread Timo Rantalaiho
On Mon, 13 Oct 2008, V. Jenks wrote:
 I'm using the FileUploadField and the name of the field is image.  When the
 form model loads, all other form fields appear but the upload field remains
 blank.  Why is that?  Any way around it?

I think that it's a browser security restriction, so that 
you cannot put c:\pagefile.sys there from the server for
example.

Best wishes,
Timo


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

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



Re: Links with CGI parameters?

2008-10-13 Thread Seven Corners

Well I was really grateful for that.  I've tried both alternatives and
neither works but I think maybe I just have to fiddle with them a bit.  Just
getting back to you before the end of the day.

Thanks for the response.



Randy Hammelman wrote:
 
 This will probably work for you:
 
 Isn't there a version of setResponsePage that takes a PageParameters
 object?
 
 setResponsePage(Page.class, pageParameters);
 
 Otherwise, you can construct a url for a page with parameters using the
 following code:
 
 PageParameters params = new PageParameters();
 params .put(PARAM_NAME, PARAM_VALUE);
 String targetURL =
 RequestUtils.toAbsolutePath(urlFor(YOUR_CLASS.class,params ).toString());
 
 Use a link, such as ExternalLink, that takes a url.
 
 
 Hope this helps.
 
 
 On Fri, Oct 10, 2008 at 1:39 PM, Seven Corners [EMAIL PROTECTED]
 wrote:
 

 I have figured out the considerable gyrations to subclass a LinkTree so
 its
 leaves contain links that will change the page in another frame within a
 frameset, and I'm doing this with regular Links (i.e., href and target
 attributes, and setting the response page and the frame target's page
 class
 from Link.onClick(), as Eelco does in his Frames example):

 public class FrameLinkTree extends LinkTree
 {
...
public MarkupContainer newLink( String strId, final HorizontalFrameset
 frameset, final Class pageClass )
{
Link link = new Link( strId )
{
private static final long serialVersionUID = 1L;

@Override
public void onClick()
{
frameset.getFrameTarget().setFrameClass( pageClass );

// trigger re-rendering of the page
setResponsePage( frameset );
}
};
link.add( new SimpleAttributeModifier( target, _parent ) );
return link;
}
 }

 However, my pages need a parameter in their constructors, so I'll need to
 pass that parameter from the link.  It looks like the only link type that
 takes parameters is the BookmarkablePageLink.  I would use this class so
 I
 could pass the parameters, only the BookmarkablePageLink doesn't use the
 onClick().  There's a comment in the BookmarkablePageLink code that
 BookmarkablePageLinks are dispatched by the request handling servlet,
 so
 there's no way I can override that.

 So is there any way I can get a parameter on a Link, or is there any way
 I
 can set the frame target and response page on a BookmarkablePageLink?

 --
 View this message in context:
 http://www.nabble.com/Links-with-CGI-parameters--tp19923784p19923784.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/Links-with-CGI-parameters--tp19923784p19960812.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



WSRP Service Description Interface

2008-10-13 Thread lesterburlap

Hi:

I've been working with Wicket and Liferay.  My end (possibly dream) goal is
to expose a Wicket Panel in a WSRP Consumer Proxy Portlet.

Can I assume that there is no support yet in Wicket (or wicket extensions,
etc) for the required WSRP interfaces Service Description Interface and
Markup Interface?  The WSRP spec is really confusing to me, and it doesn't
look like the wsrp4j project is really being maintained any more.  

Thanks for any tips.

LBB
-- 
View this message in context: 
http://www.nabble.com/WSRP-Service-Description-Interface-tp19961934p19961934.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket Security - best practices?

2008-10-13 Thread Maarten Bosteels
Hello Les,

On Thu, Sep 25, 2008 at 5:11 PM, Les Hazlewood [EMAIL PROTECTED]wrote:

 Haha, funny you should ask this - I'm doing it now ;)


Well, it wasn't pure coincidence: I saw your name appearing on the wicket
mailing-list a few weeks ago and I was kinda hoping for this answer ;-)



  I've recently started
 using Wicket for my latest web application, and naturally I wanted to do
 this.  I'll have to do a little write-up when I'm finished with it.


Do you have any idea when we can see some of that stuff ?


 Any questions that I could help with in particular in the meantime?


Not yet, I haven't really looked into it yet.

Thanks,
Maarten




 Naturally, I would hope that JSecurity would be one of the core supported
 or
 maybe even 'default' security mechansim for Wicket in the future, now that
 JSecurity is a part of the ASF.  I'll certainly help to that effort if it
 is
 desired!

 Cheers,

 Les
 (JSecurity founder)

 On Thu, Sep 25, 2008 at 11:05 AM, Maarten Bosteels
 [EMAIL PROTECTED]wrote:

  Hi,
 
  Anyone tried integrating Wicket with JSecurity ?
 
  http://www.jsecurity.org/
 
  Maarten
 
  On Thu, Sep 25, 2008 at 4:54 PM, James Carman
  [EMAIL PROTECTED] wrote:
   You can bridge the gap between Spring Security's default URL-based
   model and the component-based model in Wicket.  That's what we do here
   at work.  If you want an example, let me know.  I've got one out there
   on my public example stuff somewhere.  You could try poking around in
   (I think it's there):
  
   http://svn.carmanconsulting.com/public/wicket-advanced/trunk
  
  
   On Thu, Sep 25, 2008 at 10:51 AM, Claus Myglegaard Vagner
   [EMAIL PROTECTED] wrote:
   Hi,
  
   I'm about to start a new project using Wicket and is currently
 examining
   which security framework to apply for. I'm looking for best practices
   implementing security to a Wicket application.
  
   Wicket has WASP which Swarm is an implementation of and then there is
   wicket-auth-roles. Is wicket-auth-roles related to WASP in any way or
 is
   it a completely different security platform for wicket?
  
   Which security framework will be the future for wicket?
  
   I am thinking on using Spring Security (prior Acegi) for securing the
   service layer through aspects. Spring Security has build in
  authentication
   integration with various technologies like LDAP and for example a
   remember me function. I'm thinking that this project should benefit
  from
   this built in functionality, but maybe the wicket frameworks has some
 of
   the same possibilities?
  
   Well, should I integrate Spring Security to Swarm or wicket-auth-roles
  and
   what would that give me? I know that Spring Security is url based and
   Swarm is component based, but not sure yet that I need to specify
  security
   on the component level.
  
   Regards Claus
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



FileUpload and Ajax

2008-10-13 Thread Stefan Lindner
I searched the mailing list for posts about uploading a file with an 
AjaxButton. The general meaning ist hat this is not possible in wicket. On post 
statet that there might be a solution in wicketstuff (where).
Did anybody solve this problem?
Stefan


Meet the Wicket Community: interview with Nino Martinez Wael

2008-10-13 Thread Martijn Dashorst
Our community has grown quite a bit since Wicket's inception. The core
Wicket team is pretty visible through the various blogs and
meetups—but the community is more! Meet your fellow Wicketeers and
read all about them.

Our first victim is one of Wicket's most visible supporters: Nino
Martinez Wael. Read more about Nino and his experiences with Wicket
here:

http://wicketinaction.com/2008/10/meet-the-wicket-community-nino-martinez-wael/

If you have a couple of follow up questions for Nino, please leave a
comment on the blog. I'm sure Nino will be quick to answer them :)

I've got a couple more interviews in the basket, so expect more in the
coming weeks!

Thank you Nino for being so kind to participate in this interview!

Martijn

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



Re: retrieveing page parameters

2008-10-13 Thread Johan Compagner
No please read my previous mail, i explained there why there cant be 1
mount point to 2 classes

On 10/13/08, miro [EMAIL PROTECTED] wrote:

 but if   a  sub class  is the response page and no mount path  is found
 can
 wicket use the super class mountpath or is there a way to override some
 method in my sub class to return the mount path of base class ?

 Johan Compagner wrote:

 If we would say base class mounted to xxx then also all the subs are
 mounted to xxx how on earth do we know then which we should construct
 when xxx is hit?

 Also if you dont want /xx/yyy/zzz but xx?yyy=zzz then use a different
 url encoding because the first on is default look for
 QueryXUrlEncoder.

 Yes you have to have a pageparam constructor if you use bookmarkable
 pages with parameters.

 On 10/13/08, miro [EMAIL PROTECTED] wrote:

 I created a new class  Test extending   CreateNewStorageLocation   (this
 page
 is   bookmarked
 as mountBookmarkablePage(/createStorageLocation,
 CreateNewStorageLocation.class);
 just to override a method ,
 clicking on a link I call a page which redirects to Test  and
  wicket creates some new url
 http://localhost/csr/secure/index.jas/?wicket:interface=:2

 is there a way I can ask wicket to use the same  path   as of its super
 class becasue I might have several classes extedning from the same class
 overring some methods ?




 Michael Sparer wrote:

 yepp, use the setResponsePage(Page page) instead of
 setResponsePage(Class
 pageClass) method - but be aware that the resulting page is bound to the
 session and not reusable for other sessions, aka bookmarkable



 miro wrote:

 now are there  ways to hide   parameters from  url ie I want to pass
 parameters but wont show them  in url ?  also   I doing a redirect from
 the caller.

 Michael Sparer wrote:

 Yepp you need one if you want your mounting strategies work ... and
 for
 getPageParameters not returning null ;-)


 miro wrote:

 I dont have a constructor with PageParameters.Do I need one? ,
 becasue
 if itr appended to the url I can retrieve it from request or
 getPageParameters()

 Pills wrote:

 in your constructor that has a parameter PageParameters...


 miro a écrit :
 where should I call super(params)  ?

 Michael Sparer wrote:

 then there either weren't any pageparams or you missed to call
 super(params)

 regards,
 Michael


 miro wrote:

 I tried that , getPageParameters() was returning null .

 Michael Sparer wrote:

 getPageParameters()? Didn't you look at the API before posting?
 ;-)


 miro wrote:

 I am using

 setRedirect(true);
 setResponsePage(MyPage.class,pageParameters);

 in Mypage how can I retrieve pageParameters ?









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












 --
 View this message in context:
 http://www.nabble.com/retrieveing-page-parameters-tp19956410p19958664.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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




 --
 View this message in context:
 http://www.nabble.com/retrieveing-page-parameters-tp19956410p19959672.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



CompoundPropertyModel and collection attributes

2008-10-13 Thread Cristina

Hello,

I'm working on an application that will have a simple Form in front of a
rather complex object graph. I'm using JPA implemented by Hibernate at the
persistence layer.

In an effort to keep things simple I'm using CompoundPropertyModel in the
Form constructor:

Person p = session.getCurrentPerson();
setModel(new CompoundPropertyModel(p));

CompoundPropertyModel allows me to easily define anonymous TextFields to
capture the new values of plain and object attributes of Person:

add(new TextField(lastName);
// ...
add(new TextField(address.city);

Now suppose Person has an attribute whose type is a collection:

private ListPhone phones;

How can I access all phones in the collection and then generate the
corresponding TextFields for the two (or more) Phone attributes?

Thanks so much,

Cristina

-- 
View this message in context: 
http://www.nabble.com/CompoundPropertyModel-and-collection-attributes-tp19964896p19964896.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Why is DropDownChoice with wantOnSelectionChange stateful?

2008-10-13 Thread Ritesh Trivedi

Hi,

This may be a stupid question - Looking at the
DropDownChoice.getStatelessHint() it returns false if wantOnSelectionChange
is set to true?

Shouldnt it depend on the enclosing form? If the enclosing form is stateless
and only cares about the value thats getting submitted as a result of the
selection? I know I can always override that method but want to see if I
understand models correctly.
-- 
View this message in context: 
http://www.nabble.com/Why-is-DropDownChoice-with-wantOnSelectionChange-stateful--tp19965345p19965345.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket Security - best practices?

2008-10-13 Thread Les Hazlewood
Hi Maarten,

So far things are going great - it took almost no time at all to
integrate the two projects, which I consider a reflection of the good
design of both architectures ;)

I have a few classes created that basically recreates the SignIn*
classes in chapter 11 of Wicket In Action to show how to login/logout
and show/hide links based on a users login state using the JSecurity
API.  I've already licensed them to the ASF and can put them wherever
you like.  They're currently in the org.apache.wicket.jsecurity
namespace, but only as a place holder.  How would you like to receive
these files?

I'm in the process of finishing the authorization support - JSecurity
specific implementations of IAuthorizationStrategy
IUnauthorizedComponentInstantiationListener.  They're pretty slick -
they look for JSecurity's existing annotations in classes
(@RequiresAuthentication, @RequiresUser, @RequiresGuest,
@RequiresRoles, @RequiresPermissions) and allow creation or access
accordingly.  Pretty nice :)

The one final thing to do is to investigate whether or not I'll need
to create an ISessionStore implementation to access the JSecurity
Session API directly.  This allows clustered/distributed-cached
sessions, single sign on, and heterogeneous client session access.
That won't take too long, I just have to see what it entails.

Let me know how you'd like to receive the files, and I'll send
them/place them where you want.  In the meantime, I'm going to finish
up the Authorization and Session support

Cheers,

Les

On Mon, Oct 13, 2008 at 4:10 PM, Maarten Bosteels
[EMAIL PROTECTED] wrote:
 Hello Les,

 On Thu, Sep 25, 2008 at 5:11 PM, Les Hazlewood [EMAIL PROTECTED]wrote:

 Haha, funny you should ask this - I'm doing it now ;)


 Well, it wasn't pure coincidence: I saw your name appearing on the wicket
 mailing-list a few weeks ago and I was kinda hoping for this answer ;-)



  I've recently started
 using Wicket for my latest web application, and naturally I wanted to do
 this.  I'll have to do a little write-up when I'm finished with it.


 Do you have any idea when we can see some of that stuff ?


 Any questions that I could help with in particular in the meantime?


 Not yet, I haven't really looked into it yet.

 Thanks,
 Maarten




 Naturally, I would hope that JSecurity would be one of the core supported
 or
 maybe even 'default' security mechansim for Wicket in the future, now that
 JSecurity is a part of the ASF.  I'll certainly help to that effort if it
 is
 desired!

 Cheers,

 Les
 (JSecurity founder)

 On Thu, Sep 25, 2008 at 11:05 AM, Maarten Bosteels
 [EMAIL PROTECTED]wrote:

  Hi,
 
  Anyone tried integrating Wicket with JSecurity ?
 
  http://www.jsecurity.org/
 
  Maarten
 
  On Thu, Sep 25, 2008 at 4:54 PM, James Carman
  [EMAIL PROTECTED] wrote:
   You can bridge the gap between Spring Security's default URL-based
   model and the component-based model in Wicket.  That's what we do here
   at work.  If you want an example, let me know.  I've got one out there
   on my public example stuff somewhere.  You could try poking around in
   (I think it's there):
  
   http://svn.carmanconsulting.com/public/wicket-advanced/trunk
  
  
   On Thu, Sep 25, 2008 at 10:51 AM, Claus Myglegaard Vagner
   [EMAIL PROTECTED] wrote:
   Hi,
  
   I'm about to start a new project using Wicket and is currently
 examining
   which security framework to apply for. I'm looking for best practices
   implementing security to a Wicket application.
  
   Wicket has WASP which Swarm is an implementation of and then there is
   wicket-auth-roles. Is wicket-auth-roles related to WASP in any way or
 is
   it a completely different security platform for wicket?
  
   Which security framework will be the future for wicket?
  
   I am thinking on using Spring Security (prior Acegi) for securing the
   service layer through aspects. Spring Security has build in
  authentication
   integration with various technologies like LDAP and for example a
   remember me function. I'm thinking that this project should benefit
  from
   this built in functionality, but maybe the wicket frameworks has some
 of
   the same possibilities?
  
   Well, should I integrate Spring Security to Swarm or wicket-auth-roles
  and
   what would that give me? I know that Spring Security is url based and
   Swarm is component based, but not sure yet that I need to specify
  security
   on the component level.
  
   Regards Claus
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




Re: CompoundPropertyModel and collection attributes

2008-10-13 Thread Jeremy Thomerson
Use some sort of repeater over your collection, then add the individual form
components inside that.

add(new ListView(phones) {

@Override
protected void populateItem(ListItem item) {
item.setModel(new CompoundPropertyModel(item.getModel()));
item.add(new TextField());
}

});


ul
li wicket:id=phones
input type=text wicket:id=number /
/li
/ul


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

On Mon, Oct 13, 2008 at 6:45 PM, Cristina [EMAIL PROTECTED] wrote:


 Hello,

 I'm working on an application that will have a simple Form in front of a
 rather complex object graph. I'm using JPA implemented by Hibernate at the
 persistence layer.

 In an effort to keep things simple I'm using CompoundPropertyModel in the
 Form constructor:

Person p = session.getCurrentPerson();
setModel(new CompoundPropertyModel(p));

 CompoundPropertyModel allows me to easily define anonymous TextFields to
 capture the new values of plain and object attributes of Person:

add(new TextField(lastName);
// ...
add(new TextField(address.city);

 Now suppose Person has an attribute whose type is a collection:

private ListPhone phones;

 How can I access all phones in the collection and then generate the
 corresponding TextFields for the two (or more) Phone attributes?

 Thanks so much,

 Cristina

 --
 View this message in context:
 http://www.nabble.com/CompoundPropertyModel-and-collection-attributes-tp19964896p19964896.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: CompoundPropertyModel and collection attributes

2008-10-13 Thread Jeremy Thomerson
In that example, the ID in new TextField() should be new
TextField(number) - sorry

On Mon, Oct 13, 2008 at 8:42 PM, Jeremy Thomerson [EMAIL PROTECTED]
 wrote:

 Use some sort of repeater over your collection, then add the individual
 form components inside that.

 add(new ListView(phones) {

 @Override
 protected void populateItem(ListItem item) {
 item.setModel(new CompoundPropertyModel(item.getModel()));
 item.add(new TextField());
 }

 });


 ul
 li wicket:id=phones
 input type=text wicket:id=number /
 /li
 /ul


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


 On Mon, Oct 13, 2008 at 6:45 PM, Cristina [EMAIL PROTECTED] wrote:


 Hello,

 I'm working on an application that will have a simple Form in front of a
 rather complex object graph. I'm using JPA implemented by Hibernate at the
 persistence layer.

 In an effort to keep things simple I'm using CompoundPropertyModel in the
 Form constructor:

Person p = session.getCurrentPerson();
setModel(new CompoundPropertyModel(p));

 CompoundPropertyModel allows me to easily define anonymous TextFields to
 capture the new values of plain and object attributes of Person:

add(new TextField(lastName);
// ...
add(new TextField(address.city);

 Now suppose Person has an attribute whose type is a collection:

private ListPhone phones;

 How can I access all phones in the collection and then generate the
 corresponding TextFields for the two (or more) Phone attributes?

 Thanks so much,

 Cristina

 --
 View this message in context:
 http://www.nabble.com/CompoundPropertyModel-and-collection-attributes-tp19964896p19964896.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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







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


Re: Why is DropDownChoice with wantOnSelectionChange stateful?

2008-10-13 Thread Jeremy Thomerson
I suppose it's because of the stateful URL that the DDC adds to the onchange
JS event that pulls that page back out of memory to update the DDC.

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


On Mon, Oct 13, 2008 at 7:39 PM, Ritesh Trivedi [EMAIL PROTECTED]wrote:


 Hi,

 This may be a stupid question - Looking at the
 DropDownChoice.getStatelessHint() it returns false if wantOnSelectionChange
 is set to true?

 Shouldnt it depend on the enclosing form? If the enclosing form is
 stateless
 and only cares about the value thats getting submitted as a result of the
 selection? I know I can always override that method but want to see if I
 understand models correctly.
 --
 View this message in context:
 http://www.nabble.com/Why-is-DropDownChoice-with-wantOnSelectionChange-stateful--tp19965345p19965345.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




newSession(...) being called for every request

2008-10-13 Thread Craig Tataryn
Hi, I created a very simple little Wicket application which consisted
of one page and the page relied on session information which was to
persist between requests.  My surprise came when I found that
newSession(Request request, Response response)  on my WebApplication
class was being called for every request!  This is the first time I've
come across this, usually sessions just work the way I figure they
should (that is, stay around until they are expired).

In my investigation as to how to remedy this situation I came across
this list message:
http://www.nabble.com/Session-creation-td19123581.html#a19128690

So using getSession().bind() worked for me.

What exactly triggers Wicket to say oh, I should keep sessions around
instead of creating them for every request.  Martijn seems to
indicate that if your pages are statefull then Sessions will
persist.  What is meant by statefull?  That they set stuff into the
session?  Or that they have member variables?

I noticed that bind() wasn't mentioned in WiA (first place I looked to
seek help)  Seems like it would have been an excellent callout item,
would have helped me anyway :)  Took me a while to find that mail list
posting, trying various search terms.

-- 
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn

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



Re: newSession(...) being called for every request

2008-10-13 Thread Igor Vaynberg
a stateless page in wicket means that the page does not need to be put into
session. it can be reconstructed from scratch. such pages generally do not
have stateful components (components that provide user with callbacks such
as link and its onclick() or form and its onsubmit()).

so until a stateful page is hit by the user wicket will not create an http
session. this is an optimization for sites that want to scale out to massive
amounts of users without requiring an http session.

now since websession plays an important role in request cycle processing and
is itself stored in http session we need to create a new instance on every
request until we are able to reuse the instance by putting it into http
session.

makes sense?

-igor

On Mon, Oct 13, 2008 at 9:00 PM, Craig Tataryn [EMAIL PROTECTED] wrote:

 Hi, I created a very simple little Wicket application which consisted
 of one page and the page relied on session information which was to
 persist between requests.  My surprise came when I found that
 newSession(Request request, Response response)  on my WebApplication
 class was being called for every request!  This is the first time I've
 come across this, usually sessions just work the way I figure they
 should (that is, stay around until they are expired).

 In my investigation as to how to remedy this situation I came across
 this list message:
 http://www.nabble.com/Session-creation-td19123581.html#a19128690

 So using getSession().bind() worked for me.

 What exactly triggers Wicket to say oh, I should keep sessions around
 instead of creating them for every request.  Martijn seems to
 indicate that if your pages are statefull then Sessions will
 persist.  What is meant by statefull?  That they set stuff into the
 session?  Or that they have member variables?

 I noticed that bind() wasn't mentioned in WiA (first place I looked to
 seek help)  Seems like it would have been an excellent callout item,
 would have helped me anyway :)  Took me a while to find that mail list
 posting, trying various search terms.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn

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




Re: newSession(...) being called for every request

2008-10-13 Thread Craig Tataryn
Yep, thanks Igor.

On Mon, Oct 13, 2008 at 11:09 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 a stateless page in wicket means that the page does not need to be put into
 session. it can be reconstructed from scratch. such pages generally do not
 have stateful components (components that provide user with callbacks such
 as link and its onclick() or form and its onsubmit()).

 so until a stateful page is hit by the user wicket will not create an http
 session. this is an optimization for sites that want to scale out to massive
 amounts of users without requiring an http session.

 now since websession plays an important role in request cycle processing and
 is itself stored in http session we need to create a new instance on every
 request until we are able to reuse the instance by putting it into http
 session.

 makes sense?

 -igor

 On Mon, Oct 13, 2008 at 9:00 PM, Craig Tataryn [EMAIL PROTECTED] wrote:

 Hi, I created a very simple little Wicket application which consisted
 of one page and the page relied on session information which was to
 persist between requests.  My surprise came when I found that
 newSession(Request request, Response response)  on my WebApplication
 class was being called for every request!  This is the first time I've
 come across this, usually sessions just work the way I figure they
 should (that is, stay around until they are expired).

 In my investigation as to how to remedy this situation I came across
 this list message:
 http://www.nabble.com/Session-creation-td19123581.html#a19128690

 So using getSession().bind() worked for me.

 What exactly triggers Wicket to say oh, I should keep sessions around
 instead of creating them for every request.  Martijn seems to
 indicate that if your pages are statefull then Sessions will
 persist.  What is meant by statefull?  That they set stuff into the
 session?  Or that they have member variables?

 I noticed that bind() wasn't mentioned in WiA (first place I looked to
 seek help)  Seems like it would have been an excellent callout item,
 would have helped me anyway :)  Took me a while to find that mail list
 posting, trying various search terms.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn

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






-- 
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn

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



Re: Meet the Wicket Community: interview with Nino Martinez Wael

2008-10-13 Thread Nino Saturnino Martinez Vazquez Wael

No problem, I always have time for Wicket things:)

Martijn Dashorst wrote:

Our community has grown quite a bit since Wicket's inception. The core
Wicket team is pretty visible through the various blogs and
meetups—but the community is more! Meet your fellow Wicketeers and
read all about them.

Our first victim is one of Wicket's most visible supporters: Nino
Martinez Wael. Read more about Nino and his experiences with Wicket
here:

http://wicketinaction.com/2008/10/meet-the-wicket-community-nino-martinez-wael/

If you have a couple of follow up questions for Nino, please leave a
comment on the blog. I'm sure Nino will be quick to answer them :)

I've got a couple more interviews in the basket, so expect more in the
coming weeks!

Thank you Nino for being so kind to participate in this interview!

Martijn

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

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



A wicket gathering?

2008-10-13 Thread Nino Saturnino Martinez Vazquez Wael

Hi

I've been pondering as usually. This time about a wicket gathering, and 
it should be something where all could meetup, also from international 
places. Ideally all comitters would show up. It should be something that 
were held once a year and not in conjunction with something else as I 
think it would disturb it. Im not sure where it should be held, we are 
scattered all over the world?




What do you guys feel about it?


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684



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