How do retrieve Lookup Value?

Posts   
 
    
dpanet
User
Posts: 14
Joined: 31-Oct-2006
# Posted on: 15-Nov-2006 22:10:06   

I'm new here and I'm evaluating the product.

For those how have done big projects with this tool, I want to ask you , what are your techniques used to display lookup values?

do you always create dynamic lists and return it to the user.

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 16-Nov-2006 07:46:04   

A TypedList or a DynamicList is usually used in this case.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 16-Nov-2006 10:16:16   

Dynamic lists are easier, as you then fetch a single or 2 fields in a list, which are enough for the dropdown/lookup lists. You don't have to of course, you can also fetch entities if you're more comfortable with that.

Frans Bouma | Lead developer LLBLGen Pro
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 22-Nov-2006 02:28:46   

dpanet wrote:

I'm new here and I'm evaluating the product.

For those how have done big projects with this tool, I want to ask you , what are your techniques used to display lookup values?

do you always create dynamic lists and return it to the user.

Here is how I tackled the solution. I have an ILookupList interface:


public interface ILookupList
{
    void AddItem(ILookupItem item);
    void ClearItems();
}

I stick this guy in a common library so web apps or win apps have access. Now, you can either derive your own combobox that implements this interface, or create an adapter that delegates to the particular control.

Here is the ILookupItem


public interface ILookupItem
{
    object Value { get; set; }
    string DisplayText { get; set; }
}

With LLBLGen 2.0, you can now project the results of a dynamic list call onto a class that implements ILookupItem. There you go, a flexible and easy to use solution. Let me know if you have any questions.smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 22-Nov-2006 08:28:35   

Great solution! smile

Frans Bouma | Lead developer LLBLGen Pro
KristianP
User
Posts: 32
Joined: 23-Feb-2005
# Posted on: 22-Nov-2006 17:27:03   

Otis wrote:

Great solution! smile

Thanks! smile