can't get _cm_popupReturn to execute [message #1222] |
Mon, 14 January 2008 18:52 |
ikatz
Messages: 40 Registered: December 2007 Location: Durham, NH
|
Member |
|
|
I'm having trouble working with the _cm_popupReturn function. Specifically, it seems that it is never called.
I am using a popup1 through an add3 to insert rows into a multi2, representing this table:
CREATE TABLE membership_access (
membership_id INT UNSIGNED NOT NULL,
person_company_id INT UNSIGNED NOT NULL,
role_id VARCHAR(20) NOT NULL,
date_added DATE NOT NULL,
PRIMARY KEY (membership_id, person_company_id),
FOREIGN KEY (person_company_id)
REFERENCES person_company (person_company_id),
FOREIGN KEY (membership_id) REFERENCES membership (membership_id),
FOREIGN KEY (role_id) REFERENCES role (role_id)
) Engine=InnoDb;
membership is the outer, membership_access is the inner, and person_company is the popup.
I am using the _cm_popupCall function in classes/membership_access.class.inc to filter the records shown in the person_company popup (and it works). But when I choose the item from the popup, the _cm_popupReturn (which is also in classes/membership_access.class.inc) never fires. Because of this, role_id and date_added are blank -- which gives me an error message at the bottom of the multi2 screen.
My intention is to use _cm_popupReturn in order to provide default values for role_id and date_added. Am I failing because multi2 is unsuited for this purpose, or because I lack some understanding of the program flow (and should be using some other _cm_ function to achieve this result)?
|
|
|
|
|
|
|
|
|
Re: can't get _cm_popupReturn to execute [message #1230 is a reply to message #1229] |
Wed, 16 January 2008 17:21 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
If you look inside file RADICORE-yyyy-mm-dd.txt in the top-level directory you will see the version number, which on that date was 1.6.0. This is hopelessly out of date as the current version, with roughly one update per month since then, is now 1.32.0. You really ought to upgrade.
A call to popupReturn is only made in those tasks which accept a single choice. An ADD3 task can accept multiple choices, so there are multiple calls to the insertRecord method. This is described in http://www.tonymarston.net/php-mysql/dialog-types.html#add3. You will therefore have to use one of the custom methods that is referenced in that sequence.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
Re: can't get _cm_popupReturn to execute [message #1238 is a reply to message #1230] |
Thu, 17 January 2008 16:06 |
ikatz
Messages: 40 Registered: December 2007 Location: Durham, NH
|
Member |
|
|
OK, I was able to fix this by moving to a list2 transaction. I am still getting the hang of where field names (real and virtual) come from, but I will start another thread for that.
I will attempt to upgrade after I get more familiar with this system.
Thanks
|
|
|