Hyperlink in master / detail relationship

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

Hyperlink in master / detail relationship

Post by Martin »

Hi,
I have two views, one is named "atmer" and the other one "complex".
atmer just have 1 field, this is named "Naam"; this is the master
complex (the detail) have more then 1 field, they are:
Naam
Object
Adres
Plaats
I want to create hyperlinks in the "master"view atmer so if I click on the field "Naam" the result is al the records from the view "complex" which belong to the specific field I've clicked on.
Whithin Table Specific Common - Row_Rendered I wrote the code :

// Row Rendered event
function Row_Rendered() {
if (CurrentPageID() == "list"){ // the name of the current page = atmerlist.php
$this->Naam->ViewValue = "<a href='complexlist.php?cmd=search&t=complex&psearch=".$this->Naam->CurrentValue."&psearchtype='>".$this->Naam->CurrentValue."</a>";
}

}

But there is no result regarding this code, when I go to the list "atmer" the page is listing all off the fields "Naam", and at the left of each "Naam" there is a link named "complex" (this is the standard lay-out of Master / Detail).
Can anyone point me out to the right direction?

Thanks.
Martin


mobhar
User
Posts: 11703

Post by mobhar »

I used "orders" and "orderdetails" tables in demo project for testing, and cannot reproduce your issue.

You may try to search directly from "complexlist.php" by entering the keyword that returned by $this->Naam->CurrentValue.


Martin
User
Posts: 73

Post by Martin »

Mobhar, thanks. I've tested this several times, and now it's working.
There is one issue left : if "Naam" have the value "pietjepuk" it's working fine, but if "Naam" have the value "pietje puk" I get back this error, "Failed to execute SQL. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(Naam LIKE '%puk%') LIMIT 40 OFFSET 0' at line 1.
And if I type directly into the search box "pietje puk" it also works fine.

Anyone a clue ?

Thanks,
Martin.


mobhar
User
Posts: 11703

Post by mobhar »

What PHPMaker version are you using?


Martin
User
Posts: 73

Post by Martin »

Hi Mobhar,

At this moment I'm using version 9. I already have a licenced 2017 version, but to switch right now is not yet planned.


mobhar
User
Posts: 11703

Post by mobhar »

Version 9 is too old and had been phrased out. There is no support provided for that version anymore.

Please always update to the latest version since too many advantages you will get. Support is always provided for the latest version. In addition, there are many great new features you will get in the latest version.


Martin
User
Posts: 73

Post by Martin »

Hi Mobhar,

I've switched now to PHPmaker 2017, and now I've no problems anymore. Thanks for your advice.

Regards, Martin


Post Reply