ext:Label in FormLayout

  1. #1

    ext:Label in FormLayout



    Hi!

    It is possible to put Label in FormPanel?

    I'd like to show non editable information - my piece of code:

    
    <ext:FormPanel ID="FormPanel1" runat="server" Title="title"
            StyleSpec="padding-left:16px;padding-top:16px;" MonitorPoll="500" MonitorValid="true"
            Width="1024" BodyStyle="padding:5px;" ButtonAlign="Right">
            <Body>
                <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                    <ext:LayoutColumn ColumnWidth=".5">
                        <ext:Panel ID="Panel1" runat="server" Border="false">
                            <Body>
                                <ext:ContainerLayout ID="ContainerLayout1" runat="server">
                                   <ext:Panel runat="server" Title="Data" Border="false" Frame="true" Header="true"
                                        FormGroup="true">
                                        <Defaults>
                                            <ext:Parameter Name="MsgTarget" Value="side" />
                                        </Defaults>
                                        <Body>
                                            <ext:FormLayout runat="server" LabelAlign="Left" LabelCls="form-label" LabelWidth="160">
                                                <ext:Anchor Horizontal="92%">
                                               <ext:Label ID="labelKind" runat="server" FieldLabel="Kind"   />
                                                 
                                                </ext:Anchor>
    but js error occured - label doesn't have isValid method...




    Regards




    Mrozik


  2. #2

    RE: ext:Label in FormLayout

    Hi Mrozik,

    Are you running some custom validation logic that makes a call to the .isValid() function()? Maybe you could post a full sample which demonstrates how to reproduce the issue.


    Geoffrey McGill
    Founder
  3. #3

    RE: ext:Label in FormLayout

    I forgot to mention, placing an <ext:Label> control inside a FormPanel is not a problem.

    Somewhere a script is making a call to the .isValid() function of a Label, but the Label does not have that function. I'm unsure if the call is being made from our script or a custom script.


    Geoffrey McGill
    Founder
  4. #4

    RE: ext:Label in FormLayout

    A piece of code (dynamic) that causes exception is:

    var valid=true;this.form.items.each(function(f){if(!f. isValid(true)){valid=false;return false;}})

    - 'f' variable points to my label ctl00_pageContentPlaceHolderCenter_labelRodzaj

    - full code of page is in attachment.

    As I know our code doesn't do nothing special - only save button check form valid:

    <Click OnEvent="FormSave" Before="var valid= #{FormPanel1}.getForm().isValid(); if(valid){#{FormStatusBar}.showBusy('Saving form...');} return valid;">
                            <EventMask ShowMask="true" MinDelay="1000" Target="CustomTarget" CustomTarget="={#{FormPanel1}.getEl()}" />
                        </Click>
    Thanks for your help

    Mrozik
  5. #5

    RE: ext:Label in FormLayout

    Hi Mrozik,

    I'm not sure if you're still having an issue or not? The call to FormPanel1.getForm().isValid() is correct.


    The first chunk of code you posted should be revised as follows:


    Example


    var valid=true;this.form.items.each(function(f){if(f.isValid &amp;&amp; !f.isValid(true)){valid=false;return false;}})

    Notice the extra check of "f.isValid" added to the if statement.


    Hope this helps.


    Geoffrey McGill
    Founder
  6. #6

    RE: ext:Label in FormLayout

    Hi,
    I'm still looking for solution.
    First piece of code I posted is generated on the fly by Coolite library when calling FormPanel1.getForm().isValid() in 'Before' handler - how can I rewrite it to retrieve 'if(f.isValid &amp;&amp; !f.isValid(true)' as you wrote?
    Mrozik
  7. #7

    RE: ext:Label in FormLayout

    k. I think I found the issue. There appears to be a defect in the client-side implementation of the MonitorValid property.

    We should be able to fix easily.


    Geoffrey McGill
    Founder
  8. #8

    RE: ext:Label in FormLayout

    ok. I've committed a fix to the svn source code repository.

    We are expecting to have another public maintenance release (v0.8.2), although no time frame has been set for that release.


    If you do not have access to the svn repository, you can work-around the problem by setting MonitorValid="false".


    Hope this helps.


    Geoffrey McGill
    Founder
  9. #9

    RE: ext:Label in FormLayout

    Thank you for your fix.
    Regards
    Mrozik

Similar Threads

  1. [CLOSED] Label Style / Obtain label color based on theme
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Apr 15, 2010, 10:35 AM
  2. Combine label alignement in FormLayout
    By sfvaleriano in forum 1.x Help
    Replies: 4
    Last Post: Jun 24, 2009, 12:31 PM
  3. Replies: 1
    Last Post: Feb 03, 2009, 6:44 AM
  4. FormLayout Resize
    By mathec in forum 1.x Help
    Replies: 2
    Last Post: Jan 28, 2009, 5:52 PM
  5. FormLayout with label above of input
    By pkngan in forum 1.x Help
    Replies: 0
    Last Post: Oct 29, 2008, 1:12 PM

Posting Permissions