3
<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.

2 Answers 2

14

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()"> 
Sign up to request clarification or add additional context in comments.

3 Comments

Seems both methods do not reload the whole page. Javascript isn't working then. (I'm using a slider for divs, which is destroyed when i rerender something, so I have to reload the whole page)
If even the synchronous approach doesn't work, then your concrete problem is caused elsewhere. Hard to tell without having an SSCCE. Perhaps you need PRG?
what if I want to to do the same plus executing a function ?
1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.