problem with t:commandLink in rerendered datatable
dpaterson Apr 6, 2007 8:46 AMI'm trying to create a simple "suggest" like feature based on a inputText box and a Ajax supported dataTable. I am able to update the dataTable no problem but for some reason my commandLinks within the table don't work.
These same links function properly, making the appropriate backing bean calls, in a non-ajax scenario. I've tried a bunch of variants using a4j command links instead of t:commandLink but that has't helped. Here's the snippet of the JSF and backing bean. Basically when I click a link I should call a backing bean method that will load the details for the record and take me to a detail page based on the string populate() returns. Not sure what I'm missing.
JSF
<t:inputText forceId="true" value="#{serviceBeanAllView.a4jTest}" id="test11"> <a4j:support event="onkeyup" requestDelay="180" immediate="false" reRender="id_data_table_pop"/> </t:inputText> <t:dataTable id="id_data_table_pop" rowOnMouseOver="this.style.backgroundColor='#D6DDE2'" rowOnMouseOut="this.style.backgroundColor=''" forceId="true" styleClass="class_table_view_all class_table_view_pop" rowClasses="even_class, odd_class" columnClasses="name_column" cellpadding="0" cellspacing="0" align="center" var="service" value="#{serviceBeanAllView.sortListFiltered}" sortColumn="#{serviceBeanAllView.sort}" renderedIfEmpty="true"> <%-- Name column. --%> <h:column> <t:commandLink styleClass="name_link" action="#{serviceBeanSingle.populate}"> <t:updateActionListener property="#{serviceBeanSingle.zoneId}" value="#{service.zoneId}" /> <t:updateActionListener property="#{serviceBeanSingle.id}" value="#{service.id}" /> <t:updateActionListener property="#{serviceBeanSingle.task}" value="#{serviceBeanSingle.editTask}" /> <h:outputText value="#{service.name}" /> </t:commandLink> </h:column> </t:dataTable>
ServiceBeanSingle.populate()
public String populate() { logger.info("populate() "+PreferencesBean.START_STR); setReadOnly(true); ServiceServiceBean service = ServiceServiceBean.getService(); try { ServiceObject object = service.getById(getZoneId(), getId()); setName(object.getName()); setDescription(object.getDescription()); setApplicationId(object.getApplicationId()); setNetworkDestinationId(object.getNetworkDestinationId()); setSubscriberRoleName(object.getSubscriberRoleName()); setNoFurtherClassification(object.isNoFurtherClassification()); setZoneId(object.getZoneId()); setId(object.getId()); applicationMap = ServiceServiceBean.getAllApplications(); networkDestinationMap = ServiceServiceBean.getAllNetworkDestinations(); return PAGE_SERVICE_EDIT; } catch (Throwable t) { UiErrorHandlerBean.getHandler().handle(null, t); return PAGE_SERVICE_VIEW_ALL; } finally { logger.debug("populate() "+PreferencesBean.FINISH_STR); } }
My Environment is: MyFaces 1.1.4, Tomahawk 1.1.3, Tomcat 5.5.28, JDK 1.5.x. We are also using tiles support with MyFaces. Any help would be greatly appreciated.