[CLOSED] Slider control - SetValue()

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Slider control - SetValue()

    Hi Guys,

    I've got a strange issue with the Ext.NET slider control I was hoping someone could shed some light on.

    Put simply, I have a basic page with a slider control with a simple change listener:

                                                
    <ext:Slider runat="server" ID="sldProbability" MinValue="0" MaxValue="100" Increment="1" Width="250">
    <Listeners>
          <Change Fn="ProbabilityChange" />
    </Listeners>
    </ext:Slider>
    The listener simply sets a label value (largely irrelevant for this issue but posted for completeness):

        var ProbabilityChange= function (oSlider) {
            lblProbPercent.setValue(oSlider.getValue() + '%');
        };
    The issue is this. On page load I would like to set the initial value of the slider to 50. To do this I've tried setting the 'Value' property and using the SetValue() method.

    This seems to set the value visually on page, but when I click my save button and use the corrosponding sldProbability.GetValue() it returns Int.MinValue if the slider has not been moved by the user. (If the slider has been moved by the user then the value is reported within the range I'd expect 0-100.

    Am I using the incorrect method to set the value here? or retrieve it? feels like I'm doing something wrong but slightly unsure what, any thoughts?

    Many thanks,

    Doug
    Last edited by Daniil; Jul 19, 2012 at 3:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Setting up the Value property should be enough.

    I have tried to reproduce the issue with no success using the example below.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Slider1.Value = 50;
            }
    
        }
    
        protected void GetValue(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("GetValue", this.Slider1.Value).Show();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Slider
                ID="Slider1" 
                runat="server" 
                Width="200"
                MinValue="0" 
                MaxValue="100" />
    
            <ext:Button runat="server" Text="Get value" OnDirectClick="GetValue" />
        </form>
    </body>
    </html>
    Does that example reproduce the problem on your side?

    If yes, please clarify what Ext.NET sources do you use? I will test as well.

    If no, please provide your test case to reproduce the issue.
  3. #3
    Hi Daniil,

    That example does indeed reproduce the problem:

    Click image for larger version. 

Name:	Slider.png 
Views:	91 
Size:	4.7 KB 
ID:	4458

    We're using build 1.2.0.21133 and at the moment this system is live, as a result we're not easily able to update the DLL and perform a full regression test at the moment :(
  4. #4
    I am unable to reproduce with the official v1.2 release.

    Do you use some trunk revision?

    It would be simplest if you will send me the Ext.Net.dll to test. If it's possible please email to:
    daniil at ext dot net

    I would test and try to come up with a fix.
  5. #5
    I'm not sure if it's a trunk compilation as our developer who configured the project original has since left the company. Generally we didn't opt to compile our own versions though as we aimed to keep with the official release. It is possible though that this is the exception!

    I've emailed you the precise DLL, would be good if there was a sensible work around / fix, although it's not the words most massive issue as we can just code round it at the back end if needed.

    Cheers,

    Doug
  6. #6
    I have no new e-mail (including the Spam folder).

    Please re-check the email:
    Quote Originally Posted by Daniil View Post
    please email to:
    daniil at ext dot net
  7. #7
    Got it. Please also send the Ext.Net.Utilities.dll and Newtonsoft.Json.dll.

    Apologize, I had to make clearer my initial request.
    Last edited by Daniil; Jul 10, 2012 at 5:02 PM.
  8. #8
    Weird, it is also not reproducible on my side with your dlls as well.

    Please clarify did you test exactly my example?
  9. #9
    I did test the exact example yeah, literally copied and pasted into a new webform and set it as the start page in our current project.

    I was testing on IE8 if it makes any difference, but we see the same issue on IE9 and Chrome.

    I'll double check when I'm back in the office tomorrow morning to make sure I didn't leave anything else hanging about but I'm 99.9% sure it was the exact example.
  10. #10
    I have just double checked as well and can confirm - the issue is not reproducible on my side with the dlls you sent and the example I posted.

    I have tested in IE9, FF, Chrome. Though I think that issue should not depend on a browser.

    Maybe something in the project global things... Did you test that example within your real project?

    If yes, could you create a simple test project with the minimum required Ext.NET settings and test the example again? Is the issue still reproducible? If yes, please email the whole project. If no, something stops it working in your real project.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] problem with slider setValue on clientside
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 11, 2012, 3:37 PM
  2. Bug with dynamic panels and slider control
    By decho in forum 1.x Help
    Replies: 7
    Last Post: Sep 09, 2011, 8:13 AM
  3. [CLOSED] .setValue in TokenScript of a ASP Control
    By tms in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 01, 2010, 7:20 PM
  4. [CLOSED] Menu and Slider
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 15, 2010, 7:01 PM
  5. [CLOSED] slider example
    By Lex in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 22, 2008, 11:24 AM

Tags for this Thread

Posting Permissions