Pergunta

My code in RichFaces 3.3.3:

    <a:region>
      <h:form>
        <a:poll id="feed" enabled="true" reRender="feedReader" interval="100"/>
      </h:form>
    </a:region>
    <h:form>
      <h:outputText value="#{feedReader2.title}" id="feedReader" />
    </h:form>

This is close to the example here: http://www.mastertheboss.com/richfaces/using-ajax-with-jboss-richfaces

What it should do is poll the server which reads an rss feed and gives back the title.

However, this is not working. In Chrome developer tools I can't see any AJAX requests made to the server. Instead, I see an error Uncaught TypeError: Cannot read property action of null on framework.pack.js. The line in which the error occurs is:

this._actionUrl=(this._form.action)?this._form.action:this._form

I can only guess that this is releated to the <h:form> which doesn't have an action attribute. But I don't see why I need this here, as it is not included in all of the examples you can find.

Moreover, I do not want the <h:outputText> to query the bean on page load. My aim is to use AJAX to read the feed after the page is done rendering.

If this is an issue related to my RichFaces version, could someone please give me an example on how to do this in 3.3.3?

Foi útil?

Solução

I found the issue. It was an error outside the above markup i've included. Had two <h:form> nested, which caused the second one to malfunction.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top