All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the Setting
of this property with the business object. This works fine. I then create
a Form, put a TextBox control on it, add a DataBinding to the control to the
business object's property. When the control is displayed, it sets the text
to the property's get - perfect. When I type something in the textbox and
tab off of it, it calls the Set part of the property, which validates the
value and throws an exception. Where does this exception go? It doesn't
seem to go anywhere - as if the internal .net code has a try...catch, but is
not doing anything with the exception.
Is this even the correct approach for control validation? I have to have
the validation in the business object and I don't want to have to re-write
it again in the GUI.
Any help is appreciated!
Dave 7 1224
Sorry,
I meant to post some source code:
Public Class MyTestClass
Public Property Test() As String
Get
Return "Test"
End Get
Set(ByVal Value As String)
Throw New System.Exception("This is an exception")
End Set
End Property
End Class
Create a window with a button and a textbox. Here's my binding code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs Handles Button1.Click
Dim o As New MyTestClass
Me.TextBox1.DataBindings.Add("Text", o, "Test")
End Sub
Thanks in advance...
Dave
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message
news:3f******@news.splitrock.net... All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the Setting of this property with the business object. This works fine. I then
create a Form, put a TextBox control on it, add a DataBinding to the control to
the business object's property. When the control is displayed, it sets the
text to the property's get - perfect. When I type something in the textbox and tab off of it, it calls the Set part of the property, which validates the value and throws an exception. Where does this exception go? It doesn't seem to go anywhere - as if the internal .net code has a try...catch, but
is not doing anything with the exception.
Is this even the correct approach for control validation? I have to have the validation in the business object and I don't want to have to re-write it again in the GUI.
Any help is appreciated!
Dave
Lets see the validation code in the Object Dave...
--
Ibrahim Malluf http://www.malluf.com
==============================================
MCS Data Services Code Generator http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message
news:3f******@news.splitrock.net... All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the Setting of this property with the business object. This works fine. I then
create a Form, put a TextBox control on it, add a DataBinding to the control to
the business object's property. When the control is displayed, it sets the
text to the property's get - perfect. When I type something in the textbox and tab off of it, it calls the Set part of the property, which validates the value and throws an exception. Where does this exception go? It doesn't seem to go anywhere - as if the internal .net code has a try...catch, but
is not doing anything with the exception.
Is this even the correct approach for control validation? I have to have the validation in the business object and I don't want to have to re-write it again in the GUI.
Any help is appreciated!
Dave
Dave,
As a suggestion you might want to look at Rockfort Lhota's book on Business
Objects. I like and have used his method (abiet modified) for a BrokenRules
class.
Dan
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message
news:3f******@news.splitrock.net... All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the Setting of this property with the business object. This works fine. I then
create a Form, put a TextBox control on it, add a DataBinding to the control to
the business object's property. When the control is displayed, it sets the
text to the property's get - perfect. When I type something in the textbox and tab off of it, it calls the Set part of the property, which validates the value and throws an exception. Where does this exception go? It doesn't seem to go anywhere - as if the internal .net code has a try...catch, but
is not doing anything with the exception.
Is this even the correct approach for control validation? I have to have the validation in the business object and I don't want to have to re-write it again in the GUI.
Any help is appreciated!
Dave
Dan,
Thanks for the suggestion.
What is the title of this book? Do you have a ISBN number?
Dave
"solex" <so***@nowhere.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl... Dave,
As a suggestion you might want to look at Rockfort Lhota's book on
Business Objects. I like and have used his method (abiet modified) for a
BrokenRules class.
Dan
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message news:3f******@news.splitrock.net... All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the
Setting of this property with the business object. This works fine. I then create a Form, put a TextBox control on it, add a DataBinding to the control to the business object's property. When the control is displayed, it sets the text to the property's get - perfect. When I type something in the textbox
and tab off of it, it calls the Set part of the property, which validates
the value and throws an exception. Where does this exception go? It
doesn't seem to go anywhere - as if the internal .net code has a try...catch,
but is not doing anything with the exception.
Is this even the correct approach for control validation? I have to
have the validation in the business object and I don't want to have to
re-write it again in the GUI.
Any help is appreciated!
Dave
Visual Basic 6 Business Object (I believe he has one for dotNet, but the
methods still apply) ISBN 1-861001-07-X
Dan
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message
news:3f********@news.splitrock.net... Dan,
Thanks for the suggestion.
What is the title of this book? Do you have a ISBN number?
Dave
"solex" <so***@nowhere.com> wrote in message news:ef**************@TK2MSFTNGP10.phx.gbl... Dave,
As a suggestion you might want to look at Rockfort Lhota's book on Business Objects. I like and have used his method (abiet modified) for a BrokenRules class.
Dan
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message news:3f******@news.splitrock.net... All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the Setting of this property with the business object. This works fine. I then create a Form, put a TextBox control on it, add a DataBinding to the control
to the business object's property. When the control is displayed, it sets
the text to the property's get - perfect. When I type something in the textbox and tab off of it, it calls the Set part of the property, which validates the value and throws an exception. Where does this exception go? It doesn't seem to go anywhere - as if the internal .net code has a try...catch, but is not doing anything with the exception.
Is this even the correct approach for control validation? I have to have the validation in the business object and I don't want to have to re-write it again in the GUI.
Any help is appreciated!
Dave
Sorry,
I meant to post some source code:
Public Class MyTestClass
Public Property Test() As String
Get
Return "Test"
End Get
Set(ByVal Value As String)
Throw New System.Exception("This is an exception")
End Set
End Property
End Class
Create a window with a button and a textbox. Here's my binding code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs Handles Button1.Click
Dim o As New MyTestClass
Me.TextBox1.DataBindings.Add("Text", o, "Test")
End Sub
Thanks
Dave
"IbrahimMalluf" <Ib*****@malluf.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl... Lets see the validation code in the Object Dave...
-- Ibrahim Malluf http://www.malluf.com ============================================== MCS Data Services Code Generator http://64.78.34.175/mcsnet/DSCG/Announcement.aspx ==============================================
"Dave Wurtz" <da*******************@asdsoftware.com> wrote in message news:3f******@news.splitrock.net... All,
Not sure if I'm taking the correct approach or not, but here it is...
I have my business object with a property. I want to validate the
Setting of this property with the business object. This works fine. I then create a Form, put a TextBox control on it, add a DataBinding to the control to the business object's property. When the control is displayed, it sets the text to the property's get - perfect. When I type something in the textbox
and tab off of it, it calls the Set part of the property, which validates
the value and throws an exception. Where does this exception go? It
doesn't seem to go anywhere - as if the internal .net code has a try...catch,
but is not doing anything with the exception.
Is this even the correct approach for control validation? I have to
have the validation in the business object and I don't want to have to
re-write it again in the GUI.
Any help is appreciated!
Dave
"Dave Wurtz" <da*******************@asdsoftware.com> wrote...
Dave... I'm going to guess you took too many shortcuts.
Start off by adding a private property to MyTestClass and actually Get and
Set it (we want it to work properly.)
Then you are declaring your object in the Button_Click handler. It isn't
going to be visible outside of there right? And you are adding the binding
there too, each time you click.
So declare the instance of MyTestClass as a private property of the form,
assign the value of Test and do the binding in form_load. You shouldn't
need to be clicking the button to test it.
Tom Public Class MyTestClass Public Property Test() As String Get Return "Test" End Get Set(ByVal Value As String) Throw New System.Exception("This is an exception") End Set End Property End Class
Create a window with a button and a textbox. Here's my binding code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs Handles Button1.Click Dim o As New MyTestClass Me.TextBox1.DataBindings.Add("Text", o, "Test") End Sub This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bruce Duncan |
last post by:
I know this isn't a php group but I was wondering if my problem is with my
javascript in my php code. I'm debugging someone else's code and I can't
figure out why this form won't submit.
This...
|
by: x muzuo |
last post by:
Hi guys,
I have got a prob of javascript form validation which just doesnt work
with my ASP code. Can any one help me out please.
Here is the code:
{////<<head>
<title>IIBO Submit Page</title>...
|
by: John Boy |
last post by:
Hi,
Can anyone help. This is really doing my nut in. 3 years ASP exp. and
now doing .DOT which is a step in the wrong direction.
Basically I am left with the code of a guy who has left. When I...
|
by: Student |
last post by:
Good evening,
I create a three tier ASP.NET web application. How can I validate the
form input data in the Business Logic Layer? Can anyone give me an
example?
|
by: cmay |
last post by:
Is there any way to databind the properties of a business object, like
an Employee, to fields in a form in asp.net 2.0?
cmay
|
by: stathis gotsis |
last post by:
Hello everyone,
I am tying to come up with an elegant way to process some input data that
come from a form. When the user hits the 'Submit' button, i want the form to
appear again with the...
|
by: Rik |
last post by:
Hello guys,
now that I'm that I'm working on my first major 'open' forms (with
uncontrolled users I mean, not a secure backend-interface), I'd like to add
a lot of possibilities to check wether...
|
by: gweasel |
last post by:
What is the best way to apply a Validation Rule - or rather, where is
the best place to put it? Is there an advantage to putting it on the
field in the table vs setting the validation rule on the...
|
by: Bryan |
last post by:
I want my business objects to be able to do this:
class Person(base):
def __init__(self):
self.name = None
@base.validator
def validate_name(self):
if not self.name: return
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |