BBJSP CORE:IfNotEmpty Tag (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher, the ifnotempty tag can be used within a BBJSP Page to control the conditional rendering of the tag body if the data is not empty.

The data can be a BBjVector, a Map, including BBjspHashMap or a String.

If the data value of null() is considered empty.

Attributes

Attribute Name

Description

Required

Expression

Data Type

data

the data attribute should evaluate to an object.

true

true

int

Remarks

The Core Tag Library library needs to be referenced in the BBJSP Page

Example

<!DOCTYPE html/>

<%-- We must import the tag library before we can use it. --%>
<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>

<%
vect! = new BBjVector()
REM === Store the vector in the page context so we can reference it in an expression.
#PageContext!.setAttribute("vect",vect!)
%>
<html>
<head> 
<title><c:ifempty></title> 
</head>
<body>
<c:ifempty data='${vect}'>
The Vector was empty
</c:ifempty>
<code>${vect}</code> 
... 
then we added 'Something' into it
<%
vect!.add("Something")
%>
<c:ifnotempty data='${vect}' >
and it was no longer empty
</c:ifnotempty>
<code>${vect}</code>.
</body>
</html>

See Also

BBJSP

Core Tag Library

<CORE.IfNotEmpty>