org.zkoss.zul
Class Iframe

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Iframe
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Iframe, XulElement
Direct Known Subclasses:
Jasperreport

public class Iframe
extends XulElement
implements Iframe

Includes an inline frame.

Unlike HTML iframe, this component doesn't have the frameborder property. Rather, use the CSS style to customize the border (like any other components).

Author:
tomyeh
See Also:
Include, Serialized Form

Nested Class Summary
protected  class Iframe.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from class org.zkoss.zk.ui.AbstractComponent
_visible
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Iframe()
           
Iframe(java.lang.String src)
           
 
Method Summary
 java.lang.String getAlign()
          Returns the alignment.
 Media getContent()
          Returns the content set by setContent(org.zkoss.util.media.Media).
protected  java.lang.String getEncodedSrc()
          Returns the encoded src (getSrc()).
 java.lang.String getName()
          Returns the frame name.
 java.lang.String getOuterAttrs()
          Returns the exterior attributes for generating the enclosing HTML tag; never return null.
 java.lang.String getScrolling()
          Return the scroll bars.
 java.lang.String getSrc()
          Returns the src.
 boolean isAutohide()
          Returns whether to automatically hide this component if a popup or dropdown is overlapped with it.
 boolean isChildable()
          Default: not childable.
protected  java.lang.Object newExtraCtrl()
          Used by AbstractComponent.getExtraCtrl() to create a client control.
 void setAlign(java.lang.String align)
          Sets the alignment: one of top, middle, bottom, left, right and center.
 void setAutohide(boolean autohide)
          Sets whether to automatically hide this component if a popup or dropdown is overlapped with it.
 void setContent(Media media)
          Sets the content directly.
 void setName(java.lang.String name)
          Sets the frame name.
 void setScrolling(java.lang.String scrolling)
          Define scroll bars
 void setSrc(java.lang.String src)
          Sets the src.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, clone, containsVariable, detach, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, hasFellow, insertBefore, invalidate, isAsapRequired, isInvalidated, isListenerAvailable, isVisible, newChildren, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, onWrongValue, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, unsetVariable
 

Constructor Detail

Iframe

public Iframe()

Iframe

public Iframe(java.lang.String src)
Method Detail

setScrolling

public void setScrolling(java.lang.String scrolling)
Define scroll bars

Specified by:
setScrolling in interface Iframe
Parameters:
scrolling - "true", "false", "yes" or "no" or "auto", "auto" by default If null, "auto" is assumed.
Since:
3.0.4

getScrolling

public java.lang.String getScrolling()
Return the scroll bars.

Defalut: "auto"

Specified by:
getScrolling in interface Iframe
Since:
3.0.4

getAlign

public java.lang.String getAlign()
Returns the alignment.

Default: null (use browser default).

Specified by:
getAlign in interface Iframe

setAlign

public void setAlign(java.lang.String align)
Sets the alignment: one of top, middle, bottom, left, right and center.

Specified by:
setAlign in interface Iframe

getName

public java.lang.String getName()
Returns the frame name.

Default: null (use browser default).

Specified by:
getName in interface Iframe

setName

public void setName(java.lang.String name)
Sets the frame name.

Specified by:
setName in interface Iframe

isAutohide

public boolean isAutohide()
Returns whether to automatically hide this component if a popup or dropdown is overlapped with it.

Default: false.

If an iframe contains PDF or other embeds, it will be placed on top of other components. It may then make popups and dropdowns obscure. In this case, you have to specify autohide="true" to ask ZK to hide the iframe when popups or dropdowns is overlapped with the iframe.

Specified by:
isAutohide in interface Iframe

setAutohide

public void setAutohide(boolean autohide)
Sets whether to automatically hide this component if a popup or dropdown is overlapped with it.

Specified by:
setAutohide in interface Iframe

getSrc

public java.lang.String getSrc()
Returns the src.

Default: null.

Specified by:
getSrc in interface Iframe

setSrc

public void setSrc(java.lang.String src)
Sets the src.

Calling this method implies setContent(null). In other words, the last invocation of setSrc(java.lang.String) overrides the previous setContent(org.zkoss.util.media.Media), if any.

Specified by:
setSrc in interface Iframe
Parameters:
src - the source URL. If null or empty, nothing is included.
See Also:
setContent(org.zkoss.util.media.Media)

getEncodedSrc

protected java.lang.String getEncodedSrc()
Returns the encoded src (getSrc()).


setContent

public void setContent(Media media)
Sets the content directly. Default: null.

Calling this method implies setSrc(null). In other words, the last invocation of setContent(org.zkoss.util.media.Media) overrides the previous setSrc(java.lang.String), if any.

Specified by:
setContent in interface Iframe
Parameters:
media - the media for this inline frame.
See Also:
setSrc(java.lang.String)

getContent

public Media getContent()
Returns the content set by setContent(org.zkoss.util.media.Media).

Note: it won't fetch what is set thru by setSrc(java.lang.String). It simply returns what is passed to setContent(org.zkoss.util.media.Media).

Specified by:
getContent in interface Iframe

getOuterAttrs

public java.lang.String getOuterAttrs()
Description copied from class: HtmlBasedComponent
Returns the exterior attributes for generating the enclosing HTML tag; never return null.

Used only by component developers.

Default: Generates the tooltip text, style, sclass, draggable and droppable attribute if necessary. In other words, the corresponding attribute is generated if HtmlBasedComponent.getTooltiptext(), HtmlBasedComponent.getRealStyle(), HtmlBasedComponent.getSclass(), HtmlBasedComponent.getDraggable(), HtmlBasedComponent.getDroppable() are defined.

You have to call both HtmlBasedComponent.getOuterAttrs() and HtmlBasedComponent.getInnerAttrs() to generate complete attributes.

For simple components that all attributes are put on the outest HTML element, all you need is as follows.

<xx id="${self.uuid}"${self.outerAttrs}${self.innerAttrs}>

If you want to put attributes in a nested HTML element, you shall use the following pattern. Notice: if HtmlBasedComponent.getInnerAttrs() in a different tag, the tag must be named with "${self.uuid}!real".

<xx id="${self.uuid}"${self.outerAttrs}>
 <yy id="${self.uuid}!real"${self.innerAttrs}>...

Note: This class handles non-deferrable event listeners automatically. However, you have to invoke AbstractComponent.appendAsapAttr(java.lang.StringBuffer, java.lang.String) for each event the component handles in HtmlBasedComponent.getOuterAttrs() as follows.


        appendAsapAttr(sb, Events.ON_OPEN);
  appendAsapAttr(sb, Events.ON_CHANGE);

Theorectically, you could put any attributes in either HtmlBasedComponent.getInnerAttrs() or HtmlBasedComponent.getOuterAttrs(). However, zkau.js assumes all attributes are put at the outer one. If you want something different, you have to provide your own setAttr (refer to how checkbox is implemented).

Overrides:
getOuterAttrs in class XulElement

isChildable

public boolean isChildable()
Default: not childable.

Specified by:
isChildable in interface Component
Overrides:
isChildable in class AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Description copied from class: HtmlBasedComponent
Used by AbstractComponent.getExtraCtrl() to create a client control. It is used only by component developers.

Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl.

Overrides:
newExtraCtrl in class HtmlBasedComponent


Copyright &copy; 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo