﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » want to clear databound textbox after populating</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 17 May 2026 10:35:25 GMT</lastBuildDate><ttl>20</ttl><item><title>want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29113.aspx</link><description>I currently have a date textbox that has the bindingfield and businessobjectname properties set, and is populating based on that. However, since I am working with dates, I have set a NULL replacement value in the business object mapper of&amp;nbsp;CDate("1/1/1800").&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I would like the textbox to display nothing if the database field has a null value in it, however I have so far been unable to figure out how to clear the textbox if the date is 1/1/1800.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Is there a way to clear the textbox without using javascript? Is there a different value I could be using in the business object mapper for the NULL replacement value?</description><pubDate>Wed, 01 Dec 2010 18:34:41 GMT</pubDate><dc:creator>Greg</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29142.aspx</link><description>LOL, glad you got it figured out!</description><pubDate>Wed, 01 Dec 2010 18:34:41 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29139.aspx</link><description>Oh boy... I feel like an idiot. The problem was that the save() function was being overridden and a stored procedure was taking over. So DUH! I have to pass the DBNull value myself!&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Thanks for your help guys :D</description><pubDate>Wed, 01 Dec 2010 12:02:34 GMT</pubDate><dc:creator>Greg</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29132.aspx</link><description>Teddy right on the money. The web adds some complexity so sometimes it's a good idea to create a mini test project, a SF C# (or VB.NET...whatever you use) Winform app, copy your BO over, and see if it works. If the BO is working, then you have an issue with the TextBox, but likely it is a configuration issue.&amp;nbsp; I've attached an image showing the settings in the BO mapper.</description><pubDate>Tue, 30 Nov 2010 21:15:58 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29129.aspx</link><description>Hi Greg,&lt;br/&gt;&lt;br/&gt;I use "new&amp;nbsp;DateTime(1800,1,1)" as alternate value in the bo, and it works for me when using SF datetimepicker. &lt;br/&gt;&lt;br/&gt;This just so you maybe could narrow&amp;nbsp;your problem&amp;nbsp;down to the subclassed textbox, if it doesn't work.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;/Teddy</description><pubDate>Tue, 30 Nov 2010 15:07:29 GMT</pubDate><dc:creator>Teddy Jensen</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29127.aspx</link><description>&lt;div&gt;Thanks for your help, Greg. Can't seem to get the 1/1/1800 to stay out of my database though :(&lt;br/&gt;&lt;br/&gt;Currently I am just using a property (DateValue) to sync the Text values to my Date values. It looks like it works, but I am still getting 1/1/1800s in my database. I am using Set Null on Alternate Value now as well. Currently my alternate value is&amp;nbsp;DateTime.Parse("1/1/1800 12:00:00 AM"). The only thing I did in my subclassed textbox was create the property. Feel like I am missing something small, but I'm not sure what.</description><pubDate>Tue, 30 Nov 2010 14:17:20 GMT</pubDate><dc:creator>Greg</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29126.aspx</link><description>Greg,&lt;br/&gt;&lt;br/&gt;You won't be storing 1/1/1800 in the database (or you don't have to), you'll be storing NULL in the database. When you use the BO Mapper to map a datetime field to a column in the database and you use the Null option value of &lt;span style="font-weight: bold;"&gt;Return Alternate on Null / Set Null on Alternate&lt;/span&gt;, this sets the value of the field in the BO to the alternate value (1/1/1800 in this case), but when storing data in the database, if the value in the BO is 1/1/1800, it sends a NULL to the db for storage (See note below).&lt;br/&gt;&lt;br/&gt;So, what the post you found (I totally forgot about that one) is saying is that you separate the property you are binding from the property you are displaying. Then you synch the display property and the binding property via events.&lt;br/&gt;&lt;br/&gt;Let us know if you run into problems with the sub-classed TextBox.&lt;br/&gt;&lt;font size="4"&gt;&lt;br style="font-weight: bold;"&gt;&lt;font style="color: rgb(0, 0, 255);" size="2"&gt;&lt;span style="font-weight: bold;"&gt;Details of Alternate Nulls&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br/&gt;What is actually happening is that the property in the BO is referencing a column in the underlying &lt;span style="font-style: italic;"&gt;DataTable&lt;/span&gt;. The property getter checks if the value in the &lt;span style="font-style: italic;"&gt;DataTable &lt;/span&gt;is &lt;span style="font-style: italic;"&gt;DbNull &lt;/span&gt;and if it is, it returns the alternate value. In the setter, it checks if the value being set is the alternate value and if it is, it sets the column in the &lt;span style="font-style: italic;"&gt;DataTable &lt;/span&gt;to &lt;span style="font-style: italic;"&gt;DbNull&lt;/span&gt;.&amp;nbsp; Check out the .designer file to see what is actually happening.</description><pubDate>Tue, 30 Nov 2010 12:13:40 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29125.aspx</link><description>Thanks for the reply, Greg, and thanks for tagging it. I see this post is closest to what I am looking to do:&amp;nbsp;&lt;a href="http://forum.strataframe.net/Topic13228.aspx"&gt;&lt;a href="http://forum.strataframe.net/Topic13228.aspx"&gt;http://forum.strataframe.net/Topic13228.aspx&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I am still a little worried about storing 1/1/1800 dates in my database, but I suppose I shouldn't be. There are other instances where this date pops up in the application that I need to handle as well. Hopefully this subclassed control will help me in those situations as well.</description><pubDate>Tue, 30 Nov 2010 11:04:09 GMT</pubDate><dc:creator>Greg</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29115.aspx</link><description>this is an ASP.NET app</description><pubDate>Mon, 29 Nov 2010 12:52:15 GMT</pubDate><dc:creator>Greg</dc:creator></item><item><title>RE: want to clear databound textbox after populating</title><link>http://forum.strataframe.net/FindPost29114.aspx</link><description>Is this a Winform or a ASP.NET app?&amp;nbsp; If you are using Winforms, there are SF controls designed to handle dates when using a null replacement value. The DateTimePicker has a  &lt;span style="font-weight: bold;"&gt;NullDateValue &lt;/span&gt;property and the DateBox has the &lt;span style="font-weight: bold;"&gt;EmptyValue &lt;/span&gt;property.&amp;nbsp; </description><pubDate>Mon, 29 Nov 2010 12:28:44 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>