CodeSmith Community
Your Code. Your Way. Faster!

ManyToManyListRelationship Update Inccorect !

Latest post 05-22-2008 7:44 PM by blake05. 7 replies.
  • 02-21-2008 11:55 PM

    • july.liu
    • Top 500 Contributor
    • Joined on 11-28-2007
    • Posts 14
    • Points 190

    ManyToManyListRelationship Update Inccorect !

    Version 702 :

    I have a table with many to many relationship . When I use ManyToManyListRelationship ,I found that when I Add checked list , it works well ,but when I delete a checkbox from the checkBoxList, the relation ship didn't work .It remove nothing .

    PropertyGroup1:
                        <asp:CheckBoxList ID="GalleryPropertyItemList" runat="server" DataSourceID="GalleryPropertyItemReferenceDataSource"
                            DataTextField="PropertyName" DataValueField="PropertyId" RepeatColumns="4" />
                        <data:GalleryPropertyItemDataSource ID="GalleryPropertyItemReferenceDataSource" runat="server"
                            SelectMethod="GetByPropertyGroupId">
                            <Parameters>
                                <data:CustomParameter Name="PropertyGroupId" Value="1" ConvertEmptyStringToNull="false" />
                            </Parameters>
                        </data:GalleryPropertyItemDataSource>
                        <data:GalleryImagePropertyMappingDataSource ID="GalleryImagePropertyMappingDataSource"
                            runat="server" SelectMethod="GetBySiteImageId">
                            <Parameters>
                                <asp:QueryStringParameter Name="SiteImageId" QueryStringField="imgId" Type="String" />
                            </Parameters>
                        </data:GalleryImagePropertyMappingDataSource>
                        <data:ManyToManyListRelationship ID="GalleryImagePropertyMappingRelationship" runat="server">
                            <PrimaryMember ID="PrimaryMember1" runat="server" DataSourceID="GallerySiteDataSource"
                                EntityKeyName="SiteImageId" />
                            <LinkMember ID="LinkMember1" runat="server" DataSourceID="GalleryImagePropertyMappingDataSource"
                                EntityKeyName="SiteImageId" ForeignKeyName="PropertyId" />
                            <ReferenceMember ID="ReferenceMember1" runat="server" DataSourceID="GalleryPropertyItemReferenceDataSource"
                                ListControlID="GalleryPropertyItemList" EntityKeyName="PropertyId" />
                        </data:ManyToManyListRelationship>

    And I have a problem more ,Does the ManyToManyListRelationship Can work together with 2 ManyToManyListRelationship Control . I mean Like above . I have two property group and I want group them ,and make them update m-to-m relation seperately.

    Group1
                        <asp:CheckBoxList ID="GalleryPropertyItemList" runat="server" DataSourceID="GalleryPropertyItemReferenceDataSource"
                            DataTextField="PropertyName" DataValueField="PropertyId" RepeatColumns="4" />
                        <data:GalleryPropertyItemDataSource ID="GalleryPropertyItemReferenceDataSource" runat="server"
                            SelectMethod="GetByPropertyGroupId">
                            <Parameters>
                                <data:CustomParameter Name="PropertyGroupId" Value="1" ConvertEmptyStringToNull="false" />
                            </Parameters>
                        </data:GalleryPropertyItemDataSource>
                        <data:GalleryImagePropertyMappingDataSource ID="GalleryImagePropertyMappingDataSource"
                            runat="server" SelectMethod="GetBySiteImageId">
                            <Parameters>
                                <asp:QueryStringParameter Name="SiteImageId" QueryStringField="imgId" Type="String" />
                            </Parameters>
                        </data:GalleryImagePropertyMappingDataSource>
                        <data:ManyToManyListRelationship ID="GalleryImagePropertyMappingRelationship" runat="server">
                            <PrimaryMember ID="PrimaryMember1" runat="server" DataSourceID="GallerySiteDataSource"
                                EntityKeyName="SiteImageId" />
                            <LinkMember ID="LinkMember1" runat="server" DataSourceID="GalleryImagePropertyMappingDataSource"
                                EntityKeyName="SiteImageId" ForeignKeyName="PropertyId" />
                            <ReferenceMember ID="ReferenceMember1" runat="server" DataSourceID="GalleryPropertyItemReferenceDataSource"
                                ListControlID="GalleryPropertyItemList" EntityKeyName="PropertyId" />
                        </data:ManyToManyListRelationship>
                        Group2:
                        <asp:CheckBoxList ID="GalleryPropertyItemList2" runat="server" DataSourceID="GalleryPropertyItemReferenceDataSource1"
                            DataTextField="PropertyName" DataValueField="PropertyId" RepeatColumns="4" />
                        <data:GalleryPropertyItemDataSource ID="GalleryPropertyItemReferenceDataSource1" runat="server"
                            SelectMethod="GetByPropertyGroupId">
                            <Parameters>
                                <data:CustomParameter Name="PropertyGroupId" Value="2" ConvertEmptyStringToNull="false" />
                            </Parameters>
                        </data:GalleryPropertyItemDataSource>
                        <data:GalleryImagePropertyMappingDataSource ID="GalleryImagePropertyMappingDataSource1"
                            runat="server" SelectMethod="GetBySiteImageId">
                            <Parameters>
                                <asp:QueryStringParameter Name="SiteImageId" QueryStringField="imgId" Type="String" />
                            </Parameters>
                        </data:GalleryImagePropertyMappingDataSource>
                        <data:ManyToManyListRelationship ID="ManyToManyListRelationship1" runat="server">
                            <PrimaryMember ID="PrimaryMember2" runat="server" DataSourceID="GallerySiteDataSource"
                                EntityKeyName="SiteImageId" />
                            <LinkMember ID="LinkMember2" runat="server" DataSourceID="GalleryImagePropertyMappingDataSource1"
                                EntityKeyName="SiteImageId" ForeignKeyName="PropertyId" />
                            <ReferenceMember ID="ReferenceMember2" runat="server" DataSourceID="GalleryPropertyItemReferenceDataSource1"
                                ListControlID="GalleryPropertyItemList2" EntityKeyName="PropertyId" />
                        </data:ManyToManyListRelationship>

    just like above .I have tried ,it didn't work correctly . And I expect some body give me a solution of this problem . Thanks a ton .

    Nettier Funs . Make programe easier and fatster ! July.Liu
    Filed under:
    • Post Points: 35
  • 02-22-2008 6:42 AM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 726
    • Points 16,910

    Re: ManyToManyListRelationship Update Inccorect !

    it may have got broken back in december by the following check-in:

    - [ENH] Updated ExecuteUpdate to load entity as per data source settings (required when DeepSave is done after DeepLoad)

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 65
  • 02-22-2008 3:25 PM In reply to

    • wkampas
    • Top 500 Contributor
    • Joined on 05-31-2006
    • Posts 9
    • Points 135

    Re: ManyToManyListRelationship Update Inccorect !

    Thanks for the information, Mike!  This was a show-stopper for me also, and I had no idea where to begin looking for the solution.

    FYI - for anyone else who needs a quick fix - the change mentioned can be patched/reverted in your generated solution by finding the following code in:

    xxx.Web\Data\BaseDataSource.cs at line 1568 (in rev 704)

       //IList<Entity> entityList = GetEntityList();  
       // causes the overridde ProviderDataSource.OnSelected to fire, enabling DeepLoad on updates
       IList<Entity> entityList = Owner.Select();

    To comment out the change and revert back, uncomment the first line, and comment the last line; like so:

       IList<Entity> entityList = GetEntityList();  
       // causes the overridde ProviderDataSource.OnSelected to fire, enabling DeepLoad on updates
       //IList<Entity> entityList = Owner.Select();

    Being new at this, I don't know what the negative impact of reverting back to the prior version is.  It would be great if someone more familiar with the code could go back and make a real fix to the CST that doesn't have unintended consequences.

    Regards,

    Walt

    • Post Points: 5
  • 03-04-2008 10:34 PM In reply to

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 186
    • Points 4,716

    Re: ManyToManyListRelationship Update Inccorect !

    Hi Mike!

    I am experiencing the same bug as July. This is a problem for me, since I rely heavily on ManyToManyListRelationships. Could someone fix this bug rapidly?

    Cheers!

    JF

     

    • Post Points: 35
  • 03-07-2008 5:22 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 726
    • Points 16,910

    Re: ManyToManyListRelationship Update Inccorect !

    velum,

     I haven't got around fixing this problem yet ... i'll have a look at it over the weekend.

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 35
  • 03-11-2008 9:25 AM In reply to

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 186
    • Points 4,716

    Re: ManyToManyListRelationship Update Inccorect !

    Hi Mike!

    Did you have a chance to have a look at the problem during the weekend? I'll be glad to give your fix a try if you need someone to test it.

    Cheers!

    JF

     

    • Post Points: 35
  • 03-11-2008 9:52 AM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 726
    • Points 16,910

    Re: ManyToManyListRelationship Update Inccorect !

    Hi velum,

     I tried to reproduce the problem reported here by Anton http://community.codesmithtools.com/forums/p/6373/30205.aspx#30205 .. yet to hear feedback, in mean time i reverted back the change (it made into rev. 706)

    Mike Shatny
    --------------------------------------------------------------
    Member of the .netTiers team http://www.nettiers.com
    --------------------------------------------------------------

    • Post Points: 35
  • 05-22-2008 7:44 PM In reply to

    • blake05
    • Top 25 Contributor
    • Joined on 04-03-2008
    • Wisconsin
    • Posts 333
    • Points 5,930

    Re: ManyToManyListRelationship Update Inccorect !

     Hello,

    I don't know the current status of this bug so I have added this to our to-do list. You can check the status of this here

    Thanks

    -Blake

    Blake Niemyjski

    CodeSmith Tools, LLC Support Specialist

    Blog: http://windowscoding.com/blogs/blake/

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
Page 1 of 1 (8 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems