3 Replies Latest reply: Sep 27, 2012 6:30 AM by HakanBiroglu RSS

    Drop Down List in Grid is dependent on Dropdown List at Level 0

    Mohsin
      Hi All,

      In my secondary page, there are three Drop-Down List Boxes D1, D2 and D3.

      D3 is in grid at Level 1 on secondary page and the prompt Table in D3 have 3 Keys.Key 1 and Key 2 are the same field as D1 and D2.As D3 is dependent on D1 and D2.
      First time, D3 remains empty even i select values in D1 and D2 but when i EndModal(1) and then come back , D3 has values.

      What is happening ?

      What is the solution of this scenario ?

      Thanks for your help in advance.
        • 1. Re: Drop Down List in Grid is dependent on Dropdown List at Level 0
          HakanBiroglu
          check the page field order that D3 is set after D1 and D2.
          • 2. Re: Drop Down List in Grid is dependent on Dropdown List at Level 0
            Mohsin
            D3 is in GRID_RECORD at Level 1.

            As Grid Record is totally dependent on D1 and D2.

            therefore, On field Change of D2 ,

            I delete the Grid Record,

            for &i = GRID_RECORD.ActiveRowCount to 1 Step -1
            GRID_RECORD.DeleteRow(&i);
            End-for;

            As a Result, The Default Row only present at Grid_Record, and D3 has no values.

            so i also include in field change of D2

            for &i = GRID_RECORD.ActiveRowCount to 1 Step -1
            GRID_RECORD.DeleteRow(&i);
            End-for;

            Local Rowset &RowSetGRID_RECORD;
            &RowSetGRID_RECORD =GetLevel0()(1).GetRowSet(Scroll.GRID_RECORD);

            &RowSetGRID_RECORD(1).GRID_RECORD.KEY1.VALUE = D1.Value;
            &RowSetGRID_RECORD(1).GRID_RECORD.KEY2.VALUE = D2.Value;

            Now D3 has values.

            Am i doing right, or there is any better solution ?
            • 3. Re: Drop Down List in Grid is dependent on Dropdown List at Level 0
              HakanBiroglu
              Yes that looks ok, as D3 is dependent of the high level keys D1 and D2 and you delete all the rows, that leaves a new blank row.
              I thought if you have auto select enabled on your grid that the values of D1 and D2 would automatically be copied to level 1.
              If not, it has no harm in setting these values like you do.

              Note that this will change the buffer and the user will receive a message box that changes have been made and if the user want to continue or go back and save.
              So a DoSave() somewhere in your code would be nice.