PDA

View Full Version : [CLOSED] Text property not set, when in window??



Jurke
Nov 15, 2008, 6:02 AM
Hi, the text property is not set when in a window, basically your login example. If I remove the window the textproperty is set. Then also there are an error when poping a window with a IFrame, also included in this example. Please try it.

/Mikael





<%@ Page Language="C#" CodeFile="Test.aspx.cs" Inherits="Test_Default" %>


<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">


<head id="Head1" runat="server">





<link href="TravelPerfectSalesPort.css" rel="stylesheet" type="text/css" />


<link href="../ExtJS/resources/css/xtheme-tp.css" rel="stylesheet" type="text/css" />


<title>Example</title>





</head>


<body>


<form id="form1" runat="server">





<ext:ScriptManager ID="ScriptManager1" runat="server" HideInDesign="false">


</ext:ScriptManager>


<ext:Button ID="Button1" runat="server" Text="" Icon="Magnifier">


<AjaxEvents>


<Click OnEvent="Showpop"><EventMask ShowMask="true" /></Click>


</AjaxEvents>


</ext:Button>


<ext:Window


ID="wndLogin"


runat="server"


Closable="false"


Resizable="false"


Height="150"


Icon="Lock"


Title="Login"


Draggable="false"


Width="350"


Modal="true"


BodyStyle="padding:5px;">


<Body>


<ext:TextField


ID="Test"


runat="server"


InputType="Password"


FieldLabel="Password"


AllowBlank="false"


BlankText="Password is required."


EnableKeyEvents="true"


>


<AjaxEvents><KeyPress OnEvent="btnClick_Click" Before="var e = params[1]; var isEnter = e.getKey() == e.ENTER; if(isEnter){e.preventDefault();} return isEnter;" ><EventMask ShowMask="true"/></KeyPress></AjaxEvents>





</ext:TextField>


<ext:Button ID="btnLogin" runat="server" Text="Login" Icon="Accept">


<AjaxEvents>


<Click OnEvent="btnClick_Click">


<EventMask ShowMask="true" />


</Click>


</AjaxEvents>





</ext:Button>


</body>


</ext:Window>


<ext:Window Border="false" CenterOnLoad="true" ID="wndPopup" Maximizable="true" Modal="true" runat="server" Showonload="false" Collapsible="false" Icon="Application" >


</ext:Window>














</form>








</body>


</html>








using System;


using System.Collections;


using System.Configuration;


using System.Data;


using System.Linq;


using System.Web;


using System.Web.Security;


using System.Web.UI;


using System.Web.UI.HtmlControls;


using System.Web.UI.WebControls;


using System.Web.UI.WebControls.WebParts;


using System.Xml.Linq;


using System.Data.SqlClient;


using Coolite.Ext.Web;


using System.Threading;


using System.Text;


using System.Collections.Generic;





public partial class Test_Default : System.Web.UI.Page


{





protected void Page_Load(object sender, EventArgs e)


{


}








protected void Showpop(object sender, AjaxEventArgs e)


{


wndPopup.AutoLoadIFrame = "http://www.google.se";


wndPopup.Title = "Browse booking";


wndPopup.SetIconClass("icon-magnifier");


wndPopup.SetSize(710, 326);


wndPopup.Show();


}


protected void btnClick_Click(object sender, AjaxEventArgs e)


{


string test = Test.Text;


}





}

Vladimir
Nov 15, 2008, 9:00 AM
Hi Mikael,

In your example I don't see where you try update TextField value. In your handler you just set value from text field to local variable



protected void btnClick_Click(object sender, AjaxEventArgs e)
{
string test = Test.Text;
}


If you set value for Text property then it appears in browser



protected void btnClick_Click(object sender, AjaxEventArgs e)
{
string test = Test.Text;

Test.Text = "Test";
}


About IFrame error I wrote in your topic

http://forums.ext.net/showthread.php?threadid=3880-16-1.aspx

Hope this help

Jurke
Nov 15, 2008, 5:50 PM
No you are supposed to type in a value in the form from the browser then click the button to fetch the value. That does not work any more, since the last update.

geoffrey.mcgill
Nov 15, 2008, 7:13 PM
We found the defect and have committed a fix to SVN. Please SVN update and confirm everything is working again for you.

