SliderItem events when returning slider to initial or min value

I’d like to do some work after the user has moved a SliderItem’s control;
sometimes no event I expect (e.g. change, changed, transformInput, click or valueChanged)
is handled by my debug code when moving the slider to the initial or the minimum value.

Q: Which event should I use to trigger my work? Will I need to return a value?

Please see my test page at the bottom of this message and try:

  • load page (slider = 2)
  • click slider to 3 (tranformInput, change & changed are handled)
  • click slider to 2 (NO expected events are handled)
  • click slider to 1 (NO expected events are handled)
  • click slider to 2 (tranformInput, change & changed are handled)
  • click slider to 3 (tranformInput, change & changed are handled)
  • click slider to 2 (tranformInput, change & changed are handled)
  • click slider to 1 (NO expected events are handled)
  • click slider to 2 (tranformInput, change & changed are handled)
  • click slider to 1 (NO expected events are handled)
  • click slider to 2 (tranformInput, change & changed are handled)
  • click slider to 1 (NO expected events are handled)
    …
    If the return statements are deleted from the code below the non-eventful
    behaviour is exhibited only when clicking to position 2.

Confused.
Using: WinXP, IE 7.0.5730.13, SM v6.51 LGPL
Awaiting an unexpected answer, TIA.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" >
            <title>Slider Bug Tester</title>
            
            <SCRIPT>var isomorphicDir = "isomorphic/";</SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Core.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Foundation.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Containers.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Grids.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Forms.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_DataBinding.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/skins/TreeFrog/load_skin.js"></SCRIPT>
    </head>
    <body>
        <script>
            
            var MyForm = isc.DynamicForm.create({
                                fields: [
                                    {name: "wrappedSlider", title: "Wrapped Slider", editorType: "slider",
                                        minValue: 1, maxValue: 3, numValues: 3,  titleOrientation: "top",
                                        width: 500,
                                        change: "changeHandler()"
                                        , changed: "changedHandler()"
                                        , transformInput: "transformInputHandler()"
                                        , click: "clickHandler()"
                                        , valueChanged: "valueChangedHandler()"
                                    } 
                                ],
                                width: 200,
                                values: { wrappedSlider: 2 }
            });
            function changeHandler() {
                alert('changeHandler');
                return true;
            }
            function changedHandler() {
                alert('changedHandler');
                return true;
            }
            function transformInputHandler() {
                alert('transformInputHandler');
                return true;
            }
            function clickHandler() {
                alert('clickHandler');
                return true;
            }
            function valueChangedHandler() {
                alert('valueChangedHandler');
                return true;
            }
            
        </script>
    </body>
</html>

Hi Bladewheels
You should be able to use change or changed to react to user changes.

However there are 2 issues here:

There is a SmartClient bug with SliderItems which we’ve resolved internally but haven’t yet made public - this is causing the failure to fire handlers when clicking to position 2.
You can resolve this issue via the following patch code:

isc.SliderItem.addProperties({
    _oSC:isc.SliderItem.getPrototype().sliderChange,
    sliderChange : function () {
        this._oSC();
        this.$207 = this.canvas.getValue();
    }
})

Note: this patch will no longer be required and should be removed when up update to our 7.0 final release.

The second issue is with your code - transformInput is expected to return the transformed value of the item - by returning “true” you’re confusing the sliderItem’s values handling code, which is leading to the erratic firing of change / changed that you’re seeing.

Let us know if this doesn’t do it for you
Thanks

Isomorphic Software

SliderItem extended forever

Hi iso&Co.

When I click on -5 on this page:

<html>
    <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" >
            <title>Debug Slider</title>
            
            <SCRIPT>var isomorphicDir = "isomorphic/";</SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Core.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Foundation.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Containers.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Grids.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_Forms.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/system/modules/ISC_DataBinding.js"></SCRIPT>
            <SCRIPT SRC="isomorphic/skins/TreeFrog/load_skin.js"></SCRIPT>
    </head>
    <body>
        <script>
        
            
            var myForm = isc.DynamicForm.create({
                                fields: [
                                    {   name: "sliderValue", 
                                        title: "My Slider goes to Eleven (ala Spinal tap) when I click -5", 
                                        editorType: "slider",
                                        minValue: -5, maxValue: 10, 
                                        numValues: 16,  
                                        vertical: true , titleOrientation: "top",
                                        width: 20, height: 360
                                        //,change: "alert('Changing...'); return true;"
                                    }                                   
                                ],
                                width: 100, height: 150,
                                values: { sliderValue: 3 }
            });
            
            
        </script>
    </body>
</html>

the SliderItem is continuously extended until the page is closed; all other positions behave properly.
The patch does not effect this errant behaviour.
Happens in IE7 & FF3 on WinXP.

Some DevConsole logging follows:

16:27:18.832:INFO:Log:initialized
16:27:23.508:INFO:Log:isc.Page is loaded
Global Log Priorities updated: Logging messages at priority 'Debug' and above for category 'DynamicForm'.
16:28:29.263:TMR6:DEBUG:DynamicForm:isc_DynamicForm_0:delaying adjustOverflow: childResized
16:28:29.298:RDQ9:DEBUG:DynamicForm:isc_DynamicForm_0:blur w/o handler: no item to blur
16:28:29.307:RDQ9:DEBUG:DynamicForm:isc_DynamicForm_0:Drawing FormItem: [SliderItem ID:isc_SliderItem_1 name:sliderValue]
16:28:29.348:TMR2:DEBUG:DynamicForm:isc_DynamicForm_0:delaying adjustOverflow: childResized
16:28:29.371:RDQ5:DEBUG:DynamicForm:isc_DynamicForm_0:blur w/o handler: no item to blur
16:28:29.385:RDQ5:DEBUG:DynamicForm:isc_DynamicForm_0:Drawing FormItem: [SliderItem ID:isc_SliderItem_1 name:sliderValue]
16:28:29.421:TMR8:DEBUG:DynamicForm:isc_DynamicForm_0:delaying adjustOverflow: childResized
16:28:29.449:RDQ1:DEBUG:DynamicForm:isc_DynamicForm_0:blur w/o handler: no item to blur
...ad infinitum

Can you give that a shot in 7.0 RC? There were some CanvasItem (hence SliderItem) fixes.

Will do. ;^)

Is this the URL for 7.0 RC?
http://smartclient.com/releases/SmartClient_70beta_LGPL.zip

I haven’t found any other…

See blog.isomorphic.com.

Same bug in 7.0 RC

Right; IE was caching the November 2008 page which contained the link to 7beta.

Bug is still reproducible in IE & FF w/v.7.0.RC

Thanks we’ll check this out.

Is this a bug?

If so, is there a place I can watch for a fix?

I guess I can subscribe to this thread too?

This thread will be updated when the bug is confirmed and fixed. It’s near the top of the queue now.

A quick update on this. We are reproducing the problem in house and are looking at getting a fix into 7.0 final.
In the meantime here’s a patch / workaround you can use:

isc.Slider.addProperties({ labelHeight:16 });

Regards
Isomorphic Software

Merci beaucoup