I need to make a panelGrid
(one of man that are populated from a list of objects) clickable, and then send the item associated with it to the backing bean.
My HTML so for:
<ui:repeat var="searchItem" value="#{bean.filteredSearchItems}" varStatus="searchResult">
<h:panelGrid>
<!-- I get some info here from the searchResult object -->
</h:panelGrid>
<f:ajax event="click" listener="{bean.clickFlight}" />
<f:param name="lfi" value="#{searchResult.index}" />
</ui:repeat>
I know that (in my backing bean) I need a function called clickSearchItem()
that can handle the ajax call, so to test all of this, I did the following in my backing bean:
public void clickFlight()
{
HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String lfi = req.getParameter("lfi");
if (lfi == null)
log.info("LFI WAS RETURNED AS NULL :(");
log.info("HOPEFULLY AN INDEX OF SOME SORT!: " + lfi);
}
Nothing is getting logged - the click doesn't register. Has anyone else had this problem? Does anyone know how to solve it?