This is a migrated thread and some comments may be shown as answers.

Disabling Currency Changes Display

20 Answers 175 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jay
Top achievements
Rank 1
Jay asked on 18 Mar 2011, 03:00 PM
If you .Enable(false) on a currency textbox it now displays unformatted.  This is a definate change from the previous version.   I don't know if this is by design or not, but was definitely unexpected when I upgraded by project.

20 Answers, 1 is accepted

Sort by
0
Juan Pablo Perez
Top achievements
Rank 1
answered on 18 Mar 2011, 07:59 PM
I have the same problem after updating. It works properly with IE when is disabled but not with Chrome (appears the amount twice) nor Mozilla. With the 3 of them it appears unformatted when it loses focus.
0
Juan Pablo Perez
Top achievements
Rank 1
answered on 21 Mar 2011, 10:54 AM
Please, any help with this problem?

Everything was working perfectly before updating to 2011 Q1 version.

Many thanks in advance.

Juan Pablo Pérez
0
Jay
Top achievements
Rank 1
answered on 21 Mar 2011, 01:23 PM
Juan,

My screen looked like yours when I first updated.  But I'd noticed I hadn't properly updated the css files.   I went through and deleted all of the css/js files from my project, then added them back in from the telerik folder, and it all worked out.

The problem I'm having above persisted even after I updated the content files though.  I rolled back to Q32010 because I'm out of time to deal with this right now.

-Jeff
0
Georgi Krustev
Telerik team
answered on 21 Mar 2011, 02:32 PM
Hello Jeff,

 
This issue is expected because of the changes in the HTML rendering. It is caused by the default behavior of some browsers to reject any styles if the HTML input element is disabled. That is why was enforced to hide DIV element which holds the formatted value.

Nevertheless, I will forward this problem to our developers for further consideration and possible improvement.

Regards,

Georgi Krustev
the Telerik team
0
Juan Pablo Perez
Top achievements
Rank 1
answered on 21 Mar 2011, 02:55 PM
Hello Georgi,

The problem arises when you include an additional class with InputHtmlAttributes, I think it has nothing to do with the disabled of the control.

I've Included
 a sample project where you can clearly see the behavior. In each browser it behaves differently.

Thank you very much for your time.

Regards,

Juan Pablo Perez
0
Juan Pablo Perez
Top achievements
Rank 1
answered on 22 Mar 2011, 10:44 AM
Hello Georgi,

Could you, please, confirm me if there is any problem when you include an additional class with InputHtmlAttributes? Or maybe I'm doing something wrong?

Thank you very much in advance.

Regards,

Juan Pablo Pérez
0
Georgi Krustev
Telerik team
answered on 22 Mar 2011, 10:52 AM
Hello Juan,

 
NumericTextBox UI component has breaking changes in the rendering. The changes are described in this help topic. Hence component now renders HTML input element and span. You will need to revise your custom CSS styles to meet changes in the rendering. There are no known issues with the InputHtmlAttributes and far as I noticed in your test project they are correctly applied to the HTML input and to the span elements.

Regards,
Georgi Krustev
the Telerik team
0
Juan Pablo Perez
Top achievements
Rank 1
answered on 22 Mar 2011, 01:34 PM
Hello Georgi,

I've been investigating with firebug and I think the class that I'm adding, FormText, is only added to the input value not to the div formatted value.

Any suggestion to solve the problem?.

Also, I think that when the control is Localized to be used in Spanish, decimal point is not  been renderized correctly.

Regards,

Juan Pablo Pérez
<div class="t-widget t-numerictextbox">
<div class="t-formatted-value" style="font-family: MS Shell Dlg; font-size: 12px; font-weight: 400; line-height: 15px; color: rgb(0, 0, 0); text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; display: block;">1,111.00</div>
<input title="Points" name="Points" id="Points" data-val-required="The Points field is required." data-val-number="The field Points must be a number." data-val="true" class="t-input FormText" style="color: rgb(255, 255, 255);">
</div>
0
Georgi Krustev
Telerik team
answered on 23 Mar 2011, 04:08 PM
Hello Juan,

 
Excuse me for the misleading information. Currently NumericTextBox UI component does not copy value of the class attribute from HTML input element to the DIV. It just copy a particular set of styles.

Nevertheless I forward this issue to our developers and they decide that we should copy value of the class attribute too. The fix will be included in the next official release of Telerik Components for ASP.NET MVC.

For your convenience I have attached the modified JavaScript file.

Regards,
Georgi Krustev
the Telerik team
0
Bob Mills
Top achievements
Rank 2
answered on 11 Apr 2011, 10:40 PM
I am having the same problem with the disabled numeric textbox after applying the latest Telerik controls.
The textbox displays two sets of numbers.

