Question: Maplets - ListBox strange behavior

January 23 2013 JeremyB 5

1

I need the button that will change the content (list) of a ListBox. When I create such Maplet, ListBox behaves very strange! The ListBox sometimes shows the list after the button click, but sometimes the list disappears. 

The code below reproduces this strange behavior. Just click the button several times.

 

with(Maplets[Elements]):

getObjects := proc()
local testList;
use Maplets:-Tools in
testList := ["YAHOO", "YAHOO", "YAHOO", "YAHOO", "YAHOO", "YAHOO"];
Set(ObjectList(itemlist) = testList);
end use;
end proc;

maplet := Maplet('reference'='Maplet1', Button('background'=
"#D6D3CE",'caption'= "Button1",'enabled'='true','foreground'=
"#000000",'onclick'='searchAction','reference'='SearchButton','visible'='true',
Action('reference'='searchAction', Evaluate(function = "getObjects"))),
ListBox('background'= "#FFFFFF",'enabled'='true','foreground'=
"#000000",'reference'='ObjectList','visible'='true'), BoxLayout('background'=
"#D6D3CE",'border'='false','halign'='center','inset'='5','reference'='BoxLayout5','valign'='center','vertical'='false','visible'='true',
BoxColumn(BoxCell('hscroll'='never','value'='SearchButton','vscroll'='never'),
BoxCell('hscroll'='never','value'='ObjectList','vscroll'='never'))),
GridLayout('background'=
"#D6D3CE",'border'='false','halign'='center','inset'='5','reference'='GridLayout3','valign'='center','visible'='true',
GridRow(GridCell('height'='1','hscroll'='never','value'='BoxLayout5','vscroll'='never','width'='1'))),
Window('width'= 640,'height'=
480,'layout'='GridLayout3','reference'='Window1','resizable'='true','title'=
"DG Library")):

Maplets[Display](maplet);

Please Wait...