JSF - checking for zero and empty in one method

Currently my code is similar to

<h:panelGroup rendered="#{templatePrescriptionMaintenanceBackingBean.allSelectedMedicationList != null && !empty templatePrescriptionMaintenanceBackingBean.allSelectedMedicationList}">
        <b>List of Selected Drugs</b> // and some other stuff
</h:panelGroup> 

Now allSelectedMedicationListwill do a lot of process in the backend. Calling webservice and adding data to the current database, etc.

Now the problem arises when I need to check nullor empty- 2 times this method, which is called here. Once again, when I use the same method with datatable, it will call 1 more again . I think in order to create one method or something for JSF, which will check nullboth emptyat the very moment and on return. Is it possible?

+3
source share
1 answer

All Articles