After applying the new js file mentioned in this thread, it works best under Firefox.  Under Chrome it doesn't work at all.  Under IE it works most of the time.  Some times the numbers do not display zeros.  Has this file been updated?

Regards


0
Dimo
Telerik team
answered on 12 Apr 2011, 04:00 PM
Hi all,

The problem in the webkit-based browsers (Safari, Chrome) is caused by the fact that they do not apply accurately the color style of disabled elements. In our case, these browsers apply a little lighter or darker textbox color and it remains visible behind the formatted value.

We did a little research and came up with an alternative technique of hiding the disabled textbox content (except in Internet Explorer). The change will be reflected in one of the next internal builds of the MVC extensions.

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Bob Mills
Top achievements
Rank 2
answered on 12 Apr 2011, 04:43 PM
When is the next internal build?  Thanks
0
Dimo
Telerik team
answered on 13 Apr 2011, 07:06 AM
Hello Bob,

We will upload an internal build within the next couple of days.

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Bob Mills
Top achievements
Rank 2
answered on 16 Apr 2011, 08:55 PM
We upgraded to 414. Under IE it appears that the display is garbled if you have HTMl attributes (style width) on the control and it is disabled. 
When the control is disabled it does not format the number.

under Firefox, it appears fine.

Under chrome -  display is garbled if you have HTMl attributes on the control and it is disabled.
0
Dimo
Telerik team
answered on 18 Apr 2011, 10:09 AM
Hi Bob,

Yes, the value of disabled numeric textboxes is not formatted in IE due to two known limitations in this browser - inability to set color for disabled elements and inability to hide the textbox content with a text-indent style.

However, I don't see anything garbled on my side in IE or Chrome. Can you please send a screenshot and a demo, which produces the undesired result?

Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jay
Top achievements
Rank 1
answered on 17 May 2011, 03:22 PM
It seems that the new way of displaying the NumericTextbox/CurrencyTextbox is causing more problems than it's solving.  I would think that the display issue in IE would be kind of a show stopper personally.   

Then the sneaky div that displays the value half the time (when not focused) seems a little wacky to me as well.  I understand what you're trying to do, but those kind of hijinks break things like client side data binding.

It seems as though the NumericTextbox/CurrencyTextbox is the red-headed step child of controls here, because it's been almost a MONTH and I don't see these issues addressed.  For now I've simply removed the NumericTextbox, I can do simple currency formatting on my own without the CSS and JavaScript hacks I need to put in place to get the Telerik one working.

Overall I'm pretty disappointed, I've been using Telerik controls for years, and this seems like a definite step in the opposite direction.
0
Dimo
Telerik team
answered on 17 May 2011, 05:19 PM
Hi Jeff,

Actually, the component has been updated and now the formatted value is displayed also in IE when the textbox is disabled. You can test this in the internal build.

The purpose of the <div> is to show the formatted value or the empty message, while the textbox always holds the actual value or is empty. Owing to this implementation, the component can work with Javascript disabled and there is no need to unformat the value before submitting a form, which causes visible flicker on posts and AJAX requests.

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jay
Top achievements
Rank 1
answered on 18 May 2011, 02:49 PM
Well that's good to know.  I've also found I can use some custom binding handlers to interact with the numeric textboxes fairly painlessly.  I do have a question though but I'll create a separate thread for it.
0
Dewey
Top achievements
Rank 1
answered on 14 Aug 2012, 10:06 PM
The garbled text in the CurrencyTextBoxFor is still an issue in Q2 2012 MVC for IE9.  Will this be addressed or should I start on a workaround?
0
Dimo
Telerik team
answered on 15 Aug 2012, 07:21 AM
Hello Dewey,

You can read more about this problem in the following forum thread:

http://www.telerik.com/community/forums/aspnet-mvc/numericinput/calling-disable-in-a-javascript-client-side-causes-display-issue.aspx

I am afraid we do not plan fixing the issue in IE, because this will require major changes in the component's HTML output and Javascript. This has been done in the Kendo UI NumericTextBox, which will eventually replace its MVC couterpart, so you can start using it.

Regards,
Dimo
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
NumericTextBox
Asked by
Jay
Top achievements
Rank 1
Answers by
Juan Pablo Perez
Top achievements
Rank 1
Jay
Top achievements
Rank 1
Georgi Krustev
Telerik team
Bob Mills
Top achievements
Rank 2
Dimo
Telerik team
Dewey
Top achievements
Rank 1
Share this question
or