Also, I inserted the following code in userForm.jsp and no persons were
displayed, even though I have populated the db with some test persons for
the user that I use to log in and test. 

    <li>
     <strong><shotoncall:label key="user.persons"/></strong>
        <c:forEach var="person" items="${user.personList}"
varStatus="status">
            <c:out value="${person.label}"/><c:if
test="${!status.last}">,</c:if>
            <input type="hidden" name="userContacts" value="<c:out
value="${person.label}"/>"/>
        </c:forEach>
    </li>


I added a getPersonList function to User.java which is similar to the
getRoleList function. 

Thanks.

~rk


23455432 wrote:
> 
> This is correct. I just checked, and struts is being used. 
> 
> The way I set up my relationship is shown below. I tried to follow the
> weblog tutorial posted on the tutorials site.
> 
> USER CLASS
> 
>   protected List persons = new ArrayList();    
>     /**
>      * @hibernate.bag name="persons" lazy="false" cascade="all"
>      * @hibernate.collection-key column="person_id"
>      * @hibernate.collection-one-to-many class="org.appfuse.model.Person"
>      */
>     public List getPersons(){
>       return this.persons;
>     }
>     
>     public void setPersons(List persons){
>       this.persons = persons;
>     }
>     
>     public void addPerson(Person person){
>       getPersons().add(person);
>     }
> 
> 
> PERSON CLASS
> 
> 
>       private Long userId;
> 
>       /**
>      * @hibernate.property column="user_id"
>        */
>       public Long getUserId(){
>               return userId;
>       }
>       
>       public void setUserId(Long userId){
>               this.userId = userId;
>       }
> 
> 
> 
> 
> 
> Matt Raible-3 wrote:
>> 
>> Which version of AppFuse?  I'm assuming 1.9.x.  If so, you're using
>> Struts.
>> 
>> On 2/11/07, 23455432 <[EMAIL PROTECTED]> wrote:
>>>
>>> I am sorry, not sure what you mean by web framework? Hibernate, spring,
>>> pretty much the default appfuse installation.
>>>
>>> Thanks.
>>>
>>>
>>>
>>> Matt Raible-3 wrote:
>>> >
>>> > What web framework are you using? It should be as simple as using a
>>> > <c:forEach> tag to iterate through the collection and show the
>>> > results.
>>> >
>>> > Matt
>>> >
>>> > On 2/11/07, 23455432 <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >> So I have set up a one-to-many relationship between my user and
>>> persons.
>>> >> Now
>>> >> I would like to display all the persons that are associated with a
>>> user,
>>> >> add
>>> >> a person to a user's person list and edit the persons in there. I am
>>> not
>>> >> sure how to start doing this. Should I set up a new
>>> >> controller/form/action?
>>> >> Any input would be helpful. I just need a starting point.
>>> >>
>>> >> Thanks for helping.
>>> >>
>>> >> ~rk
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/Displaying-information-in-one-to-many-bag-tf3211353s2369.html#a8918115
>>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > http://raibledesigns.com
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> > For additional commands, e-mail: [EMAIL PROTECTED]
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Displaying-information-in-one-to-many-bag-tf3211353s2369.html#a8918228
>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> 
>> -- 
>> http://raibledesigns.com
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaying-information-in-one-to-many-bag-tf3211353s2369.html#a8918373
Sent from the AppFuse - User mailing list archive at Nabble.com.

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

Reply via email to