Examples of IModel


Examples of org.apache.wicket.model.IModel

   *
   * @return The backing model object
   */
  public final Object getModelObject()
  {
    final IModel model = getModel();
    if (model != null)
    {
      // Get model value for this component.
      return model.getObject();
    }
    else
    {
      return null;
    }
View Full Code Here

Examples of org.apache.wicket.model.IModel

   * @return True if the given component's model is the same as this component's model.
   */
  public final boolean sameInnermostModel(final IModel model)
  {
    // Get the two models
    IModel thisModel = getModel();
    IModel thatModel = model;

    // If both models are non-null they could be the same
    if (thisModel != null && thatModel != null)
    {
      return getInnermostModel(thisModel) == getInnermostModel(thatModel);
View Full Code Here

Examples of org.apache.wicket.model.IModel

   *            The model
   * @return This
   */
  public Component setModel(final IModel model)
  {
    IModel prevModel = getModelImpl();
    // Detach current model
    if (prevModel != null)
    {
      prevModel.detach();
    }

    if (prevModel instanceof IWrapModel)
    {
      prevModel = ((IWrapModel)prevModel).getWrappedModel();
View Full Code Here

Examples of org.apache.wicket.model.IModel

   *            The object to set
   * @return This
   */
  public final Component setModelObject(final Object object)
  {
    final IModel model = getModel();

    // Check whether anything can be set at all
    if (model == null)
    {
      throw new IllegalStateException(
        "Attempt to set model object on null model of component: " + getPageRelativePath());
    }

    // Check authorization
    if (!isActionAuthorized(ENABLE))
    {
      throw new UnauthorizedActionException(this, ENABLE);
    }

    // Check whether this will result in an actual change
    if (!getModelComparator().compare(this, object))
    {
      modelChanging();
      model.setObject(object);
      modelChanged();
    }

    return this;
  }
View Full Code Here

Examples of org.apache.wicket.model.IModel

  /**
   * Detaches the model for this component if it is detachable.
   */
  protected void detachModel()
  {
    IModel model = getModelImpl();
    if (model != null)
    {
      model.detach();
    }
    // also detach the wrapped model of a component assigned wrap (not
    // inherited)
    if (model instanceof IWrapModel && !getFlag(FLAG_INHERITABLE_MODEL))
    {
View Full Code Here

Examples of org.apache.wicket.model.IModel

   *            The model
   * @return The innermost (most nested) model
   */
  protected final IModel getInnermostModel(final IModel model)
  {
    IModel nested = model;
    while (nested != null && nested instanceof IWrapModel)
    {
      final IModel next = ((IWrapModel)nested).getWrappedModel();
      if (nested == next)
      {
        throw new WicketRuntimeException("Model for " + nested + " is self-referential");
      }
      nested = next;
View Full Code Here

Examples of org.apache.wicket.model.IModel

    {
      // Get model
      // Don't call the getModel() that could initialize many inbetween
      // completely useless models.
      // IModel model = current.getModel();
      IModel model = current.getModelImpl();

      if (model instanceof IWrapModel && !(model instanceof IComponentInheritedModel))
      {
        model = ((IWrapModel)model).getWrappedModel();
      }
View Full Code Here

Examples of org.apache.wicket.model.IModel

   * @see org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel#newEditor(org.apache.wicket.MarkupContainer,
   *      java.lang.String, org.apache.wicket.model.IModel)
   */
  protected FormComponent newEditor(MarkupContainer parent, String componentId, IModel model)
  {
    IModel choiceModel = new AbstractReadOnlyModel()
    {

      private static final long serialVersionUID = 1L;

      public Object getObject()
View Full Code Here

Examples of org.apache.wicket.model.IModel

  {
    // the #getModel() call below will resolve and assign any inheritable
    // model this component can use. Set that directly to the label and
    // editor so that those components work like this enclosing panel
    // does not exist (must have that e.g. with CompoundPropertyModels)
    IModel m = getModel();

    // check that a model was found
    if (m == null)
    {
      Component parent = getParent();
View Full Code Here

Examples of org.apache.wicket.model.IModel

     */
    protected void populateItem(final ListItem listItem)
    {
      final FeedbackMessage message = (FeedbackMessage)listItem.getModelObject();
      message.markRendered();
      final IModel replacementModel = new Model()
      {
        private static final long serialVersionUID = 1L;

        /**
         * Returns feedbackPanel + the message level, eg 'feedbackPanelERROR'. This is used
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.