I have a managed bean under ViewScope. It has an instance variable inside it.
MetaData object has a inputItem object List.
@ManagedBean
@ViewScoped
public class ConBean implements Serializable {
private MetaData metadata;
@PostConstruct
@SuppressWarnings("unchecked")
public void init() throws IOException {
this.metadata = new MetaData ();
}
public void proc(){
List<InputItem> inputs= new ArrayList<InputItem>();
inputs.add(***** code to populate the inputItem List);
//after populating, inputs added to the metadata
metadata.setInputs(inputs);
}
//getters & setters
}
in my JSF , input list is populated inside a UI repeat.
<div id="inputplaceholder">
<ui:repeat value="#{conBean.metaData.inputs}" var="content">
</ui:repeat>
</div>
the div inputplaceholder is periodically updated using a richfaces poll.
<a4j:poll id="poll" interval="12000" action="#{conBean.proc}"
execute="@form" render="inputplaceholder"/>
The problem that I have is even though inputItems are set to the metaData object correctly inside the proc() method, when the view is rendered/partially updated, it doesn’t get highlighted in the UI. so partial update takes no effect. I tried moving
this.metadata = new MetaData ();
inside the proc method but had no luck.
any ideas and help is highly appreciated.
thanks …
Did the partial render really take place? This is impossible. There is namely no JSF component with the ID
inputplaceholder. You assigned it to a plain HTML<div>element. Replace it by a fullworthy JSF component:Also, since you used a relative ID in the
renderattribute, it will only scan for components in the same parent naming container component. The<ui:repeat>is such one, however the component with the desired ID is placed outside it. You’d like to use an absolute ID instead. Assuming that it’s inside a<h:form>with a fixed ID:then you should be referencing it in the
renderattribute as follows