-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Using Dropdownlist for Many-To-One-Relations
PostPosted: Fri Mar 24, 2006 7:03 am 
Beginner
Beginner

Joined: Mon Mar 20, 2006 7:59 am
Posts: 30
Hi,

I am using the last NHibernate CVS-head and have the following problem:

I have got a list of tasks and every task is linked to a user. I have a gridview that lists all the tasks I have and also shows the username of the linked user.

Editing also works for the task's properties except of the user. The user looks something like that:

Code:
public class AMSUser
{
    public Guid UserId{ get; set; }
    public string UserName {get; set; }
    public string Address {get; set; }
}


A task is like that:
Code:
public class Task : DomainBase
{
   public string Description { get; set; }
   public string Title {get; set;}
   public AMSUser AMSUser {get; set; }
}

I have DataAccess-classes that return Lists of Users and Tasks and all this stuff works well. But how to add a dropdownlist to the gridview to choose the task's user?

I think these kind of "Lookup-Dropdownlists" occur in every application, so there must be examples how to implement it best. I think I could add a new property UserId to class Task and in the set property setter change the user, but probably there is a better way for doing it.

I hope anybody can help :-)

Regards,
Dominik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.