1 Reply Latest reply: Jun 27, 2013 5:51 AM by Tobias Löwenthal RSS

    Clear/UnClear any field from within an object extension

    Stefan Walther

      Hi,

       

      did anybody manage to clear, unclear, lock, unlock any field (by the given field name) from within an object extension?

      There are some related methods in the JS API but not what I am exactly searching for:

       

      • this.Document.Clear() => Clears all Selections
      • this.DocumentMgr.LockSelections() => Locks all fields, but not only a single one
      • this.DocumentMgr.UnlockSelections() => Unlocks all fields, but not only a single one
      • this.Data.ClearSelections() => Clears selections within the underlaying data-table of an extension (based on defined dimensions and measures).

       

      Thanks in advance for your advices and ideas!

       

      Regards

      Stefan

        • Re: Clear/UnClear any field from within an object extension

          Hi Stefan,

           

          theoretically you should be able to apply function ClearSelections(), Lock(), Unlock() to specific list boxes as well.

           

          For ClearSelections() it works fine for me, but not for Lock() and Unlock().

           

          var doc = Qv.GetCurrentDocument();

          var lb1 = doc.GetObject("LB06");

          button.click(function() { lb1.Data.ClearSelections(); });

           

          This is the syntax I used to deleselecting a specific element that was not in the extension objects data table.

           

          Best regards,
          Tobias