TagLib: AddressBook

contact

Description

This tag denotes a reference to the current contact bean within an enclosing collection tag, e.g., <ab:contacts>. The body of this tag may contain get/set tags that will generate output derived from the contents of this bean tag.

Tag Body

JSP

Tag Parent

<abPrefix:contacts>

Restrictions

Only one of id, name, or entryid should be used at a time. If no attributes are specified, the current entry in the parent collection is used. 

Attributes

This tag has the following attributes:  

Attribute

Description

Req'd?

id Specifies the bean id of the bean to create. No
name Specifies the bean id of the bean to use. No
entryid Specifies the address book entry id to use. No

Properties

This tag provides the following bean properties:

Property

Description

Type


Access

fn First name. String
Get/Set
ln Last name. String
Get/Set
em Email address. String
Get/Set
bp Business phone. String
Get/Set
hp Home phone. String
Get/Set
fp Fax phone. String
Get/Set
mp Mobile phone. String
Get/Set
pp Pager phone. String
Get/Set
entryid id of address book entry. String
Get/Set
cn
 Type of entry bean.  May be "contact" or "group". String
Get/Set

Example(s)

<%-- Example 1 Current contact in the contacts collection --%>
<%@ page errorPage="/jsp/errorpage.jsp" %>
<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>
<ab:fetch ln="$(ln)" fn="$(fn)" bp="$(bp)" em="$(em)" hp="$(
hp)" fp="$(fp)" mp="$(mp)" pp="$(pp)" sb="ln" sd="up">
          Error in Looking up address book.
</ab:fetch>

        Number of Address Book entries:

<ab:context>
  <ab:get property="numEntries"/>
</ab:context>

<ab:contacts iterate="true">  
  <ab:contact>
             Entry Id: <ab:get property="entryid"/>
             First Name: <ab:get property="fn"/>
             Last Name: <ab:get property="ln"/>
             Email: <ab:get property="em"/>
  </ab:contact>
</ab:contacts>


<%-- Example 2 Retrieve a contact by entryid --%>
<ab:contact entryid="$(entryid)">
             First Name: <ab:get property="fn"/>
             Last Name: <ab:get property="ln"/>
             Email: <ab:get property="em"/>
</ab:contact>