Master/Detail and retrun page (v2022)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
gargiulo
User
Posts: 49

Master/Detail and retrun page (v2022)

Post by gargiulo »

Hi,

  • i have a table master A and several detail tables linked to A e.g. B C D E
  • when i select Master/Detail Vew i land in Master detail page
  • at the top i have the record of master
  • at the bottom i have a series of tab related to the details tables B C D E and focus is on the table B
  • suppose i go in table E and i edit or add a record in table E
  • when inserted or updated the page come back to focus on table B

what i look for is remain in table E without refreshing in table B

do you have some indication to solve it

thanks


arbei
User
Posts: 9384

Post by arbei »

You may, for example,

  1. Use Page_Load server event of the Add/Edit page of Table E to save the current detail table name in a session variable,
  2. Use Page_Render server event of the View page of Table A to check your session variable and set the current table, e.g. $this->DetailPages["TableE"]->Active = true;, then clear the session variable.

gargiulo
User
Posts: 49

Post by gargiulo »

Hi Arbei,

i did but it refresh always in table B.
let me explain what i did, perhaps something went wrong :

  • in Server event- Login Page - Page Load i clear my variable (otherwise when i invoked Master Detail View from table A i received an error due to the key my_tab was undefined)
    $_SESSION["my_tab"]="";
  • in Page_Load server event of the Add/Edit/Delete page of Table E i did
    $_SESSION["my_tab"]= CurrentDetailTable();
  • In Page_Render server event of the View page of Table A
if ($_SESSION['my_tab'] !="") {

$this->DetailPage[$_SESSION['my_tab']]->Active = true;
}

$_SESSION['my_tab']="";

something is wrong but i don't know what, thanks for your help.


arbei
User
Posts: 9384

Post by arbei »

gargiulo wrote:

in Page_Load server event of the Add/Edit/Delete page of Table E i did
$_SESSION["my_tab"]= CurrentDetailTable();

CurrentDetailTable() there is the current detail table of Table E, so it is wrong. During development, you should check the value by, for example, var_dump() first.

You should save "Table E" (replace it with the real table variable name of table E) directly.


gargiulo
User
Posts: 49

Post by gargiulo »

Thnaks for suggestions that i applied but receiving error.
Based on what you said :

You should save "Table E" (replace it with the real table variable name of table E) directly

  • i modify my code in table E server event Add/Edit/Delete Page Load

$_SESSION["my_tab"]= "parrservizi";

  • in server event of Table A Page Render :
    if ($_SESSION['my_tab'] !="" ) {
    
    $this->DetailPage["parrservizi"]->Active = true;
    }
    
    $_SESSION['my_tab']="";
    i know this isn't correct but it was just to force table E true

but..... i received the error

Notice: Indirect modification of overloaded property PHPMaker2022\CARITAS\ParrocchieView::$DetailPage has no effect in C:\xampp\htdocs\Caritas\models\ParrocchieView.php on line 1847

there is something still wrong


arbei
User
Posts: 9384

Post by arbei »

It should be $this->DetailPages.


gargiulo
User
Posts: 49

Post by gargiulo »

Thanks, it runs perfectly.

the post could be useful for someone else who has the same need.


Post Reply