[CLOSED] checkbox callback wrong value

  1. #1

    [CLOSED] checkbox callback wrong value

    Hi there, I have developed a user control which allows to generate a CRUD form based on a JSON file.
    For this purpose the user control creates grid and edit window with form for editing purposes.

    I have located the initialisation code like this

        Protected Overrides Sub OnInit(e As EventArgs)
            MyBase.OnInit(e)
        End Sub
    
        Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
            InitControl()
            OnAfterInit(e)
        End Sub
    Inside the InitControl routine I initialise fields like:

                    ElseIf _type = "checkbox" Then
                        Dim cb As New Ext.Net.Checkbox With {.FieldLabel = p("title").ToString, .Flex = "1"}
                        ctrl = cb
    I first create form fields, then add them to form and finally add form to window and add window to user control.

    My problem is that whenever I check the checkbox and click save button, in code behind when evaluating value for checkbox it tells the value is the one before modifying it at the screen. If I check true, I receive false, which happens to be the value before. If I then uncheck and hit save, I received true.

    Do you have any idea of what could be wrong here?
    I know it is difficult to understand specially considering I should submit a full example ir order for you to evaluate but wonder if this has happened before to someone and you already know how to fix it?
    Last edited by Daniil; Jun 06, 2014 at 6:30 PM. Reason: [CLOSED]
  2. #2
    Hi @jstifel,

    Yes, it is difficult to say something concrete without a full test case to reproduce.

    Please check in a request (when you click the Save button) that a correct Checkbox's value is being submitted from client. By the way, you use a Button's Click DirectEvent? How do you retrieve a Checkbox's value? Where?

    Also you can debug a Checkbox's LoadPostData.
  3. #3
    Yes I use DirectEvents to post data back to server.

    I have checked debugging request.params on callback and realised the problem is checkbox data is not always submitted, sometimes the request.params shows the checkbox's clientid and value and some other simply checkbox's clientid does not list at all in request.params.

    Is it there any reason for a field defined in a formpanel not to be listed in request.params on callback?
    Last edited by jstifel; May 29, 2014 at 10:02 AM.
  4. #4
    If a Checkbox is not checked, it is not submitted at all. So, if it is not submitted, its value on server should be false.

Similar Threads

  1. [CLOSED] Store Callback not firing
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 21, 2012, 11:34 AM
  2. checkbox in treegrid is wrong
    By cloudon10 in forum 1.x Help
    Replies: 2
    Last Post: Jun 02, 2011, 6:00 AM
  3. sync callback
    By gisxiaowei in forum 1.x Help
    Replies: 0
    Last Post: Aug 20, 2009, 11:50 AM
  4. Callback
    By hbbazan in forum 1.x Help
    Replies: 0
    Last Post: Jul 28, 2009, 3:52 PM
  5. ASP.NET AJAX CallBack
    By tonymayoral in forum 1.x Help
    Replies: 2
    Last Post: Feb 07, 2009, 11:37 PM

Tags for this Thread

Posting Permissions