many thanks jiju,

I've opted for:

@InjectState("user-data")
public abstract UserData getUserData ();

rather than the misused @InjectStateFlag, and followed your suggestion.
Cinzia


jiju wrote:
please read the doc about @InjectState...
if the user-data instance is not present in session scope,
tapestry will create a new instance ,when you access it during the first
time,

i think u can set some data in user-data object(may be using some different
constructor) from login component, inorder to identify that the
instance is created from login component



Cinzia-2 wrote:

Hi,

I'm (new to tapestry) using tapestry 4.0.2 and JBoss 4.0.5, and having
problems with @InjectStateFlag.

I have an Application Object "user-data" which contains a "user" among
other
objects (specified in hivemodule), this is used in a BaseComponent
(login),
and its state flag accessed in the pageValidate( PageEvent event ) method
of
"private page":

<!-- hivemodule.xml -->
<contribution configuration-id="tapestry.state.ApplicationObjects">
  <state-object name="user-data" scope="session">
    <create-instance class="com.cs.web.tapestry.domain.UserData"/>
  </state-object>

<!-- login component -->
@InjectState("user-data")
 public abstract UserData getUserData();
 public abstract void setUserData( UserData ud );

<!-- private page -->
@InjectStateFlag("user-data")
 public abstract boolean getUserDataExists();

I know that if I use the following, the test getUserData().getUser() will
return the correct value (e.g. null if not logged in), yet why is
getUserData() already instantiated:
@InjectState("user-data")
 public abstract UserData getUserData ();

Thanks
Cinzia


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




--
View this message in context: http://www.nabble.com/%40InjectStateFlag-always-returns-true-tf3172367.html#a8800579
Sent from the Tapestry - 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]

Reply via email to