platform
platform copied to clipboard
Can't use two Orchid\Screen\Layouts\Listener(s) in one Screen
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.
I just stumbled upon this issue, i worked around it by adding isset($this->query)
when i use that method, did you find another way?
Same problem here is there any way work around this issue
Unfortunately no... for now you need to choose one or combine somehow the logic
no any better ideas right now
is there any other way to listen to the change of Select?
Same problem for me...
It is already fixed on version 13.9.3: https://github.com/orchidsoftware/platform/issues/2489