Thursday 22 July 2010

Infragistics WebImageButton width problems on non IE Browsers

While testing our application on different browsers, I came across a problem that Infragistic's WebImageButton has on non IE browsers. In particular the width somehow gets set to 0px and the button will not show up. The HTML to show a Save/Cancel set of buttons is as follows:

<div style="margin-left: 40%; margin-right: auto; width: 20%; margin-top: 2em; padding-bottom: 1em;
height: 2em;">
   <div style="width: 100%; height: auto;">
       <div clientselector="btnSave_Container" style="float: left; width: 48%; margin-right: 2%;height: auto;">
             <div style="width: 6em; float: right;" >
                  <igtxt:WebImageButton ID="btnSave" runat="server" Width="100%">
                         <ClientSideEvents Click="SaveView" />
                  </igtxt:WebImageButton>
             </div>
      </div>
      <div style="float: left; width: 45%; height: auto;">
          <div style="width:6em;float:left;" >
               <igtxt:WebImageButton ID="btnCancel" runat="server" Width="100%">
                    <ClientSideEvents Click="closeAddEditDialog" />
              </igtxt:WebImageButton>
          </div>
      </div>
  </div>
</div>
--------------------------------
When viewing this set of buttons in IE8 it looks as follows:
Note that the Save and Cancel buttons are the same size and appear to obey the CSS style of 100% of the containg <div> of width 6em.
Using IE's developer tools, this confirms my assumption:
 

Note that the <table> which is the WebImageButton rendered, has an inline width style of 100% .

However when viewing this same HTML in Chrome, I see the following:



Not what I would expect to see! Using Chrome's developer tools I saw that the <table> did NOT have the style width=100% as it did in IE but rather 0px. This also happens in Firefox. I didn't test Safari but would expect it to be the same as Chrome.


When I reported this to Infragistic's support, they were able to reproduce the problem as well which is good because I didn't want this to be a WOMM (Works On My Machine) issue. A work-around they suggested was to set the style's width in the PreRender Event of the WebImageButton :

