Hi,
I just updated my project to 2008.2 this morning. Now for all my WebNumericEdit controls, you cannot update the value. Looking at the source, it seems that an readonly="true" is added to the source for those controls for no reason. I tried a simple sample of one page with one control on it, and the problem does not occur. I tried putting that control into a web
Nothing to complex. Numeric editor within a user control
<igtxt:WebNumericEdit ID="SecuritiesChargeMember" runat="server" ValueText="0" ></igtxt:WebNumericEdit>
<input type="hidden" name="ctl00$ctl00$SIRFF_Main$SIRFF_Main$CDDetailsControl0$RiskCapitalBeforeChargeSRO" id="ctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO" value="0" /><input type="hidden" name="ctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO_p" id="ctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO_p" value="" /><input type="text" style="text-align:Right;ime-mode:disabled;" value="0" id="igtxtctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO" readonly="true" />
Source before upgrade
<input type="hidden" name="ctl00$ctl00$SIRFF_Main$SIRFF_Main$CDDetailsControl0$RiskCapitalBeforeChargeSRO" id="ctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO" value="0" />
<input type="hidden" name="ctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO_p" id="ctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO_p" value="" /><input type="text" style="text-align:Right;" value="0" id="igtxtctl00_ctl00_SIRFF_Main_SIRFF_Main_CDDetailsControl0_RiskCapitalBeforeChargeSRO" />
A simple sample in a new project has no issues, but even a simple page on this upgraded project has this issue. All other infragistics controls appear to be okay.
Any thoughts?
Hi Guys,
My mistake here. I forgot to update the infragistics scripts within my project to the newest version. All is fine now.
That "readonly" was added to get around features in IE related to loading html and resources after async request. IE does not wait for resources and shows html instantly, but if resources are large, then user see input field and if script was not ran yet, then user might enter anything there. While initialization of control text is deleted. So, readonly does a trick.
Hey guys,
I realize that a) This post is really old, and b) The "classic" ASP.NET controls have been superceded by the Aikido-based controls, but I'm trying to upgrade a project from 2007.1 CLR2.0 to 2011.1 CLR2.0 (using the classic controls, just to get the IE9 support) and I'm SOOOO close to having it working! The only thing that's still giving me trouble is that my WebNumericEdit controls that I've embedded into my UltraWebGrid are no longer working. (The code's been working for 5+ years using 2007.1.) In inspecting the HTML, I noticed that I get the exact same difference as James (readonly="true" using 2011.1, but not using 2007.1)
However, I'm not using an old version of the script files. I'm using the embedded resources from the dll's. Or at least, I think I am, since I can't find any ig_*.js files in my Temporary Internet Files folder, but I CAN find ScriptResource.axd files, and found one that's got the contents of the ig_edit.js file... I did a WinMerge file comparison between that file and my 2011.1 copy of ig_edit.js, and the only differences are that the .axd file does not have any comments in it. Otherwise, the two are identical. (I cleared out all of my temporary internet files, and then loaded just the page in question, and then looked for the .js and .axd files.) So, this says to me that I'm using the right version of script. I have also tried deploying this application to a test server which does NOT have any Infragistics .js files on it, and I still get the same behavior.
My 2 target browsers are IE8 and IE9, and I get the same behavior/rendered HTML with both.
I've got Infragistics version 11.1.20111.2178 installed.
Do you have any other ideas of things I could look at?
Thanks!
Jamie Foster
Hi Jamie,
The unconditional readonly="true" attribute for INPUT of WebTextEdit was added to get around situation, when editor is located in UpdatePanel or similar and page loads very slowly. In this situation content of html can be already available for end user, but js files were still not loaded or javascript initialization was not executed yet. If end user will start to edit text in WebTextEdit, then INPUT behaves as a dummy without any filtering or knowledge about end-user entry. The javascript initialization, which may come later will not know about new value and functionality will be corrupted.The readonly allows to avoid that situation and prevents end-user entry until js initialization hits. The initialization removes readonly and editor becomes functional.
If your application loads embedded js files for WebTextEdit, then what you describe, should not happen. I think, that happens because of wrong version ig_edit.js used by your application. Maybe 2 js files are loaded: one from resources and one explicit old ig_edit.js from webconfig or similar, but wrong js file gets priority.
You may inspect content of generated html and look at <script src="..."> tags and search for (wrong) ig_edit.js value.
You also may debug by following:
1. Add to your page something like below:
<script type="text/javascript"> function WebTextEdit1_Initialize(oEdit, text){ debugger; }</script><igtxt:WebTextEdit ID="WebTextEdit1" runat="server"> <ClientSideEvents Initialize="WebTextEdit1_Initialize" /></igtxt:WebTextEdit>
2. Run page in any browser which supports javscript debugging or in VisualStudio in debug mode.
3. At break point (debugger;) go to "Call Stack" tab of debugger and go to "fireEvent" or "igedit_init" lines.That will open actual run-time ig_edit.js (should be embedded resource).
4. Within content of that js file do search for "readOnly" string. Somewhere in the middle offunction igedit_new(elem,id,prop0) ...you should find following line:
if((this._flag&4)==0)e.readOnly=false;
If that statement is not there, then it means that your dynamically loaded js file is wrong.Also the very first line in that js file should contain something like//vs 111411
Which represents internal compressed date of last update: 11/14/2011 (month, day, year).
Hey Viktor,
Thanks for the Reply! It looks like I AM running the correct version of ig_edit.js. In #3, I opened the script file via the igedit_init line.
In #4, I do have that line (1043 when it's rendered). It's in the middle of igedit_new, as you suggested:
if((e=document.getElementById(id+"_t"))==null)e=elem;
this.elem=e;
Also, at the top of the ScriptResource.axd file, I do see that it's 111411 that's running:
//vs 111411
Do you have any other ideas that I could try?
I have exciting news! I've found the magical combination!
Column:
column.Type = ColumnType.Custom;
column.DataType = "System.Decimal";
column.EditorControlID = webNumericEdit.ID;
WebNumericEdit:
webNumericEdit.Nullable = allowNull;
webNumericEdit.EnableViewState = false;
webNumericEdit.BorderStyle = BorderStyle.None;
webNumericEdit.Visible = true;
System.Globalization.NumberFormatInfo nf = new System.Globalization.NumberFormatInfo();
nf.NumberDecimalDigits = 2;
webNumericEdit.NumberFormat = nf;
if (allowNull)
{
webNumericEdit.NullText = "";
}
Thank you so much for your help! Knowing that it wasn't a wrong-script-version problem allowed me to focus on the different combinations of property values!