I'm trying to implement a ListView and in on column of it I added a
listView, for each line,
I want to save the data inserted on it and update the model:
I'm implemented the code bellow:
val description = new TextField("description",new
PropertyModel[Meeting](meeting, "description"))
description.add(new AjaxFormComponentUpdatingBehavior("keyup") {
protected def onUpdate(target: AjaxRequestTarget) {
description.getDefaultModelObjectAsString
}
})
item.add(description)
And I added a link for each line of my ListView for save the information in
database,
each line is a instance of a model meeting as is showed bellow:
item.add(new LinkSave("save", meeting))
private class LinkSave(id: String, meeting: Meeting) extends
AjaxLink[String](id) {
@SpringBean
var meetingMediator: TMeetingMediator = _
setVisible(clickavel.asInstanceOf[Boolean])
add(new Label("label", new Model[String]() {
override def getObject: String = "Save"
}))
def onClick(target: AjaxRequestTarget) {
meetingDAO.saveMeeting(meeting)
}
}
But unfortunately the code above doesn't work. It's fail to retrieve the
value of the text
field and also to set the attribute description of the Object meeting with
the value of the text field, so in the database the column description is
never filled
Someone know where I am doing wrong stuff?
Thanks a lot!
Bera