platform icon indicating copy to clipboard operation
platform copied to clipboard

Can't use two Orchid\Screen\Layouts\Listener(s) in one Screen

Open DmitrySidorenkoShim opened this issue 2 years ago • 6 comments

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:

  1. Create one Listener
  2. Create another listener
  3. Add both to one Screen
  4. 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.

DmitrySidorenkoShim avatar Dec 01 '21 22:12 DmitrySidorenkoShim

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?

elbaku avatar Mar 09 '22 02:03 elbaku

Same problem here is there any way work around this issue

aminemeickel avatar Apr 11 '22 23:04 aminemeickel

Unfortunately no... for now you need to choose one or combine somehow the logic

no any better ideas right now

DmitrySidorenkoShim avatar Apr 12 '22 07:04 DmitrySidorenkoShim

is there any other way to listen to the change of Select?

aminemeickel avatar Apr 13 '22 01:04 aminemeickel

Same problem for me...

gioacchinopoletto avatar Aug 14 '22 09:08 gioacchinopoletto

It is already fixed on version 13.9.3: https://github.com/orchidsoftware/platform/issues/2489

SubniC avatar Jan 11 '23 11:01 SubniC