Re: [Wicket-user] noob question about wicket

2007-06-18 Thread Eelco Hillenius
Just tested it and found an entry on their mailing list. In maven 2,
at least the current version mvn eclipse:eclipse tries to download
sources and javadocs automatically.

Eelco


On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
 I'm guessing it includes the source jars if they are in your local
 repository, but doesn't download them unless you provide the extra
 argument. Anyway, to be sure, you can provide the argument.

 Eelco

 On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
  On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
   no, you probably edited your mvn launch script and added it there?
 
  Haha, that would be funny. No, of course I didn't.
 
  Eelco
 


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-18 Thread Martijn Dashorst
If you look at the settings for the eclipse project in our parent
pom.xml you will see a setting that is responsible for downloading the
sources:

plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-eclipse-plugin/artifactId
version2.3/version
configuration
downloadSourcestrue/downloadSources
/configuration
/plugin

Martijn

On 6/18/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Just tested it and found an entry on their mailing list. In maven 2,
 at least the current version mvn eclipse:eclipse tries to download
 sources and javadocs automatically.

 Eelco


 On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
  I'm guessing it includes the source jars if they are in your local
  repository, but doesn't download them unless you provide the extra
  argument. Anyway, to be sure, you can provide the argument.
 
  Eelco
 
  On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
   On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
no, you probably edited your mvn launch script and added it there?
  
   Haha, that would be funny. No, of course I didn't.
  
   Eelco
  
 

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-- 
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-18 Thread Eelco Hillenius
Yeah, you're right. I just found a similar entry in our pom. Gawd, why
don't they just do that automatically.

Eelco

On 6/17/07, Martijn Dashorst [EMAIL PROTECTED] wrote:
 If you look at the settings for the eclipse project in our parent
 pom.xml you will see a setting that is responsible for downloading the
 sources:

 plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-eclipse-plugin/artifactId
 version2.3/version
 configuration
 downloadSourcestrue/downloadSources
 /configuration
 /plugin

 Martijn

 On 6/18/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
  Just tested it and found an entry on their mailing list. In maven 2,
  at least the current version mvn eclipse:eclipse tries to download
  sources and javadocs automatically.
 
  Eelco
 
 
  On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
   I'm guessing it includes the source jars if they are in your local
   repository, but doesn't download them unless you provide the extra
   argument. Anyway, to be sure, you can provide the argument.
  
   Eelco
  
   On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 no, you probably edited your mvn launch script and added it there?
   
Haha, that would be funny. No, of course I didn't.
   
Eelco
   
  
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 --
 Join the wicket community at irc.freenode.net: ##wicket
 Wicket 1.2.6 contains a very important fix. Download Wicket now!
 http://wicketframework.org

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-18 Thread Eelco Hillenius
 Yeah, you're right. I just found a similar entry in our pom. Gawd, why
 don't they just do that automatically.

 our == Teachscape

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread verbal evasion

the code i'm writing basically just resulted from my playing with the
examples giving in the Pro Wicket book i got. then i wanted to write a basic
site to play with things i can do. this is not anything that i've
designed. just seeing what wicket is capable of.

also, am i missing something? i do not see isTemporary or bind methods in
Session or WebSession.

thanks,

verbal

On 6/13/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


 the default behavior is for a session to be temporary? that doesnt make
 sense.

It is Wicket trying to be as efficient as possible. I understand the
confusion, but think of it: you would typically only want a persistent
session when you actually do something with it (like setting the
user).

An easy solutation in your case would be to call #bind in your custom
session's constructor. Can you try that and let us know whether that
helped?

 this maybe another reason. i have my login code (basically everything
you've
 seen) in an abstract BasePage class. I then call Index which extends
 BasePage. would that have anything to do with anything?

I don't know. Why did you decide to put that loging code in that base
class? Did you take a look at the wicket-auth-roles project (an
example of how you can do authorization in a nicer way than e.g. the
library example does it)?

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Johan Compagner

when you do this:

   CSSession session = (CSSession) getSession();

   session.setUser(loggedInUser);

then that method:

CSSession.setUser(User)
{
  this.user = user;
  dirty();  You have to do this here!
}

if you alter your session data you have to call dirty
Then you session wil be stored.

johan


On 6/14/07, verbal evasion [EMAIL PROTECTED] wrote:


yeah i got it to work. it wasnt the code, it was some maven weirdness that
was going on. i have a few more questions. currently, when i login, my
authentication mechanism tells me that i have successfully logged in, but it
seems like the session information is not stored?? i have a print in my
isVisible checks and it always says that the user variable is null. i may be
returning the incorrect ResponsePage?

// in constructor
WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut) {
public boolean isVisible() {
boolean rv;
rv = ((CSSession) getSession()).getUser() == null;
System.out.println(loggedOut - isVisible?  + rv);
return rv;
}
};
...
WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn) {
public boolean isVisible() {
boolean rv;
rv = ((CSSession) getSession()).getUser() != null;
System.out.println(loggedIn - isVisible?  + rv);

return rv;
}
};
// In submit form
public void onSubmit() {
String userId = getUserId();
String password = getPassword();

User loggedInUser = null;

try {
loggedInUser = UserImpl.authenticate(userId, password);
// Components can access the Session through getSession()
CSSession session = (CSSession) getSession();

session.setUser(loggedInUser);
System.out.println(Logged in as  + userId);
logger.debug(Logged in as  + userId);
//session.get().info(Logged in as  + userId);

//Index indexPage = new Index(userId, BasePage.this);
//setResponsePage(indexPage);
setResponsePage(new Index());
} catch (AuthenticationException ae) {
String errMsg = getLocalizer().getString(
login.errors.invalidCredentials , this);
// Register this message with the form component.
error(errMsg);
}
}

when i keep logging in, it'll say the following:

20:06:14,806 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,806 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,811 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,811 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,813 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,816 INFO  [STDOUT] loggedIn - isVisible? false

this is for *one* successful login attempt. why is the constructor run so
many times?  also, the output is wrong. what should i be returning as the
setResponsePage from the onSubmit?

thanks,

verbal




