Ticket #277 (closed defect: duplicate)
Alias Problems Simplified
| Reported by: | Bryan S | Owned by: | somebody |
|---|---|---|---|
| Priority: | highest | Milestone: | |
| Version: | Severity: | blocker | |
| Keywords: | Cc: |
Description
This is a simplified version of Ticket #226 (closed defect: worksforme) which is not resolved for me. It is very easy for me to recreate two of the problems using the steps below:
I am using Model Glue 286 but I first started experiencing the problem last October.
1) In ModelGlue?.xml for any table create a scaffold event handler
<scaffold object="ZdemoTable?">
<results>
<result do="view.template" />
</results>
</scaffold>
2) In Reactor.xml create an object for the table. If you are not using Oracle you don't need the "sequence=".
<object name="ZDEMO_TABLE" alias="ZdemoTable?">
<field name="ZDT_ZDEMO_TABLE_ID" alias="ZdemoTableId?"
sequence="S_ZDEMO_TABLE" />
<field name="ZDT_COLUMN_ONE" alias="ColumnOne?" /> <field name="ZDT_COLUMN_TWO" alias="ColumnTwo?" />
</object>
3) Allow Model Glue to build the scaffold events in Scaffolds.xml http://localhost/YourApp/index.cfm?init=true&scaffold=true
4) Run the list event for the table and click on one of the view links under the column name headings. If you have the same problem that I am having you will get back an empty record.
5) Now go to your Scaffold.xml and you will see five references to the primary key (in my case ZDT_ZDEMO_TABLE_ID). Do a search and replace with the alias for the field (in my case ZdemoTableId?). Now you should get the record back.
6) Go back to the list and click the edit link for the record, make a change to the record, and click save. If you have the same problem that I am you will get an error below for the primary key get method. However, if you go back to the list you will see that your change was made.
The method 'getZDT_ZDEMO_TABLE_ID' could not be found in component D:\Inetpub\wwwroot\YourApp?\model\data\Record\ZdemoTableRecordoracle?.cfc. Detail Check to ensure that the method is defined, and that it is spelled correctly. Extended Info Tag Context D:\Inetpub\wwwroot\ModelGlue?\unity\controller\GenericORMController.cfc (143) D:\Inetpub\wwwroot\ModelGlue?\unity\listener\Listener.cfc (26) D:\Inetpub\wwwroot\ModelGlue?\unity\eventrequest\MessageBroadcaster?.cfc (32) D:\Inetpub\wwwroot\ModelGlue?\unity\framework\ModelGlue?.cfc (359) D:\Inetpub\wwwroot\ModelGlue?\unity\framework\ModelGlue?.cfc (332) D:\Inetpub\wwwroot\ModelGlue?\unity\framework\ModelGlue?.cfc (306) D:\Inetpub\wwwroot\ModelGlue?\unity\framework\ModelGlue?.cfc (264) D:\Inetpub\wwwroot\ModelGlue?\unity\ModelGlue?.cfm (104) D:\Inetpub\wwwroot\YourApp?\index.cfm (50)
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)