0

This is probably a simple question, bu I just can't find the answer I'm looking for. I have a Seam facelet page that I want want a string (that is an email address) to show up as link which when pressed, opens the users local email program with the email address in the to line

This what I have so far (the syntax is nor right):

          <ui:define name="results">
                <a:form>
                    <rich:dataTable
                    var="_item"
                    value="#{myView.addressBean.items}"
                    <rich:column>
                            <f:facet name="header">Type</f:facet>
                            <h:outputText value="#{_item.address.addressDescription}"/>
                        </rich:column>
                    <rich:column>
                            <f:facet name="header">Info</f:facet>
                            <h:outputText value="#{_item.address.addressType.type eq 'email' ? [<a href="'mailto:' + #{_item.address.addressInfo}">#{_item.address.addressInfo}</a>]  : _item.address.addressInfo}"/>
                        </rich:column>
                    </rich:dataTable>
                </a:form>
            </ui:define>

Any help would be greatly appreciated!

Ace
  • 821
  • 3
  • 16
  • 37

1 Answers1

2

Just use an ui:fragment (or an h:panelGroup), instead of h:outputText, like this:

<ui:fragment rendered="#{_item.address.addressType.type == 'email'}">
    <a href="mailto:#{_item.address.addressInfo}">#{_item.address.addressInfo}</a>
</ui:fragment>
Elias Dorneles
  • 22,556
  • 11
  • 85
  • 107