On 6/13/07, Igor Vaynberg [EMAIL PROTECTED] wrote:

 the form is added to loggedout container, also notice that the form tag
 is inside a div wicket:id=loggedout so it matches the java hierarchy.

 -igor


 On 6/13/07, verbal evasion  [EMAIL PROTECTED] wrote:
 
  i tried implementing what you had put and i am stuck because
  loggedin and form are both in the highest scope of the websitem but in
  the java code, you have the form added to the loggedin
  WeMarkupContainer. that doesnt seem to fly with wicket unless i'm doing
  something wrong. i tried to take out the html for the login form, but that
  just doesnt make sense because there will be no corresponding html to
  describe what should be in the webcontainer.
 
  this is my code snippet. thanks in advance.
 
  /*
   * loggedOut - username and password
   */
  WebMarkupContainer loggedOut = new
  WebMarkupContainer(loggedOut) {
  public boolean isVisible() {
  return ((CSSession) getSession()).getUser() == null;
  }
  };
  TextField userIdField = new TextField(userId,
  new PropertyModel(this, userId));
  PasswordTextField passField = new
  PasswordTextField(password,
  new PropertyModel(this, password));
  Form form = new LoginForm(loginForm);
 
  add(loggedOut);
  loggedOut.add(form);
  form.add(userIdField);
  form.add(passField);
 
  /*
   * loggedIn - username
   

Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Thies Edeling
Also in 1.3? Yesterday I noticed that a Calendar which I retrieved from 
the session and modified afterwards was updated in the session as well.


Thies

Johan Compagner wrote:

when you do this:

CSSession session = (CSSession) getSession();
   
session.setUser(loggedInUser);


then that method:

CSSession.setUser(User)
{
   this.user = user;
   dirty();  You have to do this here!
}

if you alter your session data you have to call dirty
Then you session wil be stored.

johan


On 6/14/07, *verbal evasion* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


yeah i got it to work. it wasnt the code, it was some maven
weirdness that was going on. i have a few more questions.
currently, when i login, my authentication mechanism tells me that
i have successfully logged in, but it seems like the session
information is not stored?? i have a print in my isVisible checks
and it always says that the user variable is null. i may be
returning the incorrect ResponsePage?

// in constructor
WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut) {
public boolean isVisible() {
boolean rv;
rv = ((CSSession) getSession()).getUser() == null;
System.out.println(loggedOut - isVisible?  + rv);
return rv;
}
};   
...

WebMarkupContainer loggedIn = new
WebMarkupContainer(loggedIn) {
public boolean isVisible() {
boolean rv;   
rv = ((CSSession) getSession()).getUser() != null;

System.out.println(loggedIn - isVisible?  +
rv);   
return rv;

}
};
// In submit form
public void onSubmit() {
String userId = getUserId();
String password = getPassword();
   
User loggedInUser = null;
   
try {   
loggedInUser = UserImpl.authenticate(userId,

password);
// Components can access the Session through
getSession()
CSSession session = (CSSession) getSession();   
   
session.setUser(loggedInUser);

System.out.println(Logged in as  + userId);
logger.debug(Logged in as  + userId);
//session.get().info(Logged in as  + userId);   
   
//Index indexPage = new Index(userId, BasePage.this);
//setResponsePage(indexPage);   
setResponsePage(new Index());

} catch (AuthenticationException ae) {
String errMsg = getLocalizer().getString(
login.errors.invalidCredentials , this);
// Register this message with the form component.
error(errMsg);
}
}

when i keep logging in, it'll say the following:

20:06:14,806 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,806 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,811 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,811 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,813 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,816 INFO  [STDOUT] loggedIn - isVisible? false

this is for *one* successful login attempt. why is the constructor
run so many times?  also, the output is wrong. what should i be
returning as the setResponsePage from the onSubmit?

thanks,

verbal





On 6/13/07, *Igor Vaynberg*  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:

the form is added to loggedout container, also notice that the
form tag is inside a div wicket:id=loggedout so it matches
the java hierarchy.

-igor



On 6/13/07, * verbal evasion*  [send email to
[EMAIL PROTECTED] via gmail] [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:

i tried implementing what you had put and i am stuck
because loggedin and form are both in the highest
scope of the websitem but in the java code, you have the
form added to the loggedin WeMarkupContainer. that
doesnt seem to fly with wicket unless i'm doing something
wrong. i tried to take out the html for the login form,
but that just doesnt make sense because there will be no
 

Re: [Wicket-user] noob question about wicket

2007-06-14 Thread verbal evasion

i put in the dirty(), but it still doesnt work. i think i'm going to do more
research and look for code examples. the one i followed in Pro Wicket doesnt
seem to be working. if there are any more complete examples and
documentation, please point me to them. i have found the documentation
available at the wicket site disappointing. it might also be just because
i'm not finding the answer to my problem. i just keep looking for examples
of people doing what i'm trying to do and all their code looks like mine. so
i dunno. i'll keep working at it and let everyone know what my mistake was.

thanks,

verbal

On 6/14/07, Johan Compagner [EMAIL PROTECTED] wrote:


when you do this:

CSSession session = (CSSession) getSession();

session.setUser(loggedInUser);

then that method:

CSSession.setUser(User)
{
   this.user = user;
   dirty();  You have to do this here!
}

if you alter your session data you have to call dirty
Then you session wil be stored.

johan


On 6/14/07, verbal evasion [EMAIL PROTECTED] wrote:

 yeah i got it to work. it wasnt the code, it was some maven weirdness
 that was going on. i have a few more questions. currently, when i login, my
 authentication mechanism tells me that i have successfully logged in, but it
 seems like the session information is not stored?? i have a print in my
 isVisible checks and it always says that the user variable is null. i may be
 returning the incorrect ResponsePage?

 // in constructor
 WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut) {
 public boolean isVisible() {
 boolean rv;
 rv = ((CSSession) getSession()).getUser() == null;
 System.out.println(loggedOut - isVisible?  + rv);
 return rv;
 }
 };
 ...
 WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn) {
 public boolean isVisible() {
 boolean rv;
 rv = ((CSSession) getSession()).getUser() != null;
 System.out.println(loggedIn - isVisible?  + rv);

 return rv;
 }
 };
 // In submit form
 public void onSubmit() {
 String userId = getUserId();
 String password = getPassword();

 User loggedInUser = null;

 try {
 loggedInUser = UserImpl.authenticate(userId, password);
 // Components can access the Session through
 getSession()
 CSSession session = (CSSession) getSession();

 session.setUser(loggedInUser);
 System.out.println(Logged in as  + userId);
 logger.debug(Logged in as  + userId);
 //session.get().info(Logged in as  + userId);

 //Index indexPage = new Index(userId, BasePage.this);
 //setResponsePage(indexPage);
 setResponsePage(new Index());
 } catch (AuthenticationException ae) {
 String errMsg = getLocalizer().getString(
 login.errors.invalidCredentials , this);
 // Register this message with the form component.
 error(errMsg);
 }
 }

 when i keep logging in, it'll say the following:

 20:06:14,806 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,806 INFO  [STDOUT] loggedIn - isVisible? false
 20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,811 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,811 INFO  [STDOUT] loggedIn - isVisible? false
 20:06:14,813 INFO  [STDOUT] loggedIn - isVisible? false
 20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,816 INFO  [STDOUT] loggedIn - isVisible? false

 this is for *one* successful login attempt. why is the constructor run
 so many times?  also, the output is wrong. what should i be returning as the
 setResponsePage from the onSubmit?

 thanks,

 verbal




 On 6/13/07, Igor Vaynberg  [EMAIL PROTECTED] wrote:
 
  the form is added to loggedout container, also notice that the form
  tag is inside a div wicket:id=loggedout so it matches the java hierarchy.
 
  -igor
 
 
  On 6/13/07, verbal evasion  [EMAIL PROTECTED] wrote:
  
   i tried implementing what you had put and i am stuck because
   loggedin and form are both in the highest scope of the websitem but in
   the java code, you have the form added to the loggedin
   WeMarkupContainer. that doesnt seem to fly with wicket unless i'm doing
   something wrong. i tried to take out the html for the login form, but that
   just doesnt make sense because there will be no corresponding html to
   describe what should be in the webcontainer.
  
   this is my code snippet. thanks in advance.
  

Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Eelco Hillenius
On 6/13/07, verbal evasion [EMAIL PROTECTED] wrote:
 the code i'm writing basically just resulted from my playing with the
 examples giving in the Pro Wicket book i got. then i wanted to write a basic
 site to play with things i can do. this is not anything that i've
 designed. just seeing what wicket is capable of.

 also, am i missing something? i do not see isTemporary or bind methods in
 Session or WebSession.

Oh, sorry, you are using Wicket 1.2 then, right? That facility wasn't
build in 1.2 yet, so it's completely irrevant here :) Your sessions
will be created automatically.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Timo Rantalaiho
On Wed, 13 Jun 2007, Eelco Hillenius wrote:
 debugging mode ;) And while you're at it, be sure to attach the Wicket
 sources to your project dependencies, so that you can step into the
 Wicket code as well. This may be a bit intimidating at the start, but
 it's a great way to learn about the framework and I hope coding in
 general :)

Attaching sources to the IDE should be a standard way of 
working with any open source code (or any software that 
you have sources of). Fortunately it's nowadays pretty easy 
with maven IDE integration.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Matej Knopp

On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


Actually the dirty bit is only relevant when you use session replication
using a 'standard' clustering technology (e.g. like Tomcat provides). If
the dirty bit is set, Wicket will explicitly set an attribute on the
session, which will typically trigger the object to be sent over the wire.

What we currently don't do, but what we should - maybe - is trigger a
session bind when the dirty bit is set. We'll have to trace carefully that
we don't create sessions too soon again then, but I think this is a good
idea.



Actually i believe this is already true for 1.3. Unless someone broke it
again :)

-Matej


Johan/ others, wdyt?


Eelco

On 6/14/07, Thies Edeling [EMAIL PROTECTED] wrote:

  Also in 1.3? Yesterday I noticed that a Calendar which I retrieved from
 the session and modified afterwards was updated in the session as well.

 Thies

 Johan Compagner wrote:

 when you do this:

 CSSession session = (CSSession) getSession();

 session.setUser(loggedInUser);

 then that method:

 CSSession.setUser(User)
 {
this.user = user;
dirty();  You have to do this here!
 }

 if you alter your session data you have to call dirty
 Then you session wil be stored.

 johan


 On 6/14/07, verbal evasion [EMAIL PROTECTED]  wrote:
 
  yeah i got it to work. it wasnt the code, it was some maven weirdness
  that was going on. i have a few more questions. currently, when i login, my
  authentication mechanism tells me that i have successfully logged in, but it
  seems like the session information is not stored?? i have a print in my
  isVisible checks and it always says that the user variable is null. i may be
  returning the incorrect ResponsePage?
 
  // in constructor
  WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut) {
  public boolean isVisible() {
  boolean rv;
  rv = ((CSSession) getSession()).getUser() == null;
  System.out.println(loggedOut - isVisible?  + rv);
  return rv;
  }
  };
  ...
  WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn) {
 
  public boolean isVisible() {
  boolean rv;
  rv = ((CSSession) getSession()).getUser() != null;
  System.out.println(loggedIn - isVisible?  + rv);
 
  return rv;
  }
  };
  // In submit form
  public void onSubmit() {
  String userId = getUserId();
  String password = getPassword();
 
  User loggedInUser = null;
 
  try {
  loggedInUser = UserImpl.authenticate(userId,
  password);
  // Components can access the Session through
  getSession()
  CSSession session = (CSSession) getSession();
 
  session.setUser(loggedInUser);
  System.out.println(Logged in as  + userId);
  logger.debug(Logged in as  + userId);
  //session.get().info(Logged in as  + userId);
 
  //Index indexPage = new Index(userId, BasePage.this);
  //setResponsePage(indexPage);
  setResponsePage(new Index());
  } catch (AuthenticationException ae) {
  String errMsg = getLocalizer().getString(
  login.errors.invalidCredentials , this);
  // Register this message with the form component.
  error(errMsg);
  }
  }
 
  when i keep logging in, it'll say the following:
 
  20:06:14,806 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,806 INFO  [STDOUT] loggedIn - isVisible? false
  20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,811 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,811 INFO  [STDOUT] loggedIn - isVisible? false
  20:06:14,813 INFO  [STDOUT] loggedIn - isVisible? false
  20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
  20:06:14,816 INFO  [STDOUT] loggedIn - isVisible? false
 
  this is for *one* successful login attempt. why is the constructor run
  so many times?  also, the output is wrong. what should i be returning as the
  setResponsePage from the onSubmit?
 
  thanks,
 
  verbal
 
 
 
 
  On 6/13/07, Igor Vaynberg  [EMAIL PROTECTED] wrote:
  
   the form is added to loggedout container, also notice that the form
   tag is inside a div wicket:id=loggedout so it matches the java 
hierarchy.
  
   -igor
  
  
   On 6/13/07, verbal evasion  [EMAIL PROTECTED] wrote:
   
i tried implementing what you had put and i am stuck because
loggedin and form are both in the highest scope of the websitem but 
in
the 

Re: [Wicket-user] noob question about wicket

2007-06-14 Thread verbal evasion

are you talking about the maven2 eclispe plugin? i am using maven1 right now
so there isnt a good plugin for it. i'm working on moving to maven2, but
maven2 kinda makes me feel gross.

thanks,

verbal

On 6/14/07, Timo Rantalaiho [EMAIL PROTECTED] wrote:


On Wed, 13 Jun 2007, Eelco Hillenius wrote:
 debugging mode ;) And while you're at it, be sure to attach the Wicket
 sources to your project dependencies, so that you can step into the
 Wicket code as well. This may be a bit intimidating at the start, but
 it's a great way to learn about the framework and I hope coding in
 general :)

Attaching sources to the IDE should be a standard way of
working with any open source code (or any software that
you have sources of). Fortunately it's nowadays pretty easy
with maven IDE integration.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Eelco Hillenius
With maven 2 you can do 'mvn eclipse:eclipse' and your Eclipse project
will be generated including sources. Plugins for other IDEs probably
work similar.

Eelco

On 6/14/07, verbal evasion [EMAIL PROTECTED] wrote:
 are you talking about the maven2 eclispe plugin? i am using maven1 right now
 so there isnt a good plugin for it. i'm working on moving to maven2, but
 maven2 kinda makes me feel gross.

 thanks,

 verbal



 On 6/14/07, Timo Rantalaiho [EMAIL PROTECTED] wrote:
  On Wed, 13 Jun 2007, Eelco Hillenius wrote:
   debugging mode ;) And while you're at it, be sure to attach the Wicket
   sources to your project dependencies, so that you can step into the
   Wicket code as well. This may be a bit intimidating at the start, but
   it's a great way to learn about the framework and I hope coding in
   general :)
 
  Attaching sources to the IDE should be a standard way of
  working with any open source code (or any software that
  you have sources of). Fortunately it's nowadays pretty easy
  with maven IDE integration.
 
  - Timo
 
  --
  Timo Rantalaiho
  Reaktor Innovations OyURL: http://www.ri.fi/ 
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Igor Vaynberg

not quiete

mvn eclipse:eclipse -DdownloadSources=true

-igor


On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


With maven 2 you can do 'mvn eclipse:eclipse' and your Eclipse project
will be generated including sources. Plugins for other IDEs probably
work similar.

Eelco

On 6/14/07, verbal evasion [EMAIL PROTECTED] wrote:
 are you talking about the maven2 eclispe plugin? i am using maven1 right
now
 so there isnt a good plugin for it. i'm working on moving to maven2, but
 maven2 kinda makes me feel gross.

 thanks,

 verbal



 On 6/14/07, Timo Rantalaiho [EMAIL PROTECTED] wrote:
  On Wed, 13 Jun 2007, Eelco Hillenius wrote:
   debugging mode ;) And while you're at it, be sure to attach the
Wicket
   sources to your project dependencies, so that you can step into the
   Wicket code as well. This may be a bit intimidating at the start,
but
   it's a great way to learn about the framework and I hope coding in
   general :)
 
  Attaching sources to the IDE should be a standard way of
  working with any open source code (or any software that
  you have sources of). Fortunately it's nowadays pretty easy
  with maven IDE integration.
 
  - Timo
 
  --
  Timo Rantalaiho
  Reaktor Innovations OyURL: http://www.ri.fi/ 
 
 

-
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 



-
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Eelco Hillenius
On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 not quiete

 mvn eclipse:eclipse -DdownloadSources=true

I don't have to do that anymore. Just works for me. Maybe it remembers
previous source attachements or something.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Igor Vaynberg

no, you probably edited your mvn launch script and added it there?

-igor


On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 not quiete

 mvn eclipse:eclipse -DdownloadSources=true

I don't have to do that anymore. Just works for me. Maybe it remembers
previous source attachements or something.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Eelco Hillenius
On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 no, you probably edited your mvn launch script and added it there?

Haha, that would be funny. No, of course I didn't.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Eelco Hillenius
I'm guessing it includes the source jars if they are in your local
repository, but doesn't download them unless you provide the extra
argument. Anyway, to be sure, you can provide the argument.

Eelco

On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
 On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  no, you probably edited your mvn launch script and added it there?

 Haha, that would be funny. No, of course I didn't.

 Eelco


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Igor Vaynberg

right, thats it

-igor


On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


I'm guessing it includes the source jars if they are in your local
repository, but doesn't download them unless you provide the extra
argument. Anyway, to be sure, you can provide the argument.

Eelco

On 6/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
 On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  no, you probably edited your mvn launch script and added it there?

 Haha, that would be funny. No, of course I didn't.

 Eelco


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-14 Thread Timo Rantalaiho
On Thu, 14 Jun 2007, Eelco Hillenius wrote:
 On 6/14/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  not quiete
 
  mvn eclipse:eclipse -DdownloadSources=true
 
 I don't have to do that anymore. Just works for me. Maybe it remembers
 previous source attachements or something.

We put it in pom.xml in the Eclipse plugin settings. I 
think that you can even put it globally in settings.xml.

In the maven2 IDEA plugin (also) that feature is broken, but
I just download the sources with eclipse:eclipse then :/

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Eelco Hillenius
It's the org.apache.wicket.examples.template package in Wicket
examples. You can best just look at the code, but a live example is at
http://wicketstuff.org/wicket13/template/.

Eelco

On 6/13/07, verbal evasion [EMAIL PROTECTED] wrote:
 eelco,

 are these templates on the wicket page? or the wiki? i cant seem to locate
 them.

 thanks,

 verbal

 On 6/12/07, Eelco Hillenius  [EMAIL PROTECTED] wrote:
 
   html
   body
   div wicket:id=loggedinspan wicket:id=username/div
   div wicket:id=loggedoutform
   wicket:id=form.../form/div
   ...
  
   MyPage() {
 add(new WebMarkupContainer(loggedin, new
   PropertyModel(this,session.user.username)) {
  public boolean isvisible() { return
   ((MySession)getSession()).getUser()!=null; }
  }
  
 WebMarkupContainer loggedout=new WebMarkupContainer(loggedout) {
  public boolean isvisible() { return
   ((MySession)getSession()).getUser()==null; }
   }
add(loggedout);
loggedout.add(new Form(form)
 
 
  That's the first option. The advantage is that it is generally easier
  to see what you have on your page. The other option - like shown in
  the templates example - is a bit cheaper memory wise, as you only add
  what you need.
 
  Eelco
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread verbal evasion

i tried implementing what you had put and i am stuck because loggedin and
form are both in the highest scope of the websitem but in the java code,
you have the form added to the loggedin WeMarkupContainer. that doesnt
seem to fly with wicket unless i'm doing something wrong. i tried to take
out the html for the login form, but that just doesnt make sense because
there will be no corresponding html to describe what should be in the
webcontainer.

this is my code snippet. thanks in advance.

   /*
* loggedOut - username and password
*/
   WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut) {
   public boolean isVisible() {
   return ((CSSession) getSession()).getUser() == null;
   }
   };
   TextField userIdField = new TextField(userId,
   new PropertyModel(this, userId));
   PasswordTextField passField = new PasswordTextField(password,
   new PropertyModel(this, password));
   Form form = new LoginForm(loginForm);

   add(loggedOut);
   loggedOut.add(form);
   form.add(userIdField);
   form.add(passField);

   /*
* loggedIn - username
*/
   WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn) {
   public boolean isVisible() {
   return ((CSSession) getSession()).getUser() != null;
   }
   };
   Label userLabel = new Label(userLabel,
   new PropertyModel(this, userId));

   add(loggedIn);
   loggedIn.add(userLabel);

