Vladimir;
This worked, but same problem still existed w/ isDirtry, so I fixed that below. Also, I had to use a FormPanel, not a Panel, to get isValid and isDirty to work. For grins, I also added an multi-row field that contained a MutlField to make sure that would work. This might turn out to be a good 'Advanced Validation' example for someone.
While this works, it sure feels like a bug-workaround. Shouldn't the framework wire these up when used in this mode?
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script type="text/javascript">
function OnClientValidation(f,e){ CheckFormState(f); }
function EditFormIsValid(){return CheckFormState(Ext.getCmp('_formPanel')); }
function CheckFormState(fp)
{
var form = fp.getForm();
var isValid = form.isValid();
Ext.getCmp('_statusBar').setStatus({
text: isValid ? 'Form is valid' : 'Form is invalid'
});
var btnSave = Ext.getCmp('_saveButton');
if(btnSave)
btnSave.setDisabled(!form.isDirty());
return isValid;
}
</script>
</head>
<body>
<form id="form2" runat="server">
<ext:ScriptManager runat="server" />
<ext:FormPanel ID="_formPanel" runat="server" Width="800" MonitorValid="true" MonitorPoll="500"
Title="FormPanel Validation" BodyStyle="padding:5px;" ButtonAlign="Right" >
<Body>
<ext:FormLayout runat="server">
<ext:Anchor Horizontal="-5">
<ext:TextField runat="server" AllowBlank="false" FieldLabel="SingleField" />
</ext:Anchor>
<ext:Anchor Horizontal="-5">
<ext:MultiField runat="server" FieldLabel="MultiField">
<Fields>
<ext:TextField ID="TextField1" runat="server" AllowBlank="false" Note="First Name" />
<ext:TextField ID="TextField2" runat="server" AllowBlank="false" Note="Last Name" />
</Fields>
</ext:MultiField>
</ext:Anchor>
<ext:Anchor Horizontal="-5" IsFormField="true" >
<ext:FormPanel runat="server" Border="false" FieldLabel="MultiRow">
<Body>
<ext:FormLayout runat="server" HideLabels="true">
<ext:Anchor Horizontal="-5">
<ext:TextField runat="server" AllowBlank="false" Note="Street" />
</ext:Anchor>
<ext:Anchor Horizontal="-5">
<ext:TextField runat="server" AllowBlank="false" Note="City" />
</ext:Anchor>
</ext:FormLayout>
</Body>
<CustomConfig>
<ext:ConfigItem Name="validate" Value="function(){return this.getForm().isValid();}" Mode="Raw" />
<ext:ConfigItem Name="haschanged" Value="function(){return this.getForm().isDirty();}" Mode="Raw" />
</CustomConfig>
<Listeners>
<Render Handler="this.isValid = this.validate; this.isDirty = this.haschanged" />
</Listeners>
</ext:FormPanel>
</ext:Anchor>
<ext:Anchor Horizontal="-5" IsFormField="true" >
<ext:FormPanel runat="server" Border="false" FieldLabel="MultiBoth">
<Body>
<ext:FormLayout runat="server" HideLabels="true">
<ext:Anchor Horizontal="-5">
<ext:MultiField runat="server">
<Fields>
<ext:TextField runat="server" AllowBlank="false" Note="Phone" />
<ext:TextField runat="server" AllowBlank="false" Note="Ext" />
</Fields>
</ext:MultiField>
</ext:Anchor>
<ext:Anchor Horizontal="-5">
<ext:TextField runat="server" AllowBlank="false" Note="Country" />
</ext:Anchor>
</ext:FormLayout>
</Body>
<CustomConfig>
<ext:ConfigItem Name="validate" Value="function(){return this.getForm().isValid();}" Mode="Raw" />
<ext:ConfigItem Name="haschanged" Value="function(){return this.getForm().isDirty();}" Mode="Raw" />
</CustomConfig>
<Listeners>
<Render Handler="this.isValid = this.validate; this.isDirty = this.haschanged" />
</Listeners>
</ext:FormPanel>
</ext:Anchor>
</ext:FormLayout>
</Body>
<Buttons>
<ext:Button ID="_saveButton" runat="server" Text="Save">
<Listeners>
<Click Handler="if(EditFormIsValid()){Ext.Msg.alert('Submit', 'Saved!');}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: 'FormPanel is incorrect', buttons:Ext.Msg.OK});}" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="Cancel" />
</Buttons>
<BottomBar>
<ext:StatusBar ID="_statusBar" runat="server" />
</BottomBar>
<Listeners>
<ClientValidation Fn="OnClientValidation" />
</Listeners>
</ext:FormPanel>
</form>
</body>
</html>