How to update Relation Manager table data
I need to create an action that when clicked it updates the relation manager table where this action is located. Which method should I call within the action to do this? Thanks
Solution:Jump to solution
The action is on the relation manager itself? If so, action should dispath an event
...
19 Replies
public function isReadOnly(): bool
{
return false;
}
Add this code in your relation manager file
Thanks for the suggestion, but I don't think I explained what I wanted well. I need that when the user clicks on the REFRESH button it triggers an action that will read the relationship and display the data in the table below the button. Something like $this->relation-manger->refresh(). then the table will be updated. Thanks
Why not just add polling?
Otherwise I have seen the option using attrbutes for On methods to refresh
How would I add POLLING?
Using the ON method would be nice, but all the examples I found only refresh the OWNER table builder of the relation-manager. If you could give me an example of how I would do it to refresh only the relation, I would appreciate it. Thanks.
Solution
The action is on the relation manager itself? If so, action should dispath an event
and then you listen for this event on the relation manager class and refresh
Hi, I did this but instead of using dispatchSelf I used after. I imagine it's similar. When I include a product in the relationship, it updates the page without any problems, but when I dispatch it in the relationship pipeline, it doesn't update at all. It goes through the refresh method and executes $this->formFill() but doesn't update the page. Do you know what it could be?
I don't understand your problem
I have a page that has a relationship on it. When I include or delete an item in the relationship it has to update the values in the parent form of the relationship on this page. And this is only happening when I include the item and when I remove it it is not updating the fields. I will send the images for you to see.
This image was when I included a new item in the relationship and it correctly updated the values that are in red.
Now I removed the item and see that it notified everything but did not change the values that are in red.
Then when I click on the save and recalculate button it changes the values correctly
These values in red are values that come from the table and are not editable.
Because you don't refresh them on the action. Hard to tell without code
Hello, This is the action code for both include and remove.
And what's the problem? Listen for them on the proper class
This action is on the editpage. Do I have to put it on the ListPage or ResourcePage for the deletion to work?
On the page where it should be refreshed
On which page should I put the Delete on to work? since it is currently on the Edit Page and works fine, but it does not work on the Delete.
Although it is being called correctly upon deletion, see the notification appearing in the deletion image. It just doesn't update.