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/02/08 01:09:07 UTC

[jira] Closed: (TAPESTRY-1998) Loop is not stateful

     [ https://issues.apache.org/jira/browse/TAPESTRY-1998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1998.
------------------------------------------

       Resolution: Invalid
    Fix Version/s:     (was: 5.0.10)
         Assignee: Howard M. Lewis Ship

The TextField component is doing exactly what it should be doing here ... it is reading and updating the currentObject property.  The fact that your code doesn't do anything with the update value is an aspect of your application.

In the real world, you would be pulling complex entity objects from a database and editting properties of those entities.  As long as you persist changes to your external store (database), then you'll get the behavior you expect.

> Loop is not stateful
> --------------------
>
>                 Key: TAPESTRY-1998
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1998
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.8
>         Environment: MaxOSX 10.5 / Java 1.5 / Jetty 5.1
>            Reporter: Eric BIANCHI
>            Assignee: Howard M. Lewis Ship
>
> Using some Cayenne Objects, Loop is not stateful even with the parameter volatile set to false.
> If you put a textfield inside a loop, value is not persistent.
> <t:loop source="objects" value="currentObject">
>   <t:textfield value="currentObject"/> <br />
> </t:loop>
> -- 
> @Persist
> private List<String> _objects;
> 	
> private String _currentObject;
> 	
>   public List<String> getObjects() {
>     if (_objects == null) {
> 	        
> 	        System.out.println ("NEW LIST OF OBJECTS CREATED");
> 	        
> 	        _objects = new ArrayList<String>();
> 	        
> 	        _objects.add("foo");
> 	        _objects.add("bar");
> 	    }
> 	    
> 	    return _objects;
> 	}
> 	
>    public String getCurrentObject() {
>         return this._currentObject;
>     }
>     public void setCurrentObject(String currentObject) {
>         this._currentObject = currentObject;
>     }
>     public void setObjects(List<String> objects) {
>         this._objects = objects;
>     }
> --
> when submitted with foo2 and bar2
> System.out.println ("_objects : " + _objects); gives _objects : [foo, bar]

-- 
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