orchidsoftware / orchidsoftware/platform
Listener does not work on a Screen with query loaded class variables
@tabuna is already working on this.
Since Nov 12, 2022.
- Dominant language
- PHP
- Stars
- 4.8k
- Forks
- 662
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
Describe the bug
If you have a class variable which is loaded by the query function in the Screen (image for reference) and If you are using this variable in the layout. The Listener's async call will fail...

To Reproduce
Steps to reproduce the behavior:
- Follow the quickstart to make a post crud (https://orchid.software/en/docs/quickstart-crud/)
- Use the
$this->postin the layout (e.g.->canSee($this->post->status == "approved")) - Add a listener to the page (e.g. A Country, State, City selector)
Expected behavior
The Listener should work properly...
Screenshots

Desktop:
- OS: PopOS
- Browser: Chrome
- Version [e.g. 22]
Server:
- Platform Version: ^13.7
- Laravel Version: ^9.19
- PHP Version: 8
- Database: MySQL
I noticed someone had a problem with multiple listeners as well, maybe we need a rework of the Listener Layout...
Can someone point me to an alternate solution I can do for a Country, State, City selector with the Relation input that updates the options for States when selecting country and so on...
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.