View Full Version : [CLOSED] Problem with store reload if de.Click.FormID is present in DirectEvents

Jul 01, 2014, 7:12 AM
I have form panel inside window,and its contain a file upload along with other field.


.Url(Url.Action("reloadgrid", "VendorRegistration"))

.Listeners(l => l.Click.Handler = "return validation();")

.DirectEvents(de =>
de.Click.FormID = "f";
de.Click.Action = "save";
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Saving...";
de.Click.EventMask.MinDelay = 100;
de.Click.Complete = "App.GridPanel1.getStore().reload();";

controller code

public ActionResult reloadgrid()
object[] o = GetData().Cast<object>().ToArray();
return this.Store(o);

the problem is if de.Click.FormID = "f"; present then reloadgrid function is not called. but if i remove de.Click.FormID = "f"; the reloadgrid function is called but i am not getting value from controls inside from.I try with de.Click.Success also.

I fond if save action return type is void then reloadgrid function is called ,but I have a fileupload filed inside the formpanel
so my save action return type is DirectResult,and end of this f unction i write
DirectResult result = new DirectResult();
result.IsUpload = true;
I f i not doing this then fileupload give an error.

please see http://legalinfoservices.com/file.zip,I think from this 2 file you will understand the scenario

Jul 01, 2014, 1:45 PM
Hi @matrixwebtech,

It is better to post all the related code (simplified) directly here. Zips are not required mostly. If it is required for some reason, we request it.

I see the following in your code:

DirectResult result = new DirectResult();
result.IsUpload = true;
return CleareFields();

Yes, you are right that you set IsUpload to true, but you don't return that result.

It should be like that:

DirectResult result = new CleareFields();
result.IsUpload = true;
return result;

If there is an upload action, please ensure it always returns a DirectResult with .IsUpload set to true.