...

   div wicket:id=loggedIn
   span wicket:id=userLabel/span
   /div
   div wicket:id=loggedOut
   form wicket:id=loginForm
   User Nameinput type=text wicket:id=userId/br/
   Password input type=password
wicket:id=password/br/
   input type=submit value=Login/
   /form
   /div

On 6/12/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


 html
 body
 div wicket:id=loggedinspan wicket:id=username/div
 div wicket:id=loggedoutform
 wicket:id=form.../form/div
 ...

 MyPage() {
   add(new WebMarkupContainer(loggedin, new
 PropertyModel(this,session.user.username)) {
public boolean isvisible() { return
 ((MySession)getSession()).getUser()!=null; }
}

   WebMarkupContainer loggedout=new WebMarkupContainer(loggedout) {
public boolean isvisible() { return
 ((MySession)getSession()).getUser()==null; }
 }
  add(loggedout);
  loggedout.add(new Form(form)


That's the first option. The advantage is that it is generally easier
to see what you have on your page. The other option - like shown in
the templates example - is a bit cheaper memory wise, as you only add
what you need.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Igor Vaynberg

the form is added to loggedout container, also notice that the form tag is
inside a div wicket:id=loggedout so it matches the java hierarchy.

-igor


On 6/13/07, verbal evasion [EMAIL PROTECTED] wrote:


i tried implementing what you had put and i am stuck because loggedin
and form are both in the highest scope of the websitem but in the java
code, you have the form added to the loggedin WeMarkupContainer. that
doesnt seem to fly with wicket unless i'm doing something wrong. i tried to
take out the html for the login form, but that just doesnt make sense
because there will be no corresponding html to describe what should be in
the webcontainer.

this is my code snippet. thanks in advance.

/*
 * loggedOut - username and password
 */
WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut)
{
public boolean isVisible() {
return ((CSSession) getSession()).getUser() == null;
}
};
TextField userIdField = new TextField(userId,
new PropertyModel(this, userId));
PasswordTextField passField = new PasswordTextField(password,
new PropertyModel(this, password));
Form form = new LoginForm(loginForm);

add(loggedOut);
loggedOut.add(form);
form.add(userIdField);
form.add(passField);

/*
 * loggedIn - username
 */
WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn) {
public boolean isVisible() {
return ((CSSession) getSession()).getUser() != null;
}
};
Label userLabel = new Label(userLabel,
new PropertyModel(this, userId));

add(loggedIn);
loggedIn.add(userLabel);

...

div wicket:id=loggedIn
span wicket:id=userLabel/span
/div
div wicket:id=loggedOut
form wicket:id=loginForm
User Nameinput type=text wicket:id=userId/br/
Password input type=password
wicket:id=password/br/
input type=submit value=Login/
/form
/div

On 6/12/07, Eelco Hillenius [EMAIL PROTECTED] wrote:

  html
  body
  div wicket:id=loggedinspan wicket:id=username/div
  div wicket:id=loggedoutform
  wicket:id=form.../form/div
  ...
 
  MyPage() {
add(new WebMarkupContainer(loggedin, new
  PropertyModel(this,session.user.username)) {
 public boolean isvisible() { return
  ((MySession)getSession()).getUser()!=null; }
 }
 
WebMarkupContainer loggedout=new WebMarkupContainer(loggedout) {
 public boolean isvisible() { return
  ((MySession)getSession()).getUser()==null; }
  }
   add(loggedout);
   loggedout.add(new Form(form)


 That's the first option. The advantage is that it is generally easier
 to see what you have on your page. The other option - like shown in
 the templates example - is a bit cheaper memory wise, as you only add
 what you need.

 Eelco


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread verbal evasion

yeah i got it to work. it wasnt the code, it was some maven weirdness that
was going on. i have a few more questions. currently, when i login, my
authentication mechanism tells me that i have successfully logged in, but it
seems like the session information is not stored?? i have a print in my
isVisible checks and it always says that the user variable is null. i may be
returning the incorrect ResponsePage?

// in constructor
WebMarkupContainer loggedOut = new WebMarkupContainer(loggedOut) {
   public boolean isVisible() {
   boolean rv;
   rv = ((CSSession) getSession()).getUser() == null;
   System.out.println(loggedOut - isVisible?  + rv);
   return rv;
   }
   };
...
   WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn) {
   public boolean isVisible() {
   boolean rv;
   rv = ((CSSession) getSession()).getUser() != null;
   System.out.println(loggedIn - isVisible?  + rv);

   return rv;
   }
   };
// In submit form
   public void onSubmit() {
   String userId = getUserId();
   String password = getPassword();

   User loggedInUser = null;

   try {
   loggedInUser = UserImpl.authenticate(userId, password);
   // Components can access the Session through getSession()
   CSSession session = (CSSession) getSession();

   session.setUser(loggedInUser);
   System.out.println(Logged in as  + userId);
   logger.debug(Logged in as  + userId);
   //session.get().info(Logged in as  + userId);

   //Index indexPage = new Index(userId, BasePage.this);
   //setResponsePage(indexPage);
   setResponsePage(new Index());
   } catch (AuthenticationException ae) {
   String errMsg = getLocalizer().getString(
   login.errors.invalidCredentials, this);
   // Register this message with the form component.
   error(errMsg);
   }
   }

when i keep logging in, it'll say the following:

20:06:14,806 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,806 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,811 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,811 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,813 INFO  [STDOUT] loggedIn - isVisible? false
20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
20:06:14,816 INFO  [STDOUT] loggedIn - isVisible? false

this is for *one* successful login attempt. why is the constructor run so
many times?  also, the output is wrong. what should i be returning as the
setResponsePage from the onSubmit?

thanks,

verbal




On 6/13/07, Igor Vaynberg [EMAIL PROTECTED] wrote:


the form is added to loggedout container, also notice that the form tag is
inside a div wicket:id=loggedout so it matches the java hierarchy.

-igor


On 6/13/07, verbal evasion [EMAIL PROTECTED] wrote:

 i tried implementing what you had put and i am stuck because loggedin
 and form are both in the highest scope of the websitem but in the java
 code, you have the form added to the loggedin WeMarkupContainer. that
 doesnt seem to fly with wicket unless i'm doing something wrong. i tried to
 take out the html for the login form, but that just doesnt make sense
 because there will be no corresponding html to describe what should be in
 the webcontainer.

 this is my code snippet. thanks in advance.

 /*
  * loggedOut - username and password
  */
 WebMarkupContainer loggedOut = new
 WebMarkupContainer(loggedOut) {
 public boolean isVisible() {
 return ((CSSession) getSession()).getUser() == null;
 }
 };
 TextField userIdField = new TextField(userId,
 new PropertyModel(this, userId));
 PasswordTextField passField = new PasswordTextField(password,
 new PropertyModel(this, password));
 Form form = new LoginForm(loginForm);

 add(loggedOut);
 loggedOut.add(form);
 form.add(userIdField);
 form.add(passField);

 /*
  * loggedIn - username
  */
 WebMarkupContainer loggedIn = new WebMarkupContainer(loggedIn)
 {
 public boolean isVisible() {
 return ((CSSession) getSession()).getUser() != null;
 }
 };
 Label userLabel = new Label(userLabel,
 new PropertyModel(this, userId));

 add(loggedIn);
 loggedIn.add(userLabel);

 ...

 div wicket:id=loggedIn
 span wicket:id=userLabel/span

Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Timo Rantalaiho
On Wed, 13 Jun 2007, verbal evasion wrote:
 yeah i got it to work. it wasnt the code, it was some maven weirdness that
 was going on. i have a few more questions. currently, when i login, my
 authentication mechanism tells me that i have successfully logged in, but it
 seems like the session information is not stored?? i have a print in my
 isVisible checks and it always says that the user variable is null. i may be
 returning the incorrect ResponsePage?

Login should output some logging information, which wasn't 
shown in the output you posted. Are you sure it's being run?

Also you could log setting and getting the user in your 
Session.

 this is for *one* successful login attempt. why is the constructor run so
 many times?  also, the output is wrong. what should i be returning as the
 setResponsePage from the onSubmit?

It's not any constructor, they are the isVisible methods of
your loggedin / loggedout components. I too have noticed 
that isVisible() gets called several times per request, but
I suppose it has its reasons.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread verbal evasion

Timo,

Speaking of logging, I want to use log4j, but i cant because it doesnt
implement serializable. secondly,  session.get().info(message); doesnt
seem to print anything. i have to resort to System.out's. I made the logger
transient so that solved that problem, but it doesnt print anything to the
screen.

i have turned on debugging for wicket.Session in log4j, but all it prints is
information about pages being dirty or not.

any other debugging i can use or turn on?

thanks,

verbal

On 6/13/07, Timo Rantalaiho [EMAIL PROTECTED] wrote:


On Wed, 13 Jun 2007, verbal evasion wrote:
 yeah i got it to work. it wasnt the code, it was some maven weirdness
that
 was going on. i have a few more questions. currently, when i login, my
 authentication mechanism tells me that i have successfully logged in,
but it
 seems like the session information is not stored?? i have a print in my
 isVisible checks and it always says that the user variable is null. i
may be
 returning the incorrect ResponsePage?

Login should output some logging information, which wasn't
shown in the output you posted. Are you sure it's being run?

Also you could log setting and getting the user in your
Session.

 this is for *one* successful login attempt. why is the constructor run
so
 many times?  also, the output is wrong. what should i be returning as
the
 setResponsePage from the onSubmit?

It's not any constructor, they are the isVisible methods of
your loggedin / loggedout components. I too have noticed
that isVisible() gets called several times per request, but
I suppose it has its reasons.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Eelco Hillenius
 Speaking of logging, I want to use log4j, but i cant because it doesnt
 implement serializable.

Either make the log instance it a static variable (statics don't get
serialized) or get it on the fly (every time you need it but don't
keep a reference).

 secondly,  session.get().info(message); doesnt
 seem to print anything. i have to resort to System.out's. I made the logger
 transient so that solved that problem, but it doesnt print anything to the
 screen.

Session#info and Component#info (and #error etc) are for a different
purpose. We call those things feedback messages, and they are intended
for communicating with end-users, for instance reporting validation
errors on a form submit. If you put a FeedbackPanel in your page, you
will see those messages.

 i have turned on debugging for wicket.Session in log4j, but all it prints is
 information about pages being dirty or not.

 any other debugging i can use or turn on?

Not anything that will help you. Component#isVisible can indeed be
called more than once in a request; not only when it renders, but also
for instance when behaviors query it. I guess the documentation can
use some improvement (I added a warning).

It is possible that your page is stateless and your session is
temporary (meaning that it isn't bound to e.g. the HttpSession yet,
and that you'll get a new volatile instance every request). You can
query that by calling session#isTemporary. If it is, and you want to
explicitly make the session persistent, you can call session#bind. See
the JavaDocs for details.

Maybe we shouldn't automagically mark pages as stateless... but I'll
post about that in another thread.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Timo Rantalaiho
On Wed, 13 Jun 2007, verbal evasion wrote:
 i have turned on debugging for wicket.Session in log4j, but all it prints is
 information about pages being dirty or not.
 
 any other debugging i can use or turn on?

Be sure to turn on debugging also for your own code to get
log messages from there.

I also like using the debugger of the IDE sometimes, like
that you can easily see whether some method gets called and
what's the state of the components and variables run-time. 
It works best if you are running just a little code at a
time, e.g. a WicketTester test.

- Timo

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

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread verbal evasion

the default behavior is for a session to be temporary? that doesnt make
sense.

this maybe another reason. i have my login code (basically everything you've
seen) in an abstract BasePage class. I then call Index which extends
BasePage. would that have anything to do with anything?

thanks,

verbal

On 6/13/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


 Speaking of logging, I want to use log4j, but i cant because it doesnt
 implement serializable.

Either make the log instance it a static variable (statics don't get
serialized) or get it on the fly (every time you need it but don't
keep a reference).

 secondly,  session.get().info(message); doesnt
 seem to print anything. i have to resort to System.out's. I made the
logger
 transient so that solved that problem, but it doesnt print anything to
the
 screen.

Session#info and Component#info (and #error etc) are for a different
purpose. We call those things feedback messages, and they are intended
for communicating with end-users, for instance reporting validation
errors on a form submit. If you put a FeedbackPanel in your page, you
will see those messages.

 i have turned on debugging for wicket.Session in log4j, but all it
prints is
 information about pages being dirty or not.

 any other debugging i can use or turn on?

Not anything that will help you. Component#isVisible can indeed be
called more than once in a request; not only when it renders, but also
for instance when behaviors query it. I guess the documentation can
use some improvement (I added a warning).

It is possible that your page is stateless and your session is
temporary (meaning that it isn't bound to e.g. the HttpSession yet,
and that you'll get a new volatile instance every request). You can
query that by calling session#isTemporary. If it is, and you want to
explicitly make the session persistent, you can call session#bind. See
the JavaDocs for details.

Maybe we shouldn't automagically mark pages as stateless... but I'll
post about that in another thread.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Eelco Hillenius
 20:06:14,806 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,806 INFO  [STDOUT] loggedIn - isVisible? false
 20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,810 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,811 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,811 INFO  [STDOUT] loggedIn - isVisible? false
 20:06:14,813 INFO  [STDOUT] loggedIn - isVisible? false
 20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,814 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,815 INFO  [STDOUT] loggedOut - isVisible? true
 20:06:14,816 INFO  [STDOUT] loggedIn - isVisible? false

It is typically way more efficient to use a debugger if you want to
find out how/ when/ where/ why things happen. Here, rather than
putting in those log statements, you could just set a break point on
your isVisible implementation - and don't forget to start up in
debugging mode ;) And while you're at it, be sure to attach the Wicket
sources to your project dependencies, so that you can step into the
Wicket code as well. This may be a bit intimidating at the start, but
it's a great way to learn about the framework and I hope coding in
general :)

Cheers,

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-13 Thread Eelco Hillenius
 the default behavior is for a session to be temporary? that doesnt make
 sense.

It is Wicket trying to be as efficient as possible. I understand the
confusion, but think of it: you would typically only want a persistent
session when you actually do something with it (like setting the
user).

An easy solutation in your case would be to call #bind in your custom
session's constructor. Can you try that and let us know whether that
helped?

 this maybe another reason. i have my login code (basically everything you've
 seen) in an abstract BasePage class. I then call Index which extends
 BasePage. would that have anything to do with anything?

I don't know. Why did you decide to put that loging code in that base
class? Did you take a look at the wicket-auth-roles project (an
example of how you can do authorization in a nicer way than e.g. the
library example does it)?

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] noob question about wicket

2007-06-12 Thread verbal evasion

hello everyone,

this is my first post. i have been playing with wicket for a while, trying
to see if it will let me do everything i want it to. while a lot of things
in wicket look very attractive from a programmer-forced-to-do-website-stuff
perspective, i do have one big glaring question. the basic way to put
stuff on a website with wicket is to create something in the WebPage, add
it to the WebPage, then add an accompanying tag on the html file.

while that is great for dynamic content, the problem i have is what if i
dont want to show that content at all.

is there a way to conditionally show certain content depending on the java
portion? one example would be that i have a main page. it displays some
content and more importantly, a login box. i want to say if they are
already logged in, dont show the login box, but instead, show some text that
says the user is logged in. everything else on the page would be different.
one way i can do that is of course to create separate pages for it, but
there will be a lot of html or code duplication. it is theoretically
possible to do so by making your class hierarchy a certain way, but it didnt
seem natural to me. also, having this technique handy will be useful in the
future.

i tried to not add anything to the form, but since the html has no
conditionals, i have to add the superset of all the tags of content i want.
wicket does not like that.

please advise and sorry for the length of the email.

thanks,

verbal
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-12 Thread mchack

Very easy to do. There are many ways but an easy one is to have an html tag
such as div, that will correspond to either the login form or signed in text
and give it a wicket:id . During processing you would check to see if the
user is signed in. If not then you would add an appropriate object to the
page (corresponding to wicket:id)  such as a custom panel that would
correspond to a login form. If they are logged in you would add maybe
another custom object or panel that indicated some welcome message.

Mike


verbal evasion wrote:
 
 hello everyone,
 
 this is my first post. i have been playing with wicket for a while, trying
 to see if it will let me do everything i want it to. while a lot of things
 in wicket look very attractive from a
 programmer-forced-to-do-website-stuff
 perspective, i do have one big glaring question. the basic way to put
 stuff on a website with wicket is to create something in the WebPage, add
 it to the WebPage, then add an accompanying tag on the html file.
 
 while that is great for dynamic content, the problem i have is what if i
 dont want to show that content at all.
 
 is there a way to conditionally show certain content depending on the java
 portion? one example would be that i have a main page. it displays some
 content and more importantly, a login box. i want to say if they are
 already logged in, dont show the login box, but instead, show some text
 that
 says the user is logged in. everything else on the page would be
 different.
 one way i can do that is of course to create separate pages for it, but
 there will be a lot of html or code duplication. it is theoretically
 possible to do so by making your class hierarchy a certain way, but it
 didnt
 seem natural to me. also, having this technique handy will be useful in
 the
 future.
 
 i tried to not add anything to the form, but since the html has no
 conditionals, i have to add the superset of all the tags of content i
 want.
 wicket does not like that.
 
 please advise and sorry for the length of the email.
 
 thanks,
 
 verbal
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/noob-question-about-wicket-tf3910852.html#a11088839
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-12 Thread verbal evasion

thanks for the responses from eelco and mchack. i appreciate it. i guess
part of the problem is i dont understand enough html either :\. it seems
that you have implied you can put anything in a span tag (e.g. a form and a
label). i will look at the template more carefully. i bought the pro wicket
book and went through half of that, so hopefully when i'm done i will have
more advanced questions.

thanks again,

verbal

On 6/12/07, Eelco Hillenius [EMAIL PROTECTED] wrote:


 is there a way to conditionally show certain content depending on the
java
 portion? one example would be that i have a main page. it displays some
 content and more importantly, a login box. i want to say if they are
 already logged in, dont show the login box, but instead, show some text
that
 says the user is logged in. everything else on the page would be
different.
 one way i can do that is of course to create separate pages for it, but
 there will be a lot of html or code duplication. it is theoretically
 possible to do so by making your class hierarchy a certain way, but it
didnt
 seem natural to me. also, having this technique handy will be useful in
the
 future.

Basically the two different strategies you have is to either set the
visibility of components (or override isVisible) appropriately, or
build up the hierarchy dynamically. As an example of the latter, you
could have a are in your page you call top bar. When you construct the
page, you decide whether to add the top bar with the login panel, or
the top bar without (e.g. to show the panel that displays the logged
in user's name). The templates example in Wicket examples shows
something similar.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-12 Thread Igor Vaynberg

html
body
div wicket:id=loggedinspan wicket:id=username/div
div wicket:id=loggedoutform wicket:id=form.../form/div
...

MyPage() {
 add(new WebMarkupContainer(loggedin, new PropertyModel(this,
session.user.username)) {
  public boolean isvisible() { return
((MySession)getSession()).getUser()!=null; }
  }

 WebMarkupContainer loggedout=new WebMarkupContainer(loggedout) {
  public boolean isvisible() { return
((MySession)getSession()).getUser()==null; }
  }
add(loggedout);
loggedout.add(new Form(form)


-igor



On 6/12/07, verbal evasion [EMAIL PROTECTED] wrote:


thanks for the responses from eelco and mchack. i appreciate it. i guess
part of the problem is i dont understand enough html either :\. it seems
that you have implied you can put anything in a span tag (e.g. a form and
a label). i will look at the template more carefully. i bought the pro
wicket book and went through half of that, so hopefully when i'm done i will
have more advanced questions.

thanks again,

verbal

On 6/12/07, Eelco Hillenius [EMAIL PROTECTED] wrote:

  is there a way to conditionally show certain content depending on the
 java
  portion? one example would be that i have a main page. it displays
 some
  content and more importantly, a login box. i want to say if they are
  already logged in, dont show the login box, but instead, show some
 text that
  says the user is logged in. everything else on the page would be
 different.
  one way i can do that is of course to create separate pages for it,
 but
  there will be a lot of html or code duplication. it is theoretically
  possible to do so by making your class hierarchy a certain way, but it
 didnt
  seem natural to me. also, having this technique handy will be useful
 in the
  future.

 Basically the two different strategies you have is to either set the
 visibility of components (or override isVisible) appropriately, or
 build up the hierarchy dynamically. As an example of the latter, you
 could have a are in your page you call top bar. When you construct the
 page, you decide whether to add the top bar with the login panel, or
 the top bar without (e.g. to show the panel that displays the logged
 in user's name). The templates example in Wicket examples shows
 something similar.

 Eelco

 -

 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] noob question about wicket

2007-06-12 Thread Eelco Hillenius
 html
 body
 div wicket:id=loggedinspan wicket:id=username/div
 div wicket:id=loggedoutform
 wicket:id=form.../form/div
 ...

 MyPage() {
   add(new WebMarkupContainer(loggedin, new
 PropertyModel(this,session.user.username)) {
public boolean isvisible() { return
 ((MySession)getSession()).getUser()!=null; }
}

   WebMarkupContainer loggedout=new WebMarkupContainer(loggedout) {
public boolean isvisible() { return
 ((MySession)getSession()).getUser()==null; }
 }
  add(loggedout);
  loggedout.add(new Form(form)


That's the first option. The advantage is that it is generally easier
to see what you have on your page. The other option - like shown in
the templates example - is a bit cheaper memory wise, as you only add
what you need.

Eelco

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user