1 Reply Latest reply on Oct 13, 2011 9:40 AM by brezel

    RF4: dynamic rendered rich:dropTarget - missing javascript resource - breaks further ajax requests (maybe JAVASERVERFACES-2016)

    slite

      Hi all,

       

      I'm quite new to richfaces, comming from icefaces and evaluating richfaces to port our application to richfaces while migrating to jsf2.

       

      The first problem i can't get around without doing a nasty render="@all" is the following:

       

      My page has a h:selectOneMenu with autosubmit and a changelistener.

      And 3 rich:dataTables which are dropTargets and get filled with dragSources. You can then drag'n'drop stuff between those 3 tables.

       

      My problem now is, that those 3 tables are empty on the initial request, and jsf2/richfaces doesn't seem to inject the necessary javascript for drag and drop into the header. When i change the listbox the datamodels get filled and dragSources get rendered. But the client doesnt have the necessary javascript resources in the header to execute the anonymous code which gets sent by the ajax reply.

       

      This leads to a (silently ignored) javascript exception, the ajax request stays in the queue and doesn't get completed, which breaks all further valueChange requests for the listbox (because the bridge waits for the queued event to finish which will never happen).

       

      The only thing that helps is an render="@all" on the a4j:ajax for the h:selectOneMenu which is not the way i want to go with a big application with a lot of visible markup.

       

      Are there any advices on how to get jsf2 to include those resources for components which are not visible at the beginning. This might be related to http://java.net/jira/browse/JAVASERVERFACES-2016 which describes the problem in combination with ui:include, but i think there are other conditions which can trigger this. (empty dataTables obviously)

       

      Might there be a possibility to specify ajaxRendered="true" for the header via some rich:header tag implementation or do header ajax rerendering automagically?

       

      hope you can provide me with some clever input on this ^^