Announcement

Collapse
No announcement yet.

New function in jqListBoxEx

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

  • #16
    Yes, I tested the style code with the sample code I posted.

    I added 5 items, but only left enough height for 2

    Scroll bar came up and I was able to scroll the items.

    The height attribute is part of the base object, but the jqListBoxEx object itself is built dynamically with javascript, using an includes file to load the objects code, so is not directly linked to that height parameter.

    The div you see inside that has the style='position...., that's built outside of HS3.

    If you look in the source code of the page, you'll see that that div is missing.

    I did see a change in the position parameter of the object, made on the 6 th of this month, but that was made in the .js, so would not be affected by the HS3 versions.

    I believe my second PC at work still has .84 on it. I'll test the sample jqListBox...,it uses nearly identical code to the jqListBoxEx.
    Wade

    sigpic

    website | products | support | youtube
    I know nothing...., nothing!!!

    Comment


    • #17
      Originally posted by Sgt. Shultz View Post
      Yes, I tested the style code with the sample code I posted.

      I added 5 items, but only left enough height for 2

      Scroll bar came up and I was able to scroll the items.

      The height attribute is part of the base object, but the jqListBoxEx object itself is built dynamically with javascript, using an includes file to load the objects code, so is not directly linked to that height parameter.

      The div you see inside that has the style='position...., that's built outside of HS3.

      If you look in the source code of the page, you'll see that that div is missing.

      I did see a change in the position parameter of the object, made on the 6 th of this month, but that was made in the .js, so would not be affected by the HS3 versions.

      I believe my second PC at work still has .84 on it. I'll test the sample jqListBox...,it uses nearly identical code to the jqListBoxEx.
      I made progress, when I add overflow:auto to the style settings, the problem is gone, not sure what changed in the latest HS3 code or in the CSS perhaps?

      Dirk

      Comment


      • #18
        Originally posted by Sgt. Shultz View Post
        I modified the List Box tab in the basic sample:

        Code:
        Function BuildTabLB(Optional ByVal Rebuilding As Boolean = False) As String
                Dim stb As New StringBuilder
                Dim lb As New clsJQuery.jqListBoxEx("lb", Me.PageName)
                
                Dim i As Integer = 1
                Dim p As HomeSeerAPI.Pair
                lb.style = "height:100px;width:300px;"
                Dim item As Object
                For Each item In lbList
                    p = New HomeSeerAPI.Pair
                    p.Name = item
                    p.Value = i
                    i += 1
                    lb.items.Add(p)
                Next
                lb.id = "olb"
                lb.UseBothClickEvents = True
                stb.Append(clsPageBuilder.FormStart("frmTab1", "ListBox", "Post"))
                stb.Append(lb.Build & " " & BuildTextbox("TextboxLB") & " " & BuildButton("ButtonLB"))
                stb.Append(clsPageBuilder.FormEnd())
                If Rebuilding Then Me.divToUpdate.Add("TabLB_div", stb.ToString)
                Return stb.ToString
            End Function
        Then I modified the PostBackProc:

        Code:
        Public Overrides Function postBackProc(page As String, data As String, user As String, userRights As Integer) As String
        
                Dim parts As Collections.Specialized.NameValueCollection
                Dim value As String = ""
                Dim name As String = ""
                parts = HttpUtility.ParseQueryString(data)
        
                Select Case parts("id")
                    Case "oButtonLB"
                        lbList.Add(parts("TextboxLB"))
                        PostMessage("'" & parts("TextboxLB") & "' has been added.")
                        BuildTabLB(True)
                    Case "olb"
                        name = parts("id")
                        name = Right(name, name.Length - 1)
                        value = parts(name)
                        If parts("click") = "double" Then value &= "-d"
                        PostMessage("value is " & value & ".")
                    Case "timer" 'this stops the timer and clears the message
                        If TimerEnabled Then 'this handles the initial timer post that occurs immediately upon enabling the timer.
                            TimerEnabled = False
                        Else
                            Me.pageCommands.Add("stoptimer", "")
                            Me.divToUpdate.Add("message", " ")
                        End If
                End Select
        
                Return MyBase.postBackProc(page, data, user, userRights)
            End Function
        This returned correct values, and could be qualified via the 'click' parameter.

        I suspect what is happening is that you're losing your connection to your object inside the page on the client side when reposting to the page.

        You may need to review what your reposting, or you may need to put some custom javascript in to handle your scenario.
        Wade, on my second issue with single clicks not working ....

        I copied/pasted your code above in the SingleEXEMultipleInstance Sample aka HSPI_SAMPLE_BASICMI and I have exactly the same issue.

        The postback returns data "TextboxLB=&id=undefined&=undefined" String

        We've had multiple issues during the early stages of HS3 with multiple instances and how HS3 has to figure out how to extract and process the postback info and call the right PI instance. I would check the code in that area.

        Dirk

        Comment


        • #19
          clsJQuery.jqListBoxEx.UseBothClickEvents doesn't work for single clicks when set

          Bump!
          After 2 years I decided to give this .UseBothClickEvents a try but it still doesn't work.
          If I set it, it works perfectly for double clicks but the single clicks don't work anymore (they don't provide the proper value).
          Wade, did you ever look at this?
          Does anyone use this?
          Dirk

          Comment

          Working...
          X