This topic is locked

How to refresh "edit page child table" after dropdown change.

2/13/2022 3:00:33 PM
PHPRunner General questions
U
ustunsoz author

Hello Folxs;
I have a child table with query depends to the session variables.
The session variables assigned on the master record dropdown with a field event, and works as normal at the time of open the page.

When I change the dropdown value, the session variables geting update, however I need to refresh the child table in the mean time.

How could I use field event (probably client after) in order to reload child table on the same page?

Thanks in advance

Sergey Kornilov admin 2/14/2022

You can find some ideas in this article

Sample code:

var detailsPage = pageObj.getDetailsPage( 'details', recordid );
detailsPage.reload( {} );
U
ustunsoz author 2/15/2022

Thank you for the solution, I used the code and leave the record id empty (because it is optinal)

var detailsPage = pageObj.getDetailsPage( 'pms_price_calc');
detailsPage.reload( {} );

When I change the dropdown value I am getting following error:

Uncaught TypeError: Cannot read properties of null (reading 'reload')
at constructor.after (pageevents_rc_resourcedetails.js?2467_1644828542:439:13)
at Object.success (pageevents_rc_resourcedetails.js?2467_1644828542:474:11)
at j (loadfirst.js?38731:2:27136)
at Object.fireWith [as resolveWith] (loadfirst.js?38731:2:27949)
at x (loadfirst.js?38731:4:22244)
at XMLHttpRequest.b (loadfirst.js?38731:4:26298)
after @ pageevents_rc_resourcedetails.js?2467_1644828542:439
(anonymous) @ pageevents_rc_resourcedetails.js?2467_1644828542:474
j @ loadfirst.js?38731:2
fireWith @ loadfirst.js?38731:2
x @ loadfirst.js?38731:4
b @ loadfirst.js?38731:4
XMLHttpRequest.send (async)
send @ loadfirst.js?38731:4
ajax @ loadfirst.js?38731:4
n.<computed> @ loadfirst.js?38731:4
submit @ pageevents_rc_resourcedetails.js?2467_1644828542:466
Runner.pages.fieldsEvents.rate_code_change @ pageevents_rc_resourcedetails.js?2467_1644828542:491
(anonymous) @ RunnerAll.js?38731:7389
callHandler @ RunnerAll.js?38731:5466
dispatch @ loadfirst.js?38731:3
r.handle @ loadfirst.js?38731:3
ListPicker._handleMouseUp @ unknown

is there something missing?

Sergey Kornilov admin 2/15/2022

If you take a look at my code you can see that getDetailsPage() function requires two parameters. You decided to drop one of them and, of course, it won't work this way.

U
ustunsoz author 2/15/2022

Thank you for the reply;
1. In the document the reference of the recordId is pointing as optinal, and referal example without recordid, so it was not my decision. ( an optional {integer}. A unique identifier of a record in a data grid on the List page.)
2. My detail table linked with 3 fields to the master table, accordingly details view listing matched rows. I don't now how to address record id. I have searched relative example but there is not any.

img alt

img alt

My code does not giving error as below but not functioning

var ctrlRoomT = Runner.getControl(pageid, 'room_type');
var room_type = ctrlRoomT.getValue();
var ctrlStayT = Runner.getControl(pageid, 'staying_type');
var staying_type = ctrlStayT.getValue();
var ctrlRateC = Runner.getControl(pageid, 'rate_code');
var rate_code = ctrlRateC.getValue();

var detailsPage = pageObj.getDetailsPage( 'pms_price_calc', room_type, rate_code, staying_type );
detailsPage.reload( {} );

I also tried only with rate_code which is equal to details table id but no luck.
I hope I didint make it complicated, thank you.

U
ustunsoz author 2/17/2022

As I could not get any response from anyone it is not doable?

U
ustunsoz author 3/7/2022

I am still waiting if someone can help

Sergey Kornilov admin 3/9/2022

If this still doesn't work you need to upload your project to Demo Account and contact support directly.