-
1. Re: Menu Item With Tomahawk Action Listener
sergeysmirnov Jan 17, 2008 3:14 AM (in response to jbossja)Using JSF EL in the id looks very strange. Are you sure you have a problem with t:updateActionListener only?
-
2. Re: Menu Item With Tomahawk Action Listener
jbossja Jan 17, 2008 3:29 AM (in response to jbossja)I am using JSF EL in the id because i was getting a
duplicate Id for component error ...
Using unique ids fixed this issue. -
3. Re: Menu Item With Tomahawk Action Listener
sergeysmirnov Jan 17, 2008 10:31 AM (in response to jbossja)In JSF, the id of the command component on the second phase of JSF life cycle should be equal to the id assigned to the same component during the creating the component tree the previous life cycle. If not, the component will not processed. This is a general rule. No any specific with RichFaces. I doubt that the way you try to make id unique just break this rule.
It is not clean does the bug in the JSF implementation or in your own code causes this problem. So, no any further suggestion yet. -
4. Re: Menu Item With Tomahawk Action Listener
yj4jboss Jan 17, 2008 10:44 AM (in response to jbossja)Thnx for the precision.
Any idea how I could implement what i described above. Will the a4j:action param be helpful in this ?
Regards,
Yogesh -
5. Re: Menu Item With Tomahawk Action Listener
sergeysmirnov Jan 17, 2008 10:54 AM (in response to jbossja)I am not sure it is about updateActionListener specifically.
Try to replace temporary this code with just:<h:commandLink value="Text" id="link_#{node.value.Id}" action="#{myBean.myaction}"/>
and does the action method is invoked. -
6. Re: Menu Item With Tomahawk Action Listener
jbossja Jan 18, 2008 2:49 AM (in response to jbossja)Some new findings !!
I am just trying this sample.<rich:panel> <h:commandLink value="#{guidelineHierarchyBean.demoPageView.page.pageName}" action="#{guidelineEditorBean.deletePage}"> <t:updateActionListener property="#{guidelineEditorBean.selectedPageView}" value="#{guidelineHierarchyBean.demoPageView}" /> <rich:contextMenu id="GuidelineContextMenu_#{demoPageView.page.pageId}" event="oncontextmenu" attached="true" submitMode="server"> <rich:menuItem id="GuidelineMenu_MenuItemDelete#{demoPageView.page.pageId}"> immediate="true" value="Delete" action="#{guidelineEditorBean.deletePage}"> <t:updateActionListener property="#{guidelineEditorBean.selectedPageView}" value="#{guidelineHierarchyBean.demoPageView}" /> </rich:menuItem> </rich:contextMenu> </h:commandLink> </rich:panel>
I am able to right click, and then click on the delete menu item. The demoPageView object is the first item in the treenode.
For my test, I have added three demoPageViews in the treeNode
So in my page:Page 1 ---> which is the demoPageView (first item in treenode) Page 1 Page 2 Page 3 -----------> which are items in my treenode
On clicking delete, the demoPageView Page 1 is correctly deleted as follows:Page 2 ---> which is the demoPageView (new first item in treenode) Page 2 Page 3 -----------> which are remaining items in my treenode
I then just refreshed my page (pressing F5) and strangely, the Page2 got deleted again.Page 3 ---> which is the demoPageView (new first item in treenode) Page 3 -----------> which are remaining items in my treenode
How can i work around this behaviour. Is the rich context menu item stable yet ? -
7. Re: Menu Item With Tomahawk Action Listener
nbelaevski Jan 18, 2008 11:25 AM (in response to jbossja)Could you please provide action code?
-
8. Re: Menu Item With Tomahawk Action Listener
yj4jboss Jan 18, 2008 12:31 PM (in response to jbossja)@Stateful @Name("guidelineEditorBean") @Scope(ScopeType.SESSION) @Interceptors(SeamInterceptor.class) public class GuidelineEditorBean implements GuidelineEditor { public void deletePage() { log.debug("enter_deletePage"); log.debug("Deleting page #0", this.selectedPageView.getPage().getPageName()); deleteSubPages(this.selectedPageView); pageDAO.remove(this.selectedPageView.getPage()); List<Page> pagesToReorder = guidelinePageUtils.getAllSubPagesByOrderNum(this.selectedPageView.getPage().getParentPageId(), this.selectedPageView.getPage().getOrderingNumber(), pageDAO.selectAll(), true); for(Page page : pagesToReorder) { page.decrementOrderingNumber(); pageDAO.merge(page); } FacesMessages.instance().addFromResourceBundle("PageSuccessfullyDeleted"); guidelineHierarchyBean.reInitializeTree(); this.selectedPageView = null; } // Remaining Code }
Is there any other approach for implementing a right click contextual menu. I need this in a tomahawk tree node component. I have seen from the examples binding and unbinding of values through the action param component through a rich component control.
What is the simplest way of implementing a right click contextual menu on command links with binding and unbinding of selected values ?
Thnx heaps for the help
Yogesh