Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: using dynamic_list_control class


From   "Zurab Sajaia" <zsajaia@hotmail.com>
To   "statalist" <statalist@hsphsun2.harvard.edu>
Subject   st: using dynamic_list_control class
Date   Thu, 15 Mar 2007 12:35:36 -0400

Dear all,

I'm building a dialog with dynamically changed content and based on earlier discussions on the Statalist came to use dynamic_list_control class.

James Hassell kindly showed how to set the list interactively, and now I'm trying to use other methods of the class, namely appending or deleting an item.

My problem is that whenever the new instant is created and linked to the listbox, contents of the list are cleared:

dlist = .dynamic_list_control.new , dialogname(d1) controlname(main.lb_level)

.set method (which is called by .new) has "._clearList" at the end that clears the list. This was not an issue in the example given by James because he was then redefining the new list by:

.dlist.setList, newlist(`levels')

but if I need to add (or drop) one item only this seems to be a problem:
.dlist.appendItem, item("something") will result in list containing just "something".

I'd appreciate much any advice what to change (if Im doing something wrong)

Thanks,
Zurab



*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index