Announcement

Collapse
No announcement yet.

I need HELP...How do I build a DropDownList in a TAB ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I need HELP...How do I build a DropDownList in a TAB ?

    The code below displays fine and allows selection, but no value is passed to postBackProc that I can see.

    postBackProc:
    Code:
                Case "doMetric"
                    name = parts("id")
                    'value = parts(name)
                    value = parts("Enabled")
    
                    If value = "Enabled" Then
                        gMetric = True
    
                    ElseIf value = "Disabled" Then
                        gMetric = False
                    End If
    Function BuildMyTab:
    Code:
                '---------------Metric-------------------
                '----------------------------------------
                stb.Append("<hr><b>Use Metric Measurements:</b><br>")
                stb.Append(clsPageBuilder.FormStart("doMetric", "doMetric", "Post"))
                stb.Append(BuildMetricDropList())
                stb.Append(clsPageBuilder.FormEnd())
    Function BuildMetricDropList:
    Code:
     '****************************************
        Private Function BuildMetricDropList() As String
            Dim ddl As New clsJQuery.jqDropList("doMetric", Me.PageName, False)
    
            ddl.id = "doMetric"
            ddl.name = "doMetric"
    
            ddl.autoPostBack = True
    
    
            If gMetric Then
                ddl.AddItem("Enabled", "Enabled", True)
                ddl.AddItem("Disabled", "Disabled", False)
            Else
                ddl.AddItem("Enabled", "Enabled", False)
                ddl.AddItem("Disabled", "Disabled", True)
            End If
    
            Return ddl.Build
        End Function
    The Case "doMetric" is accessed and parts("id") is recognized as "doMetric" but how do I get the value selected in the DropDownList ?????
    -Larry

    A member of "The HA Pioneer Group", MyWebSite

    Plugins:
    VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

    Hardware:
    Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

    #2
    Here's how I build a dropdown:
    Code:
            ''logmode
            Dim currentDebugSetting = hs.GetINISetting("config", "logmode", "NORMAL", INIFILE)
            sbtb.Append("<tr><td class='tablecellodd' align='left' width='30%'>Logging</td>")
            sbtb.Append("<td class='tablecellodd' align='left'>")
            dl = New clsJQuery.jqDropList("dlLogmode", PageName, False)
            dl.AddItem("DEBUG", "DEBUG", (currentDebugSetting = "DEBUG"))
            dl.AddItem("NORMAL", "NORMAL", (currentDebugSetting = "NORMAL"))
            dl.toolTip = "Leave set to NORMAL unless you need to capture DEBUG logs."
            dl.autoPostBack = True
            sbtb.Append(dl.Build)
            sbtb.Append("</td>")
            sbtb.Append("</tr>")
    And here's how I get the value in the postback:

    Code:
           If (Not parts("dlLogmode") Is Nothing) Then
                hs.SaveINISetting("config", "logmode", parts("dlLogmode"), INIFILE)
                Log("Logging set to " & parts("dlLogmode"), LogType.LOG_TYPE_CONSOLE)
            End If
    Your parts("doMetric") should contain "Enabled" or "Disabled".
    I wonder it it has something to do with the form tags you are using?
    HS3Pro Running on a Raspberry Pi3
    68 Z-Wave Nodes, 174 Events, 326 Devices
    UPB modules via OMNI plugin/panel
    Plugins: Z-Wave, OMNI, HSTouch, weatherXML, EasyTrigger
    HSTouch Clients: 3 Android, 1 Joggler

    Comment


      #3
      Thanks rmasonjr, your help got me thinking along the right path..it is working now, sometimes you can be staring right at the solution but can't see it.

      Much thanks.
      -Larry

      A member of "The HA Pioneer Group", MyWebSite

      Plugins:
      VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

      Hardware:
      Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

      Comment


        #4
        Re: I need HELP...How do I build a DropDownList in a TAB ?

        No problem!

        Sent from my SCH-I500 using Tapatalk 2
        HS3Pro Running on a Raspberry Pi3
        68 Z-Wave Nodes, 174 Events, 326 Devices
        UPB modules via OMNI plugin/panel
        Plugins: Z-Wave, OMNI, HSTouch, weatherXML, EasyTrigger
        HSTouch Clients: 3 Android, 1 Joggler

        Comment

        Working...
        X