Hi guys,

I saw a lot of people having problems with integrating the AutoUpdateDataTable component with Liferay. As said Dave said (below) there is a problem with extensionsfilter. So, for my needs I have investigating a little and I found a solution that suites my needs ... for all of you that have problems with Jsf-Ajax components maybe this could be helpful.

<h:form>
<div id="div_table">

<t:dataTable preserveSort="true" value="#{requestScope.list}" var="l"> <h:column>
                 <h:outputText value="#{l.callerId}"/>
           </h:column>
<h:column>
                 <h:outputText value="#{l.extension}"/>
           </h:column>
<h:column>
                 <h:outputText value="#{l.state}"/>
</h:column>
       </t:dataTable>
</div>

<!-- test end -->

<script type="text/javascript"><!--
function initAutoUpdateDataTable()
{ _idJsp1_updater = new Ajax.PeriodicalUpdater('div_table','/MY_PORTLET/index.jsf', {
frequency: 1    });
}
setTimeout("initAutoUpdateDataTable()", 0);

//--></script> </h:form>

Where MY_PORTLET is the web root of your component.

Although, a porlet cannot add any javascript to the portal pages but Liferay is allready using prototype.js so you can easily add scripts by hand in your pages. This is the only thing that AutoUpdateDataTable adds.

Hope this could help someone.

Regards,
Daniel


Dave Brondsema wrote:
Daniel Gradecak wrote:
Hi all,

I have a problem while trying to integrate AutoUpdateDataTable inside a
portlet. I am using Liferay 4.0.0 with Tomcat 5.5.17.

I have configured the ExtensionsFilter in web.xml as explained on
Tomahawk pages, but I steill get
java.lang.IllegalStateException: *ExtensionsFilter* *not* *correctly*
*configured*. JSF mapping missing. JSF pages *not* covered. Please see:
http://myfaces.apache.org/tomahawk/*extensionsFilter*.html
<http://myfaces.apache.org/tomahawk/extensionsFilter.html>

I have read a lot about this problem and saw that this could be a bug
inside Tomcat also. I have tries to use Jetty quickly but i did not
manage to make it work.

Probably that I am doing a wrong thing but i cannot find what, even
after reading a lot of forums and mailing lists. I saw that was a
"common" problem. So, is it possible to use AutoUpdateDataTable inside a
portlet?


As you may know, filters do not apply to portlets.  So for portlets the
extensionsFilter is only useful to serve css & js files, not to add
css/js tags into <head> or help with fileUpload, etc.  See
http://issues.apache.org/jira/browse/MYFACES-434 for a "portlet filter"
that may help.

I'm not familiar with AutoUpdateDataTable, but the problem probably is
that the js file is not being referenced from a tag in <head>.  Since
the <script> tag may appear outside of <head>, AutoUpdateDataTable
should be modified to add it as an inline <script> tag instead of adding
it to <head> (which requires the extensionsFilter to work).  You could
also add the <script> tag to <head> in your portal theme, but that is
not very elegant.


Reply via email to