New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERXDisplayGroup.selectedObjects() returns empty array after ERXDisplayGroup.setSelectedObjects() #599
Comments
Your code is missing a fetch on the display group after setting the datasource. Without a fetch (or using ERXDisplayGroup group = new ERXDisplayGroup(); group.setDataSource(ds); group.fetch(); group.setSelectedObjects(new NSArray(attachments.get(0))); |
I agree, that's fine for a DG, but for D2W, it means that I'd have to do this for every single place in all my code where I use a Pick List Page.
|
I am not familiar with the D2W workflows but the "old" behavior of ERXDisplayGroup (i.e. the current one of WODisplayGroup) is illogical. Selecting elements in a container that is empty doesn't make sense. Either fetching or explicitly setting an object array would be the correct way to go. How is your ERDPickPageInterface implementing class handling the fetch? Is it fetching at all? Looking at that interface you probably should do:
|
It's using ERD2WPickListPage. It's clearly fetching at some point as the EOs are being retrieved and the data is being displayed. This code has worked for years until this change was made to wonder. |
That brings up the old question: should we keep broken things in WO unchanged to support old code without modifications, or should those get fixed in Wonder? Adding another property to the already existing trillions of properties in Wonder to control ERXDisplayGroup's behavior is not a good solution as it either would let the old logic active leaving the now fixed bug open for new developments or enabling the new logic making it necessary to manually switch it off for legacy projects. Doing the latter one you could just go ahead and fix the app instead. So a property would only solve part of the problem, either old or new projects will need modifications (setting property or fixing code). I will leave that decision to the other committers. |
If you're after general opinions here (I'm not necessarily commenting on this specific case), then I lean heavily towards fixing breakages in Wonder, otherwise what's the point? Backwards compatibility should be preserved where possible, but not at the expense of deliberately leaving broken behaviour unfixed. If you need legacy code to be able to run untouched forever, pick a version in the Wonder timeline where it works, and stop updating. Living on the bleeding edge of Wonder and preserving legacy behaviour are contradictory goals.
I completely agree. |
This issue has been resolved with merge of #678. |
This will print an empty array.
Prior to the merge of pull request #535 ( commit c62ea95), this would print an array of the selectedObjects.
This is particularly causing a problem with D2W, where it would be common to do something such as
Prior to this change, the pick list page would show the selected objects.
After this commit, it shows no objects as being selected.
The text was updated successfully, but these errors were encountered: