BO data reordering


Author
Message
Ian Hammond
Ian Hammond
StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)
Group: Forum Members
Posts: 57, Visits: 277
My application has a table of items and anther table comprising a list of pictures for the item. When I show the data for an

item, I also display a column of thumbnails. The pictures are stored by filename, item_id, order of preference, pk. When the app

starts, it fills the picture BO with all the data, to display the thumbnails of an item I filter the BO and pass a file list to

the thumbnail class. The user can exchange the position of the thumbnails and this generates an event which edits the filtered BO

by exchanging the order of preference values. I then Save the BO. If I move to the next item and then back to the edited one,

the thumbnails are displayed in there original order. The data is saved correctly in the database and I can overcome this by

performing anther fill, but I don't want to do this every time I save the data.

Is there an easier way of reordering the data in the BO?

Many thanks in advance.

Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ian,



You have to play with the BO.Sort(), but be very careful with Sort and Filter since your code needs to be aware of these conditions, specially the BO.Filter.



I believe that if you apply a BO.Sort condition will take care of your situation, if this is not the case, then try posting some of the code you are using.

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I think you might want to take a step back and think about what data is being shown vs. saved. It seems to me that you have a BO that is filled when you load, then you change the preference order some other way. I.e. you don't update the filled BO directly. Are you calling a sproc or running an update via the BO, rather than actually changing the order via the strongly typed properties? I would think that if you are actually changing the properties within the BO used to control the display, then all would work fine. Essentially, you have to some how refresh the BO controlling the display with the new data. Likely this would be easiest if you just made the change directly in this BO.

Ian Hammond
Ian Hammond
StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)
Group: Forum Members
Posts: 57, Visits: 277
That sorted it, many thanks.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Glad you got it working Ian. Did you use Edhy's sorting suggestion or did something else work?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search