tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Lough (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2495) @Property tag with @Parameter used with Palette Component blanking "selected" parameter
Date Tue, 01 Jul 2008 00:12:45 GMT

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

Brian Lough commented on TAPESTRY-2495:
---------------------------------------

Okay.  Makes sense and matches my understanding, which is always up for adjustment, of Palette.

However, that does imply that the @Property annotation without the implicit setter/getters
should have worked -- is that correct?  If that's so, then passing in a collection as a component
parameter should equate to the code that was manually added in, but it does not.  Again, that's
an "implication", based on docs and available usage examples.

Given the behavior and this response, why would I [user] think of a .clone()?  If Palette
"uses the collection passed in", then why would we "clone" a collection?  Wouldn't it just
use the reference I supplied and do what it does?   And, again, if so, why wouldn't @Property
work?   Intuitively, to me, the code make sense in the working example -- I passed a collection
of known values, Palette may/may not have changed them, so I clear what the parent component
passed in and just add what Palette component believes represents the new collection collection:
".clone()", no offense, intuitively, doesn't make sense at all.





> @Property tag with @Parameter used with Palette Component blanking "selected" parameter
> ---------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2495
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2495
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.12
>         Environment: WindowsXP, Java 5.0.12,  tapestry 5.0.12-20080603-110024-79
>            Reporter: Brian Lough
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> Have a component AssignUsersToObject.[java/tml]
> Have an Add/Edit page ClientAddEdit.[java/tml] that has  a List property "selectedUsers",
which it uses to reference the above component, ala:
>         <t:assignUserToObject selected="selectedUsers"/>
> "selectedUsers" is a collection instantiated by the ClientAddEdit page with setters/getters
of:
> 	public List<User> getSelectedUsers() {
> 		return selectedUsers;
> 	}
> 	public void setSelectedUsers(List<User> selectedUsers) {
> 		this.selectedUsers.clear();
> 		this.selectedUsers.addAll(selectedUsers);		
> 	}
> In AssignUsersToObject component, there are two distinct behaviors, depending upon on
the "selected" property is defined:
> 1. (which always blanks or doesn't populated the "selected" collection")
>     @Property
>     @Parameter(required=true)
>     private List<User> selected;
> 2. (which populates the "selected" collection fine)
>     @Parameter(required=true)
>     private List<User> selected;
>    with manually created setters/getters of
> 	public List<User> getSelected() {
> 		return selected;
> 	}
> 	public void setSelected(List<User> selected) {
> 		log.debug("Selected: " + selected.size());
> 	}
> Seems @Property shouldn't make a difference, other than less typing.

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


Mime
View raw message