orchidsoftware / orchidsoftware/platform
Can't use two Orchid\Screen\Layouts\Listener(s) in one Screen
@tabuna is already working on this.
Since Dec 1, 2021.
- Dominant language
- PHP
- Stars
- 4.8k
- Forks
- 663
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
I am trying to use two different Listeners at the same Screen
for different cases.
If I use one of them while another is commented out
it works perfectly fine.
But if I use both at the same time I have an error
because of the query if null in another Listener layouts() method then one should be updated.
For example if I use this in Listener:
$this->query->has('some_key')
I will get:
Call to a member function has() on null
They use different async methods and targets.
To Reproduce
Steps to reproduce the behavior:
- Create one Listener
- Create another listener
- Add both to one Screen
- Trigger the action for any
Expected behavior
I expect each Listener layout will be updated only if was changed theirs targets.
In one case I need to show one or another input depending on selected dropdown.
and in other I need to hide one button and show another one if there were changed one of three inputs.
Desktop (please complete the following information):
- OS: macSX Monterey
- Browser Chrome
- Version latest
- "orchid/platform": "9.21.0",
Additional context
Please let me know if you need more details.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.