ZennoLab Assemblies Documentation
GetSelectedItems Method
Example 
ZennoLab.CommandCenter Namespace > HtmlElement Class : GetSelectedItems Method
Returns the value of the selected items.
Syntax
public string GetSelectedItems()

Return Value

Type: System.String

The value of the selected items recorded through ";".

Example
The following code example demonstrates uses of the GetSelectedItems method.
public static int Execute(Instance instance, IZennoPosterProjectModel project)
{
    // clear cookie
    instance.ClearCookie();
    
    // go to lessons.zennolab.com
    Tab tab = instance.MainTab;
    if ((tab.IsVoid) || (tab.IsNull)) return -1;
    if (tab.IsBusy) tab.WaitDownloading();
    tab.Navigate("lessons.zennolab.com");
    if (tab.IsBusy) tab.WaitDownloading();
    
    // find element by name
    HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByName("lang[]");
    if (he.IsVoid) return -1;
    
    // set value
    he.SetValue("1;2;3", true);
    
    // get selected items in string format
    string selectedItems = he.GetSelectedItems();
    
    return 0;
}
public static function Execute($instance, $project)
{
    // clear cookie
    $instance->ClearCookie();
    
    // go to lessons.zennolab.com
    $tab = $instance->MainTab;
    if (($tab->IsVoid) || ($tab->IsNull)) return -1;
    if ($tab->IsBusy) $tab->WaitDownloading();
    $tab->Navigate("lessons.zennolab.com");
    if ($tab->IsBusy) $tab->WaitDownloading();
    
    // find element by name
    $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByName("lang[]");
    if ($he->IsVoid) return -1;
    
    // set value
    $he->SetValue("1;2;3", true);
    
    // get selected items in string format
    $selectedItems = $he->GetSelectedItems();
    
    return 0;
}
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

HtmlElement Class
HtmlElement Members
SetSelectedItems Method