views:

206

answers:

3

Hi! Found strange problem, possibly bug.

I have 2 identical web-pages with Richfaces:suggestionbox.

On the first one my suggestionBox is doing well, everything works fine, but on another one i have some problems. SuggestionBox doesn't show my suggestions. In logs i have something like this:

WARNING: No component found to process as 'ajaxSingle' for clientId remains-form:konta-suggest
2010.1.9 12:02:29 org.ajax4jsf.component.AjaxViewRoot processPhase

Any conclusions?

UPD:

    <h:inputText value="#{repobean.kont}" id="kont" label="Payer" style="width:230px;"/>
    <rich:suggestionbox onobjectchange="printObjectsSelected(#{rich:element('konta-id')}, #{rich:component('konta-suggest')}, 'id');" usingSuggestObjects="true" width="230" var="result" fetchValue="#{result.kont}" suggestionAction="#{kontabean.suggest}" id="konta-suggest" for="kont">
                                    <h:column>
                                        <h:outputText value="#{result.kont}"/>
                                    </h:column>
                                    <h:column>
                                        <h:outputText value="#{result.kontName}"/>
                                    </h:column>
                                </rich:suggestionbox>
<h:inputHidden id="konta-id" value="#{repobean.kontId}" />

Javascript inside onobjectchange is a function which prints id into konta-id.

The code of jsp on the second page is copy-pasted from the first page.

A: 

I think a4j taglib is missing on the page.

taher
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> There is such.
Yurish
A: 

Hello,

What you can do, when you encounter Ajax problems, is to add the <a4j:log> component:

<a4j:log popup="false"/>

This will create a box in your page with all the Ajax logs from Richfaces. Eventually, you can set popup="true" and then display the popup by Ctrl + Shift + L

There are many logs in this panel, but generally the important things to look at is the WARN or ERROR messages.

Other concern about your error message: it is talking about some ajaxSingle processing. In your JSF code, you have no ajaxSingle attribute defined. When does this error happens? When you start typing some characters in your inputText component?

romaintaz
Yes, error happens, when i start to input characters in inputText.
Yurish
@Yurish Did you get interesting information with the `<a4j:log/>` component?
romaintaz
No, still nothing. On richfaces forum also no answers. Bug?
Yurish
A: 

Isn't there any conditional rendering (rendered="#{some expression}") around this input and suggestion components? Or an iteration?

Does .suggest() action get invoked before this error?

Situations like you've described happen when an action-related (causing) component is within a conditional render (or an iteration) which does not allow a component to be created on RestoreView phase. Then action is not called at all and component-id is not found in the component tree.

Example: if you have something like this:

<h:panelGroup rendered="#{not empty myBean.valueSetInActionHandler}">
  <h:commandLink id="action1" action="#{myBean.callOtherAction" value="appears after action"/>
</h:panelGroup>
<h:commandLink id="action2" action="#{myBean.setValueInActionHandler}" value="display button above"/>

First render - only one, second button is rendered. If setValueInActionHandler sets some value and displays the same page - first button ("appears after action") will get rendered too. But clicking it won't fire a callOtherAction - because on second request, during RestorePhase valueInActionHandler is empty again, so action1 will not be available...

Hope I managed to make myself clear :)

wciesiel