You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Bill Schneider (JIRA)" <de...@myfaces.apache.org> on 2006/01/03 22:48:01 UTC

[jira] Created: (MYFACES-998) default values for convertNumber and convertDateTime

default values for convertNumber and convertDateTime
----------------------------------------------------

         Key: MYFACES-998
         URL: http://issues.apache.org/jira/browse/MYFACES-998
     Project: MyFaces
        Type: New Feature
  Components: Tomahawk  
    Reporter: Bill Schneider


Would like to be able to do something like this:

<h:outputText value="#{bean.dateField}">
  <t:convertDateTime pattern="yyyy-MM-dd" default="not provided"/>
</h:outputText>

or alternately, <h:outputText value="#{bean.anyField}" default="(print this if value is null)">....

same for numbers.

It would seem cleaner to keep this in the view/JSP layer rather than pushing default-if-null logic into the controller/bean.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-998) default values for convertNumber and convertDateTime

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-998?page=all ]
     
Mike Kienenberger closed MYFACES-998:
-------------------------------------

    Resolution: Invalid

Use the rendered attribute:

<h:outputText value="(print this if value is null)" rendered="#{value is null}/>
<h:outputText value="#{bean.dateField}" rendered="#{value is not null}/>

You'll probably want to wrap this in a h:panelGroup so it's treated as one composite component.

> default values for convertNumber and convertDateTime
> ----------------------------------------------------
>
>          Key: MYFACES-998
>          URL: http://issues.apache.org/jira/browse/MYFACES-998
>      Project: MyFaces
>         Type: New Feature
>   Components: Tomahawk
>     Reporter: Bill Schneider

>
> Would like to be able to do something like this:
> <h:outputText value="#{bean.dateField}">
>   <t:convertDateTime pattern="yyyy-MM-dd" default="not provided"/>
> </h:outputText>
> or alternately, <h:outputText value="#{bean.anyField}" default="(print this if value is null)">....
> same for numbers.
> It would seem cleaner to keep this in the view/JSP layer rather than pushing default-if-null logic into the controller/bean.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira