Results 1 to 6 of 6

Thread: Rich faces tree not sending ajax requests.

  1. #1
    Join Date
    Dec 2008
    Location
    copenhagen
    Posts
    3

    Question 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. #2
    Join Date
    Dec 2008
    Location
    copenhagen
    Posts
    3

    Unhappy 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>

  3. #3
    Join Date
    Dec 2005
    Posts
    5

    Default

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

  4. #4
    Join Date
    Sep 2008
    Posts
    9

    Lightbulb 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 at 04:59 PM.

  5. #5

    Default

    I like the idea, cool!
    I have been looking for mbt for cheap,cheap mbt shoes tanks passing

  6. #6
    Join Date
    Sep 2008
    Posts
    9

    Default

    Thanks Wolf Gentleman

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •