Reputation: 257
i'm trying to set an online checkers game, using JSF2 on GlassFish 3, where all the game's logic is taken care by EJB. the thing is i want player A board's display to get updated after the player B's move. after the player B finished his/her move, i'm calling
pushContext.push("groupName")
on the code's bean (while there's <icecore:push group="groupName" />
tag in the xhtml code)
the problem is (from what it seems to me) player A's board object hasn't been updated from the EJB yet, so there's nothing to update on the display. player A's board display is updated only after he/she finished his/hers move (and at this point its bean code asks for an updated board from the EJB).
i thought i found the solution here. my plan is to set a JS function inside the xhtml, to which the the bean code would call using the <icep:register>
tag, and that JS function would call a java function inside the bean code which would ask for an updated board from the EJB and then would update the display.
the thing is i can't find anywhere how to implement any of the 'icep' tags. when i put this tag into my code i get a compile error.
what do i need to add to my project in order for this to work?
or is there a completely different (and better) approach to solve my problem?
cheers, eRez
Upvotes: 0
Views: 821
Reputation: 1
The <icep:register>
is part of the ICEpush JSP integration, and just intended for JSP pages, not JSF pages. So that may be why you're getting that compilation issue. You can use the javascript registration api. But have you looked at using the PortableRenderer? If you're ejb is in the same jvm, this might work and be a lot easier for you. Check out:
http://wiki.icesoft.org/display/ICE/Ajax+Push+-+APIs#AjaxPush-APIs-PushingfromoutsidetheJSFcontext
Thanks, Philip
Upvotes: 0