本文整理匯總了Java中javax.faces.component.UIComponent.markInitialState方法的典型用法代碼示例。如果您正苦於以下問題:Java UIComponent.markInitialState方法的具體用法?Java UIComponent.markInitialState怎麽用?Java UIComponent.markInitialState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.faces.component.UIComponent
的用法示例。
在下文中一共展示了UIComponent.markInitialState方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onComponentPopulated
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public void onComponentPopulated(FaceletContext context,
UIComponent component,
UIComponent parent)
{
assert (_markInitialState != null);
if ((component instanceof UIXComponent) &&
(_markInitialState == Boolean.TRUE))
{
if (component.getId() == null)
component.setId(context.generateUniqueId(UIViewRoot.UNIQUE_ID_PREFIX));
PhaseId phase = context.getFacesContext().getCurrentPhaseId();
// In jsf2 markInitialState will be called by the framework during restore view,
// and in fact the framework should always be the one
// calling markInitialState, but it doesn't always do that in render response, see
// http://java.net/jira/browse/JAVASERVERFACES-2285
// Also don't call markInitialState unless initialStateMarked returns false, otherwise
// any deltas previously saved may get blown away.
if (PhaseId.RENDER_RESPONSE.equals(phase) && !component.initialStateMarked())
{
component.markInitialState();
}
}
}