Mar 18, 2011, 12:42 PM
[CLOSED] Error on fire events on load controls
Hi, I have updated my project from a previous version of 1.0.0 to the latest version on premium repository. After this change, I have found a general error on multiples page of my project, caused by the same problem. I explain you the detail for one of this:
There is radio button group and a combobox. According with which one of this radio button is checked, a handler on the listener disables or not this combo.
The problem is: the system fires the event Check for the radio button "radioGroupObligatoryAccount" before the rest of the control of the page has been loaded. So, if you debug inside on the listener Check handler, the cmbCustomerAccount is not defined yet (no control below the radio button is defined). If you remove the "Checked = "true"", the page works properly.
Hence, it seems that after my last update, the coolite behaviour is different: before it, no listeners was fired until all the controls of the page has been loaded.
I would need a "global" solution to it. This is only one specific page that shows this error, but there are a lot of another pages on my project with this global problem.
Here my example detail:
The radio button group:
Thank you in advance
There is radio button group and a combobox. According with which one of this radio button is checked, a handler on the listener disables or not this combo.
The problem is: the system fires the event Check for the radio button "radioGroupObligatoryAccount" before the rest of the control of the page has been loaded. So, if you debug inside on the listener Check handler, the cmbCustomerAccount is not defined yet (no control below the radio button is defined). If you remove the "Checked = "true"", the page works properly.
Hence, it seems that after my last update, the coolite behaviour is different: before it, no listeners was fired until all the controls of the page has been loaded.
I would need a "global" solution to it. This is only one specific page that shows this error, but there are a lot of another pages on my project with this global problem.
Here my example detail:
The radio button group:
<ext:RadioGroup ID="radioGroupAccountType" runat="server" StyleSpec="padding:0px" Width="600">
<Items>
<ext:RadioColumn ID="radioColumn1" runat="server" ColumnWidth="0.25">
<Items>
<ext:Radio ID="radioGroupObligatoryAccount" runat="server" BoxLabel="<%$ Resources: ObligatoryAccount %>" Checked="true" >
<Listeners>
<Check Handler="disableAccountFields((#{radioGroupFreeAccount}.checked || #{radioGroupForbiddenAccount}.checked));" />
</Listeners>
<DirectEvents>
<Check OnEvent="InitializeGridPanelCustomerCount" >
<EventMask ShowMask="true" Msg="<%$ Resources: InitializingAccounts %>" />
</Check>
</DirectEvents>
</ext:Radio>
</Items>
</ext:RadioColumn>
<ext:RadioColumn ID="radioColumn2" runat="server" ColumnWidth="0.25">
<Items>
<ext:Radio ID="radioGroupOptionalAccount" runat="server" BoxLabel="<%$ Resources: OptionalAccount %>" >
<Listeners>
<Check Handler="disableAccountFields((#{radioGroupFreeAccount}.checked || #{radioGroupForbiddenAccount}.checked));" />
</Listeners>
<DirectEvents>
<Check OnEvent="InitializeGridPanelCustomerCount" >
<EventMask ShowMask="true" Msg="<%$ Resources: InitializingAccounts %>" />
</Check>
</DirectEvents>
</ext:Radio>
</Items>
</ext:RadioColumn>
<ext:RadioColumn ID="radioColumn3" runat="server" ColumnWidth="0.25">
<Items>
<ext:Radio ID="radioGroupFreeAccount" runat="server" BoxLabel="<%$ Resources: FreeAccount %>" >
<Listeners>
<Check Handler="disableAccountFields((#{radioGroupFreeAccount}.checked || #{radioGroupForbiddenAccount}.checked));" />
</Listeners>
</ext:Radio>
</Items>
</ext:RadioColumn>
<ext:RadioColumn ID="radioColumn4" runat="server" ColumnWidth="0.25">
<Items>
<ext:Radio ID="radioGroupForbiddenAccount" runat="server" BoxLabel="<%$ Resources: ForbiddenAccount %>" >
<Listeners>
<Check Handler="disableAccountFields((#{radioGroupFreeAccount}.checked || #{radioGroupForbiddenAccount}.checked));" />
</Listeners>
</ext:Radio>
</Items>
</ext:RadioColumn>
</Items>
</ext:RadioGroup>
The combo box to be disabled is:<ext:ComboBox ID="cmbCustomerAccount" Width="350" TriggerAction="All" runat="server" StoreID="storeCustomerAccount" ValueField="UniqueId" DisplayField="Account"
TypeAhead="true" Mode="Local" AutoHeight="true" SelectOnFocus="true" AllowBlank="true" Editable="false" ListWidth="600"
EmptyText="<%$ Resources: emptySelector.Text %>" ValueNotFoundText="<%$ Resources: emptySelector.Text %>" >
</ext:ComboBox>
And the code called by the handler is:var disableAccountFields = function(disabled) {
cmbCustomerAccount.setDisabled(disabled);
}
And the error is: "cmbCustomerAccount is not defined"Thank you in advance
Last edited by Daniil; Apr 01, 2011 at 12:36 PM.
Reason: [CLOSED]