Aug 18, 2009, 4:16 PM
[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:
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:
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 controlthis.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"
Showonload="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 & AddressUsage.Invoice) == AddressUsage.Invoice)
{
if (this.FieldSetInvoice.Collapsed)
this.FieldSetInvoice.Expand(false);
}
else
{
if (!this.FieldSetInvoice.Collapsed)
this.FieldSetInvoice.Collapse(false);
}
if ((entity.Usage & AddressUsage.Delivery) == AddressUsage.Delivery)
{
if (this.FieldSetDelivery.Collapsed)
this.FieldSetDelivery.Expand(false);
}
else
{
if (!this.FieldSetDelivery.Collapsed)
this.FieldSetDelivery.Collapse(false);