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



Error creating custom BO propertyExpand / Collapse
Author
Message
Posted 02/27/2008 2:35:09 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/31/2008 2:53:17 PM
Posts: 53, Visits: 217
I'm getting an error "Object reference not set to an instance of an object." in the FieldPropertyDescriptor code and cannot figure it out.  Maybe a second pair of eyes will help.  I'm pretty sure it is copied straight from the Help.

(This code is in my StaffBO.vb.)

Thanks,

Larry

#Region " Custom Field Properties "

''' <summary>

''' cLastFirst

''' </summary>

''' <remarks></remarks>

<Browsable(False), _

BusinessFieldDisplayInEditor(), _

Description("Staff full name, last name first"), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property [CLASTFIRST]() As System.String

Get

Return Me.CLASTNAME & ", " & Me.CFIRSTNAME

End Get

End Property

 

Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()

Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _

New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _

"cLastFirst", GetType(StaffBO))}

End Function

#End Region

Post #14575
Posted 02/27/2008 2:43:05 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/31/2008 2:53:17 PM
Posts: 53, Visits: 217
Never mind,

The call is apparently cap sensitive, and changing it to "CLASTFIRST" solved it.  Ugh... 2 hours wasted.  I thought VB wasn't cap sensitive, but apparently some of the guts of the framework are.

Larry

Post #14576
Posted 02/27/2008 3:22:17 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/31/2008 2:53:17 PM
Posts: 53, Visits: 217
Actually,

Maybe I do need some help... <s>.  I'm obviously new to VB and C# and looking at that cryptic and cap sensitive GetCustomBindablePropertiesDescriptors() override, I'm figuring it is C# and not VB.  If this is true, how would the function syntax read in VB?

Second, how would I add a second custom property descriptor to my StaffBO?

Thanks,

Larry

Post #14578
Posted 02/28/2008 9:05:20 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/31/2008 2:53:17 PM
Posts: 53, Visits: 217
Not to be pushy, but I'm going to start a second thread for this second question "how to a second custom property descriptor".   May be more useful for future users and more easily addressed.

Larry

Post #14600
Posted 02/28/2008 9:15:55 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:23:48 AM
Posts: 4,366, Visits: 4,392
OK...first of all, the framework and VB.NET are not necessarily case sensitive, but the core of .NET is regarding a type descriptor.  Anytime that you create a type descriptor, it should always match the name of your custom property...whether you are in a case sensitive language or not, this is ALWAYS the safest thing since there are other core .NET classes that get used within the framework.

Second, how would I add a second custom property descriptor to my StaffBO?

It may be too late, but there is no need to start another thread.  But to do this, just add another item to the array:

Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _
   New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("cLastFirst", GetType(StaffBO)), _
   New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("MySecondProperty", GetType(StaffBO))}
Post #14601
Posted 02/28/2008 9:29:48 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 07/31/2008 2:53:17 PM
Posts: 53, Visits: 217
Trent,

Thanks for the help.  That does it nicely.  (I'm trying to study VB syntax along with learning SF and I appreciate the clarifications.)

Larry

Post #14605
Posted 02/28/2008 9:41:51 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 9:23:48 AM
Posts: 4,366, Visits: 4,392
No problem
Post #14607
« 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 4:37pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 11 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.