RCobb1
31 Oct 2011, 5:40 AM
Hello all,
I'm using GXT 2.2.4 under GWT 2.4.0... All things are working as expected, but I am struggling with two aspects of a new app I'm working on and thought I would turn to the more seasoned experts for a suggestion on how best to resolve them. I have a form that contains a few text fields and a grid widget; the grid rows come from a DTO bean. I'm trying to set a sequence on the rows both on page render (the underlying OpenJPA entity contains a collection of children that are ordered using the @OrderBy annotation on a sequence column in the child entity). I've confirmed that the @OrderBy column IS putting the collection in the proper sequence but:
Problem 1: When the Grid renders, I get a random ordering of rows in the underlying ListStore even though I am adding them to the store in the same order. Is there a way to force displaying of the rows in the grid based on a sequence field from an element in the store?
Problem 2: If the end user adds a new item to the grid, I need to reset the sequence in all items in the store to match what is in the grid (grid supports drag and drop so the end user can put the grid-rows into a sequence that they want); I've been able to do this, somewhat inelegantly, but my real question is: is there a way to access the value of the RowNumberer assigned value to the row upon an action so I can use that to assign the sequence upon persist?
Caveat: My data is coming from a legacy OpenJPA DAO package, so I'm not allowed to change any of it. As a result, I'm converting my data from entities into DTO's that extend BaseTreeModel in my services and converting them back to entities before passing back to the DAO for persistence.
Thanks in advance to all for any suggestions!
Cheers,
Randy
I'm using GXT 2.2.4 under GWT 2.4.0... All things are working as expected, but I am struggling with two aspects of a new app I'm working on and thought I would turn to the more seasoned experts for a suggestion on how best to resolve them. I have a form that contains a few text fields and a grid widget; the grid rows come from a DTO bean. I'm trying to set a sequence on the rows both on page render (the underlying OpenJPA entity contains a collection of children that are ordered using the @OrderBy annotation on a sequence column in the child entity). I've confirmed that the @OrderBy column IS putting the collection in the proper sequence but:
Problem 1: When the Grid renders, I get a random ordering of rows in the underlying ListStore even though I am adding them to the store in the same order. Is there a way to force displaying of the rows in the grid based on a sequence field from an element in the store?
Problem 2: If the end user adds a new item to the grid, I need to reset the sequence in all items in the store to match what is in the grid (grid supports drag and drop so the end user can put the grid-rows into a sequence that they want); I've been able to do this, somewhat inelegantly, but my real question is: is there a way to access the value of the RowNumberer assigned value to the row upon an action so I can use that to assign the sequence upon persist?
Caveat: My data is coming from a legacy OpenJPA DAO package, so I'm not allowed to change any of it. As a result, I'm converting my data from entities into DTO's that extend BaseTreeModel in my services and converting them back to entities before passing back to the DAO for persistence.
Thanks in advance to all for any suggestions!
Cheers,
Randy