You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/01/03 21:18:34 UTC

[jira] Commented: (TAPESTRY-1991) It should be easy to initialize an ASO to null

    [ https://issues.apache.org/jira/browse/TAPESTRY-1991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555666#action_12555666 ] 

Howard M. Lewis Ship commented on TAPESTRY-1991:
------------------------------------------------

If you want to avoid creating it, you can use the exists flag.  For example:

@ApplicationState
private MyState _myState;

private boolean _myStateExists;

public MyState getState()
{
  return _myStateExists ? _myState : null;
}

Thus, you can easily avoid creating the MyState ASO.

> It should be easy to initialize an ASO to null
> ----------------------------------------------
>
>                 Key: TAPESTRY-1991
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1991
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 5.0.6
>            Reporter: Hugo Palma
>            Priority: Minor
>
> By default an ASO is never null. It's automatically created using the ASO class default constructor.
> It's many times needed to have the null value in an ASO, for example if i want to keep the logged in user in an ASO.
> Right now we can do this by contributing a new ApplicationStateCreator to the ApplicationStateManager but it seems to me that should be as easy as providing a parameter to the @ApplicationState indicating that you don't want it to be automatically initialized.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org