Hi Friends , sometimes we have a use case where we need a command link in the ADF table column. This scenario is required in cases where the column containing the command link represents the identifying key for the table and we want the user to click on that link and perform some action like going to details page for that record or opening the details in a pop up. This is a simple use case and easy to implement. So our jsff will look something like this.
Problem: A problem arises when we want to use print functionality on this table.
Here if we implement default print functionality provided by ADF i.e adding af:showPrintablePageBehavior element inside a command button, it omits the the command link and we get a blank field on the print page when user tries to print the contents of this page. But we wanted to display the 'text' value of commandLink. This happens because by default ADF print functionality has been designed to omit the commandLinks and buttons present on an ADF page and provide the user with a better printable format of the page in consideration.
Ta-Da...so here it is , simple and easy solution. Now when user clicks the print button, he gets this output text which is rendered only if outputMode of the current adfFacesContext is 'printable'.
Thanks. Hope it works for you . Cheers.
Problem: A problem arises when we want to use print functionality on this table.
Here if we implement default print functionality provided by ADF i.e adding af:showPrintablePageBehavior element inside a command button, it omits the the command link and we get a blank field on the print page when user tries to print the contents of this page. But we wanted to display the 'text' value of commandLink. This happens because by default ADF print functionality has been designed to omit the commandLinks and buttons present on an ADF page and provide the user with a better printable format of the page in consideration.
Solution: Now to resolve this problem user can add an output text inside the same column of the ADF table(which contains a commandLink) and to the rendered property of the output text add the following expression.
rendered="#{adfFacesContext.outputMode eq 'printable'}";
Your table jsff code should look like the following.
Ta-Da...so here it is , simple and easy solution. Now when user clicks the print button, he gets this output text which is rendered only if outputMode of the current adfFacesContext is 'printable'.
Thanks. Hope it works for you . Cheers.