-
1. Re: Disabling entries in a context menu for table rows?
btj Nov 11, 2009 3:50 AM (in response to btj)Anyone? Isn't this possible??
BTJ -
2. Re: Disabling entries in a context menu for table rows?
nbelaevski Nov 11, 2009 6:59 AM (in response to btj)Hi BTJ,
Menu item has disabled attribute. Have you tried it? -
3. Re: Disabling entries in a context menu for table rows?
btj Nov 11, 2009 7:06 AM (in response to btj)Yes, but the problem is not that... The problem is setting the disabled value based on one value for each row.. I.e. for some rows the menu item should be enabled but for some others it should be disabled...
I can't find a way to get hold on the row data so I can set the correct value for the disabled attribute...
BTJ -
4. Re: Disabling entries in a context menu for table rows?
nbelaevski Nov 11, 2009 7:36 AM (in response to btj)What is page code?
-
5. Re: Disabling entries in a context menu for table rows?
btj Nov 11, 2009 7:55 AM (in response to btj)by page code you mean an example? if so, here is an example..:
<rich:dataTable var="vare" value="#{articleSearchController.articles}"> .....rows data..... <rich:componentControl event="onRowContextMenu" for="contextmenu" operation="show" > <f:param value="#{vare.varenummer}" name="rowVarenr"/> <f:param value="#{vare.existInSortiment}" name="exists"/> </rich:componentControl> </rich:dataTable> <rich:contextMenu attached="false" submitMode="ajax" id="contextmenu" disableDefaultMenu="true" hideDelay="0"> <rich:menuItem value="#{msgs.edit_price_on_article}" action="#{myArticleSearchController.editArticle}" disabled="{!exists}"> <a4j:actionparam value="{rowVarenr}" name="varenr4" assignTo="#{myArticleSearchController.chosenVarenr}"/> </rich:menuItem> <rich:menuItem id="menudelete" value="#{msgs.delete_article}" action="delete" disabled="{!exists}"> <a4j:actionparam value="{rowVarenr}" name="varenr5" assignTo="#{myArticleSearchController.chosenVarenr}" /> <rich:componentControl for="modConfirm" attachTo="menudelete" operation="show" event="onclick"/> </rich:menuItem> </rich:contextMenu>
This I thought perhaps should work but it doesn't....
BTJ -
6. Re: Disabling entries in a context menu for table rows?
nbelaevski Nov 11, 2009 10:13 AM (in response to btj)Output disabled/not disabled menu items and switch between them via CSS. Note: you should do the check for disabled items on the server also.
-
7. Re: Disabling entries in a context menu for table rows?
btj Nov 12, 2009 3:35 AM (in response to btj)Do you have an example on how to do this?
I tried to do it like this..:<rich:componentControl event="onRowContextMenu" for="contextmenu" operation="show" > <f:param value="#{vare.varenummer}" name="rowVarenr"/> <f:param value="#{vare.finnesISortiment ? 'hidden' : 'none'}" name="show_finnes"/> <f:param value="#{vare.finnesISortiment ? 'none' : 'hidden'}" name="show_finnes_ikke"/> </rich:componentControl> <rich:contextMenu attached="false" submitMode="ajax" id="contextmenu" disableDefaultMenu="true" hideDelay="0"> <rich:menuItem value="#{msgs.add_article_to_sortiment}" action="#{articleSearchController.addArticle}" reRender="articlesearchgrid,articlestablegroup" style="display: {show_finnes_ikke};"> <a4j:actionparam value="{rowVarenr}" name="varenr6" assignTo="#{articleSearchController.chosenVarenr}"/> </rich:menuItem> <rich:menuItem value="#{msgs.add_article_to_sortiment}" action="add" style="display: {show_finnes};" disabled="true"/> <rich:menuItem value="#{msgs.edit_price_on_article}" action="#{articleSearchController.editArticle}" style="display: {show_finnes};" disabled="false"> <a4j:actionparam value="{rowVarenr}" name="varenr4" assignTo="#{articleSearchController.chosenVarenr}"/> </rich:menuItem> <rich:menuItem value="#{msgs.edit_price_on_article}" action="edit" style="display: {show_finnes_ikke};" disabled="true"/> <rich:menuItem id="menudelete" value="#{msgs.delete_article_from_sortiment}" style="display: {show_finnes};" disabled="false" action="delete"> <a4j:actionparam value="{rowVarenr}" name="varenr5" assignTo="#{articleSearchController.chosenVarenr}"/> <rich:componentControl for="modConfirm" attachTo="menudelete" operation="show" event="onclick"/> </rich:menuItem> <rich:menuItem value="#{msgs.delete_article_from_sortiment}" style="display: {show_finnes_ikke};" disabled="true"/> </rich:contextMenu>
And it kind of work... it displays the context menu with the correct items disabled but the third item is always displayed disconnected from the contxt menu and displayed under the table...
What am I missing?
BTJ -
8. Re: Disabling entries in a context menu for table rows?
ilya_shaikovsky Nov 12, 2009 5:22 AM (in response to btj)this is caused by issue in 3.3.2 SR1. please check under 3.3.3 snapshot.
-
9. Re: Disabling entries in a context menu for table rows?
btj Nov 12, 2009 5:52 AM (in response to btj)How stable is the 3.3.3 snapshot?
BTJ -
10. Re: Disabling entries in a context menu for table rows?
ilya_shaikovsky Nov 12, 2009 6:07 AM (in response to btj)all the branch under stabilization works only. and BETA should be available soon. You will get just a few bugfixes changes after switching.
-
11. Re: Disabling entries in a context menu for table rows?
btj Nov 12, 2009 6:12 AM (in response to btj)Ok, I will try the snapshot and see how it goes... Thx... :)
BTJ