error in generated scaffold

3 views
Skip to first unread message

marc

unread,
Jan 5, 2012, 6:46:04 AM1/5/12
to model-glue
Hi,

I get an error in the generated scaffold file in "/views/generated/
Form.<tableName>.cfm":

Model-Glue 3 ("Gesture")
Oops!
Message Parameter validation error for the TRIM function.
Detail The function takes 1 parameter.
Extended Info
Tag Context D:\workspace\CFlab\Application\views\Form.page.cfm (46)

This is the line in the generaetd cfm file where the error gets
thrown:

46 <cfif len( trim() ) and val() neq 0 >
47 <cfset variables.isNew = false />
48 </cfif>

I have use scaffolding, afaics scaffolding is configured correctly
since I am able to display a list form. When I click the "add new
page" (page being the tablename) the event "page.Edit" fires and I get
this error.

Is this a bug in MG 3.2 RC1 (3.2.439) or am I doing something wrong?

Marc

Ezra Parker

unread,
Jan 5, 2012, 8:33:20 AM1/5/12
to model...@googlegroups.com
From the error message you posted, it looks to me like you may have a
Form.page.cfm file at the root of the /views directory that is taking
precedence over the generated view (unless you changed the default
generatedViewMapping setting from /views/generated to /views). if this
is indeed the case, then removing or renaming that file will allow the
generated view to be rendered instead.

--
Ezra Parker

> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to model...@googlegroups.com
> To unsubscribe from this group, send email to
> model-glue+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en

marc

unread,
Jan 5, 2012, 9:05:54 AM1/5/12
to model...@googlegroups.com
Hi Ezra,

This makes no difference. That file was a copy of the generated file I put there for debugging. But the code snippets tells it all:


46        <cfif  len( trim() ) and val() neq 0 >
47                <cfset variables.isNew = false />
48        </cfif>

It put me on track: the primary key in the trim and len functions was missing. Turned out I forgot to tell my Hibernate ORM's entity that the property "id" is the primary key. MG did not get a PK from CF9's orm so couldn't fill in one in the trim and val functions.

Instead of
    <cfproperty name="id" type="numeric" ormType="integer" generated="always">
I should have
    <cfproperty name="id" type="numeric" ormType="integer" generated="always" fieldtype="id">
in my Hibernate orm page.cfc

Marc
Reply all
Reply to author
Forward
0 new messages