I am stuck with a problem, the problem is I am using a side bar and there is are certain components inside it. I want to update these components when user changes it using ajax. But I am facing issue with passing parameters to bean from primefaces component,my controller needs the parameters. I am trying the following code, any solution will be highly appreciated.
The .xhtml looks like this.
<p:outputPanel id="out">
<p:sidebar widgetVar="sidebar" position="right" baseZIndex="10000">
<h3>Right Sidebar</h3>
<h:panelGrid style="border-color: white" columns="2" cellpadding="7">
<h:outputText for="falsePositive" value="False Positive" />
<p:selectBooleanCheckbox id="falsePositive" style = "display: inline-block; border:solid 1px black" value="#{controller.falsePositive}">
<p:ajax update="out" />
</p:selectBooleanCheckbox>
</h:panelGrid>
</p:sidebar>
</p:outputPanel>
My controller looks like this
private static final String AJAX_PARAM_Id = "id";
public Boolean getFalsePositive(){
String id = getRequestParameter(AJAX_PARAM_Id);
input = inputRepository.find(id);
return input.getFalsePositive();
}
public void setFalsePositive(Boolean falsePositive){
input.setFalsePositive(falsePositive);
save(input)
}