Java Code Examples for javax.faces.component.UIComponent.markInitialState()

The following are Jave code examples for showing how to use markInitialState() of the javax.faces.component.UIComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: myfaces-trinidad   File:   Source Code and License Vote up 5 votes
public void onComponentPopulated(FaceletContext context,
                                   UIComponent component,
                                   UIComponent parent)
  assert (_markInitialState != null);

  if ((component instanceof UIXComponent) &&
      (_markInitialState == Boolean.TRUE))
    if (component.getId() == null)
    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
    // 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())