문제

I basically have a datatable in which one of the columns is clickable. I have done this by using the commandlink from primefaces.

Everywhere people have used this only to navigate, but I want the click to result in opening a sub datatable. Depending on which row I click on in that column the corresponding datatable must appear.

Can this be done using in primefaces, if so how do I proceed? Thanks

도움이 되었습니까?

해결책

I finally resolved this problem. I basically created one datatable and hid it, depending on the column clicked I used the backing bean to populate the datatable accordingly. I made the onclick event call a function in the backing bean using the following code:

<p:column headerText="Train" style="font-size:90%;font-family:Times New Roman, Times, serif;">
    <p:commandLink onclick="javascript:ShowHide('HiddenDiv');"
        id="tableUpdater" update=":closeButton,:subForm:trainTable" value="#{rail.trainNo}"
        action="#{yardMaster.populateTrainDetails(rail.trainNo)}"
        style="font-family:Times New Roman, Times, serif;">
    </p:commandLink>
</p:column>

So basically something like a dynamic datatable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top