We have been essential objects for a year or so internally; but have been testing an app destined for external use under https. We have written a core library that has a wraps some of the eo objects. My issue is with the calendar. It works sweetly under http , but under https i am getting the ubiquitous "unsecured contents warning message on IE" - is it worth noting that I do not get this same nessage under Firefox?
At this stage - I am assuming that I have 2 possible scenarios.
The Eo library is requesting from an http resource in code I am unable to see.
OR
My calendar control definition is intervening in some event processing that I am unaware of.
The composite control does not more than join a simple text field, a calendar object and a regex validator, thus allowing the user to enter dates using the keyboard or use the calendar.
I have run out of debug options.
The c# customer control that wraps the calendar is attached below , and the composite control, the attached javascript required to launch the calendar and (what i consider the offending script in the browser)
We have just taken the latest release 2007.2 (Friday Feb 2 2008). Is there a work around for this. My page renders without error if i do not use the control. But that seems rather extreme as a work around.
Regards
IB
When I view source I have NO other http references other than the one pasted below.
//-------------------------------------------
<script type="text/javascript">
//<![CDATA[
if (!window._eo_js && window._eo_autoInit && window.confirm("EO.Web Controls Client Side Debug Message:\r\n\r\nThe control library wasn't able to automatically initialize correctly. Please refer to
http://www.essentialobjects.com/Go.aspx?id=1002 for instructions on how to intialize EO.Web controls manually.\r\n\r\nSelect OK to redirect to the above page automatically."))window.location.href="http://www.essentialobjects.com/Go.aspx?id=1002";
//]]>
</script>
//-------------------------------------------------
namespace Doir.Core.UI.Controls.Input
{
[ToolboxData("<{0}:Calendar runat=server columns=1 rows=1></{0}:Calendar>")]
public class Calendar : EO.Web.PopupCalendar
{
private string IMAGE_URL = Application.ImageRoot + "07/";
private string _columns = "1";
private string _rows = "1";
[Bindable(true), Category("Appearance"), DefaultValue("1"), Description("Columns of Months to display")]
public string columns
{
get { return _columns; }
set { _columns = value; }
}
[Bindable(true), Category("Appearance"), DefaultValue("1"), Description("Rows of Months to display")]
public string rows
{
get { return _rows; }
set { _rows = value; }
}
protected override void RenderContents(HtmlTextWriter output)
{
this.RenderControl(output);
}
public Calendar()
: base()
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.DayCellHeight = 15;
this.DayCellWidth = 31;
this.DayHeaderFormat = DayNameFormat.Short;
this.DisabledDates = new EO.Web.DateCollection();
this.MonthSelectorImageUrl = "00040101";
this.OtherMonthDayVisible = true;
this.Width = new Unit("50px");
this.SelectedDates = new EO.Web.DateCollection();
this.TitleFormat = "MMMM, yyyy";
this.WeekSelectorVisible = true;
this.WeekSelectorImageUrl = "00040102";
this.MonthSelectorVisible = true;
this.TitleStyle.CssText = "font-family:Arial;font-size:0.9em;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;";
this.CalendarStyle.CssText = "font-weight:normal;background-color:white;border-bottom-color:Silver;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Silver;border-left-style:solid;border-left-width:1px;border-right-color:Silver;border-right-style:solid;border-right-width:1px;border-top-color:Silver;border-top-style:solid;border-top-width:1px;color:#2C0B1E;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;";
this.DayHoverStyle.CssText = "background-image:url('00040402');color:#1c7cdc;";
this.MonthStyle.CssText = "cursor:hand;font-family:Arial;font-size:0.9em;margin-bottom:0px;margin-left:4px;margin-right:4px;margin-top:0px;";
this.DayHeaderStyle.CssText = "border-bottom: #f5f5f5 1px solid";
this.PopupCollapseEffect.Type = EO.Web.EffectType.GlideTopToBottom;
this.SelectedDayStyle.CssText = "background-image:url('00040403');color:Brown;";
this.TitleTemplate = BuildTitleTemplate();
this.DisabledDayStyle.CssText = "color: gray";
this.TodayStyle.CssText = "background-image:url('00040401');color:#1176db;";
this.PopupExpandEffect.Type = EO.Web.EffectType.GlideTopToBottom;
this.FooterTemplate = BuildFooterTemplate();
}
private EO.Web.ClientTemplate BuildFooterTemplate()
{
EO.Web.ClientTemplate ct = new EO.Web.ClientTemplate();
ct.Text = @"<table style='font-size: 0.9em; font-family: Arial' border='0' cellSpacing='5' cellPadding='0'>
<tr><td width='30'></td><td valign='middle'></td>
<td valign='middle'>Today: {var:today:MMMM dd, yyyy}</td></tr></table>";
return ct;
}
private EO.Web.ClientTemplate BuildTitleTemplate()
{
EO.Web.ClientTemplate ct = new EO.Web.ClientTemplate();
ct.Text = @"<table width='100%' border='0' cellSpacing='0' cellPadding='0'
style='background-color:#ffffff;font-size: 0.9em; font-family: Arial; '>
<tr><td align='center' width='22'><a href=" + "\"javascript: void {var:this}.goTo(-12);\">" +
@"<img src='" + IMAGE_URL + @"xlarrow.gif' border=0/></a></td>
<td align='left'><a href=" + "\"javascript: void {var:this}.goTo(-1);\">" +
@"<img src='" + IMAGE_URL + @"larrow.gif' border=0/></a></td>
<td align='center' style='font-weight:bold;'>{var:visible_date:MMMM, yyyy}</td>
<td align='right'><a href=" + " \"javascript: void {var:this}.goTo(1);\"> " +
@"<img src='" + IMAGE_URL + @"rarrow.gif' border='0'/></a></td>
<td align='center' width='22'><a href=" + "\"javascript: void {var:this}.goTo(12);\">" +
@"<img src='" + IMAGE_URL + @"xrarrow.gif' border='0'/></a></td></tr>
<tr><td colspan='5' height='5px'></td></tr>
</table>";
return ct;
}
}
}
namespace Doir.Core.UI.Controls.Input
{
public class DateCalendar : System.Web.UI.WebControls.CompositeControl
{
private string IMAGE_URL = Application.ImageRoot + "07/";
protected Calendar _calendar = new Calendar();
protected core.Input _input = new core.Input();
protected RegularExpressionValidator _regex = new RegularExpressionValidator();
protected ImageButton _img = new ImageButton();
public DateCalendar()
: base()
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this._regex.ValidationExpression = @"\d{1,2}/\d{1,2}/\d{4}";
this._regex.EnableClientScript = true;
this._regex.Enabled = true;
this._regex.ErrorMessage = " dd/mm/yyyy";
this._regex.Display = ValidatorDisplay.Dynamic;
this._input.Justify = "left";
this._input.Enabled = this.Enabled;
this._calendar.ClientSideOnSelect = "c";
this._regex.ID = "reg";
this._calendar.ID = "cal";
this._input.ID = "txt";
this._img.ID = "img";
this._img.ImageUrl = IMAGE_URL + "calendar.gif";
this.Page.RegisterClientScriptBlock("DateCalendar", Script);
}
protected override void CreateChildControls()
{
base.CreateChildControls();
_input.Width = this.Width;
Table formatTable = new Table();
formatTable.CellPadding = 0;
formatTable.CellSpacing = 0;
TableRow tr = new TableRow();
TableCell tc1 = new TableCell();
TableCell tc2 = new TableCell();
TableCell tc3 = new TableCell();
TableCell tc4 = new TableCell();
formatTable.Rows.Add(tr);
tr.Cells.Add(tc1);
tr.Cells.Add(tc2);
tr.Cells.Add(tc3);
tr.Cells.Add(tc4);
tc1.Controls.Add(_input);
tc2.Controls.Add(_calendar);
tc3.Controls.Add(_img);
tc4.Controls.Add(_regex);
this.Controls.Add(formatTable);
this._regex.ControlToValidate = this._input.ID;
}
protected override void Render(System.Web.UI.HtmlTextWriter output)
{
this._img.OnClientClick = "p('" + _calendar.ClientID + "', '" + _img.ClientID + "', '" + _input.ClientID + "');return false;";
if (this.DesignMode)
{
this.ID = "Data" + KeyCounter.Next().ToString();
}
base.Render(output);
}
public DateTime DateValue
{
get { return Value; }
}
public string Text
{
get { return this._input.Text; }
set { this._input.Text = value; }
}
public DateTime Value
{
get
{
DateTime rslt = DateTime.MinValue;
if (this._input.Text.Equals(String.Empty))
return rslt;
if (DateTime.TryParse(this._input.Text, out rslt))
{
return rslt;
}
throw new InvalidDateException();
}
}
private const string Script = @"<script type='text/javascript'>
<!--
var eop;
function p(c,a,t){
eo_ShowPopupCalendar(c, a);
eop=t;
}
function c(o,e,vn,vf){
if (e == 'Select'){
var y=window.document.getElementById(eop);
y.value= o.formatDate(o.getSelectedDate(),'dd/MM/yyyy');
}
}
-->
</script>";
}
}
<script type='text/javascript'>
<!--
var eop;
function p(c,a,t){
eo_ShowPopupCalendar(c, a);
eop=t;
}
function c(o,e,vn,vf){
if (e == 'Select'){
var y=window.document.getElementById(eop);
y.value= o.formatDate(o.getSelectedDate(),'dd/MM/yyyy');
}
}
-->
</script>