in
Forums
Blogs
Files
Devexpress.Com
ClientCenter
Support Center
DevExpress Channel

FileAttachment module

Last post 8/28/2008 2:01 PM by Dennis (Developer Express). 6 replies.
Page 1 of 1 (7 items)
Sort Posts:
Previous Next
  • 8/21/2008 8:56 AM

    FileAttachment module

    I am trying to add the file attachment module/functionality to my BO. I reviewed the tutorial and it worked fine, but in my BO it doesn't want to work.

    What I have is a class called cFiles which is a stripped down version of the Portfolio class.

     <DefaultClassOptions()> _

    Public Class cFiles

        Inherits FileAttachmentBase

        Public Sub New(ByVal session As Session)

            MyBase.New(session)

        End Sub

         Public Overrides Sub AfterConstruction()

            MyBase.AfterConstruction()

            fDocumentType = DocumentType.Unknown

        End Sub

         Private fDocumentType As DocumentType

        Public Property DocumentType() As DocumentType

            Get

                Return fDocumentType

            End Get

            Set(ByVal value As DocumentType)

                SetPropertyValue("DocumentType", fDocumentType, value)

            End Set

        End Property

    End Class

    Then I have my BO which has a the following property:

        Private fFileList As XPCollection(Of cFiles)

        Public Property FileList() As XPCollection(Of cFiles)

            Get

                Return fFileList

            End Get

            Set(ByVal value As XPCollection(Of cFiles))

                SetPropertyValue("FileList", fFileList, value)

            End Set

        End Property

     

    The Files list view shows up in the BO's detail view, but it (and its toolbar) are disabled. So the questions are: Am I using this correctly and why is it disabled?  Huh?

     

    Thanks. 

    No trees were harmed in the sending of this message, however a large number of electrons were terribly inconvenienced.
  • 8/21/2008 2:04 PM In reply to

    Idea [I] Re: FileAttachment module

     I think that I figured it out. Please let me know if this is not the expected use of the File Attachment module.

    I added a line in the property definition (under the Get) that reads:

    If fFileList Is Nothing then fFileList = New XPCollection(of cFiles)(Session)

     

    Thanks

    No trees were harmed in the sending of this message, however a large number of electrons were terribly inconvenienced.
  • 8/21/2008 5:11 PM In reply to

    Re: FileAttachment module

    Hi,

    At first glance, I am not sure of the fix you found, so I think that a small sample project demonstrating what actually doesn't work in your solution, but works in our demos ,will give us more chances

    to help you.

    Looking forward to your sample...

    Thanks,
    Dennis

    Developer Express Support
  • 8/25/2008 11:24 AM In reply to

    Re: FileAttachment module

     Hmm... Can't seem to attach a project to the message, I get errors when uploading the file.....

    Anyway. The basic idea is that I want a to create a class that is similar to the Portfolio Class (File, DocumentType, etc), but I want to connect it to multiple BOs (Purchasing, Inventory, Jobs, Sales, etc). So, I think that the standard 'Association' attribute will not work as there is not a 1 to 1 relationship between the classes. In each of the BOs I would need a collection of Portfolio Classes. Tongue Tied

    Thanks for your help

     

    No trees were harmed in the sending of this message, however a large number of electrons were terribly inconvenienced.
  • 8/26/2008 8:48 AM In reply to

    Re: FileAttachment module

    Hi Bill,

    Have you tried to zip the project for the attachment ? I find that only small zipped attachments make it to the forum.

    Regards,
    Marc Greiner [DX-Squad]
  • 8/26/2008 4:15 PM In reply to

    Re: FileAttachment module

     I did, but still could not upload. The upload (of course) is a minor inconvenience to my problem.

    The problem is that I am unsure how to create a file management class for multiple business objects.

    Thanks

    No trees were harmed in the sending of this message, however a large number of electrons were terribly inconvenienced.
  • 8/28/2008 2:01 PM In reply to

    Re: FileAttachment module

    Hi,

    Please create a new question in the Support Center, and upload your sample there. After that, we will continue our discussion.

    Thanks,
    Dennis

    Developer Express Support
Page 1 of 1 (7 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED