The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20140210

cascading primefaces "p:contextMenu"s?

i have a p:contextMenu for a p:dataTable, but inside the table is a p:rowExpansion which contains a p:dataTable, with a p:contextMenu for that inner datatable, but the "outer" p:contextMenu seems to be overriding the "inner" p:contextMenu.

<p:contextMenu for="tripTable">
    <p:menuitem value="context menu item for main dataTable" />
</p:contextMenu>

<p:dataTable id="tripTable" rowKey="#{listObj.id}"
    selection="#{
listTrqsDataModel.tripBean.currentItem}"
    selectionMode="single"
    value="#{
listTrqsDataModel.tripBean.dataList}" var="listObj"
    rows="#{listTrqsDataModel.tripBean.noOfItemsListedPrPage}">
    <p:column>
        <p:rowToggler />
    </p:column>
    <p:column>
        ...           
    </p:column>
    <p:rowExpansion>
        <p:contextMenu for="tripTRQTable">
            <p:menuitem value="context menu item for rowExpansion dataTable" />
        </p:contextMenu>
        <p:dataTable id="tripTRQTable" ... >
            <p:column>
                ...
            </p:column>
        </p:dataTable>
    </p:rowExpansion>
</p:dataTable>



not sure how to make this work... anyone?


UPDATE 20140210

it seems like a workaround for this is to remove the "for" attribute in the inner contextMenu--making its scope for the whole page, while the outer contextMenu is still working for the outer dataTable, i.e.:

    <p:rowExpansion>
        <p:contextMenu for="tripTRQTable">
            <p:menuitem value="context menu item for rowExpansion dataTable" />
        </p:contextMenu>
        <p:dataTable id="tripTRQTable" ... >
            <p:column>
                ...
            </p:column>
        </p:dataTable>



UPDATE 20140217

doesn't look like the workaround is very reliable. once the "inner" context menu is enabled, the "outer" doesn't show. looks like i'll have to use a button/icon instead of context menus, for now...