Name value list bound to multiple combo boxes

Name value list bound to multiple combo boxes

Old forum URL: forums.lhotka.net/forums/t/9770.aspx


stevenkahan posted on Tuesday, November 16, 2010

I have  a nvl of state_id, state_abbrev.
I have to bind it to multiple combo boxes (applicant license state, applicant address state, vehicle garaging state)

I created the NVL with private constructor and using cache.

When I bound the nvl to all 3 combo boxes, changing one combo box changed all (I guess I should have realized this).

I have come up with 3 possible solutions (assuming that I'm not doing something wrong in the first place).

1. Invalidate the cache between setting the datasource for each combo box

2. Remove the private constructor of the NVL and change the shared function "GetList" to Public and instantiate 3 instances of the NVL

3.  Clone the NVL in the form, keeping the nvl as originally coded using caching and private constructor
      dim nvl1,nvl2,nvl3 as NVL
      nvl1 = NVL.GetList()
      nvl2 = nvl1.clone
      nvl3 = nvl1.clone

I'm wondering if one of these solutions is "better" than the others or if I'm doing something wrong in the first place with my approach.

Thank you.

 

     

 

 

Copyright (c) Marimer LLC