Hi,

I am trying to bind the textArea to a bean property which is of type Map.
Could any one assist me what the issue here.

JSF page has list of appointments and form to create new appointment. User
selects the existing appointment, this populates the appointment form.

appointmentBean is mapped to Appointment table in db. which has been
prepopulated with ids and event types.

in jsf page text area is mapped as appointmentBean.commentItemMap['Event
Type']
AppointmentBean{

Map commentItemmap=new HashMap(0);

}

CommentItem{

int commentId;
int commentText;

getters and setters for above variables.

}

In the service methods the commentItem is associated with Formbean as below:


getCommentItemMap().put(eventType,newCommentItem);

When I submit the form I was getting convertion error on CommentItem. I
registered a coverter for CommentItem in faces-config.xml.

Now I am getting null pointerexception in the converter, value is null,
which indicates the converter is not getting bound to the commentItem of db.
*

public* String getAsString(FacesContext ctx, UIComponent component, Object
value) {

*return* ((CommentItem)value).getCommentId().toString*();*

}

I am not able to understand how to map a preexisting CommentItem which is
there in db to jsf textArea field

any clues here what I am missing ?

Regards

Ayub

Reply via email to