You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/02/26 17:17:16 UTC

[Myfaces Wiki] Update of "DisplayValueOnly" by DustinCox

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by DustinCox:
http://wiki.apache.org/myfaces/DisplayValueOnly

The comment on the change is:
Typo: "whithout" changed to "without"

------------------------------------------------------------------------------
- 
  Consider you are creating a page where users can inspect data and change it. You might want to implement different states of the page, one where users can only see the data, and not change it (let's call it ''view mode'' {{{DISPLAY}}}), and another where users can also modify the data (let's call it ''view mode'' {{{EDIT}}}). In view mode {{{EDIT}}}, you obviously need HTML input tags, to have the browser show editable fields. For a clean user interface, you don't want editable fields in view mode {{{DISPLAY}}}.
  
  One solution to make the difference, apart from creating 2 separate .jsp(x) pages, is to disable the fields in view mode {{{DISPLAY}}}:
@@ -8, +7 @@

    <h:inputText ... disabled="#{myHandler.viewMode == 'DISPLAY'}" ...>
  }}}
  
- With the extended standard components of Tomahawk, it is also possible to render the value of the fields just as text, whithout the field. This is controlled by the boolean {{{displayValueOnly}}} attribute. If the value of this attribute evaluates to {{{true}}}, no HTML input tags are rendered, but the component behaves like the standard {{{<h:outputText>}}} component. If the value of this attribute evaluates to {{{false}}}, HTML input tags are rendered, and the component behaves like the equivalent standard input component.
+ With the extended standard components of Tomahawk, it is also possible to render the value of the fields just as text, without the field. This is controlled by the boolean {{{displayValueOnly}}} attribute. If the value of this attribute evaluates to {{{true}}}, no HTML input tags are rendered, but the component behaves like the standard {{{<h:outputText>}}} component. If the value of this attribute evaluates to {{{false}}}, HTML input tags are rendered, and the component behaves like the equivalent standard input component.
  
  When the component is rendered as value only, you still want to control it's representation. For that, the attribute {{{displayValueOnlyStyle}}} and {{{displayValueOnlyStyleClass}}} are at your disposal. The css style or resp. style class mentioned as values for these attributes are applied to a HTML span tag around the displayed text when the value of the {{{displayValueOnly}}} attribute evaluates to {{{true}}}