StrataFrame Forum

Enforcing data type on searchfield UI in BrowseDialog

http://forum.strataframe.net/Topic30895.aspx

By Charles R Hankey - 2/9/2012

Many of my Searchfields are integers and for a lot of them I can't use a dropdown to make sure an integer is the entered result.

Since the searchfield is a textbox, the user can enter an alpha string and then get an ugly error on the search

How do I make sure only integers can be entered into the searchfield ?

I tried this :


        private void bdExchanges_InitializeSearchFields(object sender, EventArgs e)            {            bdExchanges.SearchFields["From_Date"].InitialValue = DateTime.Today.ToString();            bdExchanges.SearchFields["Thru_Date"].InitialValue = DateTime.Today.ToString();            // this searchfield has override data type set to Int32 in BD Searchfields properties UI            bdExchanges.SearchFields["ReutersExchangeID"].FieldType.Equals(SqlDbType.Int);                        }


but that does not seem to be the answer?

Eddy, you can be my hero again ( and this time I'll pay attention BigGrin )
By Charles R Hankey - 2/9/2012

Just realized there is a mask property in the UI ( Duh ! )

I think that is going to give me what I need.  It also answers how to I shorten those ugly wide textboxes etc.

The parts of the Browse Dialog that are developed are so VERY cool it makes me really yearn for major development on this aspect of the product. 
By Edhy Rijo - 2/9/2012

Charles R Hankey (2/9/2012)
Just realized there is a mask property in the UI ( Duh ! )

Charles, you are starting to sound like Marcia Blush

Charles R Hankey (2/9/2012)
The parts of the Browse Dialog that are developed are so VERY cool it makes me really yearn for major development on this aspect of the product. 

Well we are all waiting for those major changes in SF 2.0 BigGrin  I am lucky I get to use SF almost everyday and for many challenges, I always get surprised of what I can do with the framework.  I totally love the flexibility of the business objects, been able to create then on the spot, filter, seek, manipulate broken rules, etc. but still I can't wait for SF 2.0.
By Charles R Hankey - 2/9/2012

I guess my mask idea wasn't a good one.

For the Searchfields that will search on integers I put 000000 in the FieldMask and left it at ExcludePromptsAndLiterals

At run time I get six underscores in that box and they are limited to 0-9 - Great

But my search on Name begins with - not touching the integer searchfields - gets nothing. so I think the search is using the integers in the search.

There has to be a better way to do this.  Is there way to use InitializeSearchFields event as I outlined at the beginning of the thread?

I cannot let the user accidently enter alpha characters in these fields.

Second part of the question - how do I see the where clause that the browse dialog built ? 
By Charles R Hankey - 2/9/2012

Wow, Eddy, you're right - I am really starting to sound like Marsha, so I will quote her directly


OK - I CAN explain it. It is the loose nut behind the keyboard Smile

problem solved.




I didn't have advanced properties showing and didn't realize I was making my date fields = rather than <= and >=

DOH!

I think a mask is going to work ( if only to hide my embarrassed face )
By Edhy Rijo - 2/9/2012

No Problem Charles, we are always up to the task, so let us know how it goes. Tongue