cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Item14656: textboxlist SelectValue event listener not functioning - typo in code or doc.

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release:
Applies To: Extension
Component: JQueryPlugin
Branches:
Reported By: LynnwoodBrown
Waiting For: LynnwoodBrown
Last Change By: MichaelDaum
Following docs outlined in JQueryTextboxList, specifying SelectValue event listener does not appear to work. The parallel features DeleteValue event listener does appear to work fine.

Looking at the code (with a bit of help from JanKrueger on irc), I did notice that on line 295, the trigger refers to SelectedValue (rather than SelectValue as referenced in doc). Changing this in code (or modifying callback name in Doc) fixes issue.

-- LynnwoodBrown - 09 Mar 2018

Further testing revealed additional issue. If one only corrects the SelectValue callback name in the code, it gets called on both adding and deleting an item. I believe this is because line 295 doesn't factor in the suppressCallback parameter passed when the select function is called from the deselect. The following code at line 295 corrects this, although perhaps there's a more eloquent solution.
    if (!suppressCallback) {
       self.input.trigger("SelectedValue", values);
    }

-- LynnwoodBrown - 09 Mar 2018

The code analysis is correct, as well as the proposed fix. Please go ahead and check it in. Thanks a lot.

-- MichaelDaum - 20 Mar 2018
 

ItemTemplate edit

Summary textboxlist SelectValue event listener not functioning - typo in code or doc.
ReportedBy LynnwoodBrown
Codebase 2.1.5
SVN Range
AppliesTo Extension
Component JQueryPlugin
Priority Normal
CurrentState Confirmed
WaitingFor LynnwoodBrown
Checkins
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r3 - 20 Mar 2018, MichaelDaum - This page was cached on 21 Jul 2018 - 13:11.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy