Hi,
For the past 2 days, I have been trying to make one thing work with the ListGrid and it's truly unbelievable. Here's the problem i am facing:
I have a listgrid that contains two inter-dependent dropdown lists. column 1 has a list of owners, while column 2 has a list of divisions. When I select an owner, the list of divisions in column 2 should refresh to contain only the divisions of the selected owner.
In my design, i have a DS for the owners and a DS for the divisions.
I tried several things, but the 3 main things are:
A. I tried making the owners' dropdown as a SelectItem and i put an onChange handler in order to do a re-fetch on the divisions' DS. The fetch is taking place with the right criteria, however the selectItem does not refresh (or does not invalidate its cache). I have tried several tweaks, but couldn't make it work.
B. I tried the method used by the ShowCase, under "Dependent Selects(Grids)". And here's the big surprise. The method works only with a ValueMap, and it suggests that we set an EditorValueMapFunction, which is an interface that has one method to implement: getEditorValueMap which returns a String[]. So, in other words, we can only return a list of options (either values or displays, but not both), instead of a ValueMap. So, how can i have divisions showing a certain display, while having a different value in the database? Moreover, do i have to go though my DS's data and fill it into a Map in order to make use of this?
C. I even tried using the method suggested in ShowCase for the form, but i couldn't tweak it to work on a listgridfield.
To be honest, it feels almost impossible to manipulate anything in a Listgrid. I am starting to worry about future problems, like the ability to have a different picklist on each row in a listgrid, based on the value of one of its columns, for example. Also, the ability to force only a set of options in a selectItem when inserting a record, while having more options when editing a record.
Sadly, these many problems are making my boss rethink our decision to build a software based on smartGWT. And the worst part is that we were half-way through developing it.
Any help is appreciated.
Thanks in advance.
For the past 2 days, I have been trying to make one thing work with the ListGrid and it's truly unbelievable. Here's the problem i am facing:
I have a listgrid that contains two inter-dependent dropdown lists. column 1 has a list of owners, while column 2 has a list of divisions. When I select an owner, the list of divisions in column 2 should refresh to contain only the divisions of the selected owner.
In my design, i have a DS for the owners and a DS for the divisions.
I tried several things, but the 3 main things are:
A. I tried making the owners' dropdown as a SelectItem and i put an onChange handler in order to do a re-fetch on the divisions' DS. The fetch is taking place with the right criteria, however the selectItem does not refresh (or does not invalidate its cache). I have tried several tweaks, but couldn't make it work.
B. I tried the method used by the ShowCase, under "Dependent Selects(Grids)". And here's the big surprise. The method works only with a ValueMap, and it suggests that we set an EditorValueMapFunction, which is an interface that has one method to implement: getEditorValueMap which returns a String[]. So, in other words, we can only return a list of options (either values or displays, but not both), instead of a ValueMap. So, how can i have divisions showing a certain display, while having a different value in the database? Moreover, do i have to go though my DS's data and fill it into a Map in order to make use of this?
C. I even tried using the method suggested in ShowCase for the form, but i couldn't tweak it to work on a listgridfield.
To be honest, it feels almost impossible to manipulate anything in a Listgrid. I am starting to worry about future problems, like the ability to have a different picklist on each row in a listgrid, based on the value of one of its columns, for example. Also, the ability to force only a set of options in a selectItem when inserting a record, while having more options when editing a record.
Sadly, these many problems are making my boss rethink our decision to build a software based on smartGWT. And the worst part is that we were half-way through developing it.
Any help is appreciated.
Thanks in advance.
Comment