Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Error in class generated
Error in class generated [message #600] Wed, 07 February 2007 12:56 Go to next message
stephenboey is currently offline  stephenboey
Messages: 54
Registered: January 2007
Member
Hi,

I did the following alterations to the table

ALTER TABLE `mnu_role`
ADD `role_id_snr` varchar(16),
ADD `lft` INTEGER NOT NULL default 0,
ADD `rgt` INTEGER NOT NULL default 0,
ADD KEY `role_id_snr` (`role_id_snr`)

Was trying to create a list then a pop up to specify parent child relationship.

Appears that framework is not generating mnu_role_jnr.class.inc properly.

Attached are the files
Re: Error in class generated [message #601 is a reply to message #600] Wed, 07 February 2007 14:18 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
When you export from the Data Dictionary it will only create the standard database table class (mnu_role), it will not create any subclasses (mnu_role_jnr).

Subclasses will be created from table_generate(b) when you specify any table alias names

What did you do to create the subclass?


Re: Error in class generated [message #602 is a reply to message #600] Wed, 07 February 2007 16:38 Go to previous messageGo to next message
stephenboey is currently offline  stephenboey
Messages: 54
Registered: January 2007
Member
I did this

HOME>>Dic>>Databases>>Tables>>Read>>Generate PHP
Generate PHP Scripts->Pattern ID -> LIST2
>>Screen Capture as attached
Re: Error in class generated [message #603 is a reply to message #602] Wed, 07 February 2007 17:56 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I managed to duplicate the error. Attached is a updated file which should fix it.

Re: Error in class generated [message #604 is a reply to message #600] Wed, 07 February 2007 21:22 Go to previous messageGo to next message
stephenboey is currently offline  stephenboey
Messages: 54
Registered: January 2007
Member
Subclass generated correctly.

I will post another related problem here so that it is easier to trace.

1. I updated some child records to role_id_snr = 'GLOBAL' to test.
When I click on navigation link to LIST2.

LIST2 has no master shown

2. When I select a child recod using checkbox -> click on update.It says nothing selected for POPUP screen.

I have attached the files.
  • Attachment: Feb08.zip
    (Size: 73.94KB, Downloaded 1326 times)
Re: Error in class generated [message #606 is a reply to message #604] Thu, 08 February 2007 04:49 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
The reason the LIST2 screen is not showng anything for the master/outer record is that mnu_role(list2).php has the following entries:
$outer_table = 'mnu_role';       // name of outer (parent) table
$inner_table = 'mnu_role_jnr';   // name of inner (child) table

while mnu_role.list2.screen.inc has the following entries:
$structure['tables']['outer'] = 'mnu_role_snr';
$structure['tables']['inner'] = 'mnu_role_jnr';

You should see that there is a mismatch on the name for "outer" - the data is being put into the XML file with the name "mnu_role" but the XSL stylesheet is looking for data with the name "mnu_role_snr". When both names are the same the data will appear.

The screenshot you provided showed that the child forms you created were Add2, Delete1, Enquire1, Search, Update1 and Audit. It is only the Add2 function that uses the popup, not the Update1, so you are doing something seriously wrong.

You also have the popup appearing as a navigation button in the List2 screen. This simply will not work.


Re: Error in class generated [message #607 is a reply to message #600] Thu, 08 February 2007 06:00 Go to previous messageGo to next message
stephenboey is currently offline  stephenboey
Messages: 54
Registered: January 2007
Member
I deleted the old files and regenerated new ones. How come when I generate PHP files, it does not overwrite the old ones?

I discovered that your Part4 tutorial ask the user to specify the Popup Table Name instead of the Pop Up Screen when Child Forms : Update2, Popup2, Delete3, Search in LIST2. Has this changed?
Re: Error in class generated [message #608 is a reply to message #607] Thu, 08 February 2007 06:58 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
The transaction generation procedure does not overwrite any existing files as they may have been edited, so it does not overwrite any changes you have made. This is by design. If you don't want the contents of your current files you must delete them manually.

I changed the procedure to ask for popups by task_id, not table names, in the latest release. This is because a popup may use either one or two tables, and it began to make the code (and the screen) too complicated. It is easier to create whatever popup you need first, then to specify its name later.


Re: Error in class generated [message #609 is a reply to message #608] Thu, 08 February 2007 08:50 Go to previous messageGo to next message
stephenboey is currently offline  stephenboey
Messages: 54
Registered: January 2007
Member
Deleted all screens and redo again.

When I selected a child record for update on mnu_role(list2)snr.php screen error message says
"Nothing selected from popup screen."

I traced it to the _cm_popupCall() of mnu_role_jnr.class.inc. Seems like it is not going in there. Something is missing.

Created
1. mnu_role(list2)snr -> Update2, Popup2, Delete3, Search -> Added to mnu_role(list) Navigation button
2. mnu_role(list2)jnr -> Update2, Popup2, Delete3, Search -> added to mnu_role(list2)snr Navigation button
3. mnu_role(popup2)jnr -> Added mnu_role(add2) to Navigation button

The codes in snr and jnr are quite close to Tutorial 4, just changed the variable names.

I've attached the related files and a screenshot.
  • Attachment: Feb08 - 2.zip
    (Size: 46.26KB, Downloaded 1357 times)
Re: Error in class generated [message #610 is a reply to message #609] Thu, 08 February 2007 12:05 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I see your problem. You are trying to activate a popup2 screen from the update2 transaction. This is failing because with a popup2 you need to identify an occurrence of the outer entity before it can display occurences from the inner entity, and you have not supplied a prmary key for the outer entity.

There are two ways you can provide this missing primary key - see http://www.tonymarston.net/php-mysql/infrastructure-faq.html #faq79 for details.


Re: Error in class generated [message #611 is a reply to message #610] Thu, 08 February 2007 15:04 Go to previous messageGo to next message
stephenboey is currently offline  stephenboey
Messages: 54
Registered: January 2007
Member
Aha... Now I see. You changed the Form from specifying the table to a screen correct?

Actually in Tutorial 4, Figure 3 chooses the Senior table...So our occurence was specified in the Relationship table...Correct me if I am wrong...

Looks like it is a bit different now and requires more programming....Sad

By the way, how does Radicore pass the ONE occurence to the POPUP automatically like in Tutorial 4? It seems pretty smooth back then.....Is this feature still available? Laughing From one step, now has become 3 steps ya.

The user has selected the checkbox on the LIST2 screen, don't you think it is a bit troublesome to key into POPUP1 again?

Anyway, my intention was to treat the POPUP2 as my detail screen afthe selecting the checkbox. Now I know, I should have selected Option1 in the screen for generating...
Re: Error in class generated [message #614 is a reply to message #611] Thu, 08 February 2007 16:48 Go to previous message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
There is no significance to the fact that in http://www.tonymarston.net/php-mysql/radicore-tutorial4.html #figure4 I chose x_tree_node_snr (subclass) and x_tree_node_jnr (subclass). Either one could have been x_tree_node (superclass). The only point is that the two tables must have different names so that the system can work out which data goes where.

If you look at http://www.tonymarston.net/php-mysql/radicore-tutorial4.html #relationships.step2 you will see where the _cm_popupCall() method in x_tree_node_jnr is modified to pass the current value in $where automatically to the popup2 screen. The default is to pass nothing.

There are two choices for providing a primary key value for the outer entity in a popup2 form - if the value is available before you call the popup then use the _cm_popupCall() method, if it is not then you must call a separate popup1 form after the popup2 has been activated. That is explained in the FAQ.


Previous Topic: Bug in Tutorial 5 _cm_validateInsert
Next Topic: Task, Role - Field Access functionality not working
Goto Forum:
  


Current Time: Fri Nov 29 03:51:19 EST 2024

Total time taken to generate the page: 0.01206 seconds