[CLOSED] [1.0] MVC AjaxResult

  1. #1

    [CLOSED] [1.0] MVC AjaxResult

    This is a continuation of the following post: http://forums.ext.net/showthread.php...Control-Hiding

    So this is the code I have and I can see the XHR is returning the Json to the browser:

    {script:"tTestText.setValue(\"This is from code!\");"}
    So I think I might be missing something. The following is my View and Controller:

    View:
    <ext:TextField ID="tTestText" runat="server" Text="Default stuff" />
    <ext:Button ID="bTestButton" runat="server" Text="Test Button" Icon="Accept">
    	<DirectEvents>
    		<Click Url="/Home/Tester" CleanRequest="true" Method="POST">
    			<ExtraParams>
    				<ext:Parameter Name="Value" Value="#{tTestText}.getValue()" Mode="Raw" />
    			</ExtraParams>
    		</Click>
    	</DirectEvents>
    </ext:Button>
    Controller:
    [HttpPost]
    public ActionResult Tester(string value)
    {
    	ActionResult result = null;
    
    	if (!string.IsNullOrEmpty(value)) {
    		Ext.Net.TextField tTestText = X.GetCmp<TextField>("tTestText");
    		tTestText.Text = "This is from code!";
    
    		result = new AjaxResult(tTestText.GetGeneratedScripts());
    	} else {
    		result = RedirectToAction("SomeAction", "Home");
    	}
    
    	return result;
    }
    This is not updating the tTestText field with the code, however it's being passed back from the browser. Am I missing something?
    Last edited by geoffrey.mcgill; Jan 23, 2011 at 4:27 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I have tried exactly the code that you posted and it appears to be working fine.

    What browser do you test under?
  3. #3
    Hi,

    Are you sure that ID of tTestText equals ClientID? Do you have any javascript errors after button clicking?
    Try to set IDMode="Explicit" for the field

Similar Threads

  1. [CLOSED] Update v2.0 combobox with AjaxResult
    By romeu in forum 2.x Legacy Premium Help
    Replies: 18
    Last Post: May 10, 2012, 8:31 PM
  2. AjaxResult class issue in ext.net.dll
    By vs.mukesh in forum 1.x Help
    Replies: 4
    Last Post: Jun 10, 2010, 1:38 PM
  3. [CLOSED] AjaxResult and AjaxStoreResult
    By fondant in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Nov 19, 2009, 7:45 PM

Posting Permissions