Enforcing data type on searchfield UI in BrowseDialog


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
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 )
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
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. 
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
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 ? 
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
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 )
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
No Problem Charles, we are always up to the task, so let us know how it goes. Tongue

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search