Re: stream content with an IndicatingAjaxLink

2008-05-19 Thread renaud.houver

Ok, thanks.
Are you streaming the photo directly to the output stream of
the request that came in from clicking the link?

Yes I am ... but it does not work. 
Apparently no one is doing that, so it is not the way to do it. 
I try with the normal link and and some kind of javascript then ...

Regards, Renaud



Timo Rantalaiho wrote:
> 
> On Mon, 19 May 2008, renaud.houver wrote:
>> I have a download picture link which take a bit of time. Result is that
>> the
>> user is impatiently clicking several time. I would like to have a kind of
>> timer showing process and I tried to use IndicatingAjaxLink which does
>> the
>> job. But I cant find out to stream to the outputstream with an ajax link.
> ...
>> Here is the onClick method with a normal link.That works fine.
>> 
>> public void onClick()
>>  {
>>  final byte[] bytes = getDirectDownloadBytes(phot);
> 
> 
> Take on account that in Ajax, the browser does not make a
> normal HTTP request, but an XmlHttpRequest from Javascript,
> and then expects an XML fragment as a response (a piece of
> DOM tree as far as I know). I cannot imagine how could you
> transmit an image via Ajax, but if it is possible, please
> let me know :) 
> 
> In AJAX debug console (shown on the page when running Wicket
> in development mode), you can see the requests going in, the
> responses coming back, and whether there were errors.
> 
> I think that you would be best off by ripping the javascript
> of showing the indicator wheel and attaching it to a normal
> link instead of an Ajax link.
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho   
> Reaktor Innovations Oyhttp://www.ri.fi/ >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/stream-content-with-an-IndicatingAjaxLink-tp17316702p17334149.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: ListItem queries

2008-05-19 Thread Timo Rantalaiho
On Mon, 19 May 2008, Ned Collyer wrote:
> How would I go about getting the first panel added?

Use a visitor, something like

featuresList.visitChildren(MyPanel.class, new IVisitor() {
public visit(Component component) {
doStuffWith((MyPanel) component);
return STOP_TRAVERSAL;
}
});

You have to take on account that repeaters only create their
Items in onBeforeRender, so before that point you cannot find
the children (or you might find stale children from the
previous rendering). As you set reuseItems to true, the Items
stay the same in your case I suppose.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: ListItem queries

2008-05-19 Thread Ned Collyer

Sorry, line 1 should be -
1/ It needs to be declared final if its used inside the anonymous class.


Ned Collyer wrote:
> 
> 1/ MyPanel needs to use it inside the anonymous class.
> 2/ if its final, you cant reassign it.
> 3/ if i remove a panel from the list (using something like
> MyPanel.remove()) then its not set to the correct panel.
> 
> Doesn't quite work - a bit more complicated than u'd first expect.
> 

-- 
View this message in context: 
http://www.nabble.com/ListItem-queries-tp17332693p17333024.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: ListItem queries

2008-05-19 Thread Ned Collyer

1/ MyPanel needs to use it inside the anonymous class.
2/ if its final, you cant reassign it.
3/ if i remove a panel from the list (using something like MyPanel.remove())
then its not set to the correct panel.

Doesn't quite work - a bit more complicated than u'd first expect.




Scott Swank wrote:
> 
> MyPanel firstPanel = null;
> ListView featuresList = new ListView("listView", myList) {
>   protected void populateItem(ListItem item) {
>   MyPanel panel = new MyPanel("panel", item.getModelObject()));
>   if (firstPanel == null) firstPanel = panel;
>   item.add(panel);
>   }
> }.setReuseItems(true);
> 
> On Mon, May 19, 2008 at 8:46 PM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>>
>> I need to get access to the first panel added to a list item in
>> onBeforeRender from its parent.
>>
>> I have the following
>>
>> ListView featuresList = new ListView("listView", myList) {
>>protected void populateItem(ListItem item) {
>>MyPanel panel = new MyPanel("panel", item.getModelObject()));
>>item.add(panel);
>>}
>> }.setReuseItems(true);
>>
>>
>> How would I go about getting the first panel added?
>>
>> Rgds
>>
>> Ned
>> --
>> View this message in context:
>> http://www.nabble.com/ListItem-queries-tp17332693p17332693.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/ListItem-queries-tp17332693p17333012.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: Thread safety for components

2008-05-19 Thread Brill Pappin
Right... I think I'd just invert that, so that the "page" asked for the
stateful data when needed.

- Brill Pappin


-Original Message-
From: Michael Allan [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 18, 2008 9:41 PM
To: users@wicket.apache.org
Subject: Re: Thread safety for components

Brill Pappin wrote:
> > ...  So non-Wicket threads cannot generally access pages, 
> > components, models, and so forth - not safely.  True?
> >
>  I was trying to think of a use-case for that problem... Do you have a 
> specific use-case or is that just a potential issue you can think of?

I'm thinking generally of state changes that occur in separate processes,
changes that need to be presented in Web views.
Specifically, I have a Web page that shows recent user activity, in a list
view, where each element is a user activity event.  Not all of my users are
Web users, so the underlying list model is receiving events from other
processes (mailer daemon, and so forth).

Johan Compagner wrote:
> Accessing pages in other threads then the request thread is very bad idea.
> Because http session object shouldnt be touched between requests, you 
> have no idea what the container does with your page/session. Store it 
> on disc, replicate it to other nodes.

Of course, now I understand...  I was forgetting that instances of these
things - pages, components and models - are apt to be serialized out of
memory.  Non-Wicket threads can't even hold a reference to them.  So there's
no point in exposing the page lock for other threads (as I suggested).
 
> If you want to do stuff in background threads then let page/request 
> threads poll them if they are finished.

Then the underlying list model (in my example, above) does not belong in the
page; instead it belongs in the Application instance.  There it can safely
register with other threads, and receive events from them, because the app
will never be serialized out of memory.  And the list view (in the page) can
hook up with the model (in the app), at request time, with appropriate
synchronization - polling it, as you say.

My only other question, then, is the app life cycle.  (This article doesn't
really answer my Q:

  http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html

In a clustered environment, are there multiple instances of the app?
Might the page (the one with the list view, for example) find itself
connecting to a different instance of the app, a different instance of the
list model, from request to request?

In a non-clustered environment, can I safely assume a single instance of the
app, at any given time?

--
Michael Allan

Toronto, 647-436-4521
http://zelea.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: ListItem queries

2008-05-19 Thread Scott Swank
MyPanel firstPanel = null;
ListView featuresList = new ListView("listView", myList) {
  protected void populateItem(ListItem item) {
  MyPanel panel = new MyPanel("panel", item.getModelObject()));
  if (firstPanel == null) firstPanel = panel;
  item.add(panel);
  }
}.setReuseItems(true);

On Mon, May 19, 2008 at 8:46 PM, Ned Collyer <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I need to get access to the first panel added to a list item in
> onBeforeRender from its parent.
>
> I have the following
>
> ListView featuresList = new ListView("listView", myList) {
>protected void populateItem(ListItem item) {
>MyPanel panel = new MyPanel("panel", item.getModelObject()));
>item.add(panel);
>}
> }.setReuseItems(true);
>
>
> How would I go about getting the first panel added?
>
> Rgds
>
> Ned
> --
> View this message in context: 
> http://www.nabble.com/ListItem-queries-tp17332693p17332693.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]



ListItem queries

2008-05-19 Thread Ned Collyer

Hi,

I need to get access to the first panel added to a list item in
onBeforeRender from its parent.

I have the following

ListView featuresList = new ListView("listView", myList) {
protected void populateItem(ListItem item) {
MyPanel panel = new MyPanel("panel", item.getModelObject()));
item.add(panel);
}
}.setReuseItems(true);


How would I go about getting the first panel added?

Rgds

Ned 
-- 
View this message in context: 
http://www.nabble.com/ListItem-queries-tp17332693p17332693.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: stream content with an IndicatingAjaxLink

2008-05-19 Thread Timo Rantalaiho
On Mon, 19 May 2008, renaud.houver wrote:
> I have a download picture link which take a bit of time. Result is that the
> user is impatiently clicking several time. I would like to have a kind of
> timer showing process and I tried to use IndicatingAjaxLink which does the
> job. But I cant find out to stream to the outputstream with an ajax link.
...
> Here is the onClick method with a normal link.That works fine.
> 
> public void onClick()
>   {
>   final byte[] bytes = getDirectDownloadBytes(phot);

Are you streaming the photo directly to the output stream of
the request that came in from clicking the link?

Take on account that in Ajax, the browser does not make a
normal HTTP request, but an XmlHttpRequest from Javascript,
and then expects an XML fragment as a response (a piece of
DOM tree as far as I know). I cannot imagine how could you
transmit an image via Ajax, but if it is possible, please
let me know :) 

In AJAX debug console (shown on the page when running Wicket
in development mode), you can see the requests going in, the
responses coming back, and whether there were errors.

I think that you would be best off by ripping the javascript
of showing the indicator wheel and attaching it to a normal
link instead of an Ajax link.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Encoding problem when deploying on production server

2008-05-19 Thread Timo Rantalaiho
On Mon, 19 May 2008, Piller Sébastien wrote:
> I have a problem with the encoding of some text, on my deployment server 
> (Unix/Linux). I use wicket to generate the body of emails, with this code:
...
> But on the production server, it seems that the email is converted to 
> ISO8859-1 (and special chars are not rendered properly in UTF8). But 
> others web pages are properly rendered (I only have a problem when 
> dealing with responses)

What are the locales of the machines (or the users running
the server software on the machines)?

I think that by default, Java assumes the character encoding
it gets from the operating system, but you can override it 
by explicitly setting the relevant system property, 
-Dfile.encoding=utf-8 or something like that. 

The root problem is that property files are plain text files
that do not contain any metadata such as what encoding they
are written in, so anybody reading them just needs to assume
something. The same goes for Java source files. The problem
of property files is partially solved by using property XML
files, though it is a pity to lose the nice, simple property 
file syntax with the change.

> Have you guys any idea on how to fix it? Do I have to do someting on the 
> server config?

locale -a
And debugging the file encoding system property of Java in 
each cases are good places to start.

I don't believe that this is Wicket related.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Thread safety for components

2008-05-19 Thread Michael Allan
Johan Compagner wrote:
> yes in a clustered environment you have multiply instances of the
> Application
> because there are more instances of the WicketServlet.
> And Application/Servlet context stuff are not replicated

Thanks Johan, I've documented Wicket's thread safety (as I understand
it) using annotations in my code.  Here's the relevant page from my
API:

  http://zelea.com/project/votorola/_/javadoc/votorola/a/web/VPage.html

Thanks for the help, gents,
-- 
Mike


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



Re: Problem with Wicket and MySQL

2008-05-19 Thread James Carman
On Mon, May 19, 2008 at 9:03 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote:
> Okay, I'm not sure how you've set up the project, but I remember that
> you sometimes had to copy the JDBC driver into the tomcat lib directory.
> Haven't touched tomcat in a while, but there are project specific libs
> and container specific ones - if you put it in the container lib dir
> you'll avoid these classloader issues.
>

That's usually only needed when you're using a data source configured
within Tomcat.

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



RE: Problem with Wicket and MySQL

