StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Little trouble with Two Way binding.Expand / Collapse
Author
Message
Posted 04/09/2007 2:57:25 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 06/12/2007 1:50:03 PM
Posts: 17, Visits: 76
I'm cleaning up my application and trying to make better use of SF as I do it. One of the things I'm trying to do is the following:

I have a page for modifying my Company BO. Every Textbox is tied to a field of the Customer BO except for one: The Status ID. That one's a Dropdownlist that is tied to the Status BO, but the StatusID is in the Company BO.

At the top of the page there's a Dropdownlist that selects what company you want to edit.

Seems simple enough.

When you select a company from the top DDL that has a NULL StatusID everything works fine -- and the Status DDL is just an empty list.

Cool.

Now, when I try and pick a different Company from the top DDL this is what I get:

Input string was not in a correct format. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

....


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2753203
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
System.Int32.Parse(String s) +20
MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type InputType, Type OutputType, String FormatString) +628

[InvalidOperationException: The input value could not be converted to the output type.]
MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type InputType, Type OutputType, String FormatString) +2720
MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type OutputType) +64
MicroFour.StrataFrame.Business.BusinessLayer.BindDataFromWebControl(IWebBusinessBindable ControlFromBind, IWebBinding Binding) +598
MicroFour.StrataFrame.UI.Web.BasePage.BindBackControls() +227

[UIException: An error occurred while binding data to the web control 'ddlCompanyStatus'.]
MicroFour.StrataFrame.UI.Web.BasePage.BindBackControls() +579
MicroFour.StrataFrame.UI.Web.BasePage.Page_PreLoad(Object sender, EventArgs e) +83
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreLoad(EventArgs e) +86
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +948


Any suggestions? For the life of me I can't see where I went awry here. If I change the binding to anything but TwoWay the page "works" in the sense that it doesn't blow up, but naturally the Company.StatusID either isn't updated from the UI or the UI isn't representing what's in the DB.
Post #7991
Posted 04/10/2007 9:11:04 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
Can you post the rendered HTML code for the drop down list, with all of the Options and everything?  When binding back to the properties of the business object, we run the data through an Object converter class.  Most likely, it's trying to bind to an Integer field on your business object, but the data that is being sent back is not a string representation of an integer.


www.bungie.net
Post #8009
Posted 04/10/2007 9:27:18 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 06/12/2007 1:50:03 PM
Posts: 17, Visits: 76
Sure.




I think I see where you're going with this. Since the SelectedValue can't be cast to an Integer I'm kinda SOL, right? Even though it's bound to a nullable Integer?
Post #8016
Posted 04/10/2007 9:28:48 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 06/12/2007 1:50:03 PM
Posts: 17, Visits: 76
Aww, crap. The code tag didn't escape the HTML. Lemme try that again.

<select name="ctl00$MainContent$ddlCompanyStatus" id="ctl00_MainContent_ddlCompanyStatus" class="dropdownlist" onfocus="elementFocus(this);" onblur="elementBlur(this);" onfocusin="elementFocus(this);" onfocusout="elementBlur(this);">
</select>
Post #8017
Posted 04/10/2007 11:22:22 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
Hrm... OK, does your DDL have any items in it at all?  It could be that it's trying to pass back an empty string and trying to parse that into an integer.  You might have to add a TopMostItem to your DDL to ensure that there is always a value in the list to be selected.


www.bungie.net
Post #8022
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:54am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 7 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.