4ndro1d
4ndro1d

Reputation: 2976

JSF ajax reload whole page from dropdown

<h:selectOneMenu id="dropdownDevice"
        value="#{skinningBean.currentDevice}" converter="SkinConverter">
        <f:selectItems value="#{skinningBean.myDevicesSI}" var="c"
            itemValue="#{c}" />
        <f:ajax event="change" render="preview" />
</h:selectOneMenu>

Is it possible to reload the whole page within this dropdown? i need this because, I also need to reload a javascript when another device was selected.

Upvotes: 3

Views: 12233

Answers (2)

BalusC
BalusC

Reputation: 1108722

You're not clear on if you would like to perform it synchronously or asynchronously.

If asynchronously, specify a render of @all.

<f:ajax ... render="@all" />

If synchronously, replace <f:ajax> by JS form.submit() call.

<h:selectOneMenu ... onchange="this.form.submit()">

Upvotes: 14

partlov
partlov

Reputation: 14277

You can do this simple by setting render="@all" attribute in f:ajax tag:

<f:ajax render="@all" />

You can remove event="change" as it is default.

Upvotes: 1

Related Questions