[FIXED] [V0.8.2] Fieldset javascript error calling expand() or collapse() in code behind

  1. #1

    [FIXED] [V0.8.2] Fieldset javascript error calling expand() or collapse() in code behind

    Hi,

    I have an issue with the Fieldset control whch I just cannot figure out.

    My scenario is a user control that hosts a Window control, a Tab Panel within the Window, and then some Fieldsets within one of the tabs. I am using the 0.8.1 build.


    In the code behind I need to set the collapsed state of the fieldset control based on some logic (I am using the CheckboxToggle="true" attribute).

    When the page is rendered I get the following error:

    Microsoft JScript runtime error: 'this.el' is null or not an object
    The debugger breaks into the following line of code:

    if(this.collapsed||this.el.hasFxBlock()||this.fireEvent('beforecollapse',this,animate)===false){return;}
    this = the fieldset control
    this.collapsed = false
    this.el = 'undefined' (null)

    So, it appears the this.el is undefined and that is causing the issue. What should this.el refer to? Bearing in mind that the Window control has Showonload="false" set and is made visible in the same codebehind by calling the .show() method.

    Is this a timing issue, perhaps the control isn't initialised properly because it is initially hidden?

    Any help much appreciated. I've included some code snippets below.

    Here is the JSON script:

    {script:"Coolite.Ext.setValues([[TextFieldAddressID,\"0\"],[ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextFieldPostcodeLookup,\"\"],
    [ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextAreaDeliveryNotes,\"\"],[ctl00_ContentPlaceHolderCanvas_AddressEditor1_CheckboxTwoManJob,false],
    [ctl00_ContentPlaceHolderCanvas_AddressEditor1_CheckboxAllowMarketing,false],
    [ctl00_ContentPlaceHolderCanvas_AddressEditor1_CheckboxAllowThirdPartyMail,false],[ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextFieldInvoiceAttentionOf,null],[PointLat,\"0\"],[PointLng,\"0\"],
    [ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextAreaStreet,\"
    \"],[ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextFieldTownCity,null],
    [ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextFieldCounty,null],
    [ctl00_ContentPlaceHolderCanvas_AddressEditor1_TextFieldPostcode,null]]);
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_StoreAddresses.callbackRefreshHandler(response, {serviceResponse: {Data:{data:[], totalCount: 0},Success:true}}, 
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_StoreAddresses, o.eventType, o.action, o.extraParams);
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_ComboBoxAddressPicker.setValue(\"\");
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_ComboBoxDeliveryDay.setValue(\"0\");
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_FieldSetInvoice.collapse(false);
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_FieldSetDelivery.collapse(false);
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_TabPanel1.setActiveTab(0);
    ctl00_ContentPlaceHolderCanvas_AddressEditor1_WindowAddressDetails.show();
    mapResetPoint();"}

    
    <ext:Window  ID="WindowAddressDetails" Width="800" Height="450" runat="server"
        Show&#111;nload="false" ButtonAlign="Right" Modal="true" Icon="None"
        Title="Address" Frame="true" Border="false">
        <Body>
    
    ....
    
    
               <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0">
                    <Tabs>
                        <ext:Tab ID="TabGeneral" runat="server" Title="General">
                            <Body>
                               <ext:RowLayout ID="RowLayout2" runat="server">
      
                                    <ext:LayoutRow>
                                        <ext:FieldSet ID="FieldSetInvoice" runat="server" Title="Invoicing"
                                            CheckboxName="CheckBoxInvoice" CheckboxToggle="true">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout4" runat="server">
                                                    <Anchors>
                                                        <ext:Anchor Horizontal="70%">
                                                            <ext:TextField DataIndex="InvoiceAttentionOf" Note="(e.g. Accounts Department)" ID="TextFieldInvoiceAttentionOf"
                                                                runat="server" FieldLabel="Attention of">
                                                            </ext:TextField>
                                                        </ext:Anchor>
                                                    </Anchors>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:FieldSet>
                                    </ext:LayoutRow>
    
    
    ...
    
    
                if ((entity.Usage &amp; AddressUsage.Invoice) == AddressUsage.Invoice)
                {
                    if (this.FieldSetInvoice.Collapsed)
                        this.FieldSetInvoice.Expand(false);
                }
                else
                {
                    if (!this.FieldSetInvoice.Collapsed)
                        this.FieldSetInvoice.Collapse(false);
                }
    
                if ((entity.Usage &amp; AddressUsage.Delivery) == AddressUsage.Delivery)
                {
                    if (this.FieldSetDelivery.Collapsed)
                        this.FieldSetDelivery.Expand(false);
                }
                else
                {
                    if (!this.FieldSetDelivery.Collapsed)
                        this.FieldSetDelivery.Collapse(false);



  2. #2

    RE: [FIXED] [V0.8.2] Fieldset javascript error calling expand() or collapse() in code behind

    Hi,

    I think it is already fixed. As workaround try to set DeferredRender="false" for TabPanel
  3. #3

    RE: [FIXED] [V0.8.2] Fieldset javascript error calling expand() or collapse() in code behind

    OK, thanks I will try that.
    When you say it is already fixed, could you provide the fix as I don't yet have an svn account,
    Thanks.
  4. #4

    RE: [FIXED] [V0.8.2] Fieldset javascript error calling expand() or collapse() in code behind

    Hi,

    Sorry, It is complex fix. The fix will be available in next release. Please, use DeferredRender as workarounf until new release
  5. #5

    RE: [FIXED] [V0.8.2] Fieldset javascript error calling expand() or collapse() in code behind

    Hi,

    Please note that you should to set 'false' (not 'true') for DeferredRender

Similar Threads

  1. [CLOSED] Fieldset collapse codebehind
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 03, 2012, 8:23 AM
  2. Replies: 1
    Last Post: Mar 07, 2012, 8:39 PM
  3. Replies: 3
    Last Post: Aug 11, 2011, 11:07 AM
  4. Replies: 9
    Last Post: Apr 25, 2011, 8:23 PM
  5. [CLOSED] [1.0] Panel collapse from javascript giving error
    By vedagopal2004 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 08, 2010, 6:23 AM

Posting Permissions