tags:

views:

123

answers:

2
  1. I am using JSF RI 1.1. How to add rich text editor component? Is there any rich text editor component available?
  2. I am displaying set of images horizontally using the below code. Selected image is stored in database. while showing the images in edit mode, how to highlight the previously selected image?

    <t:dataList 
        var="item" 
        value="#{occasionBean.messageInfo}"
        layout="simple">
        <h:commandLink action="#{occasionBean.selectedImage}"  >
            <h:graphicImage 
                width="100" height="100" 
                url="#{item.imageSnapUrl}" 
                onclick="return setMsgId(this.id,{item.img_id},'{item.imageUrl}');"
                    id="test">
            </h:graphicImage>
        </h:commandLink>
    </t:dataList> 
    
A: 

1) Mojarra Scales has a htmlEditor component.

alt text

2) Add a styleClass conditionally.

styleClass="#{item.previouslySelected ? 'selected' : ''}"

with this getter

public boolean isPreviouslySelected() {
    return previouslySelected;
}

and this CSS

img.selected {
    border: 2px solid red; /* Use whatever highlight style here. */
}
BalusC
Thank you very much Dear BalusC. As Pablo Santa Cruz commented i ll ask questions one bye one
Paul
Hi BalusC ur code works fine. but my requirement is little bit different.i failed to explain it clearly. The images are displayed horizontally using <t:dataList>. At first no images are selected if selected it has to be highlighted. If user changes the selection the old has to go normal and new has to be highlighted. while in edit mode we need to highlight the already selected image and they may change in this mode so highlight should change. pls provide some solution.
Paul
A: 

Richfaces has editor component.

Bozho