[CLOSED] UserControl MultiField Allow Blank

  1. #1

    [CLOSED] UserControl MultiField Allow Blank

    I have a usercontrol with a multifield:

    <ext:MultiField ID="CopyToFields" runat="server" FieldLabel="Field Label set in code">
                          <Fields>
                            <ext:TextField ID="txtRecievedBy" EmptyText="Recieved By (name)" Width="320" AllowBlank="false"
                              runat="server">
                             
                            </ext:TextField>
                            <ext:DateField ID="dteCopyDate" runat="server" AllowBlank="false" EmptyText="Select Date.">
                             
                            </ext:DateField>
                            <ext:TimeField ID="tmeCopyTime" runat="server" Increment="1" Format="H:mm" Width="60"
                              AllowBlank="false">
                           
                            </ext:TimeField>
                          </Fields>
                        </ext:MultiField>
    I put this control in a formlayout and then in a formpanel:

                <ext:FormPanel ID="pnlRight" runat="server" Border="true" Header="false" MonitorPoll="50"
                  MonitorValid="true" StyleSpec="padding:2px">
                  <Body>
                    <ext:FormLayout ID="FormLayout2" runat="server" LabelAlign="Left" LabelWidth="100">
                      <ext:Anchor>
                        <ext:Panel ID="Panel3" Border="false" runat="server">
                          <Body>
                            <CTO:CopyTo runat="server" ID="CopyToMedicalPractitioner" />
                          </Body>
                        </ext:Panel>
                      </ext:Anchor>
    </ext:FormLayout>
                  </Body>
                </ext:FormPanel>
    But when I come to check if the #{pnlRight}.getForm().isValid() I always get true even if these fields are left blank. If I remove the usercontrol and put this multifield directly into the page the #{pnlRight}.getForm().isValid() function works correctly. Have a missed something?
  2. #2

    RE: [CLOSED] UserControl MultiField Allow Blank

    Hi,

    You have to wrap your user control code by layout (add layout inside user control and all other code of the control inside that layout). For example by ContainerLayout

Similar Threads

  1. Replies: 1
    Last Post: May 29, 2013, 6:00 PM
  2. Replies: 8
    Last Post: Feb 15, 2012, 9:04 AM
  3. Replies: 0
    Last Post: Aug 03, 2011, 10:27 PM
  4. [CLOSED] "Blank" gridpanel column until edited...then blank again!
    By dmoore in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 24, 2011, 4:11 PM
  5. [CLOSED] [1.0] DirectMethod - Page . UserControl . UserControl
    By Patrick in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 25, 2010, 9:33 AM

Posting Permissions