2008-05-19 Thread Michael Mehrle
I'm pretty sure putting the jar into Tomcat's container lib dir will fix
his problem.

-Original Message-
From: Eelco Hillenius [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 19, 2008 6:07 PM
To: users@wicket.apache.org
Subject: Re: Problem with Wicket and MySQL

> and i have made sure i have this jar
> "mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
> problem goes on...

Build path != runtime path. Make sure the jar is in your runtime path as
well.

FWIW, never ever write such code for a production application because
you'll run into scalability problems pretty fast. At the very least,
use a connection pool.

Eelco

-
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: Problem with Wicket and MySQL

2008-05-19 Thread Bogdan Mihai
Thanks for the advice, I will try to consolidate my database
programming skills very fast.
BTW, i have managed to solve the problem, by relating the tomcat libs
with the JDBC driver.
Thanks everyone for your time.

On Tue, May 20, 2008 at 4:07 AM, Eelco Hillenius
<[EMAIL PROTECTED]> wrote:
>> and i have made sure i have this jar
>> "mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
>> problem goes on...
>
> Build path != runtime path. Make sure the jar is in your runtime path as well.
>
> FWIW, never ever write such code for a production application because
> you'll run into scalability problems pretty fast. At the very least,
> use a connection pool.
>
> Eelco
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Mihai Bogdan Eugen

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



Re: Problem with Wicket and MySQL

2008-05-19 Thread Eelco Hillenius
> and i have made sure i have this jar
> "mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
> problem goes on...

Build path != runtime path. Make sure the jar is in your runtime path as well.

FWIW, never ever write such code for a production application because
you'll run into scalability problems pretty fast. At the very least,
use a connection pool.

Eelco

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



RE: Problem with Wicket and MySQL

2008-05-19 Thread Michael Mehrle
Okay, I'm not sure how you've set up the project, but I remember that
you sometimes had to copy the JDBC driver into the tomcat lib directory.
Haven't touched tomcat in a while, but there are project specific libs
and container specific ones - if you put it in the container lib dir
you'll avoid these classloader issues.



-Original Message-
From: Bogdan Mihai [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 19, 2008 6:00 PM
To: users@wicket.apache.org
Subject: Re: Problem with Wicket and MySQL

I am using Eclipse 3.3 with the last version of JDK

On Tue, May 20, 2008 at 3:58 AM, Michael Mehrle <[EMAIL PROTECTED]>
wrote:
> Are you running this out of your IDE or with maven?
>
> -Original Message-
> From: Bogdan Mihai [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 19, 2008 5:53 PM
> To: users@wicket.apache.org
> Subject: Re: Problem with Wicket and MySQL
>
> Hello,
>
> this are my imports:
>
> import java.util.ArrayList;
> import java.sql.DriverManager;
> import java.sql.ResultSet;
> import java.sql.SQLException;
>
> import com.mysql.jdbc.Connection;
> import com.mysql.jdbc.Driver;
> import com.mysql.jdbc.Statement;
>
> and i have made sure i have this jar
> "mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
> problem goes on...
>
> On Tue, May 20, 2008 at 3:48 AM, Michael Mehrle
<[EMAIL PROTECTED]>
> wrote:
>> You need to download the MYSQL JDBC driver and put it in your
> classpath.
>> That'll fix it.
>>
>> The code is trying to load the JDBC driver 'by name' - since it's not
>> there it can't find it.
>>
>> Michael
>>
>> -Original Message-
>> From: Mihai Bogdan Eugen [mailto:[EMAIL PROTECTED]
>> Sent: Monday, May 19, 2008 5:46 PM
>> To: users@wicket.apache.org
>> Subject: Problem with Wicket and MySQL
>>
>>
>> Hello,
>>
>> First of all, I am kind of new with this Wicket, actually, I am using
>> it for only a couple of days.
>> Secondly, I don't even know if I post this in the right place, so I
>> appologize if I had made such a mistake.
>>
>> Now, the problem that made write this post:
>>
>> I am working on a small JAVA + MySQL project, and by chance, when
>> browsing through Apache Software, I have discovered Wicket. I kind of
>> got the feeling with it thanks to the tutorials, but now I try to
>> integrate something related to MySQL in it:
>>
>> I have a class Catalog, :
>>
>> public class Catalog
>> {
>>   private ArrayList products;
>>
>>   public Catalog()
>>   {
>>   this.products = new ArrayList();
>>   this.populateCatalog();
>>   }
>>   private void populateCatalog()
>>   {
>>   Connection connection = null;
>>   Statement statement = null;
>>   ResultSet result_set = null;
>>
>>   String url = "jdbc:mysql://localhost:3306/proiect";
>>   String user = "root";
>>   String password = "";
>>
>>   try
>>   {
>>   Class.forName("com.mysql.jdbc.Driver");
>>
>>   connection  = (Connection)
>> DriverManager.getConnection(url,
>> user, password);
>>   statement   = (Statement)
>> connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
>> ResultSet.CONCUR_READ_ONLY);
>>   result_set  = statement.executeQuery("SELECT * from
>> produse
>> ORDER BY id_produs");
>>
>>   while(result_set.next())
>>   {
>>   this.products.add(new Product(
>> result_set.getInt("id_produs"),  result_set.getString("nume_poza")
));
>>   }
>>
>>   releaseResources(connection, statement, result_set);
>>   }
>>   catch (SQLException exception)
>>   {
>>   System.out.println("Eroare
>> =>"+exception.getLocalizedMessage());
>>   }
>>   catch (ClassNotFoundException exception)
>>   {
>>   exception.printStackTrace();
>>   }
>>   }
>>
>>   private static void releaseResources(Connection connection,
>> Statement
>> statement, ResultSet result_set) throws SQLException
>>   {
>>   result_set.close();
>>   statement.close();
>>   connection.close();
>>
>>   }
>> }
>>
>> When I "run" the site, i get an error at line
>> "Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
>> don;t know how to copy-paste the output on the Tomcat Servlet Engine
>> (oh, yes, I am running it on Tomcat), it is embedded into a JAVA
>> window... Anywya, the next line in the stack trace, besides
>> ClassNotFoundException: com.mysql.jdbc.Driver
>> is "at
>>
>
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>> .java);
>>
>> Any help it is highly apreciated, and thanks for your understanding.
>> --
>> View this message in context:
>>
>
http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074.
>> html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -

Re: Problem with Wicket and MySQL

2008-05-19 Thread Bogdan Mihai
I am using Eclipse 3.3 with the last version of JDK

On Tue, May 20, 2008 at 3:58 AM, Michael Mehrle <[EMAIL PROTECTED]> wrote:
> Are you running this out of your IDE or with maven?
>
> -Original Message-
> From: Bogdan Mihai [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 19, 2008 5:53 PM
> To: users@wicket.apache.org
> Subject: Re: Problem with Wicket and MySQL
>
> Hello,
>
> this are my imports:
>
> import java.util.ArrayList;
> import java.sql.DriverManager;
> import java.sql.ResultSet;
> import java.sql.SQLException;
>
> import com.mysql.jdbc.Connection;
> import com.mysql.jdbc.Driver;
> import com.mysql.jdbc.Statement;
>
> and i have made sure i have this jar
> "mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
> problem goes on...
>
> On Tue, May 20, 2008 at 3:48 AM, Michael Mehrle <[EMAIL PROTECTED]>
> wrote:
>> You need to download the MYSQL JDBC driver and put it in your
> classpath.
>> That'll fix it.
>>
>> The code is trying to load the JDBC driver 'by name' - since it's not
>> there it can't find it.
>>
>> Michael
>>
>> -Original Message-
>> From: Mihai Bogdan Eugen [mailto:[EMAIL PROTECTED]
>> Sent: Monday, May 19, 2008 5:46 PM
>> To: users@wicket.apache.org
>> Subject: Problem with Wicket and MySQL
>>
>>
>> Hello,
>>
>> First of all, I am kind of new with this Wicket, actually, I am using
>> it for only a couple of days.
>> Secondly, I don't even know if I post this in the right place, so I
>> appologize if I had made such a mistake.
>>
>> Now, the problem that made write this post:
>>
>> I am working on a small JAVA + MySQL project, and by chance, when
>> browsing through Apache Software, I have discovered Wicket. I kind of
>> got the feeling with it thanks to the tutorials, but now I try to
>> integrate something related to MySQL in it:
>>
>> I have a class Catalog, :
>>
>> public class Catalog
>> {
>>   private ArrayList products;
>>
>>   public Catalog()
>>   {
>>   this.products = new ArrayList();
>>   this.populateCatalog();
>>   }
>>   private void populateCatalog()
>>   {
>>   Connection connection = null;
>>   Statement statement = null;
>>   ResultSet result_set = null;
>>
>>   String url = "jdbc:mysql://localhost:3306/proiect";
>>   String user = "root";
>>   String password = "";
>>
>>   try
>>   {
>>   Class.forName("com.mysql.jdbc.Driver");
>>
>>   connection  = (Connection)
>> DriverManager.getConnection(url,
>> user, password);
>>   statement   = (Statement)
>> connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
>> ResultSet.CONCUR_READ_ONLY);
>>   result_set  = statement.executeQuery("SELECT * from
>> produse
>> ORDER BY id_produs");
>>
>>   while(result_set.next())
>>   {
>>   this.products.add(new Product(
>> result_set.getInt("id_produs"),  result_set.getString("nume_poza") ));
>>   }
>>
>>   releaseResources(connection, statement, result_set);
>>   }
>>   catch (SQLException exception)
>>   {
>>   System.out.println("Eroare
>> =>"+exception.getLocalizedMessage());
>>   }
>>   catch (ClassNotFoundException exception)
>>   {
>>   exception.printStackTrace();
>>   }
>>   }
>>
>>   private static void releaseResources(Connection connection,
>> Statement
>> statement, ResultSet result_set) throws SQLException
>>   {
>>   result_set.close();
>>   statement.close();
>>   connection.close();
>>
>>   }
>> }
>>
>> When I "run" the site, i get an error at line
>> "Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
>> don;t know how to copy-paste the output on the Tomcat Servlet Engine
>> (oh, yes, I am running it on Tomcat), it is embedded into a JAVA
>> window... Anywya, the next line in the stack trace, besides
>> ClassNotFoundException: com.mysql.jdbc.Driver
>> is "at
>>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
>> .java);
>>
>> Any help it is highly apreciated, and thanks for your understanding.
>> --
>> View this message in context:
>>
> http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074.
>> 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]
>>
>>
>
>
>
> --
> Mihai Bogdan Eugen
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> F

RE: Problem with Wicket and MySQL

2008-05-19 Thread Michael Mehrle
Are you running this out of your IDE or with maven?

-Original Message-
From: Bogdan Mihai [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 19, 2008 5:53 PM
To: users@wicket.apache.org
Subject: Re: Problem with Wicket and MySQL

Hello,

this are my imports:

import java.util.ArrayList;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Driver;
import com.mysql.jdbc.Statement;

and i have made sure i have this jar
"mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
problem goes on...

On Tue, May 20, 2008 at 3:48 AM, Michael Mehrle <[EMAIL PROTECTED]>
wrote:
> You need to download the MYSQL JDBC driver and put it in your
classpath.
> That'll fix it.
>
> The code is trying to load the JDBC driver 'by name' - since it's not
> there it can't find it.
>
> Michael
>
> -Original Message-
> From: Mihai Bogdan Eugen [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 19, 2008 5:46 PM
> To: users@wicket.apache.org
> Subject: Problem with Wicket and MySQL
>
>
> Hello,
>
> First of all, I am kind of new with this Wicket, actually, I am using
> it for only a couple of days.
> Secondly, I don't even know if I post this in the right place, so I
> appologize if I had made such a mistake.
>
> Now, the problem that made write this post:
>
> I am working on a small JAVA + MySQL project, and by chance, when
> browsing through Apache Software, I have discovered Wicket. I kind of
> got the feeling with it thanks to the tutorials, but now I try to
> integrate something related to MySQL in it:
>
> I have a class Catalog, :
>
> public class Catalog
> {
>   private ArrayList products;
>
>   public Catalog()
>   {
>   this.products = new ArrayList();
>   this.populateCatalog();
>   }
>   private void populateCatalog()
>   {
>   Connection connection = null;
>   Statement statement = null;
>   ResultSet result_set = null;
>
>   String url = "jdbc:mysql://localhost:3306/proiect";
>   String user = "root";
>   String password = "";
>
>   try
>   {
>   Class.forName("com.mysql.jdbc.Driver");
>
>   connection  = (Connection)
> DriverManager.getConnection(url,
> user, password);
>   statement   = (Statement)
> connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_READ_ONLY);
>   result_set  = statement.executeQuery("SELECT * from
> produse
> ORDER BY id_produs");
>
>   while(result_set.next())
>   {
>   this.products.add(new Product(
> result_set.getInt("id_produs"),  result_set.getString("nume_poza") ));
>   }
>
>   releaseResources(connection, statement, result_set);
>   }
>   catch (SQLException exception)
>   {
>   System.out.println("Eroare
> =>"+exception.getLocalizedMessage());
>   }
>   catch (ClassNotFoundException exception)
>   {
>   exception.printStackTrace();
>   }
>   }
>
>   private static void releaseResources(Connection connection,
> Statement
> statement, ResultSet result_set) throws SQLException
>   {
>   result_set.close();
>   statement.close();
>   connection.close();
>
>   }
> }
>
> When I "run" the site, i get an error at line
> "Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
> don;t know how to copy-paste the output on the Tomcat Servlet Engine
> (oh, yes, I am running it on Tomcat), it is embedded into a JAVA
> window... Anywya, the next line in the stack trace, besides
> ClassNotFoundException: com.mysql.jdbc.Driver
> is "at
>
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
> .java);
>
> Any help it is highly apreciated, and thanks for your understanding.
> --
> View this message in context:
>
http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074.
> 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]
>
>



-- 
Mihai Bogdan Eugen

-
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: Problem with Wicket and MySQL

2008-05-19 Thread Bogdan Mihai
Hello,

this are my imports:

import java.util.ArrayList;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Driver;
import com.mysql.jdbc.Statement;

and i have made sure i have this jar
"mysql-connector-java-5.1.6-bin.jar" to my buid path... but the
problem goes on...

On Tue, May 20, 2008 at 3:48 AM, Michael Mehrle <[EMAIL PROTECTED]> wrote:
> You need to download the MYSQL JDBC driver and put it in your classpath.
> That'll fix it.
>
> The code is trying to load the JDBC driver 'by name' - since it's not
> there it can't find it.
>
> Michael
>
> -Original Message-
> From: Mihai Bogdan Eugen [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 19, 2008 5:46 PM
> To: users@wicket.apache.org
> Subject: Problem with Wicket and MySQL
>
>
> Hello,
>
> First of all, I am kind of new with this Wicket, actually, I am using
> it for only a couple of days.
> Secondly, I don't even know if I post this in the right place, so I
> appologize if I had made such a mistake.
>
> Now, the problem that made write this post:
>
> I am working on a small JAVA + MySQL project, and by chance, when
> browsing through Apache Software, I have discovered Wicket. I kind of
> got the feeling with it thanks to the tutorials, but now I try to
> integrate something related to MySQL in it:
>
> I have a class Catalog, :
>
> public class Catalog
> {
>   private ArrayList products;
>
>   public Catalog()
>   {
>   this.products = new ArrayList();
>   this.populateCatalog();
>   }
>   private void populateCatalog()
>   {
>   Connection connection = null;
>   Statement statement = null;
>   ResultSet result_set = null;
>
>   String url = "jdbc:mysql://localhost:3306/proiect";
>   String user = "root";
>   String password = "";
>
>   try
>   {
>   Class.forName("com.mysql.jdbc.Driver");
>
>   connection  = (Connection)
> DriverManager.getConnection(url,
> user, password);
>   statement   = (Statement)
> connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_READ_ONLY);
>   result_set  = statement.executeQuery("SELECT * from
> produse
> ORDER BY id_produs");
>
>   while(result_set.next())
>   {
>   this.products.add(new Product(
> result_set.getInt("id_produs"),  result_set.getString("nume_poza") ));
>   }
>
>   releaseResources(connection, statement, result_set);
>   }
>   catch (SQLException exception)
>   {
>   System.out.println("Eroare
> =>"+exception.getLocalizedMessage());
>   }
>   catch (ClassNotFoundException exception)
>   {
>   exception.printStackTrace();
>   }
>   }
>
>   private static void releaseResources(Connection connection,
> Statement
> statement, ResultSet result_set) throws SQLException
>   {
>   result_set.close();
>   statement.close();
>   connection.close();
>
>   }
> }
>
> When I "run" the site, i get an error at line
> "Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
> don;t know how to copy-paste the output on the Tomcat Servlet Engine
> (oh, yes, I am running it on Tomcat), it is embedded into a JAVA
> window... Anywya, the next line in the stack trace, besides
> ClassNotFoundException: com.mysql.jdbc.Driver
> is "at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
> .java);
>
> Any help it is highly apreciated, and thanks for your understanding.
> --
> View this message in context:
> http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074.
> 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]
>
>



-- 
Mihai Bogdan Eugen

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



RE: Problem with Wicket and MySQL

2008-05-19 Thread Michael Mehrle
You need to download the MYSQL JDBC driver and put it in your classpath.
That'll fix it.

The code is trying to load the JDBC driver 'by name' - since it's not
there it can't find it.

Michael

-Original Message-
From: Mihai Bogdan Eugen [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 19, 2008 5:46 PM
To: users@wicket.apache.org
Subject: Problem with Wicket and MySQL


Hello,

First of all, I am kind of new with this Wicket, actually, I am using
it for only a couple of days.
Secondly, I don't even know if I post this in the right place, so I
appologize if I had made such a mistake.

Now, the problem that made write this post:

I am working on a small JAVA + MySQL project, and by chance, when
browsing through Apache Software, I have discovered Wicket. I kind of
got the feeling with it thanks to the tutorials, but now I try to
integrate something related to MySQL in it:

I have a class Catalog, :

public class Catalog
{
   private ArrayList products;

   public Catalog()
   {
   this.products = new ArrayList();
   this.populateCatalog();
   }
   private void populateCatalog()
   {
   Connection connection = null;
   Statement statement = null;
   ResultSet result_set = null;

   String url = "jdbc:mysql://localhost:3306/proiect";
   String user = "root";
   String password = "";

   try
   {
   Class.forName("com.mysql.jdbc.Driver");

   connection  = (Connection)
DriverManager.getConnection(url,
user, password);
   statement   = (Statement)
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
   result_set  = statement.executeQuery("SELECT * from
produse
ORDER BY id_produs");

   while(result_set.next())
   {
   this.products.add(new Product(
result_set.getInt("id_produs"),  result_set.getString("nume_poza") ));
   }

   releaseResources(connection, statement, result_set);
   }
   catch (SQLException exception)
   {
   System.out.println("Eroare
=>"+exception.getLocalizedMessage());
   }
   catch (ClassNotFoundException exception)
   {
   exception.printStackTrace();
   }
   }

   private static void releaseResources(Connection connection,
Statement
statement, ResultSet result_set) throws SQLException
   {
   result_set.close();
   statement.close();
   connection.close();

   }
}

When I "run" the site, i get an error at line
"Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
don;t know how to copy-paste the output on the Tomcat Servlet Engine
(oh, yes, I am running it on Tomcat), it is embedded into a JAVA
window... Anywya, the next line in the stack trace, besides
ClassNotFoundException: com.mysql.jdbc.Driver
is "at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java);

Any help it is highly apreciated, and thanks for your understanding.
-- 
View this message in context:
http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074.
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]



Problem with Wicket and MySQL

2008-05-19 Thread Mihai Bogdan Eugen

Hello,

First of all, I am kind of new with this Wicket, actually, I am using
it for only a couple of days.
Secondly, I don't even know if I post this in the right place, so I
appologize if I had made such a mistake.

Now, the problem that made write this post:

I am working on a small JAVA + MySQL project, and by chance, when
browsing through Apache Software, I have discovered Wicket. I kind of
got the feeling with it thanks to the tutorials, but now I try to
integrate something related to MySQL in it:

I have a class Catalog, :

public class Catalog
{
   private ArrayList products;

   public Catalog()
   {
   this.products = new ArrayList();
   this.populateCatalog();
   }
   private void populateCatalog()
   {
   Connection connection = null;
   Statement statement = null;
   ResultSet result_set = null;

   String url = "jdbc:mysql://localhost:3306/proiect";
   String user = "root";
   String password = "";

   try
   {
   Class.forName("com.mysql.jdbc.Driver");

   connection  = (Connection)
DriverManager.getConnection(url,
user, password);
   statement   = (Statement)
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
   result_set  = statement.executeQuery("SELECT * from
produse
ORDER BY id_produs");

   while(result_set.next())
   {
   this.products.add(new Product(
result_set.getInt("id_produs"),  result_set.getString("nume_poza") ));
   }

   releaseResources(connection, statement, result_set);
   }
   catch (SQLException exception)
   {
   System.out.println("Eroare
=>"+exception.getLocalizedMessage());
   }
   catch (ClassNotFoundException exception)
   {
   exception.printStackTrace();
   }
   }

   private static void releaseResources(Connection connection, Statement
statement, ResultSet result_set) throws SQLException
   {
   result_set.close();
   statement.close();
   connection.close();

   }
}

When I "run" the site, i get an error at line
"Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
don;t know how to copy-paste the output on the Tomcat Servlet Engine
(oh, yes, I am running it on Tomcat), it is embedded into a JAVA
window... Anywya, the next line in the stack trace, besides
ClassNotFoundException: com.mysql.jdbc.Driver
is "at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java);

Any help it is highly apreciated, and thanks for your understanding.
-- 
View this message in context: 
http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074.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]



[Problem with Wicket and MySQL]

2008-05-19 Thread Bogdan Mihai
Hello,

First of all, I am kind of new with this Wicket, actually, I am using
it for only a couple of days.
Secondly, I don't even know if I post this in the right place, so I
appologize if I had made such a mistake.

Now, the problem that made write this post:

I am working on a small JAVA + MySQL project, and by chance, when
browsing through Apache Software, I have discovered Wicket. I kind of
got the feeling with it thanks to the tutorials, but now I try to
integrate something related to MySQL in it:

I have a class Catalog, :

public class Catalog
{
private ArrayList products;

public Catalog()
{
this.products = new ArrayList();
this.populateCatalog();
}
private void populateCatalog()
{
Connection connection = null;
Statement statement = null;
ResultSet result_set = null;

String url = "jdbc:mysql://localhost:3306/proiect";
String user = "root";
String password = "";

try
{
Class.forName("com.mysql.jdbc.Driver");

connection  = (Connection) DriverManager.getConnection(url,
user, password);
statement   = (Statement)
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
result_set  = statement.executeQuery("SELECT * from produse
ORDER BY id_produs");

while(result_set.next())
{   
this.products.add(new Product(
result_set.getInt("id_produs"),  result_set.getString("nume_poza") ));
}

releaseResources(connection, statement, result_set);
}
catch (SQLException exception)
{
System.out.println("Eroare =>"+exception.getLocalizedMessage());
}
catch (ClassNotFoundException exception)
{
exception.printStackTrace();
}
}

private static void releaseResources(Connection connection, Statement
statement, ResultSet result_set) throws SQLException
{
result_set.close();
statement.close();
connection.close();

}
}

When I "run" the site, i get an error at line
"Class.forName("com.mysql.jdbc.Driver");" from the file up above. I
don;t know how to copy-paste the output on the Tomcat Servlet Engine
(oh, yes, I am running it on Tomcat), it is embedded into a JAVA
window... Anywya, the next line in the stack trace, besides
ClassNotFoundException: com.mysql.jdbc.Driver
is "at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java);

Any help it is highly apreciated, and thanks for your understanding.

-- 
Mihai Bogdan Eugen

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



Strange problem cancelling out of a modal

2008-05-19 Thread Michael Mehrle
I've got a strange problem cancelling out of a modal. Unless I make
selections on all my form components inside that modal, it just won't
close. Debugger shows that the cancel button's onSubmit() method doesn't
even get called, unless I fill out all the fields and select all the
radios. The AJAX panel doesn't show any errors either, neither does the
feedback panel.

 

I suspect this has to do with those components being set to required,
but I never had a problem like that before.

 

Any idea what's going on here?

 

Michael



Re: AjaxButton without a Form

2008-05-19 Thread mnwicket

That is an option, but would rather use;



I have styles around my input buttons that I want to reuse.  I'm sure I can
create my own custom component, but thought someone has probably done it or
has a good way around it.



Mathias P.W Nilsson wrote:
> 
> Are you talking about an input type button? Couldn't you just use
> 
> add( new AjaxLink( "closeLink" ){
>public void onClick( AjaxRequestTarget target ){
>   // close the modal window
>}
> } );
> 
> 
> Markup
> 
>  src="../path/to/link"/>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/AjaxButton-without-a-Form-tp17330924p17331010.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: AjaxButton without a Form

2008-05-19 Thread Mathias P.W Nilsson

Are you talking about an input type button? Couldn't you just use

add( new AjaxLink( "closeLink" ){
   public void onClick( AjaxRequestTarget target ){
  // close the modal window
   }
} );


Markup

../path/to/link  

-- 
View this message in context: 
http://www.nabble.com/AjaxButton-without-a-Form-tp17330924p17330993.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]



Contribution for Wicket

2008-05-19 Thread Mathias P.W Nilsson

Hi!

I was wondering how I could make a contribution for wicket. I'm not talking
about a code contribution but rather a small money contribution. I have got
a lot of help here on this forum and in fact I don't think I have ever
experienced this kind of help elsewhere!


-- 
View this message in context: 
http://www.nabble.com/Contribution-for-Wicket-tp17330946p17330946.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]



AjaxButton without a Form

2008-05-19 Thread mnwicket

Is there a good way to create a button, say AjaxButton that does depend on a
form?

Basically I just want to create my own button with in the content of a modal
window to close it.
-- 
View this message in context: 
http://www.nabble.com/AjaxButton-without-a-Form-tp17330924p17330924.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: Controlling PagingNavigation

2008-05-19 Thread Mathias P.W Nilsson

Thanks again Igor. 
-- 
View this message in context: 
http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17330923.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: Controlling PagingNavigation

2008-05-19 Thread Igor Vaynberg
why is this so hard?

class mypagingnavigator extends pagingnavigator {
  protected Link newPagingNavigationIncrementLink(... final
pageable, final increment {
  return new PagingNavigationIncrementLink(id, pageable, increment) {
isvisible() {
  if (increment==-1) {
 return pageable.getcurrentpage()>0;
  } else {
  return pageable.getcurrentpage() wrote:
>
> I still can't find a way to hide the prev and/or the next on a certain
> condition.
>
> If the first page is showed I want to hide the prev. And if there are no
> more pages I want to hide the next. Anyone that has done this?
> --
> View this message in context: 
> http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17330081.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: Controlling PagingNavigation

2008-05-19 Thread Mathias P.W Nilsson

I still can't find a way to hide the prev and/or the next on a certain
condition.

If the first page is showed I want to hide the prev. And if there are no
more pages I want to hide the next. Anyone that has done this?
-- 
View this message in context: 
http://www.nabble.com/Controlling-PagingNavigation-tp17290391p17330081.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: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread Mathias P.W Nilsson

I think a good practice is to always take care of null objects and list your
self. You never know when or if the implementation might change. 
-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17330046.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: Very annoing error

2008-05-19 Thread Mathias P.W Nilsson

I solved this using a modal window instead of a popup window. Still don't
know what was wrong!
-- 
View this message in context: 
http://www.nabble.com/Very-annoing-error-tp17323755p17330023.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: OK, more JPA questions

2008-05-19 Thread Igor Vaynberg
On Mon, May 19, 2008 at 12:04 PM, David Nedrow <[EMAIL PROTECTED]> wrote:
> First, thanks for the help. Item 1 implemented via @SpringBean(name =
> "blah"). ;)
>
> On May 16, 2008, at 3:31 PM, Igor Vaynberg wrote:
>
>> there are basically two things that you need no matter what web
>> framework you are integrating with:
>>
>> 1) a way to lookup your dao singleton
>>
>> wicket-ioc allows you to quickly build an annotation based injection
>
>
>> 2) a way to scope the entity manager to request
>>
>> you need this so that lazy loading works. you are already doing this
>> with a threadlocal already, the only thing you need to do is to wire
>> in that closeEntityManager() call.
>>
>> you can either do this with a servlet filter that sits around the
>> wicket filter, or you can hook into wicket's requestcycle and do it
>> from there. there are really no advantages either way.
>
> I'll ask for help with this bit on the Spring list  to help avoid clutter
> here.
>
> The filter route sounds like want I want, as I would prefer to keep as much
> of the "bookkeeping" as possible out of the application logic.

see  org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter

-igor

>
> -David
>
> -
> 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: OK, more JPA questions

2008-05-19 Thread David Nedrow
First, thanks for the help. Item 1 implemented via @SpringBean(name =  
"blah"). ;)


On May 16, 2008, at 3:31 PM, Igor Vaynberg wrote:


there are basically two things that you need no matter what web
framework you are integrating with:

1) a way to lookup your dao singleton

wicket-ioc allows you to quickly build an annotation based injection




2) a way to scope the entity manager to request

you need this so that lazy loading works. you are already doing this
with a threadlocal already, the only thing you need to do is to wire
in that closeEntityManager() call.

you can either do this with a servlet filter that sits around the
wicket filter, or you can hook into wicket's requestcycle and do it
from there. there are really no advantages either way.


I'll ask for help with this bit on the Spring list  to help avoid  
clutter here.


The filter route sounds like want I want, as I would prefer to keep as  
much of the "bookkeeping" as possible out of the application logic.


-David

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



Set request in WicketTester

2008-05-19 Thread nate roe
I'm using Wicket 1.2.

I'm using WicketTester, but my Page requires certain request headers.  What
is the appropriate way to add headers to the MockHttpServletRequest (via
addHeaders(...) I assume) before the Page is rendered?

I tried:
tester.getServletRequest().addHeader("host", "www.myhost.com");
tester.startPage(MyPage.class);
tester.assertRenderedPage(MyPage.class);

but that doesn't work; request.getHeader("host") returns null in
MyPage.onAfterRender().

Thanks,
Nate


Re: [inmethod-grid] javascript error closing modal window containing grid

2008-05-19 Thread ChuckDeal

Nope, that didn't help.  I did identify another use case.  When the grid is
hidden via javascript, the error is thrown as well.  I have attached another
quickstart with this additional scenario.  I believe that the modal window
is probably doing something similar when closing thus triggering this error
when making the grid hidden.  Therefore, this issue may have nothing to do
with modal dialogs, but with hiding the grid control via js.

http://www.nabble.com/file/p17324786/modal-grid.zip modal-grid.zip 

Chuck


Matej Knopp-2 wrote:
> 
> Hi,
> 
> I'll look at it as soon as I get some spare time. In the meanwhile,
> can you try putting the modal window in a wicket form and see if that
> helps?
> 
> -Matej
> 
> On Tue, May 13, 2008 at 5:23 PM, ChuckDeal <[EMAIL PROTECTED]> wrote:
>>
>>  I am experiencing a javascript error when closing a ModalWindow that
>>  contains an inmethod-grid control.  I am having trouble tracking where
>> the
>>  error originates.  Could anyone offer some advice on how to begin
>>  debugging an error with the ModalDialog?
>>
>>  This is a quickstart that shows the problem.  On the home page, click
>> the
>>  link to open the modal dialog.  Then simply click the close button of
>> the
>>  dialog.  When the dialog disappears, the js error message will be
>>  available.
>>
>>  http://www.nabble.com/file/p17211224/modal-grid.zip modal-grid.zip
>>
>>  I am using IE 6 on WinXPProSP2
>>
>>  Chuck
>>  --
>>  View this message in context:
>> http://www.nabble.com/-inmethod-grid--javascript-error-closing-modal-window-containing-grid-tp17211224p17211224.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]
>>
>>
> 
> 
> 
> -- 
> Resizable and reorderable grid components.
> http://www.inmethod.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
-- 
View this message in context: 
http://www.nabble.com/-inmethod-grid--javascript-error-closing-modal-window-containing-grid-tp17211224p17324786.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]



Very annoing error

2008-05-19 Thread Mathias P.W Nilsson

I know this code is a little long. My problem is that if the popupwindow get
called twice then all the data is null afterwards. 

public class StorePage extends BaseAdministrationPage {

private Brand brand;
private Store store;
private BrandTranslation brandTranslation;
private BrandPresentation brandPresentation;


public StorePage( Brand brand, Store store ){
this.brand = getBrandDao().getBrand( brand.getId() );
this.store = getStoreDao().getStoreById( store.getId() );


add( new Label( "storeName" , getStore().getName() ) );

initiateTranslation();
initiatePresentation();



final CSSFeedbackPanel panel = new CSSFeedbackPanel( "feedback" 
);
panel.setOutputMarkupId(true);
add( panel );

final FileUploadField overviewImage = new FileUploadField( 
"overviewImage"
);
final FileUploadField backgroundImage = new FileUploadField(
"backgroundImage" );
final FileUploadField promotionImage = new FileUploadField(
"promotionImage" );


Form brandForm = new Form( "brandForm" ){
private static final long serialVersionUID = 1L;

@Override
protected void onSubmit()
{

final FileUpload uploadOverviewImage = 
overviewImage.getFileUpload();
final FileUpload uploadBackgroundImage= 
backgroundImage.getFileUpload();
final FileUpload uploadPromotionImage = 
promotionImage.getFileUpload();
/**
 * If the brand is new check that both files will be 
uploaded
 */
if( getBrandPresentation().getId() == null ){
if ( uploadOverviewImage == null ||  
uploadBackgroundImage ==
null || uploadPromotionImage == null ){
info( "Please upload all images" );
return;
}
}

if( uploadOverviewImage != null  ){
FileResource resource = newFileResource(new File(
getHairlessApplicationSettings().getBrandFolder(), UUID.randomUUID() + "." +
FileType.getFileExtension( uploadOverviewImage.getClientFileName()
)),uploadOverviewImage);
if( resource == null ){
info( "Could not upload overview file" );
return;
}else{
getBrandPresentation().setOverviewImage( 
resource );
}
}

if( uploadBackgroundImage != null  ){
FileResource resource = newFileResource(new File(
getHairlessApplicationSettings().getBrandFolder(), UUID.randomUUID() + "." +
FileType.getFileExtension( uploadBackgroundImage.getClientFileName()
)),uploadBackgroundImage);
if( resource == null ){
info( "Could not upload background image" );
return;
}else{
getBrandPresentation().setBackgroundImage( 
resource );
}
}

if( uploadPromotionImage != null  ){
FileResource resource = newFileResource(new File(
getHairlessApplicationSettings().getBrandFolder(), UUID.randomUUID() + "." +
FileType.getFileExtension( uploadPromotionImage.getClientFileName()
)),uploadPromotionImage);
if( resource == null ){
info( "Could not upload background image" );
return;
}else{
getBrandPresentation().setPromotionImage( 
resource );
}
}

String code = getHexCode( 
getBrandPresentation().getTextColor());
getBrandPresentation().setTextColor(code);
code = getHexCode( 
getBrandPresentation().getBackgroundColor());
getBrandPresentation().setBackgroundColor( 
code);
code = getHexCode( 
getBrandPresentation().getHeadlineColor());
getBrandPresentation().setHeadlineColor( code);


 

Re: Form models not populated when using FileUploadField and "multipart/form-data" .. ?

2008-05-19 Thread Matthew Young
>I'd forgotten that this was required on multipart forms:
>f.setMultiPart(true);

Odd, I didn't call .setMultiPart(true); and I have no problem at all.


On Mon, May 19, 2008 at 6:24 AM, Joel Halbert <[EMAIL PROTECTED]>
wrote:

> I am an idiot.
> I'd forgotten that this was required on multipart forms:
> f.setMultiPart(true);
>
> (hanging head in shame)
>
> --
> From: "Joel Halbert" <[EMAIL PROTECTED]>
> Sent: Monday, May 19, 2008 2:10 PM
> To: 
> Subject: Re: Forn models not populated when using FileUploadField and
> "multipart/form-data" .. ?
>
>  I've identified that in the cases where this is working the request type
>> Wicket creates to handle the form submission is a
>> "MultipartServletWebRequest", and in those where it is not the request type
>> is a standard "ServletWebRequest".
>>
>> The form markup on both pages looks the same
>>
>> Form that does work:
>> > action="?wicket:bookmarkablePage=%3ARatingAdd&wicket:interface=%3A7%3Aadd%3A%3AIFormSubmitListener%3A%3A&bottomTab=0&topTab=0"
>> method="post" wicket:id="add">
>>
>>
>> Form that doesn't work:
>> > action="?wicket:bookmarkablePage=%3ARegisterUser&wicket:interface=%3A2%3Aregister%3A%3AIFormSubmitListener%3A%3A&bottomTab=0&topTab=0"
>> method="post" wicket:id="register">
>>
>>
>> Any ideas why  a ServletWebRequest would be used to handle a form of type
>> "multipart" ?
>>
>> --
>> From: "Joel Halbert" <[EMAIL PROTECTED]>
>> Sent: Monday, May 19, 2008 1:14 PM
>> To: 
>> Subject: Forn models not populated when using FileUploadField and
>> "multipart/form-data" .. ?
>>
>>  Hi,
>>>
>>> I'm experiencing a problem on a form whereby if I include a
>>> "FileUploadField" in the form, causing the form encoding type to become
>>> "multipart/form-data", none of the model objects from other fields on the
>>> form are correctly populated when the form is submitted. Oddly enough we do
>>> have other pages that do use "FileUploadField" with no problems, and I'm
>>> unable to see any differences between the page that doesn't work and those
>>> that do.
>>>
>>> Is there any obvious reason why model objects might not get populated
>>> when the form enctype becomes "multipart/form-data" as is the case when
>>> using a FileUploadField ? If i remove the FileUploadField from the form
>>> everything works as expected.
>>>
>>> Thanks,
>>> Joel
>>>
>>
>>
>> -
>> 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: [JUG] Advanced Wicket - Cincinnati, OH (tonight)

2008-05-19 Thread James Carman
Well, I don't really have slides.  I'm doing more of a code
"walkthrough".  Here's the example code, though:

http://svn.carmanconsulting.com/public/wicket-advanced/trunk

I'm basically stepping through user stories, creating a site for
managing a martial arts school.  I need to get those IDEA files out of
there! :)  It's kind of late to think of doing a video.  I'll ask the
place that's hosting if they have video equipment.  They do video
conferencing all the time.  That would be cool if I could webcast it!


On Mon, May 19, 2008 at 11:53 AM, Jonathan Locke
<[EMAIL PROTECTED]> wrote:
>
> if you get a chance, upload the slide deck to slideshare.com
> or better yet, make a video. I am sure we're all interested.
>
>
> jwcarman wrote:
>>
>> All,
>>
>> If anyone is in the Cincinnati, OH area, I'm giving an "Advanced
>> Wicket" talk tonight at our Cincinnati Java Users Group
>> (www.cinjug.org) meeting tonight.  Meeting information (when, where,
>> etc.) is on our website.  Hope to see you there (membership is free
>> and we usually have pizza)!
>>
>>
>> James Carman
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/-JUG--Advanced-Wicket---Cincinnati%2C-OH-%28tonight%29-tp17320076p17321830.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: ReloadingWicketFilter for Classes in a referenced project?

2008-05-19 Thread Eelco Hillenius
> i'm trying to create a ReloadingWicketFilter. I've tried a lot especially
> reading (WICKET-685) ReloadingWicketFilter not working with markup
> inheritance (
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg01938.html) but
> nothing worked for me.

I think a better way to go is to use JavaRebel. See
http://www.zeroturnaround.com/javarebel/

Eelco

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



Re: New wicket site and wiki post

2008-05-19 Thread Jonathan Locke

 I think there is beer after work all three weeks...


Jonathan Locke wrote:
> 
> June 1 through June 21
> Think there may be a meet up the second week
> 
> 
> Johan Compagner wrote:
>> 
>> you should be in Switzerland in june :)
>> 
>> I will be in Swi from 7 - 14 june.
>> When are you in holland?
>> 
>> On Mon, May 19, 2008 at 5:48 PM, Jonathan Locke
>> <[EMAIL PROTECTED]>
>> wrote:
>> 
>>>
>>> Very cool! I will be in the Netherlands in June.
>>> People tell me they are crazy for football there.
>>> People painting themselves orange and such.
>>> And thanks for the SEO article.
>>>
>>>
>>> Michael Sparer wrote:
>>> >
>>> > http://isport.eu is a simple but hopefully useful website for people
>>> like
>>> > me who spend several hours a week to get the latest football (American
>>> > readers: feel free to replace the word 'football' with 'soccer') news
>>> from
>>> > the major European leagues. See the Blog-Post
>>> > (http://talk-on-tech.blogspot.com/2008/05/introducing-isporteu.html)
>>> for
>>> > details.
>>> >
>>> > But for not being too barefaced and posting this message just for
>>> > promotion-purpose I also created a new wiki page about search engine
>>> > optimization (SEO) tricks that can be easily accomplished using
>>> wicket. I
>>> > combined some recently discussed topics from the mailing list and
>>> added
>>> > some of my own findings. Please feel free to add your own findings,
>>> > experience and tricks to the page that can be found on:
>>> >
>>> http://cwiki.apache.org/confluence/display/WICKET/SEO+-+Search+Engine+Optimization
>>> >
>>> > regards,
>>> > Michael
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/New-wicket-site-and-wiki-post-tp17316686p17321109.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/New-wicket-site-and-wiki-post-tp17316686p17322398.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: New wicket site and wiki post

2008-05-19 Thread Jonathan Locke

June 1 through June 21
Think there may be a meet up the second week


Johan Compagner wrote:
> 
> you should be in Switzerland in june :)
> 
> I will be in Swi from 7 - 14 june.
> When are you in holland?
> 
> On Mon, May 19, 2008 at 5:48 PM, Jonathan Locke <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Very cool! I will be in the Netherlands in June.
>> People tell me they are crazy for football there.
>> People painting themselves orange and such.
>> And thanks for the SEO article.
>>
>>
>> Michael Sparer wrote:
>> >
>> > http://isport.eu is a simple but hopefully useful website for people
>> like
>> > me who spend several hours a week to get the latest football (American
>> > readers: feel free to replace the word 'football' with 'soccer') news
>> from
>> > the major European leagues. See the Blog-Post
>> > (http://talk-on-tech.blogspot.com/2008/05/introducing-isporteu.html)
>> for
>> > details.
>> >
>> > But for not being too barefaced and posting this message just for
>> > promotion-purpose I also created a new wiki page about search engine
>> > optimization (SEO) tricks that can be easily accomplished using wicket.
>> I
>> > combined some recently discussed topics from the mailing list and added
>> > some of my own findings. Please feel free to add your own findings,
>> > experience and tricks to the page that can be found on:
>> >
>> http://cwiki.apache.org/confluence/display/WICKET/SEO+-+Search+Engine+Optimization
>> >
>> > regards,
>> > Michael
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/New-wicket-site-and-wiki-post-tp17316686p17321109.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/New-wicket-site-and-wiki-post-tp17316686p17322374.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: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread guillaume.mary

I agree with you, my problem is on the fact that Wicket seems to me
inconsistent because of the 2 behaviors: if I have the IOOBE I should have
the NPE.


Wouter Huijnink wrote:
> 
> 
> Yes, you are wrong. It's bad practice to refer to a location in a list 
> if you're not sure the entry exists. Wicket probably *does* take care of 
> the situation where your List is null.
> 
> regards,
> Wouter
> 
> -- 
> Wouter Huijnink
> Func. Internet Integration
> W http://www.func.nl
> T +31 20 423
> F +31 20 4223500
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17322161.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: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread guillaume.mary

Well, i'm just doing A a; But I put a trace on the getA() and a is really
null.

Can you make a try ?


Mathias P.W Nilsson wrote:
> 
> I don't know if I got it right. Is the A null? Are you just doing A a; or
> A a = null; ?
> 
> If you do this I don't understand why you don't get an exception. The
> PropertyModel extends AbstractPropertyModel and when setting the property
> model it does a super. In the AbstractPropertyModel it checks if the
> object is null and throws a IllegalArgumentException.
> 
> Is a really null?
> 

-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17322053.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: [JUG] Advanced Wicket - Cincinnati, OH (tonight)

2008-05-19 Thread Jonathan Locke

if you get a chance, upload the slide deck to slideshare.com
or better yet, make a video. I am sure we're all interested.


jwcarman wrote:
> 
> All,
> 
> If anyone is in the Cincinnati, OH area, I'm giving an "Advanced
> Wicket" talk tonight at our Cincinnati Java Users Group
> (www.cinjug.org) meeting tonight.  Meeting information (when, where,
> etc.) is on our website.  Hope to see you there (membership is free
> and we usually have pizza)!
> 
> 
> James Carman
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-JUG--Advanced-Wicket---Cincinnati%2C-OH-%28tonight%29-tp17320076p17321830.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: New wicket site and wiki post

2008-05-19 Thread Johan Compagner
you should be in Switzerland in june :)

I will be in Swi from 7 - 14 june.
When are you in holland?

On Mon, May 19, 2008 at 5:48 PM, Jonathan Locke <[EMAIL PROTECTED]>
wrote:

>
> Very cool! I will be in the Netherlands in June.
> People tell me they are crazy for football there.
> People painting themselves orange and such.
> And thanks for the SEO article.
>
>
> Michael Sparer wrote:
> >
> > http://isport.eu is a simple but hopefully useful website for people
> like
> > me who spend several hours a week to get the latest football (American
> > readers: feel free to replace the word 'football' with 'soccer') news
> from
> > the major European leagues. See the Blog-Post
> > (http://talk-on-tech.blogspot.com/2008/05/introducing-isporteu.html) for
> > details.
> >
> > But for not being too barefaced and posting this message just for
> > promotion-purpose I also created a new wiki page about search engine
> > optimization (SEO) tricks that can be easily accomplished using wicket. I
> > combined some recently discussed topics from the mailing list and added
> > some of my own findings. Please feel free to add your own findings,
> > experience and tricks to the page that can be found on:
> >
> http://cwiki.apache.org/confluence/display/WICKET/SEO+-+Search+Engine+Optimization
> >
> > regards,
> > Michael
> >
>
> --
> View this message in context:
> http://www.nabble.com/New-wicket-site-and-wiki-post-tp17316686p17321109.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: New wicket site and wiki post

2008-05-19 Thread Jonathan Locke

Very cool! I will be in the Netherlands in June.
People tell me they are crazy for football there.
People painting themselves orange and such.
And thanks for the SEO article.


Michael Sparer wrote:
> 
> http://isport.eu is a simple but hopefully useful website for people like
> me who spend several hours a week to get the latest football (American
> readers: feel free to replace the word 'football' with 'soccer') news from
> the major European leagues. See the Blog-Post
> (http://talk-on-tech.blogspot.com/2008/05/introducing-isporteu.html) for
> details.
> 
> But for not being too barefaced and posting this message just for
> promotion-purpose I also created a new wiki page about search engine
> optimization (SEO) tricks that can be easily accomplished using wicket. I
> combined some recently discussed topics from the mailing list and added
> some of my own findings. Please feel free to add your own findings,
> experience and tricks to the page that can be found on:
> http://cwiki.apache.org/confluence/display/WICKET/SEO+-+Search+Engine+Optimization
> 
> regards, 
> Michael
> 

-- 
View this message in context: 
http://www.nabble.com/New-wicket-site-and-wiki-post-tp17316686p17321109.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: [JUG] Advanced Wicket - Cincinnati, OH (tonight)

2008-05-19 Thread Johan Compagner
love to come, but i think i just just cant make it even i i start moving now
:(

On Mon, May 19, 2008 at 4:18 PM, James Carman <[EMAIL PROTECTED]>
wrote:

> All,
>
> If anyone is in the Cincinnati, OH area, I'm giving an "Advanced
> Wicket" talk tonight at our Cincinnati Java Users Group
> (www.cinjug.org) meeting tonight.  Meeting information (when, where,
> etc.) is on our website.  Hope to see you there (membership is free
> and we usually have pizza)!
>
>
> James Carman
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Automatic sign-on using HTTP headers

2008-05-19 Thread Maurice Marrink
You could take a look at http://wicketstuff.org/wicketsecurity/basichttp/
It does the same with standard http headers.
Source 
http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-security/examples/all_in_one/src/main/java/org/apache/wicket/security/examples/httplogin/basic
although if you want to get it running / compiling you want to check
out from here 
http://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-security/

Maurice

On Mon, May 19, 2008 at 4:32 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> On Mon, May 19, 2008 at 6:08 AM, Lauri Lehtinen
> <[EMAIL PROTECTED]> wrote:
>> Hello -
>>
>> I am in the process of porting a Struts application into Wicket, and would
>> appreciate some insights regarding an upcoming task:
>>
>> I need to implement automatic sign-on based on the value of a custom HTTP
>> header in the request, if the request is coming from a specific IP range.
>>
>> For those familiar with Struts - previously this has been handled using
>> custom RequestProcessors, where you have access to the HttpServletRequest
>> object.
>>
>> I have taken a look at the Wicket API, and ended up obeying the advice to
>> mail this list before depending on WebRequest's getHttpServletRequest()
>> method directly.
>>
>> So, my main questions:
>>
>> - Does Wicket provide access to custom HTTP headers in a request via other
>> means than getHttpServletRequest()?
>
> i dont see why not, you know you are running in a webapp...
>
>> - Where in the Wicket land would YOU place the code responsible for
>> automatic sign-on (every request that needs sign-on should go through that
>> code before sending to a login page)?
>
> the code should go into IAuthorizationStrategy implementation,
> probably on isInstantiationAuthorized. IAuthorizationStrategy is your
> single point for security-related things.
>
> -igor
>
>>
>> Thank you in advance for any comments on this.
>>
>> Best regards,
>> Lauri Lehtinen
>>
>> -
>> 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: DataTable, Form and Firefox

2008-05-19 Thread Igor Vaynberg
code snippets usually help us help you

-igor

On Mon, May 19, 2008 at 6:36 AM, Flowen <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I've got a problem with Firefox when using a DefaultDataTable inside a form.
> I added a button to submit the form in a customized AbstractColumn. On the
> first page, every button works fine. But if I use the navigation toolbar to
> go to another page (page 2 for example) nothing happen when I click on a
> button to submit the form.
>
> I have no problems with IE 7.
>
> Can you help me to find where does the problem come from ?
>
> -Flowen
> --
> View this message in context: 
> http://www.nabble.com/DataTable%2C-Form-and-Firefox-tp17316697p17316697.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: Automatic sign-on using HTTP headers

2008-05-19 Thread Igor Vaynberg
On Mon, May 19, 2008 at 6:08 AM, Lauri Lehtinen
<[EMAIL PROTECTED]> wrote:
> Hello -
>
> I am in the process of porting a Struts application into Wicket, and would
> appreciate some insights regarding an upcoming task:
>
> I need to implement automatic sign-on based on the value of a custom HTTP
> header in the request, if the request is coming from a specific IP range.
>
> For those familiar with Struts - previously this has been handled using
> custom RequestProcessors, where you have access to the HttpServletRequest
> object.
>
> I have taken a look at the Wicket API, and ended up obeying the advice to
> mail this list before depending on WebRequest's getHttpServletRequest()
> method directly.
>
> So, my main questions:
>
> - Does Wicket provide access to custom HTTP headers in a request via other
> means than getHttpServletRequest()?

i dont see why not, you know you are running in a webapp...

> - Where in the Wicket land would YOU place the code responsible for
> automatic sign-on (every request that needs sign-on should go through that
> code before sending to a login page)?

the code should go into IAuthorizationStrategy implementation,
probably on isInstantiationAuthorized. IAuthorizationStrategy is your
single point for security-related things.

-igor

>
> Thank you in advance for any comments on this.
>
> Best regards,
> Lauri Lehtinen
>
> -
> 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: Form validation when using custom onSubmit()

2008-05-19 Thread Igor Vaynberg
why did you call in the first place. that method does exactly what it
sounds like, which is turn off the default form processing.

-igor

On Mon, May 19, 2008 at 4:00 AM, Blackbird <[EMAIL PROTECTED]> wrote:
>
> I had to remove ".setDefaultFormProcessing(false)" to make the validation
> work
>
> --
> View this message in context: 
> http://www.nabble.com/Form-validation-when-using-custom-onSubmit%28%29-tp17315177p17316629.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: .properties files question

2008-05-19 Thread Igor Vaynberg
component.getstring(key)

-igor

On Mon, May 19, 2008 at 6:52 AM, Blackbird <[EMAIL PROTECTED]> wrote:
>
> My question isn't about i18n.
> Wicket has its own very nice system of properties (MyApplication.properties,
> MyWebPage.properties) which makes it so easy to get when one writes his HTML
> files.
>
> Can we ask wicket to get the value from a key in a java class just as
> easily? I don't want to specify the path or even the name of the property
> file, I shouldn't have to: no need to do it in the HTML files, why would I
> have to in my Java classes?
> --
> View this message in context: 
> http://www.nabble.com/.properties-files-question-tp13821533p17316712.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: .properties files question

2008-05-19 Thread James Carman
Have a look at the java.util.ResourceBundle class (which is
essentially what Wicket uses).

On Mon, May 19, 2008 at 9:52 AM, Blackbird <[EMAIL PROTECTED]> wrote:
>
> My question isn't about i18n.
> Wicket has its own very nice system of properties (MyApplication.properties,
> MyWebPage.properties) which makes it so easy to get when one writes his HTML
> files.
>
> Can we ask wicket to get the value from a key in a java class just as
> easily? I don't want to specify the path or even the name of the property
> file, I shouldn't have to: no need to do it in the HTML files, why would I
> have to in my Java classes?
> --
> View this message in context: 
> http://www.nabble.com/.properties-files-question-tp13821533p17316712.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]



[JUG] Advanced Wicket - Cincinnati, OH (tonight)

2008-05-19 Thread James Carman
All,

If anyone is in the Cincinnati, OH area, I'm giving an "Advanced
Wicket" talk tonight at our Cincinnati Java Users Group
(www.cinjug.org) meeting tonight.  Meeting information (when, where,
etc.) is on our website.  Hope to see you there (membership is free
and we usually have pizza)!


James Carman

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



RE: Wicket java.lang.IllegalAccessError bug?

2008-05-19 Thread Zappaterrini, Larry
I can't get the ternary statement you provided to compile correctly
using 1.4-M1. The error I get is:

The type AbstractChoice is not visible

Due to the fact that the common ancestor for ListMultipleChoice and
ListChoice is the inaccessible package protected object AbstractChoice.
This is caused by the behavior of ternary assignment where, if the
second and third operands are of different reference types, then it must
be possible to convert one of the types to the other type (call this
latter type T) by assignment conversion; the type of the conditional
expression is T. It is a compile-time error if neither type is
assignment compatible with the other type. This is copied verbatim from

http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.h
tml#290293

Casting one of the new statements to FormComponent allows the statement
to compile and run without error for me:

FormComponent o = false
? (FormComponent) new ListMultipleChoice("",
new Model(), Collections.EMPTY_LIST, (IChoiceRenderer) null)
: new ListChoice("",
new Model(), Collections.EMPTY_LIST, (IChoiceRenderer)
null).setNullValid(true);

I imagine it may correct the runtime error you are seeing too.

-Original Message-
From: Martin Makundi [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 18, 2008 3:56 AM
To: users@wicket.apache.org
Subject: Re: Wicket java.lang.IllegalAccessError bug?

Yap. If you rephrase it into ifs (or change ternary false state into
true) it works fine.

**
Martin

2008/5/18 Johan Compagner <[EMAIL PROTECTED]>:
> I have no idea what could cause that suddenly in 1.4
> Maybe something that java 5 source compiler does?
> But a simple if works fine?
>
> On 5/17/08, Martin Makundi <[EMAIL PROTECTED]> wrote:
>> Hi!
>>
>> I just upgraded from 1.3.1 to 1.4-m1 and I received the strangest of
errors.
>>
>> Has anyone had the same experience below? This occurs only with the
>> ternary operator, probably because both elements get initialized at
>> runtime:
>>
>> public class AnyPage extends WebPage {
>>
>> public AnyPage() {
>> // I wanted to use a ternary operator to choose between rendering
>> a listchoice or a multiplelistchoice.
>> // This worked in 1.3.1 but not in 1.4-m1 anymore. The JVM used
is
>> 1.6.0_04 with jetty 6.1.0
>>
>>// 
>>
>> Object o = false
>> ? new ListMultipleChoice("",
>> new Model(), Collections.EMPTY_LIST, (IChoiceRenderer) null)
>> : new ListChoice("",
>> new Model(), Collections.EMPTY_LIST, (IChoiceRenderer)
>> null).setNullValid(true);
>>
>>// 
>>   }
>> }
>>
>> Throws a nasty exception:
>>
>> 2008-05-17 16:57:23,531 67447 [btpool0-8] ERROR RequestCycle  - Can't
>> instantiate page using constructor public wicket.quickstart.AnyPage()
>> org.apache.wicket.WicketRuntimeException: Can't instantiate page
using
>> constructor public wicket.quickstart.AnyPage()
>>   at
>>
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.
java:168)
>>   at
>>
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.
java:58)
>>   at
>>
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget
.newPage(BookmarkablePageRequestTarget.java:262)
>>   at
>>
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget
.getPage(BookmarkablePageRequestTarget.java:283)
>>   at
>>
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget
.processEvents(BookmarkablePageRequestTarget.java:210)
>>   at
>>
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(Ab
stractRequestCycleProcessor.java:91)
>>   at
>>
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1174)
>>   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1251)
>>   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1352)
>>   at
org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
>>   at
>>
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:375
)
>>   at
>>
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:1
24)
>>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>>   at
>>
wicket.quickstart.SessionLeakWorkaroundServlet.service(SessionLeakWorkar
ound.java:57)
>>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>   at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
>>   at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
>>   at
>>
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:1
85)
>>   at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>   at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
>>   at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
>>   at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>   at 

Re: .properties files question

2008-05-19 Thread Blackbird

My question isn't about i18n.
Wicket has its own very nice system of properties (MyApplication.properties,
MyWebPage.properties) which makes it so easy to get when one writes his HTML
files.

Can we ask wicket to get the value from a key in a java class just as
easily? I don't want to specify the path or even the name of the property
file, I shouldn't have to: no need to do it in the HTML files, why would I
have to in my Java classes?
-- 
View this message in context: 
http://www.nabble.com/.properties-files-question-tp13821533p17316712.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]



stream content with an IndicatingAjaxLink

2008-05-19 Thread renaud.houver

I have a download picture link which take a bit of time. Result is that the
user is impatiently clicking several time. I would like to have a kind of
timer showing process and I tried to use IndicatingAjaxLink which does the
job. But I cant find out to stream to the outputstream with an ajax link.

I tried both to get outputStream from ajax target.

public void onClick(AjaxRequestTarget target) {
  target.getHeaderResponse().getResponse().getOutputStream();
...

or from a new target on requestCycle from page

public void onClick(AjaxRequestTarget target) {

public void onClick(AjaxRequestTarget target) {
target.getHeaderResponse().getResponse().getOutputStream();
target.getPage().getRequestCycle().setRequestTarget(new 
IRequestTarget(){
public void respond(RequestCycle requestCycle) {

((WebResponse)requestCycle.getResponse()).getOutputStream();
...
None works ... Any advice ? Something with resources maybe ?

Here is the onClick method with a normal link.That works fine.

public void onClick()
{
final byte[] bytes = getDirectDownloadBytes(phot);
if(bytes != null && bytes.length > 0) {
getRequestCycle().setRequestTarget(new IRequestTarget()
{

public void respond(RequestCycle requestCycle) {
WebResponse r = 
(WebResponse)requestCycle.getResponse();
r.setAttachmentHeader(fileName);

try {

r.getOutputStream().write(bytes);
} catch (IOException e) {
throw new RuntimeException(e);
} finally { }
}
});
}
}


-- 
View this message in context: 
http://www.nabble.com/stream-content-with-an-IndicatingAjaxLink-tp17316702p17316702.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]



DataTable, Form and Firefox

2008-05-19 Thread Flowen

Hi all, 

I've got a problem with Firefox when using a DefaultDataTable inside a form.
I added a button to submit the form in a customized AbstractColumn. On the
first page, every button works fine. But if I use the navigation toolbar to
go to another page (page 2 for example) nothing happen when I click on a
button to submit the form. 

I have no problems with IE 7.

Can you help me to find where does the problem come from ?

-Flowen 
-- 
View this message in context: 
http://www.nabble.com/DataTable%2C-Form-and-Firefox-tp17316697p17316697.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 models not populated when using FileUploadField and "multipart/form-data" .. ?

2008-05-19 Thread Joel Halbert

I am an idiot.
I'd forgotten that this was required on multipart forms:
f.setMultiPart(true);

(hanging head in shame)

--
From: "Joel Halbert" <[EMAIL PROTECTED]>
Sent: Monday, May 19, 2008 2:10 PM
To: 
Subject: Re: Forn models not populated when using FileUploadField and 
"multipart/form-data" .. ?


I've identified that in the cases where this is working the request type 
Wicket creates to handle the form submission is a 
"MultipartServletWebRequest", and in those where it is not the request 
type is a standard "ServletWebRequest".


The form markup on both pages looks the same

Form that does work:
action="?wicket:bookmarkablePage=%3ARatingAdd&wicket:interface=%3A7%3Aadd%3A%3AIFormSubmitListener%3A%3A&bottomTab=0&topTab=0" 
method="post" wicket:id="add">



Form that doesn't work:
action="?wicket:bookmarkablePage=%3ARegisterUser&wicket:interface=%3A2%3Aregister%3A%3AIFormSubmitListener%3A%3A&bottomTab=0&topTab=0" 
method="post" wicket:id="register">



Any ideas why  a ServletWebRequest would be used to handle a form of type 
"multipart" ?


--
From: "Joel Halbert" <[EMAIL PROTECTED]>
Sent: Monday, May 19, 2008 1:14 PM
To: 
Subject: Forn models not populated when using FileUploadField and 
"multipart/form-data" .. ?



Hi,

I'm experiencing a problem on a form whereby if I include a 
"FileUploadField" in the form, causing the form encoding type to become 
"multipart/form-data", none of the model objects from other fields on the 
form are correctly populated when the form is submitted. Oddly enough we 
do have other pages that do use "FileUploadField" with no problems, and 
I'm unable to see any differences between the page that doesn't work and 
those that do.


Is there any obvious reason why model objects might not get populated 
when the form enctype becomes "multipart/form-data" as is the case when 
using a FileUploadField ? If i remove the FileUploadField from the form 
everything works as expected.


Thanks,
Joel



-
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: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread Mathias P.W Nilsson

I don't know if I got it right. Is the A null? Are you just doing A a; or A a
= null; ?

If you do this I don't understand why you don't get an exception. The
PropertyModel extends AbstractPropertyModel and when setting the property
model it does a super. In the AbstractPropertyModel it checks if the object
is null and throws a IllegalArgumentException.

Is a really null?
-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17316687.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]



New wicket site and wiki post

2008-05-19 Thread Michael Sparer

http://isport.eu is a simple but hopefully useful website for people like me
who spend several hours a week to get the latest football (American readers:
feel free to replace the word 'football' with 'soccer') news from the major
European leagues. See the Blog-Post
(http://talk-on-tech.blogspot.com/2008/05/introducing-isporteu.html) for
details.

But for not being too barefaced and posting this message just for
promotion-purpose I also created a new wiki page about search engine
optimization (SEO) tricks that can be easily accomplished using wicket. I
combined some recently discussed topics from the mailing list and added some
of my own findings. Please feel free to add your own findings, experience
and tricks to the page that can be found on:
http://cwiki.apache.org/confluence/display/WICKET/SEO+-+Search+Engine+Optimization

regards, 
Michael

-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/New-wicket-site-and-wiki-post-tp17316686p17316686.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: Forn models not populated when using FileUploadField and "multipart/form-data" .. ?

2008-05-19 Thread Joel Halbert
I've identified that in the cases where this is working the request type 
Wicket creates to handle the form submission is a 
"MultipartServletWebRequest", and in those where it is not the request type 
is a standard "ServletWebRequest".


The form markup on both pages looks the same

Form that does work:
action="?wicket:bookmarkablePage=%3ARatingAdd&wicket:interface=%3A7%3Aadd%3A%3AIFormSubmitListener%3A%3A&bottomTab=0&topTab=0" 
method="post" wicket:id="add">



Form that doesn't work:
action="?wicket:bookmarkablePage=%3ARegisterUser&wicket:interface=%3A2%3Aregister%3A%3AIFormSubmitListener%3A%3A&bottomTab=0&topTab=0" 
method="post" wicket:id="register">



Any ideas why  a ServletWebRequest would be used to handle a form of type 
"multipart" ?


--
From: "Joel Halbert" <[EMAIL PROTECTED]>
Sent: Monday, May 19, 2008 1:14 PM
To: 
Subject: Forn models not populated when using FileUploadField and 
"multipart/form-data" .. ?



Hi,

I'm experiencing a problem on a form whereby if I include a 
"FileUploadField" in the form, causing the form encoding type to become 
"multipart/form-data", none of the model objects from other fields on the 
form are correctly populated when the form is submitted. Oddly enough we 
do have other pages that do use "FileUploadField" with no problems, and 
I'm unable to see any differences between the page that doesn't work and 
those that do.


Is there any obvious reason why model objects might not get populated when 
the form enctype becomes "multipart/form-data" as is the case when using a 
FileUploadField ? If i remove the FileUploadField from the form everything 
works as expected.


Thanks,
Joel 



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



Automatic sign-on using HTTP headers

2008-05-19 Thread Lauri Lehtinen

Hello -

I am in the process of porting a Struts application into Wicket, and 
would appreciate some insights regarding an upcoming task:


I need to implement automatic sign-on based on the value of a custom 
HTTP header in the request, if the request is coming from a specific IP 
range.


For those familiar with Struts - previously this has been handled using 
custom RequestProcessors, where you have access to the 
HttpServletRequest object.


I have taken a look at the Wicket API, and ended up obeying the advice 
to mail this list before depending on WebRequest's 
getHttpServletRequest() method directly.


So, my main questions:

- Does Wicket provide access to custom HTTP headers in a request via 
other means than getHttpServletRequest()?
- Where in the Wicket land would YOU place the code responsible for 
automatic sign-on (every request that needs sign-on should go through 
that code before sending to a login page)?


Thank you in advance for any comments on this.

Best regards,
Lauri Lehtinen

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



Re: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread Wouter Huijnink



What I meant in my first post, is since I don't get a NPE in that case, I
was thinking that Wicket shouldn't throw a IOOBE in the case of an
inexisting position in my List: according to me Wicket should handle it.
Am i wrong ?
  


Yes, you are wrong. It's bad practice to refer to a location in a list 
if you're not sure the entry exists. Wicket probably *does* take care of 
the situation where your List is null.


regards,
Wouter

--
Wouter Huijnink
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500


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



Re: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread guillaume.mary

Well, if the person is null I don't get a NPE (to check, I took a wicket
page, added an attribute A to it, displayed A.B with a Label +
PropertyModel, but never setted the attribute A => I never got the NPE)

What I meant in my first post, is since I don't get a NPE in that case, I
was thinking that Wicket shouldn't throw a IOOBE in the case of an
inexisting position in my List: according to me Wicket should handle it.
Am i wrong ?


Mathias P.W Nilsson wrote:
> 
> The person.name check getPerson().setName() , getName(). If the person is
> null you will get a nullpointer.
> 
> If you do get( 0 ) on a list and the null doens't exists then you will get
> a IndexOutOfBoundException. Just try with a normal list and an object.
> 
> The list is probably initialized like with hibernate you will get an empty
> list. But doens't contains any elements.
> 

-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17316664.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]



Forn models not populated when using FileUploadField and "multipart/form-data" .. ?

2008-05-19 Thread Joel Halbert
Hi,

I'm experiencing a problem on a form whereby if I include a "FileUploadField" 
in the form, causing the form encoding type to become "multipart/form-data", 
none of the model objects from other fields on the form are correctly populated 
when the form is submitted. Oddly enough we do have other pages that do use 
"FileUploadField" with no problems, and I'm unable to see any differences 
between the page that doesn't work and those that do.

Is there any obvious reason why model objects might not get populated when the 
form enctype becomes "multipart/form-data" as is the case when using a 
FileUploadField ? If i remove the FileUploadField from the form everything 
works as expected.

Thanks,
Joel

session expired while modal window is opened

2008-05-19 Thread Milan Křápek
Hi,
 I encountered this problem while I was testing my web application. In my 
aplication I have Modal window with some form. I have opened this window and 
wait 30 min to let the session expired When the session expired I try to close 
the Modal window but nothing happens. I cannot do anythink. I must refresh the 
page to get "Page expired message" or close the browser.  I want to know if 
this is the  normal wicket behavior or if I can to close the modal window 
automaticaly when the session expires.

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



Re: IndexOutOfBoundException and PropertyModel

2008-05-19 Thread Mathias P.W Nilsson

The person.name check getPerson().setName() , getName(). If the person is
null you will get a nullpointer.

If you do get( 0 ) on a list and the null doens't exists then you will get a
IndexOutOfBoundException. Just try with a normal list and an object.

The list is probably initialized like with hibernate you will get an empty
list. But doens't contains any elements.
-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17316645.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]



Encoding problem when deploying on production server

2008-05-19 Thread Piller Sébastien

Hello guys,

I have a problem with the encoding of some text, on my deployment server 
(Unix/Linux). I use wicket to generate the body of emails, with this code:


   StringResponse stringResponse = new StringResponse();
   Response originalResponse = RequestCycle.get().getResponse();

   try {
   RequestCycle.get().setResponse(stringResponse);
   render();
   } finally {
   RequestCycle.get().setResponse(originalResponse);
   }

   return stringResponse.toString();

All of my resources files are encoded with UTF8.

When I use it on my development workstation, everything works fine. 
Every chars are properly rendered.


But on the production server, it seems that the email is converted to 
ISO8859-1 (and special chars are not rendered properly in UTF8). But 
others web pages are properly rendered (I only have a problem when 
dealing with responses)


Have you guys any idea on how to fix it? Do I have to do someting on the 
server config?


Thank you vm!

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



Re: Form validation when using custom onSubmit()

2008-05-19 Thread Blackbird

I had to remove ".setDefaultFormProcessing(false)" to make the validation
work

-- 
View this message in context: 
http://www.nabble.com/Form-validation-when-using-custom-onSubmit%28%29-tp17315177p17316629.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]



IndexOutOfBoundException and PropertyModel

2008-05-19 Thread guillaume.mary

Hi all,

I'm wondering why the PropertyModel sends an IndexOutOfBoundException when I
use an expression such as "myList.0.name" and that the 0 element doesn't
exist, whereas it doesn't sends a NullPointerException when I user
"person.name" with a null person.

Is it a wanted behavior or not (or a mistake from me)

thank you
-- 
View this message in context: 
http://www.nabble.com/IndexOutOfBoundException-and-PropertyModel-tp17315359p17315359.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 validation when using custom onSubmit()

2008-05-19 Thread Mathias P.W Nilsson

Take a look at this link and see if it helps 
http://javathoughts.capesugarbird.com/2007/06/changing-wickets-default-form.html
http://javathoughts.capesugarbird.com/2007/06/changing-wickets-default-form.html
 
-- 
View this message in context: 
http://www.nabble.com/Form-validation-when-using-custom-onSubmit%28%29-tp17315177p17315180.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]



Form validation when using custom onSubmit()

2008-05-19 Thread Blackbird

Hi, I have a page with several validation constraints : Required,
NumberValidator.minimum(...), ... and a FeedBackPanel to display
corresponding error messages.
When not overriding the default submission method, the validation works
perfectly and the error messages are displayed upon submission on the
FeedBackPanel.

The issue is that I have to call a custom business code when the form is
submitted, and then redirect to another page. So I overrid the onSubmit()
method like this :

Button uploadButton = new Button("uploadButton") {
private static final long serialVersionUID = 1L;

@Override
public void onSubmit() {
// The business code call

setResponsePage(ThePageAfterSubmission.class);
}
}.setDefaultFormProcessing(false);

The problem is that now the form doesn't go through validation anymore.
What's the solution?
-- 
View this message in context: 
http://www.nabble.com/Form-validation-when-using-custom-onSubmit%28%29-tp17315177p17315177.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: Account Activation Email generation and response processing: any design example?

2008-05-19 Thread Sam Stainsby
You must be either storing the hash, or the data that you are hashing to 
regenerate the hash.

On Mon, 19 May 2008 08:40:36 +0300, Martin Makundi wrote:

> If you use hash you do not need to store the "random" part into the db.
> Saves you some persistence trouble.
> 
> 2008/5/19 Michael Allan <[EMAIL PROTECTED]>:
>> Sam Stainsby wrote:
>>>
>>> Martin Makundi wrote:
>>> > The benefit in digest is that the user (or another user) cannot
>>> > fabricate it... so easily.
>>>
>>> Just send a large random number ... no need for expensive hash
>>> operations.
>>
>> But use java.security.SecureRandom, not java.util.Random.
>>
>> --
>> Michael Allan
>>
>> Toronto, 647-436-4521
>> http://zelea.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]



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



Re: Thread safety for components

2008-05-19 Thread Johan Compagner
yes in a clustered environment you have multiply instances of the
Application
because there are more instances of the WicketServlet.
And Application/Servlet context stuff are not replicated

johan


On Mon, May 19, 2008 at 3:41 AM, Michael Allan <[EMAIL PROTECTED]> wrote:

> Brill Pappin wrote:
> > > ...  So non-Wicket threads cannot generally access pages,
> > > components, models, and so forth - not safely.  True?
> > >
> >  I was trying to think of a use-case for that problem... Do you have a
> > specific use-case or is that just a potential issue you can think of?
>
> I'm thinking generally of state changes that occur in separate
> processes, changes that need to be presented in Web views.
> Specifically, I have a Web page that shows recent user activity, in a
> list view, where each element is a user activity event.  Not all of my
> users are Web users, so the underlying list model is receiving events
> from other processes (mailer daemon, and so forth).
>
> Johan Compagner wrote:
> > Accessing pages in other threads then the request thread is very bad
> idea.
> > Because http session object shouldnt be touched between requests, you
> > have no idea what the container does with your page/session. Store it
> > on disc, replicate it to other nodes.
>
> Of course, now I understand...  I was forgetting that instances of
> these things - pages, components and models - are apt to be serialized
> out of memory.  Non-Wicket threads can't even hold a reference to
> them.  So there's no point in exposing the page lock for other threads
> (as I suggested).
>
> > If you want to do stuff in background threads then let page/request
> > threads poll them if they are finished.
>
> Then the underlying list model (in my example, above) does not belong
> in the page; instead it belongs in the Application instance.  There it
> can safely register with other threads, and receive events from them,
> because the app will never be serialized out of memory.  And the list
> view (in the page) can hook up with the model (in the app), at request
> time, with appropriate synchronization - polling it, as you say.
>
> My only other question, then, is the app life cycle.  (This article
> doesn't really answer my Q:
>
>  http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html
>
> In a clustered environment, are there multiple instances of the app?
> Might the page (the one with the list view, for example) find itself
> connecting to a different instance of the app, a different instance of
> the list model, from request to request?
>
> In a non-clustered environment, can I safely assume a single instance
> of the app, at any given time?
>
> --
> Michael Allan
>
> Toronto, 647-436-4521
> http://zelea.com/
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Page pooling (for stateless pages)

2008-05-19 Thread Joel Halbert
In our use case all the pages are stateless, but they are by no means 
static. We have in fact designed the entire site to use stateless pages, 
again for scalability; but every single page is also dynamic. I would like 
to produce and share some metrics from the JVM around object allocation and 
collection for a wicket application that is under sustained load using 
JMeter, and will do so as and when these become available. If anyone has any 
concise testing strategies along these lines please share them


Joel

--
From: "Eelco Hillenius" <[EMAIL PROTECTED]>
Sent: Monday, May 19, 2008 7:18 AM
To: 
Subject: Re: Page pooling (for stateless pages)


On Sun, May 18, 2008 at 11:04 PM, James Carman
<[EMAIL PROTECTED]> wrote:

stateless != static, though

If you cache the results of a stateless page, you could show stale
information from the database, correct?


True, so it depends on your use case. And obviously it wouldn't work
for form processing either. But for - say - a catalogue site where
hourly updates are good enough (in which case you would invalidate the
cache every hour), it might be an option.

Eelco

-
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: State of 1.4-m1

2008-05-19 Thread Johan Compagner
M2 will be there anyday now.
I guess that M3 will follow M2 in about 3,4 weeks and hopefully we can
release 1.4 a few short weeks (2) after that.

On 5/19/08, Ned Collyer <[EMAIL PROTECTED]> wrote:
>
> I'm just curious as to an approximate release schedule for 1.4 getting out
> of
> its milestone release.
>
> Rough estimate - 1, 3, 6, 12 months type of thing so I can plan for the
> upgrade.
>
> Rgds
>
> Ned
> --
> View this message in context:
> http://www.nabble.com/State-of-1.4-m1-tp17312118p17312118.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]