Dedemonn
Dedemonn

Reputation: 126

Reloading div using Ajax

I have found this topic, where's a bit of code to reload a div using Ajax. I've tried creating such example, but not successfully.

Here's my code:

So what am I missing? Variable viewedPage is updated, normal labels/texts etc. are updated, but can't get this div working.

Upvotes: 2

Views: 2206

Answers (1)

Dedemonn
Dedemonn

Reputation: 126

Found the solution:

<h:commandButton value="Games" action="#{navigationBean.requestPage}">
    <f:param name="requestedPage" value="games.xhtml"/>
    <f:ajax execute="@this" render="@none" />
    <f:ajax render=":content"/>
</h:commandButton>

plus changing @ViewScoped to @SessionScoped.

Upvotes: 1

Related Questions