Jurke
Nov 16, 2008, 5:41 AM
Yes, I can now get the text property. But my loginpage now get other errors. I have an example here.
I get null reference errir on this line "ConfigProperties cahcheProperties = HttpContext.Current.Cache[key] as ConfigProperties;" In ClientConfig.cs, and the same error on this line "string error = HttpContext.Current.Error != null ? HttpContext.Current.Error.ToString() : null;" in AjaxRequestModule.cs.

/Mikael






<%@ Page Language="C#" CodeFile="Test.aspx.cs" Inherits="Test_Default" %>


<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>


<%@ OutputCache Location="None" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">


<head id="Head1" runat="server">


<title>SalesPort Login</title>


</head>


<body>


<ext:ScriptManager ID="ScriptManager1" runat="server" HideInDesign="false">


</ext:ScriptManager>





<form id="form1" runat="server">


<ext:Window


ID="wndLogin"


runat="server"


Closable="false"


Resizable="false"


Height="150"


Icon="Lock"


Title="Login"


Draggable="false"


Width="350"


Modal="true"


BodyStyle="padding:5px;">


<Body>


<ext:FormLayout ID="FormLayout1" runat="server">


<ext:Anchor>


<ext:TextField


ID="txtId"


runat="server"


FieldLabel="Id"


AllowBlank="false"


BlankText="Id is required."


Text=""


/>


</ext:Anchor>


<ext:Anchor>


<ext:TextField


ID="txtPassword"


runat="server"


InputType="Password"


FieldLabel="Password"


AllowBlank="false"


BlankText="Password is required."


Text=""


EnableKeyEvents="true"


>


<AjaxEvents><KeyPress OnEvent="btnLogin_Click" Before="var e = params[1]; var isEnter = e.getKey() == e.ENTER; if(isEnter){e.preventDefault();} return isEnter;" ><EventMask ShowMask="true"/></KeyPress></AjaxEvents>


</ext:TextField>


</ext:Anchor>


<ext:Anchor>


<ext:Label ID="lblMessage" runat="server" />





</ext:Anchor>


</ext:FormLayout>








</Body>


<Buttons>


<ext:Button ID="btnLogin" runat="server" Text="Login" Icon="Accept">


<Listeners>


<Click Handler="


if(!#{txtSellerid}.validate() || !#{txtPassword}.validate()) {


Ext.Msg.alert('Error','Id and Password fields are both required');


return false;


}" />


</Listeners>


<AjaxEvents>


<Click OnEvent="btnLogin_Click">


<EventMask ShowMask="true" Msg="Logging in..." MinDelay="250" />


</Click>


</AjaxEvents>


</ext:Button>


</Buttons>


</ext:Window>





</form>


</body>


</html>



[/CODE]





using System;


using System.Collections;


using System.Configuration;


using System.Data;


using System.Linq;


using System.Web;


using System.Web.Security;


using System.Web.UI;


using System.Web.UI.HtmlControls;


using System.Web.UI.WebControls;


using System.Web.UI.WebControls.WebParts;


using System.Xml.Linq;


using Coolite.Ext.Web;





public partial class Test_Default : System.Web.UI.Page


{


protected void Page_Load(object sender, EventArgs e)


{


}


protected void btnLogin_Click(object sender, AjaxEventArgs e)


{


try


{


string Id = txtId.Text;


string Password = txtPassword.Text;





this.wndLogin.Hide();


HttpCookie cookie = Request.Cookies["Login"];


if (cookie == null)


cookie = new HttpCookie("Login");


cookie["Id"] = Id;


cookie["Password"] = Password;


cookie.Expires = DateTime.Now.AddYears(1);


Response.Cookies.Add(cookie);





Response.Redirect("AdminPage.aspx");


}


catch(Exception err)


{


lblMessage.SetHtml("Can not login: "+err.Message);


}





}


}

Vladimir
Nov 16, 2008, 9:18 AM
Hi Mikael,

We fixed bug. Please SVN update and confirm if all works for you.

geoffrey.mcgill
Nov 16, 2008, 9:24 AM
Hi Mikael,

Please note, this Response.Redirect bug was caused by a new performance enhancement feature we incorporated into v0.7 and that feature is still being tested. This specific bug has been fixed, although we still have more testing to accomplish before we can be assured no other defects were introduced. 


I want to thank you for taking the time to report the defect. thanks!


I applogize for the defect and appreciate your patience while we work through completing this new functionality. 

Jurke
Nov 16, 2008, 1:15 PM
Hi guys, it now works like a charm!
No problems, it great that you make enhancements all the time.

/Mikael