-
1. Re: a4j:commandLink not working with binding component
mcmurdosound Oct 30, 2011 4:43 AM (in response to adb_soft)Which RF version do you use? I have RF 3.3.4-snapshot and I do almost the same. A dynamic menu from database (EJB entities).
A h:panelgroup serves as a container for UL, LI, SPAN an h:commandLink or a4j:commandLink Components. I'm using h:commandLinks now because we do not need ajax here to navigate. (There is an "onbeforeunload" listener on the page. Ajax'll get broken if the user wants to stay on page)
Sorry, but I don't have the sourcescodes right here available. But I created MethodExpressions / ActionExpressions for each Link, which are EL expressions build from Strings.
-
2. Re: a4j:commandLink not working with binding component
adb_soft Oct 30, 2011 9:36 AM (in response to mcmurdosound)Thank you for your explanation.
I use RF 4 and JSF 2 and I proceed with the same way.
they attached the source code of my Method :
// create the panelGroup
HtmlPanelGroup grp= new HtmlPanelGroup();
grp.setId("GR"+menu.getId());
// create CommandLink
UICommandLink link = UIComponentUtils.createA4JLink();
link.setValue(menu.getNom());
link.setId("idmenuItem_"+menu.getId ());
// add param to CommandLink
UIParameter paramParam = new UIParameter();
paramParam.setValue(menu.getParam());
paramParam.setName(PARAM);
// add Action to link
MethodExpression methodExpression = UIComponentUtils.createAction("#{myPageBean.navigate}", String.class);
link.setActionExpression(methodExpression);
// add link to the container grp
grp.getChildren().add(link);
and I call the component in my page as
<h:panelGroup id="menus" binding="#{myPageBean.liste}"/>
I also noticed that without the ID every component does not work !!
I hope someone can explain the correct approach in this case
-
3. Re: a4j:commandLink not working with binding component
adb_soft Nov 1, 2011 7:06 PM (in response to adb_soft)I have finally found the problem, As I have already noted
I also noticed that without the ID every component does not work !!
I had an " _ " in the client id of the component
Someone understood something?
-
4. Re: a4j:commandLink not working with binding component
mcmurdosound Nov 2, 2011 4:24 AM (in response to adb_soft)I had problems with the underscore in Ids, too. I think it's an illegal character.