سؤال
Hi i am trying to use tr:poll with no success. My jspx looks like inside body tag,
<f:view>
<tr:document></tr:document>
<tr:form>
<tr:poll id="poller" interval="500" pollListener="#{sessionScope.mainBean.polled}" ></tr:poll>
<tr:outputText value="#{sessionScope.mainBean.count }" partialTriggers="poller"></tr:outputText>
</tr:form>
And main bean looks like
public class MainBean
{
private String user;
private int count = 0;
public MainBean(String user)
{
this.user = user;
}
public void polled(org.apache.myfaces.trinidad.event.PollEvent poe)
{
System.out.println(count + "polled by "+user);
++count;
}
public int getCount()
{
return count;
}
}
But the polled gets called only once.
What is wrong here?
EDIT:
Hi all,
it seems i am so lame that i cant get ppr to work at all, leave poll alone. I have uploaded archived eclipse project here, I am using JSF 2.0 and trinidad 2.0, jstl 1.2. http://www.mediafire.com/?u35h0k65qh5ed71 its pretty much the same thing as described above.
المحلول 2
This one is going to be interesting, check this out
https://issues.apache.org/jira/browse/TRINIDAD-1151
Bottomline: Remove CDATA tags from your jsp pages.
نصائح أخرى
first of all your tr:document tag should be around the whole document:
<f:view>
<tr:document>
<tr:form>
<tr:pollid="poller"interval="500"
pollListener="{sessionScope.mainBean.polled}">
</tr:poll>
<tr:outputText
value="#{sessionScope.mainBean.count}"
partialTriggers="poller"></tr:outputText>
</tr:form>
</tr:document>
</f:view>
Try again this way.
لا تنتمي إلى StackOverflow