﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - UXTextBox not clearing out</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXTextBox-not-clearing-out/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>UXTextBox not clearing out</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXTextBox-not-clearing-out/</link><pubDate>Tue, 08 Oct 2013 02:19:45 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;UXTextBox is a fundamental input control generally used to obtain input data from users through input devices such as keyboard. Similar to native text box control (assume that the &lt;em&gt;Text&lt;/em&gt; property is bound to a property in View Model – let’s name it as &lt;em&gt;BarCode&lt;/em&gt; property), the &lt;em&gt;set accessor&lt;/em&gt; of the property will be invoked &lt;/span&gt;&lt;span style="text-decoration: underline; color: rgb(31, 73, 125);"&gt;when user tabs out of UXTextBox or press Enter key&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;This default behavior matches with your requirement, &lt;em&gt;to update the list when the user tabs off the textbox (and/or when 4 characters have been entered)&lt;/em&gt;. Please try to use following snippet code in your View Model.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;public string BarCode
{
    get { return _barCode; }
    set
    {
        if (_barCode != value)
        {
            _barCode = value;
            OnPropertyChanged("BarCode");
            if (!string.IsNullOrEmpty(value))
                AddBarCode();
        }
    }
}
private void AddBarCode()
{
    if (!string.IsNullOrEmpty(BarCode) &amp;amp;&amp;amp; BarCode.Length == 4)
    {
        ContactsData.Add(new Contact { Id = BarCode.GetHashCode().ToString(), Name = BarCode });
        SetFocusBarcode();
    }
    else
        MessageBox.Show("Please enter valid BarCode character (4 characters)");
    Utility.ExecuteTimeOut(0.1, () =&amp;gt;
    {
        this.BarCode = string.Empty;
    });
}
private void SetFocusBarcode()
{
    ISFocusManager.SetFocus("EnterBarCode");
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;This should help.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>UXTextBox not clearing out</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXTextBox-not-clearing-out/</link><pubDate>Fri, 04 Oct 2013 05:12:11 GMT</pubDate><dc:creator>zen8019</dc:creator><description>Hi
Thanks for the reply.

I had a look at the sample - it works as you describe, however I need it to work slightly different.

I can't have the user click a button to add to list - I need the control to update the list when the user tabs off the textbox (and/or when 4 characters have been entered).

 The business requirement is for the user
1) to use a bar code scanner to scan a barcode
2) After the barcode scanned - do something (e.g. add to listbox)
3) Clear out the text field and set focus ready for the next barcode to be scanned

This is rapid data entry and so button clicks do not fit the requirement.

I await you reply...thanks

 




</description></item><item><title>UXTextBox not clearing out</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXTextBox-not-clearing-out/</link><pubDate>Fri, 04 Oct 2013 04:34:20 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I created a simple Silverlight project based on the provided description and snippet code. However, I was unable to reproduce the reported problem in my local end (as shown in the attached video). It adds to the list box and clear out the UXTextBox.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Please have the attached SL project evaluated on your end and let us hear your feedback.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>UXTextBox not clearing out</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXTextBox-not-clearing-out/</link><pubDate>Tue, 01 Oct 2013 06:38:25 GMT</pubDate><dc:creator>zen8019</dc:creator><description>&lt;p&gt;        Hi&lt;/p&gt;
    
&lt;p&gt;
        I am using MVVM. I have uxTextbox and a uxListbox.&lt;/p&gt;
    
&lt;p&gt;
        Aim...&lt;/p&gt;
    
&lt;p&gt;
        &lt;span style="font-size: 10pt;"&gt;Users scan into the text box and this value is added
            to the uxListBox then the cursor returns to the uxtext and clearout the the value
            ready for the next input.&lt;/span&gt;&lt;/p&gt;
    
&lt;p&gt;
        &lt;span style="font-size: 10pt;"&gt;I am struggling to get this to work (and have tried serveral versions of the code below) - it
            adds to the list box ok, but does not clear out the uxtext box.&lt;/span&gt;&lt;/p&gt;
    
&lt;p&gt;
        &lt;span style="font-size: 10pt;"&gt;The cursor does remain
            in the Barcode control but does not clear out.&lt;/span&gt;&lt;/p&gt;
    &lt;pre&gt;        public string BarCode
            {
            get
            {
                return _BarCode;
            }
            set
            {
                if (_BarCode != value)
                {
                    _BarCode = value;
                    OnPropertyChanged("BarCode");
                    if (!string.IsNullOrWhiteSpace(_BarCode))
                      AddBarCode(_BarCode);
                }
            }
        }
        private void AddBarCode(string barcode)
        {
            if (!string.IsNullOrWhiteSpace(barcode))
            {
                BarCodeList.Add(barcode);
                BarCode = string.Empty;
                SetFocusBarcode();
               // OnPropertyChanged("BarCodeCount");
            }
        }
        private void SetFocusBarcode()
        {
            ISFocusManager.SetFocus("EnterBarCode");
        }&lt;/pre&gt;
    
&lt;p&gt;
        Thanks&lt;/p&gt;</description></item></channel></rss>