1 Reply Latest reply: Aug 2, 2010 7:05 AM by Ilya Shaikovsky RSS

JSF2.0+RichFaces3.3.3 suggestionBox inside a modalPanel

Mateusz Dymczyk Newbie

Following this example http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=editDataTable&cid=101317 I created a modal panel used for editing an entry. The difference is that one of my inputText fields has a suggestion box:

<h:inputText id="entryName" value="#{controller.currentItem.name}" validator="#{controller.entryNameValidator}"/>
<rich:suggestionbox id="suggestionBoxId" for="entryName" suggestionAction="#{controller.autocomplete}" var="result">
    <h:column>
        <h:outputText value="#{result.name}" />
    </h:column>
</rich:suggestionbox>
<rich:message for="entryName"/>

The problem is that when the modal appears and I change a single letter in the "entryName" the suggestion takes place, but when it finds no suggestions it reverts the changed value (the one without the letter i just deleted) to the original value (the one before deleting). If on the other hand it finds some suggestions it still reverts the value to the old one but also prints the suggestions in the modal right below "entryName" (and not in a suggestion box, it's just grey text). Also the suggestion triggers only once. If I lets say change "hello" to "hell" it reverts back to "hello" and the next time i try to modify it to "hell" nothing happens.

What am I doing wrong? Oh also I'm using the very exact same code in my jsf view when adding entries (it's not a modal though, just a table) and it works fine.

 

Apparently enclosing it with a <a4j:region></a4j:region> helps a bit as at least as I'm able to see the suggestion box (but in the background, so I have to set the zindex) and in the left corner of the browser not below the "entryName" AND still I can't click it (it just sits there and doesn't disappear even after closing the modal), the suggestions still are printed below the inputText (not in a suggestionBox and in grey) and it still triggers only once...