Announcement

Collapse
No announcement yet.

JQuery EditBox not displaying current value when trying to edit

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

  • JQuery EditBox not displaying current value when trying to edit

    Hi,

    I have multiple editboxes on my plugin configuration page. The boxes are filled when something is selected in a DropList.

    I use following code to do so in postBackProc
    Code:
    m_editTriggerName.defaultText = trigger.Name;
    m_editTriggerName.promptText = trigger.Name;
    divToUpdate.Add(m_editTriggerName.name, m_editTriggerName.Build());
    This updates the content of the edit box. However, when the users clicks on it to modify, the text in the prompt is empty. How can I make it the same as the text in the edit box ?

    Br,
    Kriz

  • #2
    Nobody ?

    Comment


    • #3
      After looking at the SDK for jqTextbox I can not see anything that sets the prompt (https://homeseer.com/support/homesee...DK/default.htm).

      Comment


      • #4
        Me neither, yet some plugin shows the current value in the textbox whenever it is shown :-(

        Comment


        • #5
          Somebody must have figured this out :-)


          Flow:
          1. Page is opened, by default the first item in the jqDropList is selected and the jqTextBox is filled. The textbox is in its own div
          2. User selects a different item from the jqDropList
          3. in the postBackProc i change the jqTextBox and add it divToUpdate
          What I see:
          The text is updated in the textbox. However, when I click on it to change the value, the dialog that is shown still shows the old value ...

          Comment


          • #6
            Originally posted by kriz83 View Post
            Somebody must have figured this out :-)


            Flow:
            1. Page is opened, by default the first item in the jqDropList is selected and the jqTextBox is filled. The textbox is in its own div
            2. User selects a different item from the jqDropList
            3. in the postBackProc i change the jqTextBox and add it divToUpdate
            What I see:
            The text is updated in the textbox. However, when I click on it to change the value, the dialog that is shown still shows the old value ...
            I can't say I have ever had a problem with this. Web pages are the weakest aspect of my programing skills as, prior to writing HS3 plug-ins, my user interfaces have always been windows forms. I struggled with the jQuery controls at first but seemed to get everything working with a lot of trial and error and a certain amount of frustration.

            All my jQTextBox controls open with the default text displayed ready for editing when the user clicks on them. The only thing I see that I do differently to you is that I add the default text in the jqtextbox definition rather than setting the property separately. In other words in my BuildTextBox functions, which are called to initially build the TextBox on the page and rebuild it from PostBackProc, I have something like the following:

            textbox = New clsJQuery.jqTextBox(Name, "", plugin.Settings.PauseBetweenAlerts, Me.PageName, 3, False)

            Where plugin.Settings.PauseBetweenAlerts is the variable for the default text.

            I hope this helps.

            Steve

            Comment


            • #7
              Thanks for your reply SteveMSJ.

              I create the textbox like that, but afterwards when i have to modify the values I use the properties of the jqTextBox, followed by a build(). I also recreated the textbox, but it still shows me the old value ...

              Comment


              • #8
                Originally posted by kriz83 View Post
                Thanks for your reply SteveMSJ.

                I create the textbox like that, but afterwards when i have to modify the values I use the properties of the jqTextBox, followed by a build(). I also recreated the textbox, but it still shows me the old value ...
                Well, there must be something wrong in your code as it seems to work for everybody else

                I don't know what else to suggest as, although I have encountered all sorts of issues with the jQuery controls that hasn't been one of them.

                When I started building my first config page in HS3 I spent some time playing with the WebTestPage in the HSPI_Sample which, if I remember correctly, had working examples of all the jQuery controls on it.

                Best of luck.

                Steve

                Comment


                • #9
                  You cant recreate the full control in this case (AFAIK), you need to update the text by updating the control property. The dialog is a popup and gets recreated each time you build the control, so you wind up with two, and then you get the wrong one. E.g. Me.propertySet.Add﴾id,"addattr=ATTR"﴿

                  Comment

                  Working...
                  X