Package org.ajax4jsf.model

Examples of org.ajax4jsf.model.DataComponentState


//    this._statesMap.put(getBaseClientId(faces), this._currentState);
//    this._modelsMap.put(getBaseClientId(faces), this._currentModel);
    for (Iterator iter = this._statesMap.entrySet().iterator(); iter
        .hasNext();) {
      Map.Entry stateEntry = (Map.Entry) iter.next();
      DataComponentState dataComponentState = ((DataComponentState) stateEntry
          .getValue());
      Object stateKey = stateEntry.getKey();
      if (encodedIds.isEmpty() || encodedIds.contains(stateKey)) {
        PerIdState idState = new PerIdState();
        // Save component state , depended if implemented interfaces.
        if (null == dataComponentState) {
          idState.componentState = null;
        } else {
          if (dataComponentState instanceof Serializable) {
            idState.componentState = dataComponentState;
          } else if (dataComponentState instanceof StateHolder) {
            idState.componentState = ((StateHolder) dataComponentState)
                .saveState(faces);
            idState.stateInHolder = true;
          }
          ExtendedDataModel extendedDataModel = (ExtendedDataModel) this._modelsMap
              .get(stateKey);
          if (null != extendedDataModel) {
            idState.model = extendedDataModel
                .getSerializableModel(dataComponentState
                    .getRange());

          }
        }
        if (null != idState.model || null != idState.componentState) {
View Full Code Here


*/
public abstract class SequenceDataAdaptor extends UIDataAdaptor {

  protected DataComponentState createComponentState() {
    // Create component state based on this instance.
    return new DataComponentState(){
 
      public Range getRange() {
        return new SequenceRange(getFirst(),getRows());
      }
    };
View Full Code Here

  /**
   * @return current state of this component.
   */
  public DataComponentState getComponentState() {
    DataComponentState state = null;
    if (this._currentState == null) {
      // Check for binding state to user bean.
      ValueExpression valueBinding = getValueExpression(UIDataAdaptor.COMPONENT_STATE_ATTRIBUTE);
      FacesContext facesContext = getFacesContext();
      ELContext elContext = facesContext.getELContext();
View Full Code Here

    // component not child of iterable )
    for (Iterator<Entry<String, PerIdState>> iter = state.componentStates.entrySet().iterator(); iter
        .hasNext();) {
      Entry<String, PerIdState> stateEntry = iter.next();
      PerIdState idState = stateEntry.getValue();
      DataComponentState compState;
      if (idState.stateInHolder) {
        // TODO - change RichFaces Tree component, for remove reference
        // to component from state.
        compState = createComponentState();
        ((StateHolder) compState).restoreState(faces,
View Full Code Here

//    this._statesMap.put(getBaseClientId(faces), this._currentState);
//    this._modelsMap.put(getBaseClientId(faces), this._currentModel);
    for (Iterator<Entry<String, DataComponentState>> iter = this._statesMap.entrySet().iterator(); iter
        .hasNext();) {
      Entry<String, DataComponentState> stateEntry = iter.next();
      DataComponentState dataComponentState = stateEntry.getValue();
      String stateKey = stateEntry.getKey();
      if (encodedIds.isEmpty() || encodedIds.contains(stateKey)) {
        PerIdState idState = new PerIdState();
        // Save component state , depended if implemented interfaces.
        if (null == dataComponentState) {
          idState.componentState = null;
        } else {
          if (dataComponentState instanceof Serializable) {
            idState.componentState = dataComponentState;
          } else if (dataComponentState instanceof StateHolder) {
            idState.componentState = ((StateHolder) dataComponentState)
                .saveState(faces);
            idState.stateInHolder = true;
          }
          ExtendedDataModel extendedDataModel = (ExtendedDataModel) this._modelsMap
              .get(stateKey);
          if (null != extendedDataModel) {
            idState.model = extendedDataModel
                .getSerializableModel(dataComponentState
                    .getRange());

          }
        }
        if (null != idState.model || null != idState.componentState) {
View Full Code Here

   * Test method for {@link org.ajax4jsf.component.UIDataAdaptor#getComponentState()}.
   */
  public void testGetComponentState() {
    createDataTree();
    data.setRowIndex(0);
    DataComponentState state0 = adaptor.getComponentState();
    assertTrue(state0 instanceof MockComponentState);
    data.setRowIndex(1);
    DataComponentState state1 = adaptor.getComponentState();
    data.setRowIndex(0);
    assertSame(state0, adaptor.getComponentState());
    data.setRowIndex(1);
    assertSame(state1, adaptor.getComponentState());
  }
View Full Code Here

  /**
   * Test method for {@link org.ajax4jsf.component.UIDataAdaptor#createComponentState()}.
   */
  public void testCreateComponentState() {
    DataComponentState state = adaptor.createComponentState();
    assertTrue(state instanceof MockComponentState);
  }
View Full Code Here

  /**
   * @return current state of this component.
   */
  public DataComponentState getComponentState() {
    DataComponentState state = null;
    if (this._currentState == null) {
      // Check for binding state to user bean.
      ValueExpression valueBinding = getValueExpression(UIDataAdaptor.COMPONENT_STATE_ATTRIBUTE);
      FacesContext facesContext = getFacesContext();
      ELContext elContext = facesContext.getELContext();
View Full Code Here

    // component not child of iterable )
    for (Iterator<Entry<String, PerIdState>> iter = state.componentStates.entrySet().iterator(); iter
        .hasNext();) {
      Entry<String, PerIdState> stateEntry = iter.next();
      PerIdState idState = stateEntry.getValue();
      DataComponentState compState;
      if (idState.stateInHolder) {
        // TODO - change RichFaces Tree component, for remove reference
        // to component from state.
        compState = createComponentState();
        ((StateHolder) compState).restoreState(faces,
View Full Code Here

//    this._statesMap.put(getBaseClientId(faces), this._currentState);
//    this._modelsMap.put(getBaseClientId(faces), this._currentModel);
    for (Iterator<Entry<String, DataComponentState>> iter = this._statesMap.entrySet().iterator(); iter
        .hasNext();) {
      Entry<String, DataComponentState> stateEntry = iter.next();
      DataComponentState dataComponentState = stateEntry.getValue();
      String stateKey = stateEntry.getKey();
      if (encodedIds.isEmpty() || encodedIds.contains(stateKey)) {
        PerIdState idState = new PerIdState();
        // Save component state , depended if implemented interfaces.
        if (null == dataComponentState) {
          idState.componentState = null;
        } else {
          if (dataComponentState instanceof Serializable) {
            idState.componentState = dataComponentState;
          } else if (dataComponentState instanceof StateHolder) {
            idState.componentState = ((StateHolder) dataComponentState)
                .saveState(faces);
            idState.stateInHolder = true;
          }
          ExtendedDataModel extendedDataModel = (ExtendedDataModel) this._modelsMap
              .get(stateKey);
          if (null != extendedDataModel) {
            idState.model = extendedDataModel
                .getSerializableModel(dataComponentState
                    .getRange());

          }
        }
        if (null != idState.model || null != idState.componentState) {
View Full Code Here

TOP

Related Classes of org.ajax4jsf.model.DataComponentState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.