-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix MNU when using component list as input port in custom presenter #1463
Conversation
Specialize transmitTo:transform: to handle problem with connecting presenters with component list.
sorry but this fix is wrong. |
transmissions do not work between presenters but between ports aPresenter transmitTo: otherPresenter is the same as doing: aPresenter defaultOutputPort transmitTo: otherPresenter defaultInputPort but you cannot take a port and connect it to a presenter. EDIT: basically, you cannot use a presenter as input port. |
I made a revert: |
The documentation isn't exactly clear about what's the difference between "using as" and "connecting". The documentation mentions that "a transmission connects a presenter's output port with a presenter's input port," whereas you wrote, "transmissions do not work between presenters but between ports." This is contradictory because the documentation implies that the transmission connects presenters indirectly through their ports, whereas you suggest that the transmission works only between ports, not presenters. Additionally you've mentioned "you cannot take a port and connect it to a presenter," which contradicts the information in the documentation, where it is shown that a port can be connected to a presenter's default input port, as in the example "list defaultOutputPort transmitTo: detail defaultInputPort". I provided an |
this part or your case: defaultOutputPort
^ self categoryListPresenter is wrong. You cannot answer a presenter as a port. |
There is a draft chapter on transmissions Using transmissions and ports in the Spec2 book: https://github.com/SquareBracketAssociates/BuildingApplicationWithSpec2/releases/download/latest/Spec2-wip.pdf You can simply define defaultOutputPort
^ self categoryListPresenter defaultOutputPort |
Thanks @demarey ! That's exactly what I was looking for. |
This PR handles a case with transmissions along a component list in custom presenters. There is an issue in transmitTo:transform: method when connecting a transmission between presenters where the target presenter has defined an input port as a
SpListItemPort
with a component list .The PR includes a case with a test to reproduce the problem:
SpComplexComponentListExample open.
To fix it, the PR specializes
transmitTo:transform:
to handle problem with connecting presenters with component list.