[CLOSED] Adding Checkbox items to checkbox group during a postback?

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi Team,

    I am trying to add checkbox items during a post back. But it is showing a java script error as " Expected ';' ".

    I have a user control to which i am passing the object (Question object)to bound. During page load the object is null. But from the page i am passing a object instance to the user control and by calling a method LoadData i am trying to add items to the checkbox group based on the options provided in the object (Question).

    I am using the coolite version V 8.1. By reading the forum topics I understand that during a post back coolite controls cannot be added dynamically.

    Is that true? If so, could you please suggest me any workaround for this. This is mandatory in my project.

    Regards,
    Gopal.
    Bizbites Pvt. Limited.
  2. #2

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi,

    Coolite control cannot be added during AjaxEvent. But you can create it during pure PostBack. Please show test sample which demonstrates how you try to add checkbox to the group
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?



    Hi vladimir,

    Sorry for not mentioning this. It is not a pure post back. we are using an asp update panel (with UpdateMmode = always).


    Will this make any difference?


    Regards,


    Gopal.


    Bizbites Pvt. Limited.
  4. #4

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi Gopal,

    Please provide test example which demonstrates the issue. If update panel updates whole checkbox group then it should works
    Vladimir Shcheglov
    Sr. Developer
  5. #5

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi vladimir,

    Thanks for your quick reply.

    Please see the attachment for test example.

    Waiting for your reply. :-)

    Regards,
    Gopal
    Bizbites Pvt. Limited.
  6. #6

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi,

    The problem related with Items collection clear. Before clear Items you have to remove those items from Controls and LazyInit collection (by the way, in 1.0 version it is not required anymore)

    OptionsQuestion class, LoadData method.

    Before the following line
    cbgOptionsQuestion.Items.Clear();
    Add the following code
    foreach (Coolite.Ext.Web.Component component in cbgOptionsQuestion.Items)
                        {
                            cbgOptionsQuestion.Controls.Remove(component);
                            cbgOptionsQuestion.LazyItems.Remove(component);
                        }
    Vladimir Shcheglov
    Sr. Developer
  7. #7

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi vladimir,

    Thank you very much. It solved my problem now. :-)

    Regards,
    Gopal.
  8. #8

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi Vladimir Shcheglov,

    I am getting a problem with adding an ajax event to the check box item when adding in post back.

    I have added a ajax event "check" for each check box item while adding. But it is throwing an error that

    "The control with ID 'ucSectionEvaluator_ctl09_ctl05' not found
    "

    Could you please suggest anything in this.

    I have attached a test sample again for this issue.

    Thanks in advance
    Regards,
    Gopal.
  9. #9

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi,

    Any dynamic control with server side event handler must be recreated on each request (even AjaxEvent). You don't do that. Therefore ScriptManager cannot find event handler. Please always recreate checkboxes or use client side events (Listeners) and call AjaxMethod (AjaxMethod doesn't require controls)
    Vladimir Shcheglov
    Sr. Developer
  10. #10

    RE: [CLOSED] Adding Checkbox items to checkbox group during a postback?

    Hi Vladimir Shcheglov,

    I tried what you said. I created a ajaxmethod in user control (OptionsQuestion) and tried to call using checkbox check event listener.

    But it is becoming as a failure request saying "Internal Server Error".

    Please see the attachement with trial.

    Thanks in Advance.

    Regards,
    Gopal.


Page 1 of 2 12 LastLast

Similar Threads

  1. Checkbox with group command.
    By hendry_agust in forum 1.x Help
    Replies: 1
    Last Post: Jun 13, 2012, 9:28 PM
  2. About checkBox group
    By Egale in forum 1.x Help
    Replies: 0
    Last Post: May 05, 2011, 5:32 AM
  3. [CLOSED] [1.0] Dynamically load checkbox in Checkbox Group
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 14, 2010, 5:05 PM
  4. [CLOSED] Adding Item to Checkbox group by Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 31, 2010, 7:17 PM
  5. Checkbox in Group Command
    By hendry_agust in forum 1.x Help
    Replies: 0
    Last Post: May 04, 2010, 11:06 PM

Tags for this Thread

Posting Permissions