Dear List,
i have a problem with the <tr:poll> tag.
I use it to update contents of a <tr:table> data.
My problem is, that everytime i send an action to the server or submit
the form, the poll repeats the previous action.
In case i send the form and update the table, the poll starts to ask my
whether i want to resend the data.
Is it possible to use a poll for just 1 element ? (The table) I tried to
do it with <tr:table partialTriggers="::chatPoll" ... > but this did not
work.
Here´s my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%-- jsf:pagecode language="java" location="/src/pagecode/Chat.java"
--%><%-- /jsf:pagecode --%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
<html>
<f:view>
<tr:document id="doc1" title="Chat mit #{chatuserbean.displayName}">
<tr:form id="form1" defaultCommand="sendButton">
<tr:panelPage id="panelPage">
<tr:table id="chattable" width="100%" emptyText="No messages sent"
partialTriggers="::chatPoll"
value="#{chatuserbean.historyListFromChatPartner}" var="chat">
<tr:column headerText="Sender">
<tr:outputText value="#{chat.messageSender}" />
</tr:column>
<tr:column headerText="Message">
<tr:outputText value="#{chat.message}" />
</tr:column>
</tr:table>
<tr:panelFormLayout>
<tr:inputText value="#{messagebean.message}" />
<f:facet name="footer">
<tr:panelButtonBar>
<tr:commandButton text="Send" id="sendButton"
action="#{messageaction.doSendMessage}" />
</tr:panelButtonBar>
</f:facet>
</tr:panelFormLayout>
</tr:panelPage>
<tr:poll id="chatPoll" interval="2000" immediate="true" />
</tr:form>
</tr:document>
</f:view>
</html>
Thanks in advance !
Robin