WebImageButton1.Attributes.Add("style", width:100%");

Although this works, I would have to set this in code for every WebImageButton (which I have a few). The approach I used was to simply use a CSS class with a child selector to enforce the width as follows:
.WebImageButtonContainer


{

}

.WebImageButtonContainer > table

{

width:100% !important;

}
 
This will force the width of the <table> (WebImageButton) to be 100% no matter what, which is how I want this to work. By adding this class to the containg div-

<div style="margin-left: 40%; margin-right: auto; width: 20%; margin-top: 2em; padding-bottom: 1em;
height: 2em;">
     <div style="width: 100%; height: auto;">
          <div clientselector="btnSave_Container" style="float: left; width: 48%; margin-right: 2%;height:auto;">
               <div style="width: 6em; float: right;" class="WebImageButtonContainer" >
                   <igtxt:WebImageButton ID="btnSave" runat="server" Width="100%">
                       <ClientSideEvents Click="SaveView" />
                  </igtxt:WebImageButton>
               </div>
          </div>
         <div style="float: left; width: 45%; height: auto;">
               <div style="width:6em;float:left;" class="WebImageButtonContainer" >
                   <igtxt:WebImageButton ID="btnCancel" runat="server" Width="100%">
                        <ClientSideEvents Click="closeAddEditDialog" />
                  </igtxt:WebImageButton>
         </div>
    </div>
  </div>
</div>
--------


View the HTML with Chrome now works as desired:
 

Using Chrome's developer tools I can see that the class has overridden the inline width of 0px:



Wednesday 19 May 2010

Infragistics Killer App Contest. Reveille Realtime

OK so the 'Show us yours' popup along with the picture did indeed catch my eye on Infragistics homepage: http://infragistics.com/Default.aspx. The chance of winning the TV was nice as well.

Last year we released Reveille Management Consoles V5.1. A component of this is called Realtime which is a web dashboard:

http://www.reveillesoftware.com/managementconsoles.html

When evaluating a controls product we were initially drawn to Infragistic's 3D charts and gauges. The other controls included in the product came as a bonus. Over a period of time, we found several other Infragistics controls to be of value in the look of our realtime product. With our extensive use of Infragistics controls, AJAX and jQuery, we were able to produce a pure web product without using Flash or Silverlight. It works on IE7+, Firefox, Chrome and Safari as well.



The homepage of Realtime utilizes several Infragistics controls:
  • WebSplitter
  • ultraWebTree
  • webImageButton
  • webGroupBox
  • UltraGauge
All of the data values on the homepage are automatically refreshed at a time set by the user. Instead of an ASP.Net postback, we used a webservice call to an asmx and then updated the values using javascript. To further give the user a smooth refresh look (no postback flickering), we use Infragistic's AsyncRefresh feature on the Ultraguages. When we update the guages, the image is updated smoothly on the screen and does not flicker when the guage image is updated on the screen. A very nice feature! I wish the charts had the same feature!


Clicking on one of the ultraWebTree items, which was loaded from our asp.net web.sitemap file, the target url is loaded into the viewer panel of the websplitter.
Utilizing ASP.Net's AJAX update panels, the ultraWebCharts are drawn using the filter criteria in the top section. Each dropdown list fires an async postback to redraw the charts. Sure would be nice to have the asyncrefresh on the charts like the Ultraguage has. One nice thing that we do on this page is handle a window resize event and redraw the charts to fit. For example, if you click the hide pane of the WebSplitter to hide the navigation tree, the charts will be redrawn to fit the content window's new size. Using jQuery functions to recalculate the height and width of the 4 chart containers, we redraw the charts to fit nicely in its window:


For our reports section, we used the UltraWebGrid to create an HTML view of the report.

We allow the user to save this report in either the database or to their local machine. Using Infragistic's Grid DocExporter, we are able to convert the grid to a PDF,Excel or Text file. The Date dropdown controls on the page? A combination of Infragistic's Webcalendar and WebDateTimeEdit field! In NetAdvantage 10.1 for ASP.Net, they have released a WebDatePicker which is supposed to replace using these 2 controls and a javascript function.

Tuesday 10 June 2008

Joomla 1.5 upgrade error: Fatal error: Cannot redeclare class jconfig in .../public_html/configuration.php on line 2

Even though my blog says .Net and SQL Server experiences, this post deals with Joomla which is an open source LAMP/WAMP etc Content Management System (CMS). My Rotary Club's website was a Joomla 1.0.15 installation and after problems using IE8 beta, Firefox 3 beta 3 as well as Apple Safari (The popup windows when editing content would not work properly) I decided to upgrade to Joomla's new 1.5 CMS.

Needless to say, the migration did not go smoothly and I spent an entire day trying to get the upgraded 1.5 to work.

My situation was that after my upgrade to 1.5 (1.5.3), which completed successfully according to the installer, The site would not work. Trying to view the homepage returned in this PHP error:



Fatal error: Cannot redeclare class jconfig in ..../public_html/configuration.php on line 2



Where the ... is my path to get to public_html directory; yours will different which is why I replaced it with ...



Trying to get to the administration page to login resulted in the same message. Basically this site was dead.



In a nutshell- here is what I discovered: You cannot cleanly do an installation of Joomla 1.5 over a Joomla 1.0.x installation.



After I messed up my site, I found this document which confirmed my observation:

http://help.joomla.org/component/option,com_easyfaq/task,view/id,240/Itemid,268/



I wished the page I used as my guide to upgrade (link below) stated this more clearly.



Details -



I used this page as my guide to the upgrade:



http://www.siteground.com/tutorials/joomla15/joomla_upgrade.htm



I would recommend this page to use for upgrading because it has clear screen shots of what to look for as well as a pretty straightforward step by step explanation with the exception of one paragraph which what caused my problem-



Select Joomla-1.5.0.zip from the file list and download it to your Desktop. Next log in cPanel and go to File manager. Once you open it, you would need to create a new directory called dev (since we are using it for development) inside your public_html directory:



Since I was wanting to move my current production site from 1.0.15 to 1.5.3, I placed the zip file in the public_html directory where 1.0.15 resided and assumed that the installer would uninstall any previous versions of joomla before it "installed" 1.5.3. I was wrong. It seems that after the install of 1.5, there were still 1.0.15 files in the folder and during the initialization of the page (index.php) 1.5 and 1.0.15 php modules got mixed together and resulted in the php error. After stepping through the PHP code, it required (loads) includes\joomla.php. In my case this joomla.php file was still the 1.0.15 version and started loading old 1.0.15 php files. It was the includes/version.php file that clearly showed me what happened. The version.php file clearly showed in the code that it was 1.0:



class joomlaVersion {

/** @var string Product */

var $PRODUCT = 'Joomla!';

/** @var int Main Release Level */

var $RELEASE = '1.0';

/** @var string Development Status */

var $DEV_STATUS = 'Stable';

/** @var int Sub Release Level */

var $DEV_LEVEL = '15';

/** @var int build Number */

var $BUILD = '$Revision: 10052 $';

/** @var string Codename */

var $CODENAME = 'Daytime';

/** @var string Date */

var $RELDATE = '22 February 2008';

/** @var string Time */

var $RELTIME = '23:00';

/** @var string Timezone */

var $RELTZ = 'UTC';

/** @var string Copyright Text */

var $COPYRIGHT = "Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.";

/** @var string URL */

var $URL = 'Joomla! is Free Software released under the GNU/GPL License.';

/** @var string Whether site is a production = 1 or demo site = 0: 1 is default */

var $SITE = 1;

/** @var string Whether site has restricted functionality mostly used for demo sites: 0 is default */

var $RESTRICT = 0;

/** @var string Whether site is still in development phase (disables checks for /installation folder) - should be set to 0 for package release: 0 is default */

var $SVN = 0;


Joomla 1.5 does not appear to even have a version.php file.



So what I did was-


  1. Completely moved ALL files and folders under the public_html directory to somewhere else- Don't delete them because more than likely not all of your files are Joomla 1.0.x. This will now be a "clean" installation

  2. Proceed with the installation step 3 from the siteground upgrade document- http://www.siteground.com/tutorials/joomla15/joomla_upgrade.htm

After this I no longer received the PHP error and was able to view my homepage but without the template information. I then used my backup of public_html to find my templates folder and then my custom joomla 1.0 template. After copying the custom template folder to the new templates folder in my Joomla 1.5 I was able to see my template but only partially.



This forum post cleared up that problem which was to enable the legacy plugin:



http://forum.joomla.org/viewtopic.php?f=466&t=284778



There were a few other things that I had to do to get my site upgraded but at least it was back online.

Thursday 29 May 2008

SQL Server 2005: transaction log for database is full. However there is plenty of space on the Disk

More than likely if you are looking at this entry, you are experiencing a full transaction log AND you are needing to find a quick resolution to get your database back to normal.

So I won't waste your time, beacuse you are probably frantic to get the database back online, this blog entry deals with this scenerio:


  • Message from SQL Server: 'The transaction log for database 'x' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases"


  • SQL Server is running on Windows Server 2003 or Windows Server 2000. Disk is NTFS


  • There is plenty of available disk space on the drive where the transaction log resides


  • The event viewer also shows this message at the same time it reports that the transaction log is full: C:\Data\MSSQL2005External\Data\xxxxx.ldf: Operating system error 112(There is not enough space on the disk.) encountered.

In this particular case the problem was not in the SQL server management (which I spent a considerable amount of time trying to shrink the log, manually run a full backup or even a differential backup with no success). The problem was a disk quota limit was reached for the SQLServer userid.


If your log or data files reside on an NTFS drive, there is a feature in Windows Server that limits the amount of disk space a userid can allocate. Looking at the Log File viewer, Select the "Windows NT" logs and look for a log entry with source 'Ntfs' that occured the same time the SQL log failure occured. The message will say: "A user hit their quota limit on volume x:" The log entry will also show the user id that hit the limit which in my case was the userid for the SQL Server instance.


How to resolve the problem

If this is your situation, open windows explorer on the drive where the quota was reached and right click to view the properties window-





Click the Quota tab and note that quota management is enabled:






Click the Quota Entries... button. You will then see a list of quota entries for this disk- your SQL Server userid should be in this list. Double click the userid entry to see the quota settings for this user for this disk:


Change the limit disk space button to 'do not limit disk space'. I don't know why you would want to limit the SQL Server userid but if you do then set the limit higher. Click OK.

You should now be able to log transactions, do backups and other SQL tasks.

I don't know how the SQL Server userid got placed into the quota list. In fact the person who set up this server did not know he had enabled disk quota: this is a SBS setup so maybe it sets quotas on by default. In any case I just wanted to post this scenerio so that someone else does not get stuck for several hours while customers are trying to use the database.