com.ivata.mask.web.tag.html
Class IFrameTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.apache.struts.taglib.html.BaseHandlerTag
              extended byorg.apache.struts.taglib.html.LinkTag
                  extended bycom.ivata.mask.web.tag.html.IFrameTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class IFrameTag
extends org.apache.struts.taglib.html.LinkTag

Provides the functionality of an iframe tag for those browsers which support it, and displays the tag body, or the contents of the URL referenced, for those which do not.

If you specify a URL via one of the SecureLinkTag attributes, this will be displayed as the contents of the iframe, otherwise the tag body is used.

Note: it is the tag body which appears in the resultant iframe, unlike the HTML implementation (where the tag body is a comment for older browsers)

Tag attributes:

attribute reqd. param. class description
align false java.lang.String Alignment of the iframe contents. If this has the value "block", indicates the contents should fill the entire iframe.
formAction false java.lang.String Specify this tag attribute to define the action of a form which will surround the iframe contents. The action should be specified relative to the web application context path
formName false java.lang.String Specify this tag attribute to create a form with the given name. The action can be specified using the formAction attribute and the target using formTarget.
formTarget false java.lang.String Specify this tag attribute to define the target of a form which will surround the iframe contents.
frameName false java.lang.String Specify this tag attribute to set the name of the iframe.
height false java.lang.String This attribute represents the height of this frame, though its actual interpretation depends on the implementation..
width false java.lang.String This attribute represents the width of this frame, though its actual interpretation depends on the implementation..

Since:
ivata masks 0.4 (2003-01-25)
Version:
$Revision: 1.4 $
Author:
Colin MacLeod colin.macleod@ivata.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.struts.taglib.html.LinkTag
action, anchor, forward, href, indexId, linkName, messages, module, name, page, paramId, paramName, paramProperty, paramScope, property, scope, target, text, transaction, useLocalEncoding
 
Fields inherited from class org.apache.struts.taglib.html.BaseHandlerTag
accesskey, defaultLocale, indexed, tabindex
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
IFrameTag()
           
 
Method Summary
 void addMaskTag(org.apache.struts.taglib.html.BaseHandlerTag maskTagParam, javax.servlet.jsp.PageContext pageContext)
           Implementation method.
 int doAfterBody()
           Overriddent to analyze the tag body and use it as the body of the iframe if present.
 int doEndTag()
           Overridden to actually output the HTML code on the basis of the input parameters.
 int doStartTag()
           Overridden to prevent the superclass implementation from executing.
 java.lang.String getAlign()
           Alignment of the iframe contents.
 java.lang.String getFormAction()
           Specify this tag attribute to define the action of a form which will surround the iframe contents.
 java.lang.String getFormName()
           Specify this tag attribute to create a form with the given name.
 java.lang.String getFormTarget()
           Specify this tag attribute to define the target of a form which will surround the iframe contents.
 java.lang.String getHeight()
           This tag attribute specified the height of the frame.
 java.lang.String getValign()
           Vertical alignment of the iframe contents.
 java.lang.String getWidth()
           This tag attribute specified the width of the frame.
 void setAlign(java.lang.String alignParam)
           Alignment of the iframe contents.
 void setFormAction(java.lang.String formActionParam)
           Specify this tag attribute to define the action of a form which will surround the iframe contents.
 void setFormName(java.lang.String formNameParam)
           Specify this tag attribute to create a form with the given name.
 void setFormTarget(java.lang.String formTargetParam)
           Specify this tag attribute to define the target of a form which will surround the iframe contents.
 void setFrameName(java.lang.String frameName)
           Specify this tag attribute to set the name of the iframe created.
 void setHeight(java.lang.String heightParam)
           This tag attribute specified the height of the frame.
 void setValign(java.lang.String valignParam)
           Vertical alignment of the iframe contents.
 void setWidth(java.lang.String widthParam)
           This tag attribute specified the width of the frame.
 
Methods inherited from class org.apache.struts.taglib.html.LinkTag
calculateURL, getAction, getAnchor, getForward, getHref, getIndexId, getLinkName, getModule, getName, getPage, getParamId, getParamName, getParamProperty, getParamScope, getProperty, getScope, getTarget, getTransaction, isUseLocalEncoding, release, setAction, setAnchor, setForward, setHref, setIndexId, setLinkName, setModule, setName, setPage, setParamId, setParamName, setParamProperty, setParamScope, setProperty, setScope, setTarget, setTransaction, setUseLocalEncoding
 
Methods inherited from class org.apache.struts.taglib.html.BaseHandlerTag
getAccesskey, getAlt, getAltKey, getBundle, getDisabled, getElementClose, getIndexed, getLocale, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getReadonly, getStyle, getStyleClass, getStyleId, getTabindex, getTitle, getTitleKey, isXhtml, lookupProperty, message, prepareEventHandlers, prepareFocusEvents, prepareIndex, prepareKeyEvents, prepareMouseEvents, prepareStyles, prepareTextEvents, setAccesskey, setAlt, setAltKey, setBundle, setDisabled, setIndexed, setLocale, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setStyle, setStyleClass, setStyleId, setTabindex, setTitle, setTitleKey
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

