Examples of IModel


Examples of org.apache.wicket.model.IModel

            link.setPopupSettings(popupSettings);

            add(link);

            IModel tmpLabelModel = labelModel;

            if (labelModel == null)
            {
                tmpLabelModel = createLabelModel(model);
            }
View Full Code Here

Examples of org.apache.wicket.model.IModel

     */
    public TriggerButton(final String id, final ResourceReference resourceReference)
    {
      super(id);
      add(new PathAttributeModifier("id", this));
      IModel srcReplacement = new Model()
      {
        private static final long serialVersionUID = 1L;

        public Object getObject()
        {
View Full Code Here

Examples of org.apache.wicket.model.IModel

{
    private static final long serialVersionUID = 2219855853289144320L;

    public ModelBeanPage()
    {
        IModel beanModel = new LoadableDetachableObjectModel();
       
        BeanMetaData meta = new BeanMetaData(beanModel.getObject().getClass(), null, this, null, false);
        add( new BeanForm("beanForm", beanModel, meta) );
    }
View Full Code Here

Examples of org.apache.wicket.model.IModel

        SerializableBean[] beans = new SerializableBean[20];
        for (int i = 0; i < beans.length; i++) {
            beans[i] = new SerializableBean("Name" + i, "XYZ" + i);
        }
       
        IModel beanModel = new Model<Serializable>((Serializable)(Object)Arrays.asList(beans));
       
        BeanMetaData meta = new BeanMetaData(SerializableBean.class, null, this, null, false);
        add( new BeanForm("beanForm", beanModel, meta) );
    }
View Full Code Here

Examples of org.apache.wicket.model.IModel

        if (componentClassName != null) {
            try {
                Class<?> componentClass = Class.forName(componentClassName);
                Constructor<?> xtor = componentClass.getConstructor(constructorArgs);
               
                IModel model = new BeanPropertyModel(bean, propertyMeta);
                Component component = (Component)xtor.newInstance( new Object[] { wicketId, model, propertyMeta, viewOnly } );
                associateLabelToFormComponents(propertyMeta, component);
                return component;
            }
            catch (ClassNotFoundException e) {
View Full Code Here

Examples of org.apache.wicket.model.IModel

            isList = (modelBean instanceof List);
        }
       
        if (isList) {
            // BeanTablePanel expects a model. Wrap bean if necessary.
            IModel model;
            if (bean instanceof IModel) {
                model = (IModel)bean;
            }
            else {
                model = new Model<Serializable>((Serializable) bean);
View Full Code Here

Examples of org.apache.wicket.model.IModel

    final boolean triggerError = parameters.getBoolean("trigger");

    if (!triggerError)
      throw new AbortWithWebErrorCodeException(1234, "this error will be rendered");

    IModel model = new LoadableDetachableModel()
    {
      private static final long serialVersionUID = -1285116295157071919L;

      protected Object load()
      {
View Full Code Here

Examples of org.apache.wicket.model.IModel

   * Test that testing if a component is on the ajax response can handle if the response is
   * encoded.
   */
  public void testAssertComponentOnAjaxResponse_encoding()
  {
    final IModel labelModel = new IModel()
    {
      private static final long serialVersionUID = 1L;

      private String value;

      public Object getObject()
      {
        return value;
      }

      public void setObject(Object object)
      {
        value = (String)object;
      }

      public void detach()
      {
      }
    };

    labelModel.setObject("Label 1");
    final Label label = new Label(MockPageWithLinkAndLabel.LABEL_ID, labelModel);
    label.setOutputMarkupId(true);

    final Page page = new MockPageWithLinkAndLabel();
    AjaxLink ajaxLink = new AjaxLink(MockPageWithLinkAndLabel.LINK_ID)
    {
      private static final long serialVersionUID = 1L;

      public void onClick(AjaxRequestTarget target)
      {
        labelModel.setObject("Label which needs encoding: [] ][");
        target.addComponent(label);
      }
    };
    ajaxLink.setOutputMarkupId(true);

View Full Code Here

Examples of org.apache.wicket.model.IModel

      throw new IllegalArgumentException("argument [tabs] cannot be null");
    }

    this.tabs = tabs;

    final IModel tabCount = new AbstractReadOnlyModel()
    {
      private static final long serialVersionUID = 1L;

      public Object getObject()
      {
View Full Code Here

Examples of org.apache.wicket.model.IModel

   *
   * @return The model
   */
  public final IModel getModel()
  {
    IModel model = getModelImpl();
    // If model is null
    if (model == null)
    {
      // give subclass a chance to lazy-init model
      model = initModel();
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.