[jboss-user] [JBoss Seam] - Foreign Keys and changing Seam Gen templates
do-not-reply at jboss.com
Thu Feb 8 10:45:06 EST 2007
I'm using Seam Gen to generate the CRUD pages for my application using Seam 1.1.5, however one thing that I find odd with the generated pages is that if you have a foreign key, the generated pages do not allow you to enter it in a normal fashion.
For example: If you have one table COUNTRY with a primary key of COUNTRYCODE and another table PERSON with a foreign key of COUNTRYCODE, the generated pages make you enter in a COUNTRY and then the PERSONs associated with that country. When entering in PERSON you cannot select a country.
In reality you would enter in a COUNTRY and then be able to select a country when entering the PERSON.
I've tried to modify the Seam Template edit.xhtml.ftl and change the line:
<#if !c2h.isCollection(property) && !c2h.isManyToOne(property) && property.columnSpan==1>
to remove the restriction on "isManytoOne", however this results in an error:
property.value.typeName is undefined. It cannot be assigned to propertyType
I don't know the Seam gen package and Freemarker well enough to jump into it.
Can anybody suggest how to modify the template so that all fields in the table are displayed? Even better would be having some means of automating the lookup? eg using ice:selectInputText or similar?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013087#4013087
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013087
More information about the jboss-user