while item + div + img + label should work the same way it would require much more custom code. It might be easier to just go back to checkboxes ;)
Each item has an attribute "selected". You can use the children collection of your listbox to go through all of the items in the listbox and then process all which have selected set to true. There is no collection with only the selected items - selectedIndex and selectedItem will only return the first selected index/item in multiselect mode. Benjamin On Feb 21, 1:33 am, Eric <[email protected]> wrote: > Thank you very much, > > I am using a different approach, i loop through each record set and > instead of using CheckBox i use > Item + div + img + label to construct 1 entry in ListBox. It works > fine now. > > My other question when "multiSelect" is set to true, how can we > retrieve items they are current selected? > either the index or the actual div object. > > thanks again > > On Feb 20, 4:21 pm, Benjamin Schirmer <[email protected]> > wrote: > > > A single backslash is used to encode a character. To fix this you > > should use a forward slash / in your paths: > > > newCB.image="stock_images/checkbox_up.png" ; > > newCB.downImage="stock_images/checkbox_down.png"; > > newCB.overImage="stock_images/checkbox_over.png"; > > newCB.checkedImage="stock_images/checkbox_checked_up.png"; > > newCB.checkedOverImage="stock_images/checkbox_checked_over.png"; > > newCB.checkedDownImage="stock_images/checkbox_checked_down.png"; > > > Benjamin > > > On Feb 20, 8:54 pm, Eric <[email protected]> wrote: > > > > Hi, > > > > I am new to develop google desktop gadget using the Gadget Designer. > > > > I am trying to figure out how to add multiple checkbox to a ListBox > > > dynamically rather than hard it in the xml markup. > > > I tried the following method, (lbRecords is the ListBox object). > > > > However, no checkbox showed up, only the caption. > > > > i am wondering if I am doing this correctly. > > > What i was trying to do is to allow user to check a few items and then > > > process those checked item in a button click event later. > > > > thank you. > > > > (METHOD 1) > > > var newItem = lbRecords.appendElement("<item />"); > > > newItem.height = "20"; > > > newItem.width = "100"; > > > var newCB = newItem.appendElement("<checkbox />"); > > > newCB.height="16"; > > > newCB.name="checkbox11"; > > > newCB.width="100"; > > > newCB.x="0"; > > > newCB.y="0"; > > > newCB.caption="New button"; > > > newCB.image="stock_images\checkbox_up.png" ; > > > newCB.downImage="stock_images\checkbox_down.png"; > > > newCB.overImage="stock_images\checkbox_over.png"; > > > newCB.checkedImage="stock_images\checkbox_checked_up.png"; > > > newCB.checkedOverImage="stock_images\checkbox_checked_over.png"; > > > newCB.checkedDownImage="stock_images\checkbox_checked_down.png"; > > > > (METHOD 2) > > > lbRecords.appendElement("<item height=\"20\" width=\"100\"><checkbox > > > height=\"16\" name=\"checkbox23\" width=\"100\" x=\"0\" y=\"0\" > > > downImage=\"stock_images\checkbox_down.png\" image= > > > \"stock_images\checkbox_up.png\" overImage=\"stock_images > > > \checkbox_over.png\" caption=\"checkbox3\" checkedDownImage= > > > \"stock_images\checkbox_checked_down.png\" checkedImage= > > > \"stock_images\checkbox_checked_up.png\" checkedOverImage= > > > \"stock_images\checkbox_checked_over.png\" /> </item>"); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Desktop Developer Group" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Desktop-Developer?hl=en -~----------~----~----~----~------~----~------~--~---
