You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Robin Müller-Bady <bm...@ffm.tc.iot.dtag.de> on 2009/07/21 14:20:53 UTC
[Trinidad] polling mechanism
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
Re: [Trinidad] polling mechanism
Posted by Matthias Wessendorf <ma...@apache.org>.
On Tue, Jul 21, 2009 at 4:57 PM, Max Starets<ma...@oracle.com> wrote:
> Robin,
>
> I see. So you are running into the old problem with the JSP engine rendering
> whitespace at the beginning of
> the PPR response with the JSPs. I do not have a proper workaround for you,
> but rendering <html> still seems
> like a wrong thing to do... So using jspx is absolutely not an option for
> you?
I was wondering if it is something on the container, as the demo (using jspx)
is failing on his container as well.
-Matthias
>
> Max
>
> Robin Müller-Bady wrote:
>>
>> Hi,
>>
>> in case i omit the <html> tag, i get errors about </head> and </html>
>> tags. Also the poll does not work, but the fields get rendered.
>> I tried to find a workaouround to be able to use jsp instead of jspx.
>> But my problem is the same on the Apache MyFaces Trinidad Demo v.1.0.10,
>> so i think the reason for the firefox-submit-dialogs is JSF 1.1 or the old
>> version of Trinidad :(
>>
>> Best regards,
>>
>> Robin
>>
>>
>> Max Starets schrieb:
>>>
>>> Robin,
>>>
>>> I do not understand how having the <html> tag helps you with setting the
>>> content type...
>>> <tr:document> will output the <html> tag even in Trinidad 1.0.10. When
>>> you look at the generated
>>> source (View->Source), do you see two html tags?
>>>
>>> Max
>>>
>>> Robin Müller-Bady wrote:
>>>>
>>>> Hey,
>>>>
>>>> i used this tag, because its not possible to use "<jsp:directive.page
>>>> contentType="text/html;charset=utf-8"/>" in my project. So i decided to use
>>>> the html-tag in order to get my project running.
>>>>
>>>> One important information is, that i need to use Apache MyFaces Trinidad
>>>> 1.0.10 and JSF 1.1, because the application is deployed on a Websphere
>>>> Application Server 6.1. Could this fact cause the problems ?
>>>> I just deployed the Apache MyFaces Demo version 1.0.10 and in this
>>>> version, the same problem occurs on
>>>> /trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
>>>> Firefox)
>>>>
>>>> Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Robin
>>>>
>>>> Max Starets schrieb:
>>>>>
>>>>> Robin,
>>>>>
>>>>> Are you saying that you are getting the standard browser dialog asking
>>>>> whether data should be re-posted?
>>>>> That would happen only if the page is being refreshed. Perhaps
>>>>> something wrong is happening with the PPR request.
>>>>> I see one problem in your page - the <html> tag should not be there.
>>>>> <tr:document> renders its own <html> tag.
>>>>> I would get rid of the <html> tag and re-test.
>>>>>
>>>>> Max
>>>>>
>>>>> Robin Müller-Bady wrote:
>>>>>>
>>>>>> 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
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
Re: [Trinidad] polling mechanism
Posted by Max Starets <ma...@oracle.com>.
Robin,
I see. So you are running into the old problem with the JSP engine
rendering whitespace at the beginning of
the PPR response with the JSPs. I do not have a proper workaround for
you, but rendering <html> still seems
like a wrong thing to do... So using jspx is absolutely not an option
for you?
Max
Robin Müller-Bady wrote:
> Hi,
>
> in case i omit the <html> tag, i get errors about </head> and </html>
> tags. Also the poll does not work, but the fields get rendered.
> I tried to find a workaouround to be able to use jsp instead of jspx.
> But my problem is the same on the Apache MyFaces Trinidad Demo
> v.1.0.10, so i think the reason for the firefox-submit-dialogs is JSF
> 1.1 or the old version of Trinidad :(
>
> Best regards,
>
> Robin
>
>
> Max Starets schrieb:
>> Robin,
>>
>> I do not understand how having the <html> tag helps you with setting
>> the content type...
>> <tr:document> will output the <html> tag even in Trinidad 1.0.10.
>> When you look at the generated
>> source (View->Source), do you see two html tags?
>>
>> Max
>>
>> Robin Müller-Bady wrote:
>>> Hey,
>>>
>>> i used this tag, because its not possible to use
>>> "<jsp:directive.page contentType="text/html;charset=utf-8"/>" in my
>>> project. So i decided to use the html-tag in order to get my project
>>> running.
>>>
>>> One important information is, that i need to use Apache MyFaces
>>> Trinidad 1.0.10 and JSF 1.1, because the application is deployed on
>>> a Websphere Application Server 6.1. Could this fact cause the
>>> problems ?
>>> I just deployed the Apache MyFaces Demo version 1.0.10 and in this
>>> version, the same problem occurs on
>>> /trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
>>> Firefox)
>>>
>>> Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
>>>
>>> Thanks in advance,
>>>
>>> Robin
>>>
>>> Max Starets schrieb:
>>>> Robin,
>>>>
>>>> Are you saying that you are getting the standard browser dialog
>>>> asking whether data should be re-posted?
>>>> That would happen only if the page is being refreshed. Perhaps
>>>> something wrong is happening with the PPR request.
>>>> I see one problem in your page - the <html> tag should not be
>>>> there. <tr:document> renders its own <html> tag.
>>>> I would get rid of the <html> tag and re-test.
>>>>
>>>> Max
>>>>
>>>> Robin Müller-Bady wrote:
>>>>> 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
>>>>
>>>>
>>>
>>
>>
>
Re: [Trinidad] polling mechanism
Posted by Robin Müller-Bady <bm...@ffm.tc.iot.dtag.de>.
Hey,
i dont even get jetty running on my system.
(I dont have the jetty plugin for maven)
I think that it would work with jspx, but i migrated a IBM JWL project
to Trinidad, so there are some details like "<%-- jsf:pagecode
language="java" location="/src/pagecode/Chat.java" --%><%--
/jsf:pagecode --%>" in my code.
With jspx, these tags cant remain in the code because of validation errors.
I will try it tomorrow, but i have a presentation on it tomorrow
afternoon, so i think i wont be ready till then.
Best regards,
Robin
The HTML tag was a workaround, so that the polls work.
Matthias Wessendorf schrieb:
> what errors ?
>
> By when correctly using the <tr:document> it should (it does) generate
> proper HTML
>
> Question, the demo polling demo does not work on your server, but does
> it work on jetty ?
> (mvn jetty:run -PjettyConfig (on the trinidad-demo project))
>
> -Matthias
>
> On Tue, Jul 21, 2009 at 4:50 PM, Robin
> Müller-Bady<bm...@ffm.tc.iot.dtag.de> wrote:
>
>> Hi,
>>
>> in case i omit the <html> tag, i get errors about </head> and </html> tags.
>> Also the poll does not work, but the fields get rendered.
>> I tried to find a workaouround to be able to use jsp instead of jspx.
>> But my problem is the same on the Apache MyFaces Trinidad Demo v.1.0.10, so
>> i think the reason for the firefox-submit-dialogs is JSF 1.1 or the old
>> version of Trinidad :(
>>
>> Best regards,
>>
>> Robin
>>
>>
>> Max Starets schrieb:
>>
>>> Robin,
>>>
>>> I do not understand how having the <html> tag helps you with setting the
>>> content type...
>>> <tr:document> will output the <html> tag even in Trinidad 1.0.10. When you
>>> look at the generated
>>> source (View->Source), do you see two html tags?
>>>
>>> Max
>>>
>>> Robin Müller-Bady wrote:
>>>
>>>> Hey,
>>>>
>>>> i used this tag, because its not possible to use "<jsp:directive.page
>>>> contentType="text/html;charset=utf-8"/>" in my project. So i decided to use
>>>> the html-tag in order to get my project running.
>>>>
>>>> One important information is, that i need to use Apache MyFaces Trinidad
>>>> 1.0.10 and JSF 1.1, because the application is deployed on a Websphere
>>>> Application Server 6.1. Could this fact cause the problems ?
>>>> I just deployed the Apache MyFaces Demo version 1.0.10 and in this
>>>> version, the same problem occurs on
>>>> /trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
>>>> Firefox)
>>>>
>>>> Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Robin
>>>>
>>>> Max Starets schrieb:
>>>>
>>>>> Robin,
>>>>>
>>>>> Are you saying that you are getting the standard browser dialog asking
>>>>> whether data should be re-posted?
>>>>> That would happen only if the page is being refreshed. Perhaps something
>>>>> wrong is happening with the PPR request.
>>>>> I see one problem in your page - the <html> tag should not be there.
>>>>> <tr:document> renders its own <html> tag.
>>>>> I would get rid of the <html> tag and re-test.
>>>>>
>>>>> Max
>>>>>
>>>>> Robin Müller-Bady wrote:
>>>>>
>>>>>> 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
>>>>>>
>>>>>
>>>
>>
>
>
>
>
Re: [Trinidad] polling mechanism
Posted by Matthias Wessendorf <ma...@apache.org>.
what errors ?
By when correctly using the <tr:document> it should (it does) generate
proper HTML
Question, the demo polling demo does not work on your server, but does
it work on jetty ?
(mvn jetty:run -PjettyConfig (on the trinidad-demo project))
-Matthias
On Tue, Jul 21, 2009 at 4:50 PM, Robin
Müller-Bady<bm...@ffm.tc.iot.dtag.de> wrote:
> Hi,
>
> in case i omit the <html> tag, i get errors about </head> and </html> tags.
> Also the poll does not work, but the fields get rendered.
> I tried to find a workaouround to be able to use jsp instead of jspx.
> But my problem is the same on the Apache MyFaces Trinidad Demo v.1.0.10, so
> i think the reason for the firefox-submit-dialogs is JSF 1.1 or the old
> version of Trinidad :(
>
> Best regards,
>
> Robin
>
>
> Max Starets schrieb:
>>
>> Robin,
>>
>> I do not understand how having the <html> tag helps you with setting the
>> content type...
>> <tr:document> will output the <html> tag even in Trinidad 1.0.10. When you
>> look at the generated
>> source (View->Source), do you see two html tags?
>>
>> Max
>>
>> Robin Müller-Bady wrote:
>>>
>>> Hey,
>>>
>>> i used this tag, because its not possible to use "<jsp:directive.page
>>> contentType="text/html;charset=utf-8"/>" in my project. So i decided to use
>>> the html-tag in order to get my project running.
>>>
>>> One important information is, that i need to use Apache MyFaces Trinidad
>>> 1.0.10 and JSF 1.1, because the application is deployed on a Websphere
>>> Application Server 6.1. Could this fact cause the problems ?
>>> I just deployed the Apache MyFaces Demo version 1.0.10 and in this
>>> version, the same problem occurs on
>>> /trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
>>> Firefox)
>>>
>>> Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
>>>
>>> Thanks in advance,
>>>
>>> Robin
>>>
>>> Max Starets schrieb:
>>>>
>>>> Robin,
>>>>
>>>> Are you saying that you are getting the standard browser dialog asking
>>>> whether data should be re-posted?
>>>> That would happen only if the page is being refreshed. Perhaps something
>>>> wrong is happening with the PPR request.
>>>> I see one problem in your page - the <html> tag should not be there.
>>>> <tr:document> renders its own <html> tag.
>>>> I would get rid of the <html> tag and re-test.
>>>>
>>>> Max
>>>>
>>>> Robin Müller-Bady wrote:
>>>>>
>>>>> 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
>>>>
>>>>
>>>
>>
>>
>
>
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
Re: [Trinidad] polling mechanism
Posted by Robin Müller-Bady <bm...@ffm.tc.iot.dtag.de>.
Hi,
in case i omit the <html> tag, i get errors about </head> and </html>
tags. Also the poll does not work, but the fields get rendered.
I tried to find a workaouround to be able to use jsp instead of jspx.
But my problem is the same on the Apache MyFaces Trinidad Demo v.1.0.10,
so i think the reason for the firefox-submit-dialogs is JSF 1.1 or the
old version of Trinidad :(
Best regards,
Robin
Max Starets schrieb:
> Robin,
>
> I do not understand how having the <html> tag helps you with setting
> the content type...
> <tr:document> will output the <html> tag even in Trinidad 1.0.10. When
> you look at the generated
> source (View->Source), do you see two html tags?
>
> Max
>
> Robin Müller-Bady wrote:
>> Hey,
>>
>> i used this tag, because its not possible to use "<jsp:directive.page
>> contentType="text/html;charset=utf-8"/>" in my project. So i decided
>> to use the html-tag in order to get my project running.
>>
>> One important information is, that i need to use Apache MyFaces
>> Trinidad 1.0.10 and JSF 1.1, because the application is deployed on a
>> Websphere Application Server 6.1. Could this fact cause the problems ?
>> I just deployed the Apache MyFaces Demo version 1.0.10 and in this
>> version, the same problem occurs on
>> /trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
>> Firefox)
>>
>> Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
>>
>> Thanks in advance,
>>
>> Robin
>>
>> Max Starets schrieb:
>>> Robin,
>>>
>>> Are you saying that you are getting the standard browser dialog
>>> asking whether data should be re-posted?
>>> That would happen only if the page is being refreshed. Perhaps
>>> something wrong is happening with the PPR request.
>>> I see one problem in your page - the <html> tag should not be there.
>>> <tr:document> renders its own <html> tag.
>>> I would get rid of the <html> tag and re-test.
>>>
>>> Max
>>>
>>> Robin Müller-Bady wrote:
>>>> 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
>>>
>>>
>>
>
>
Re: [Trinidad] polling mechanism
Posted by Max Starets <ma...@oracle.com>.
Robin,
I do not understand how having the <html> tag helps you with setting the
content type...
<tr:document> will output the <html> tag even in Trinidad 1.0.10. When
you look at the generated
source (View->Source), do you see two html tags?
Max
Robin Müller-Bady wrote:
> Hey,
>
> i used this tag, because its not possible to use "<jsp:directive.page
> contentType="text/html;charset=utf-8"/>" in my project. So i decided
> to use the html-tag in order to get my project running.
>
> One important information is, that i need to use Apache MyFaces
> Trinidad 1.0.10 and JSF 1.1, because the application is deployed on a
> Websphere Application Server 6.1. Could this fact cause the problems ?
> I just deployed the Apache MyFaces Demo version 1.0.10 and in this
> version, the same problem occurs on
> /trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
> Firefox)
>
> Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
>
> Thanks in advance,
>
> Robin
>
> Max Starets schrieb:
>> Robin,
>>
>> Are you saying that you are getting the standard browser dialog
>> asking whether data should be re-posted?
>> That would happen only if the page is being refreshed. Perhaps
>> something wrong is happening with the PPR request.
>> I see one problem in your page - the <html> tag should not be there.
>> <tr:document> renders its own <html> tag.
>> I would get rid of the <html> tag and re-test.
>>
>> Max
>>
>> Robin Müller-Bady wrote:
>>> 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
>>
>>
>
Re: [Trinidad] polling mechanism
Posted by Robin Müller-Bady <bm...@ffm.tc.iot.dtag.de>.
Hey,
i used this tag, because its not possible to use "<jsp:directive.page
contentType="text/html;charset=utf-8"/>" in my project. So i decided to
use the html-tag in order to get my project running.
One important information is, that i need to use Apache MyFaces Trinidad
1.0.10 and JSF 1.1, because the application is deployed on a Websphere
Application Server 6.1. Could this fact cause the problems ?
I just deployed the Apache MyFaces Demo version 1.0.10 and in this
version, the same problem occurs on
/trinidad-demo-1.0.10/faces/components/poll.jspx. (Resend Diaog from
Firefox)
Isn´t it possible to fix this issue in JSF1.1 / Trinidad 1.0.10 ?
Thanks in advance,
Robin
Max Starets schrieb:
> Robin,
>
> Are you saying that you are getting the standard browser dialog asking
> whether data should be re-posted?
> That would happen only if the page is being refreshed. Perhaps
> something wrong is happening with the PPR request.
> I see one problem in your page - the <html> tag should not be there.
> <tr:document> renders its own <html> tag.
> I would get rid of the <html> tag and re-test.
>
> Max
>
> Robin Müller-Bady wrote:
>> 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
>
>
Re: [Trinidad] polling mechanism
Posted by Max Starets <ma...@oracle.com>.
Robin,
Are you saying that you are getting the standard browser dialog asking
whether data should be re-posted?
That would happen only if the page is being refreshed. Perhaps something
wrong is happening with the PPR request.
I see one problem in your page - the <html> tag should not be there.
<tr:document> renders its own <html> tag.
I would get rid of the <html> tag and re-test.
Max
Robin Müller-Bady wrote:
> 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