May 13, 2011, 2:00 PM
[CLOSED] Create web server control (composite control)
I created a web server control (composite control) that contains an Ext: TextField.
The following structure was encapsulated in Web server control:
If I place the structure of the "ext:CompositeField" right on the page rather than the Web server control "SUtText1", by clicking the "btnApply", the command "getForm().isValid()" returns "false", not allowing the execution of the event "ToolBarClick". This is the correct procedure.
I need to implement some code in the web server control for the correct functioning of the "isValid()"?
Is there any example that makes this type of implementation?
The following structure was encapsulated in Web server control:
<ext:CompositeField ID="CompositeField1" runat="server"
FieldLabel="Usuário" LabelAlign="Right"
IndicatorIconCls="form-icon-mandatory"
MsgTarget="Side" Width="227" >
<Items>
<ext:TextField ID="TextField1" runat="server"
AllowBlank="false"
Width="200" >
</ext:TextField>
</ext:CompositeField>
I have a page that implements the Web server control and an Ex: Button that runs the validation of information. <form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server"/>
<ext:Viewport runat="server" ID="ViewPort1" >
<Items>
<ext:FormPanel ID="frmDetails" runat="server" Border="false" BodyStyle="background-color:transparent;"
Width="1120" Height="670" >
<Items>
<ext:Panel ID="Panel1" runat="server" Border="false" EnableViewState="true">
<Items>
<ext:Button ID="btnApply" runat="server" Text="Aplicar" IconCls="toolbar-icon-apply-n">
<DirectEvents>
<Click OnEvent="ToolBarClick" Before="return #{frmDetails}.getForm().isValid();">
</Click>
</DirectEvents>
</ext:Button>
</Items>
<Content>
<Sispro:SUtText ID="SUtText1" runat="server" FieldLabel="teste" Width="100" >
</Sispro:SUtText>
</Content>
</ext:Panel>
</Items>
</ext:FormPanel>
</Items>
</ext:Viewport>
</form>
When I type an invalid content in the text, the field is marked as invalid, but clicking the button "btnApply", the code "getForm().isValid()" returns "true", allowing the execution of the event "ToolBarClick".If I place the structure of the "ext:CompositeField" right on the page rather than the Web server control "SUtText1", by clicking the "btnApply", the command "getForm().isValid()" returns "false", not allowing the execution of the event "ToolBarClick". This is the correct procedure.
I need to implement some code in the web server control for the correct functioning of the "isValid()"?
Is there any example that makes this type of implementation?
Last edited by Daniil; May 17, 2011 at 2:07 PM.
Reason: [CLOSED]