Hi,

I do not know if I really understand your problem, but if you just want to
bind the commentText to the textarea it will be straight forward like this

appointmentBean.commentItemMap['Event Type'].commentText

this will call the getCommentText() method on the corresponding commentItem
in the map. No need for a converter here.
(But keep in mind that there has to be already such an entry in the map)

Regards,

Berthold


On Wed, Nov 26, 2008 at 8:35 AM, Ayub Khan <[EMAIL PROTECTED]> wrote:

>
> 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
>
>
>
>
>
>
>
>
>
>



-- 
Berthold Scheuringer
+43 664 80508 3919

Irian Solutions GmbH
Your JSF powerhouse
http://www.irian.at

Reply via email to