Announcement Announcement Module
Collapse
No announcement yet.
Rich faces tree not sending ajax requests. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rich faces tree not sending ajax requests.

    Hi guys,

    I've been using some of the rich faces components within my Spring web flow application and with some tweaking I have come some way as far as widgets go.

    However I can't really get Rich Faces' ajax requests running. A simple example: I've made a richfaces tree like this:
    Code:
    <rich:tree nodeSelectListener="#{dataSelection.selectColumn}"  ajaxSubmitSelection="true" ...></rich:tree>
    The dataSelection bean is registered as a <var> in my flow. The selectColumn method adheres to the rich faces spec but nothing comes through:
    Code:
    public void selectColumn(NodeSelectedEvent event) {
    	System.out.println("!!! hole through to rich faces and web flow !!!");
    }
    ... Simply nothing happens! What should I do? Have anyone had any luck getting rich faces working with ajax requests like this?

  • #2
    Firebug investigations...

    I just tried out firebug to see what was going on when I pressed the nodes of the richfaces tree and the request looks fine I think (is the URL correct? It shouldn't be /a4j/something?)

    The request:
    Code:
    URL: ht tp:// localho st:8080/mysit e/main-flow?execution=e1s3
    
    POST:
    AJAXREQUEST	_viewRoot
    schemasForm:j_id16:input	schemasForm:j_id16:j__id17:1:j__id20:1::j_id21
    schemasForm:j_id16:j__id17:0::j_id18NodeExpanded	true
    schemasForm:j_id16:j__id17:0:j__id26:0::j_id27NodeExpanded	false
    schemasForm:j_id16:j__id17:1::j_id18NodeExpanded	true
    schemasForm:j_id16:j__id17:1:j__id20:0::j_id21NodeExpanded	false
    schemasForm:j_id16:j__id17:1:j__id20:0:j__id23:0::j_id24NodeExpanded	false
    schemasForm:j_id16:j__id17:1:j__id20:0:j__id23:10::j_id24NodeExpanded	false
    schemasForm:j_id16:j__id17:1:j__id20:0:j__id23:1::j_id24NodeExpanded	false
    ...
    schemasForm:j_id16:j__id17:1:j__id26:0::j_id27NodeExpanded	false
    schemasForm:j_id16:selectedNode	schemasForm:j_id16:j__id17:1:j__id20:1::j_id21
    schemasForm_SUBMIT	1
    ... but the response is a complete HTML page (the same as the original page) and not something I would expect as an ajax response (eg. a JSON message or similar)... This leads me to think that the incoming AJAX request is not detected properly. Here's how I have registered Rich Faces in my Flow Handler Adapter:
    Code:
    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
    	<property name="flowExecutor" ref="flowExecutor" />
    	<property name="ajaxHandler">
    		<bean class="org.springframework.faces.richfaces.RichFacesAjaxHandler" />
    	</property>
    </bean>

    Comment


    • #3
      You are probably using a JavaScript code that conflicts with RichFaces scripts

      Comment


      • #4
        sure, that could conflict

        The problem may be that you are using the jQuery library, so, come in conflict with the Prototype library of Rich Faces, that happened to me and so it was resolved:
        <script type="text/javascript">
        var $j = jQuery.noConflict();
        // Code that uses other library's $ can follow here.
        </script>


        Might also need to configure dojo follows:

        <script type="text/JavaScript">
        var djConfig = {
        parseOnLoad :true,
        isDebug :false
        };
        </script>
        <sf:includeScripts />
        I hope I have been very helpful
        Last edited by TarSon; Mar 11th, 2010, 04:59 PM.

        Comment


        • #5
          I like the idea, cool!

          Comment


          • #6
            Thanks Wolf Gentleman

            Comment

            Working...
            X