HtmlAjaxCommandLink problem
tcavaleiro Jul 22, 2007 3:42 PMHi all,
I'm creating ajax4jsf components dynamically (basically I'm only using HtmlAjaxCommandLink) and I'm getting an error during the rendering of the page (Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/ajax/html/HtmlAjaxCommandLink)
Using directly a a4j:commandLink the error disappear (when I comment the HtmlAjaxCommandLink dynamic creating).
I've also verified the lib (ajax4jsf) on the .ear archive and it exists.
(the XHTML)
.... <ui:composition ...> <ui:define name="menu"> <h:form id="another_form"> <h:panelGrid binding="#{navigationMenu.menu}" /> <a4j:commandLink action="#{navigationMenu.doSomething}" value="hello..testing" /> </h:form> </ui:define> </ui:composition>
(the bean)
@Name("navigationMenu") @Scope(SESSION) public class NavigationMenu { @Logger Log log; private UIComponent menu; public NavigationMenu() {} public UIComponent getMenu() { return menu; } public void setMenu(UIComponent menu) { this.menu = menu; } @Create public void init() { menu = new UIPanel(); FacesContext context = FacesContext.getCurrentInstance(); Application app = context.getApplication(); HtmlAjaxCommandLink myLink = (HtmlAjaxCommandLink)app.createComponent(HtmlAjaxCommandLink.COMPONENT_TYPE); myLink.addActionListener(new ActionListener() { public void processAction(ActionEvent e) { log.info("making a test...."); } }); myLink.setValue("testing 1...2...3.."); menu.getChildren().add(myLink); } public void doSomething() { log.info("doing something..."); } }
I don't get it, if the library is there what's the reason for the error?
(maybe it's something easy, trivial but please help anyway)
I'm currently using JBoss 4.2.0.GA + JBoss Seam 2.0.0.BETA1
I've also downloaded the ajax4jsf source code and I didn't found any class related to HtmlAjaxCommandLink (there is UIAjaxCommandLink but don't have nothing important related with HtmlAjaxCommandLink), someone could explain the reason for that too? (the download source archive name was jboss-ajax4jsf-1.1.1-src.tar.gz)
One more thing, could you point me good resources about adding dynamically JSF components. I've read something on java sun foruns, etc.. but there aren't any good start points about this subject?
Thanks!
Tiago Cavaleiro.