Hi,

I am having a small issue, I am getting

Error testing property 'commenttext' in bean of type null error message. I
googled and did lot of troubleshooting, however unable to resolve it.
I have a managed bean AppointmentBean which has a Map of comments

Appointment{

private Map commentitemMap=new HashMap();

*

public* Map getCommentItemMap() {

*return* *this*.commentItemMap;

}

*public* *void* setCommentItemMap(Map commentItemMap) {

*this*.commentItemMap = commentItemMap;

}

}

in my jsp I have bound the text area to
appointment.commentItemMap['Cancellation Reason'].commenttext

CommentItem {

*private* String commenttext="";
*

public* String getCommenttext() {

*return* *this*.commenttext;

}

*public* *void* setCommenttext(String commenttext) {

*this*.commenttext = commenttext;

}

}



In my action method I am setting the commentItem value as below:

CommentItem item=*new* CommentItem();

comentMap.put("Cancellation Reason",item);

appointment.setCommentItemMap(comentMap);



when the form is submitted, I read Error testing property 'commenttext' in
bean of type null error message.

In the facesConfig.xml I have declared both appointments bean and
CommentItem as managed beans in session scope.

If I use appointment.commentItemMap['Cancellation Reason'] without the
.commenttext , the full classpath of CommentItem is being displayed in the
text area (I assume its the object.toString value here ).

Please let me know where I am doing wrong.

Regards

Ayub

-- 
-- "Two roads diverged in a wood
And I took the one less traveled by
And that has made all the difference.

Robert Frost....."

Reply via email to