2

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.

Andrey Agibalov
  • 7,624
  • 8
  • 66
  • 111
FUD
  • 5,114
  • 7
  • 39
  • 61

2 Answers2

1

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.

lkdg
  • 1,031
  • 7
  • 18
  • That didnt helped. the document tag was used just to kick off the skin. – FUD Aug 16 '11 at 06:58
  • Hmm, this was the only difference I discovered, which is different to a poll solution of mine. – lkdg Aug 16 '11 at 07:15
1

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.

FUD
  • 5,114
  • 7
  • 39
  • 61