Dec 30, 2012, 3:19 PM
[CLOSED] formID with directMethod fails to send dates
Hello
Experimenting with direct methods a little and I faced following issue: If DateField.Format is set, the date is not passed to the server. In fact, the date is passed to the server but in d/m/Y format, which fails to be formated on server. This happends only if formId is set, otherwise it works fine
Here is a code:
In addition - is it possible to configure directevent to send form data only? (it send "dummy" as well)
I'm on Ext 2.0
Thanks
Experimenting with direct methods a little and I faced following issue: If DateField.Format is set, the date is not passed to the server. In fact, the date is passed to the server but in d/m/Y format, which fails to be formated on server. This happends only if formId is set, otherwise it works fine
Here is a code:
<script>
function submitMe() {
Ext.net.DirectMethods.DirectMethod();
}
function submitMeFormOnly() {
Ext.net.DirectMethods.DirectMethod({
formId : '<%= testForm.ClientID %>'
});
}
</script>
<ext:TextField runat="server" ID="txtJustForHaveTHereSomethingOutofForm" Text="Dummy"></ext:TextField>
<ext:FormPanel runat="server" ID="testForm">
<Items>
<ext:DateField runat="server" ID="date" FieldLabel="xxx"/>
<ext:Button ID="Button1" runat="server" Text="Click Direct Event" OnDirectClick="testDirectEvent_click"/>
</Items>
</ext:FormPanel>
<ext:Button runat="server" Text="Test Direct Method Full Submit" OnClientClick="submitMe()"></ext:Button>
<ext:Button ID="Button2" runat="server" Text="Test Direct Method Form Only" OnClientClick="submitMeFormOnly()"></ext:Button>
codebehind:protected override void OnLoad(EventArgs e)
{
if (IsPostBack == false)
date.SelectedDate = DateTime.Now;
base.OnLoad(e);
}
protected void testDirectEvent_click(object sender, DirectEventArgs e)
{
X.Msg.Alert("",date.SelectedDate).Show();
}
[DirectMethod]
public void DirectMethod()
{
X.Msg.Alert("", date.SelectedDate).Show();
}
If the last button is clicked the severdate is DateTime.Min, not the DateTime.NowIn addition - is it possible to configure directevent to send form data only? (it send "dummy" as well)
I'm on Ext 2.0
Thanks
Last edited by Daniil; Jan 07, 2013 at 1:38 PM.
Reason: [CLOSED]