IFrameTag

public IFrameTag()
Method Detail

addMaskTag

public final void addMaskTag(org.apache.struts.taglib.html.BaseHandlerTag maskTagParam,
                             javax.servlet.jsp.PageContext pageContext)
                      throws javax.servlet.jsp.JspException

Implementation method. This method creates a hidden field matching the passed field's name, id and value. It also adds JavaScript to the original method's onchange attribute so the value of the hidden field is updated.

This lets fields be transparently (well, fairly) contained within iframes.

Parameters:
maskTagParam - tag to be added to the iframe, so it can be automatically updated using JavaScript.
pageContext - current page context for the tag .
Throws:
javax.servlet.jsp.JspException - if the mask tag type is not compatible with this routine (Radio buttons are not implemented yet).

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException

Overriddent to analyze the tag body and use it as the body of the iframe if present. This method is called after the JSP engine processes the body content of the tag.

Returns:
SKIP_BODY since we only ever want to evaluate this tag once.
Throws:
javax.servlet.jsp.JspException - encapsulates any exception when calling writeTagBodyContent.
See Also:
#writeTagBodyContent(JspWriter out, BodyContent bodyContent)

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException

Overridden to actually output the HTML code on the basis of the input parameters.

Returns:
EVAL_PAGE since we always want to evaluate the page after this tag.
Throws:
javax.servlet.jsp.JspException - if there is an error writing to out.print()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException

Overridden to prevent the superclass implementation from executing.

Returns:
EVAL_BODY_BUFFERED.
Throws:
javax.servlet.jsp.JspException - if either valueKey or titleKey have not been set, or as thrown by superclass method.

getAlign

public java.lang.String getAlign()

Alignment of the iframe contents.

Set to "left","left", or "center" to align the iframe contents in that way. Setting this to "block" causes the contents to expand to the full width of the iframe.

Returns:
the current value of align.

getFormAction

public java.lang.String getFormAction()

Specify this tag attribute to define the action of a form which will surround the iframe contents. The action should be specified relative to the web application context path.

Note: the form will only be created if the formName attribute is set and the browser supports <iframe> tags.

Returns:
the current value of formAction.

getFormName

public java.lang.String getFormName()

Specify this tag attribute to create a form with the given name. The action can be specified using the formAction attribute and the target using formTarget.

Returns:
the current value of formName.

getFormTarget

public java.lang.String getFormTarget()

Specify this tag attribute to define the target of a form which will surround the iframe contents.

Note: the form will only be created if the formName attribute is set and the browser supports <iframe> tags.

Returns:
the current value of formTarget.

getHeight

public java.lang.String getHeight()

This tag attribute specified the height of the frame.

Returns:
the current value of height.

getValign

public java.lang.String getValign()

Vertical alignment of the iframe contents.

Set to "top","bottom", or "center" to align the iframe contents in that way.

Returns:
the current value of valign.

getWidth

public java.lang.String getWidth()

This tag attribute specified the width of the frame.

Returns:
the current value of width.

setAlign

public void setAlign(java.lang.String alignParam)

Alignment of the iframe contents.

Set to "left","left", or "center" to align the iframe contents in that way. Setting this to "block" causes the contents to expand to the full width of the iframe.

Parameters:
alignParam - the new value of align.

setFormAction

public void setFormAction(java.lang.String formActionParam)

Specify this tag attribute to define the action of a form which will surround the iframe contents. The action should be specified relative to the web application context path.

Note: the form will only be created if the formName attribute is set and the browser supports <iframe> tags.

Parameters:
formActionParam - the new value of formAction.

setFormName

public void setFormName(java.lang.String formNameParam)

Specify this tag attribute to create a form with the given name. The action can be specified using the formAction attribute and the target using formTarget.

Parameters:
formNameParam - the new value of formName.

setFormTarget

public void setFormTarget(java.lang.String formTargetParam)

Specify this tag attribute to define the target of a form which will surround the iframe contents.

Note: the form will only be created if the formName attribute is set and the browser supports <iframe> tags.

Parameters:
formTargetParam - the new value of formTarget.

setFrameName

public void setFrameName(java.lang.String frameName)

Specify this tag attribute to set the name of the iframe created.

Parameters:
frameName - the new value of frameName.

setHeight

public void setHeight(java.lang.String heightParam)

This tag attribute specified the height of the frame.

Parameters:
heightParam - the new value of height.

setValign

public void setValign(java.lang.String valignParam)

Vertical alignment of the iframe contents.

Set to "top","bottom", or "center" to align the iframe contents in that way.

Parameters:
valignParam - the new value of valign.

setWidth

public void setWidth(java.lang.String widthParam)

This tag attribute specified the width of the frame.

Parameters:
widthParam - the new value of width.


Copyright © 2001-2005 ivata limited. All Rights Reserved.