[CLOSED] FormPanel and FieldSet don't work together

  1. #1

    [CLOSED] FormPanel and FieldSet don't work together

    It appears that when I use FieldSet within a FormPanel, I don't get the "valid" property of Form. Here is the code that doesn't work.

    <ext:FormPanel ID="InviteForm" runat="server" MonitorPoll="500" MonitorValid="true"
      Frame="True" BodyStyle="padding:5px;" ButtonAlign="Right" LabelAlign="Top" Width="360"
      Height="502">
      <Body>
        <ext:FieldSet ID="FieldSet1" runat="server" Title="User Information" AutoHeight="true">
          <Body>
            <ext:FormLayout runat="server">
              <ext:Anchor Horizontal="90%">
                <ext:TextField ID="txtEmail" runat="server" FieldLabel="Email"
                  Vtype="email" BlankText="Email is required" LabelSeparator=""
                  AllowBlank="false" />
              </ext:Anchor>
              <ext:Anchor Horizontal="90%">
                <ext:TextField ID="txtFirstName" runat="server" FieldLabel="FirstName"
                  AllowBlank="false" BlankText="FirstName is required"
                  LabelSeparator="" />
              </ext:Anchor>
              <ext:Anchor Horizontal="90%">
                <ext:TextField ID="txtLastName" runat="server" FieldLabel="Last Name"
                  AllowBlank="false" BlankText="LastName is required"
                  LabelSeparator="" />
              </ext:Anchor>
            </ext:FormLayout>
          </Body>
        </ext:FieldSet>
        <ext:FieldSet ID="FieldSet2" runat="server" Title="User Rights" AutoHeight="true">
          <Body>
            <ext:FormLayout ID="FormLayout2" LabelWidth="100" runat="server">
              <ext:Anchor>
                <ext:Checkbox ID="chkCreateWorkSpaces" HideLabel="true" BoxLabel="Option#1"
                  runat="server" />
              </ext:Anchor>
              <ext:Anchor>
                <ext:Checkbox ID="chkStartWebConference" HideLabel="true" BoxLabel="Option#2"
                  runat="server" />
              </ext:Anchor>
            </ext:FormLayout>
          </Body>
        </ext:FieldSet>
        <ext:FieldSet ID="FieldSet3" runat="server" Title="Message"
          AutoHeight="true">
          <Body>
            <ext:FormLayout ID="FormLayout3" runat="server">
              <ext:Anchor Horizontal="100%">
                <ext:TextArea ID="emailMessage" HideLabel="true" runat="server">
                </ext:TextArea>
              </ext:Anchor>
            </ext:FormLayout>
          </Body>
        </ext:FieldSet>
      </Body>
      <Buttons>
        <ext:Button ID="btnInviteSend" runat="server" Text="Send">
          <Listeners>
            <Click Handler="#{InviteForm}.form.submit({clientValidation: true, waitMsg:'Sending Invitation...'});" />
          </Listeners>
        </ext:Button>
        <ext:Button ID="btnCancel" runat="server" Text="Cancel">
          <Listeners>
            <Click Handler="parent.UserInvitewindow.hide(null);" />
          </Listeners>
        </ext:Button>
      </Buttons>
      <Listeners>
        <ClientValidation Handler="valid ? #{btnInviteSend}.enable() : #{btnInviteSend}.disable();" />
      </Listeners>
    </ext:FormPanel>
  2. #2

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Hi,

    You need wrap FieldSets by ContainerLayout. FormPanel can check items which placed inside layouts. Also you need update from SVN because we fix one bug related with ClientValidation
    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:FormPanel ID="InviteForm" runat="server" MonitorPoll="500" MonitorValid="true"
                Frame="True" BodyStyle="padding:5px;" ButtonAlign="Right" LabelAlign="Top" Width="360"
                Height="502">
                <Body>
                    <ext:ContainerLayout runat="server">
                        <ext:FieldSet ID="FieldSet1" runat="server" Title="User Information" AutoHeight="true">
                            <Body>
                                <ext:FormLayout runat="server">
                                    <ext:Anchor Horizontal="90%">
                                        <ext:TextField ID="txtEmail" runat="server" FieldLabel="Email" Vtype="email" BlankText="Email is required"
                                            LabelSeparator="" AllowBlank="false" />
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="90%">
                                        <ext:TextField ID="txtFirstName" runat="server" FieldLabel="FirstName" AllowBlank="false"
                                            BlankText="FirstName is required" LabelSeparator="" />
                                    </ext:Anchor>
                                    <ext:Anchor Horizontal="90%">
                                        <ext:TextField ID="txtLastName" runat="server" FieldLabel="Last Name" AllowBlank="false"
                                            BlankText="LastName is required" LabelSeparator="" />
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:FieldSet>
                        <ext:FieldSet ID="FieldSet2" runat="server" Title="User Rights" AutoHeight="true">
                            <Body>
                                <ext:FormLayout ID="FormLayout2" LabelWidth="100" runat="server">
                                    <ext:Anchor>
                                        <ext:Checkbox ID="chkCreateWorkSpaces" HideLabel="true" BoxLabel="Option#1" runat="server" />
                                    </ext:Anchor>
                                    <ext:Anchor>
                                        <ext:Checkbox ID="chkStartWebConference" HideLabel="true" BoxLabel="Option#2" runat="server" />
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:FieldSet>
                        <ext:FieldSet ID="FieldSet3" runat="server" Title="Message" AutoHeight="true">
                            <Body>
                                <ext:FormLayout ID="FormLayout3" runat="server">
                                    <ext:Anchor Horizontal="100%">
                                        <ext:TextArea ID="emailMessage" HideLabel="true" runat="server">
                                        </ext:TextArea>
                                    </ext:Anchor>
                                </ext:FormLayout>
                            </Body>
                        </ext:FieldSet>
                    </ext:ContainerLayout>                
                </Body>
                <Buttons>
                    <ext:Button ID="btnInviteSend" runat="server" Text="Send">
                        <Listeners>
                            <Click Handler="#{InviteForm}.form.submit({clientValidation: true, waitMsg:'Sending Invitation...'});" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btnCancel" runat="server" Text="Cancel">
                        <Listeners>
                            <Click Handler="parent.UserInvitewindow.hide(null);" />
                        </Listeners>
                    </ext:Button>
                </Buttons>
                <Listeners>
                    <ClientValidation Handler="valid ? #{btnInviteSend}.enable() : #{btnInviteSend}.disable();" />
                </Listeners>
            </ext:FormPanel>
        </form>
    </body>
    </html>
  3. #3

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Thanks Vladsch. It solved the problem.

    The only issue I see now that visual studio editor complains about "FieldSet" is not a known element. I also lose the intelisense. Does the update solve this issue as well?

    Shahid

  4. #4

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Hi,

    I have no problems with intelisense. Try to restart VS. If the issue repeats then can you make screenshot of VS error
  5. #5

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Hi Vlad,

    Please see the attached screenshot. I am using VS 2005 SP2. If I remove the "ContainerLayout" tag then intellisense comes back.




    Shahid
  6. #6

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Hi,

    I think it is VS cache assembly issue. Did you try to restart VS?
    Try to right-click on Solution node in Solution Explorer and choose Clean Solution. After that restart VS
  7. #7

    RE: [CLOSED] FormPanel and FieldSet don't work together

    I tried to all sorts of things with VS but it didn't resolve. I am not worried that much about intellesense. It could be my installation issue. The problem I am having now is that the same code doesn't work with IE 8.0. Works with chrome, firefox. Please see the attachement from IE debugger window.
  8. #8

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Hi,

    Setting the property with '#{InviteForm}.form.submit' should not be required. When you use FormPanel inside ASP.NET form then FormPanel doesn't render own form because one form can't be nested inside another. For me that code doesn't work in IE, FF and Chrome.

    1. If you placed inside ASP.NET form, just use simple AjaxEvent and read fields on server side

    <ext:Button ID="btnInviteSend" runat="server" Text="Send">
        <AjaxEvents>
            <Click OnEvent="SubmitFields" Before="Ext.Msg.wait('Sending Invitation...');" />
        </AjaxEvents>
    </ext:Button>
    
    protected void SubmitFields(object sender, AjaxEventArgs e)
    {
         //perform own logic
    
         Ext.Msg.Hide();//hide wait dialog
    }
    2. You can delete ASP.NET form. In this case the FormPanel will create own form and submit will work but
    - if you don't specify url then it will submit to aspx page and you need to build special answer (the simple answer can be json string - {success:true}) and prevent standard html output. Otherwise you will get js error in response parser (please note that controls will not be automically filed by submitted values because it is not postback)
    - you can define submit's url in sumbit's config and submit to the http handler

    I recomend to use first variant (the minimum code from your side) or variant with http handler and no ASP.NET form if you need quick response
  9. #9

    RE: [CLOSED] FormPanel and FieldSet don't work together

    Thanks Vlad for explaining. This is what I was suspecting and your answer confirmed that. I will use the first option as it is simpler without writing separate http handler.

    Thanks for your quick answer.


    Shahid

Similar Threads

  1. Drag and Drop: Grid To FormPanel isn´t work
    By krlos02 in forum 1.x Help
    Replies: 6
    Last Post: Feb 28, 2012, 1:35 PM
  2. Replies: 1
    Last Post: Jan 26, 2011, 3:07 PM
  3. FormPanel Validation does not work
    By weiguo526 in forum 1.x Help
    Replies: 0
    Last Post: May 12, 2010, 11:40 AM
  4. [CLOSED] loadRecord doesn't work when formPanel is in Tab
    By HOWARDJ in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 16, 2009, 2:12 PM
  5. [CLOSED] Fieldset Cls property does'nt work
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Dec 08, 2008, 4:53 AM

Posting Permissions