Pregunta

I am rendering a date field in XHTML using JSF. Since the value in DB is saved as null the date field values is shown as "null" in the UI. How to avoid this null?

My code is given below:

    <h:outputFormat value="{0, date, MM/dd/yyyy}"
                                        rendered="#{sysbean.xx.isfeed == '1' or (sysbean.yy== false and sysbean.details.endate!= null)}">
<f:param value="#{sysbean.details.endate}" /></h:outputFormat> 

The output I am getting is

Project Name : null

How can I avoid the value coming as "null"?

¿Fue útil?

Solución

<f:param value="#{value to check!=null?value when condition is true:
value when condition is false}" />

Checking the null at EL expression, or in the bean also you can put the inline check for null values.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top