【发布时间】:2011-05-25 10:00:03
【问题描述】:
当我尝试在方法体中调用它自己的方法时,我的项目中出现错误。我把我的代码放在 gsp 中。
他们来了
/* Method for appending the child menu */
def createMenuChild = { obj , paramMenuArr ->
def urlChildMenu=obj.menu.url
def idChildMenu=obj.menu.id
def nameChildMenu=obj.menu.name
out << '<div><a href="'+urlChildMenu+'" class="mChld">'<< nameChildMenu<< '</div>'
def childInstance1= Menu.findById(idChildMenu)
def child1MenuInstance= Menu.createCriteria().list{
eq("parentMenu",childInstance1)
order("sequence", "asc")
}
if (child1MenuInstance){
child1MenuInstance.each {newIt5 ->
def idChildMenu2=newIt5.id
paramMenuArr.each { newIt6 ->
if (newIt6.menu.id == idChildMenu2){
owner.call (child1MenuInstance,paramMenuArr)
}
}
}
}
}
我使用 owner.call 来调用方法本身。我遇到了这样的错误
Exception Message: No signature of method: bla.....
谁能解决?
【问题讨论】: