I think I might have an idea why the iterator or display tag do not
allow for working with collection items.

In the past I used form tags (like select) to prompt the user to make
a selection from a menu, my thought is that since I was using form
tags, by submitting the form, the property (item from the collection)
is passed to the valuestack and the action can work with it.

But an iterator or a display tag do not necessarily put properties on
the valuestack. Is this correct? I was wondering if I could use a set,
or push tag to either store the property to the scope or put it on the
top of the valuestack that way? Would you say this is a valid
strategy?

This has been troubling me for a few days, so I hope it is alright to
post my new thought on this. Thank you for any new input.

On Sun, Jul 12, 2009 at 5:16 PM, Dimitrios
Christodoulakis<dimi....@gmail.com> wrote:
> Thanks Dave,
>
> Yes, the <s:property.../> isn't supposed to be there....  Thanks for
> pointing this out. Indeed, it has to be an object there, in order to
> do the remove from the collection. Since this value-type component
> (entry) does not have a primary key to look it up from, I am a bit at
> a loss how to continue from here.
>
> If you don't mind, could you explain a little bit further? I have
> successfully removed entity object from collections before because all
> I neede was the primary key to be passed to the delete action. Then
> inside the action I did the look up using the key and removed the
> object. But with this type of object I have hit a roadblock.
>
> I appreciate any further help.
>
>
> This is the class:
>
> @Embeddable
> public class JournalEntry {
>
>       �...@org.hibernate.annotations.parent
>        private GoalToAchieve goalToAchieve;
>
>       �...@column(length = 255, nullable = false)
>        private String entry;
>
>       �...@temporal(TemporalType.TIMESTAMP)
>       �...@column(nullable = false, updatable = false)
>        private Date insertDate = new Date();
>
>
> ....plus the appropriate getters and setters..
>
> On Sun, Jul 12, 2009 at 5:03 PM, Dave Newton<newton.d...@yahoo.com> wrote:
>> Dimitrios Christodoulakis wrote:
>>>
>>> I tried adding one more column like this, hoping the entry property
>>> will be available to the DeleteEntry action via the mini-form.
>>>
>>> <display:column>
>>> <s:form action="DeleteEntry">
>>>    <s:property value="entry"/>
>>>    <s:hidden name="id" value="%{goalToAchieve.id}" />
>>>   <s:submit value="Remove"/>
>>> </s:form>
>>> </display:column>
>>
>> What's that <s:property.../> supposed to be doing?
>>
>> It's not a form field; there's no entry reference being passed back. Even if
>> it *was* a form field it's still not passing a *reference* back--forms
>> *only* submit strings. Always. If you want an actual *entry* object there
>> either needs to be some type conversion, database retrieval, etc.
>>
>> Dave
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to