0
필드 플러그인을 사용하여 필드 스캐 폴딩 코드를 수정하려고합니다. 트위터 부트 스트랩도 설치했습니다. 이제 한 행에 2 개의 필드를 표시하고 싶습니다.필드 플러그인을 사용하여 grails 스캐 폴딩 템플릿을 수정할 때 예외가 발생했습니다.
private renderFieldForProperty(p, owningClass,counter, prefix = "") {
boolean hasHibernate = pluginManager?.hasGrailsPlugin('hibernate')
boolean display = true
boolean required = false
if (hasHibernate) {
cp = owningClass.constrainedProperties[p.name]
display = (cp ? cp.display : true)
required = (cp ? !(cp.propertyType in [boolean, Boolean]) && !cp.nullable && (cp.propertyType != String || !cp.blank) : false)
}
if (display) {
if(counter%2==0){
%><div class="row-fluid"><%
}
%>
<f:field bean="${domainClass.propertyName}" property="${p.name}"/>
<%
counter++
if(counter%2==0){
%></div><%
}
} } %>
지금 생성 된 코드는 다음과 같다 : 나는 내 _form.gsp 템플릿 파일에 다음 한
<div class="row-fluid">
<f:field bean="patient" property="familyName"/>
<f:field bean="patient" property="firstName"/>
</div>
나는이 예외있어 브라우저의 코드를 보려고 :
를URI
/patient/create
Class
org.springframework.beans.NotReadablePropertyException
Message
Invalid property 'familyName' of bean class [java.lang.String]: Bean property 'familyName' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
제가 잘못 생각한 것 같습니까? 어떻게 해결할 수 있을까요?
감사합니다, 페라