You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by PDiefent <pd...@csc.com> on 2011/11/01 11:24:17 UTC

Re: Error with tree component with 1.5.2

@Martin: It's on FireFox also.

I don't thimk it's an serialization issue because it works fine with an
older Wicket release. The error occurs on expanding and collapsing single
nodes in the tree (inside the updateTree(target) method). 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-with-tree-component-with-1-5-2-tp3956513p3963083.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error with tree component with 1.5.2

Posted by PDiefent <pd...@csc.com>.
One new hint concerning the error messages. If I use the Tree class instead
of AbstractTree and set the linktype after constructing the tree, the
message doesn't appear any more but the tree component slows down extremely!

...
	tm = createTreeModel(animals);
	    tree = new CdTree("tree", tm);
	    tree.setRootLess(true);
*	    tree.setLinkType(LinkType.REGULAR);*
        tree.getTreeState().collapseAll();
        testForm.add(tree.setOutputMarkupId(true));


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-with-tree-component-with-1-5-2-tp3956513p3997926.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error with tree component with 1.5.2

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I have Maven-ized your quickstart app in the ticket because I don't
use Eclipse WTP.
Unfortunately I wasn't able to reproduce this problem with it.
Please modify it so that it fail.

On Wed, Nov 2, 2011 at 6:58 PM, PDiefent <pd...@csc.com> wrote:
> The same problem occurs if I use a PackageResourceReference as an image model
> and try to update it in an AjaxLink. When erasing the toggleIcon component
> from the target.add method, the error doesn't occur.
>
> /**
>  * @author Peter Diefenthäler
>  * Link to toggle visibility of a dependent component.
>  * <br></br>
>  * Make sure that Component is Ajax enabled:
>  * <pre>comp.setOutputMarkupPlaceholderTag(true);</pre>
>  */
> public class ToggleLink extends AjaxFallbackLink<Boolean> {
>        private static final long serialVersionUID = 1L;
>        private static final Log LOG = LogFactory.getLog(ToggleLink.class);
>        private static final PackageResourceReference RES_MAXIMIZED = new
> PackageResourceReference(ToggleLink.class,"icon_min_container.gif");
>        private static final PackageResourceReference RES_MINIMIZED = new
> PackageResourceReference(ToggleLink.class,"icon_max_container.gif");
>        private final Image toggleIcon = new Image("toggleIcon",new
> PropertyModel<PackageResourceReference>(this,"imgResource"));
>
>        @SuppressWarnings("unused")
>        private PackageResourceReference imgResource;
>        private final Component toggleComp;
>
>        /**
>         * Constructor
>         *
>         * @param id
>         *            Identifier
>         * @param comp
>         *            Content component to toggle visibility of
>         */
>        public ToggleLink(String id, final Component comp) {
>                super(id);
>                this.setDefaultModel(new PropertyModel<Boolean>(comp,"visible"));
>                this.toggleComp = comp;
>                syncImg();
>                add(toggleIcon.setOutputMarkupId(true));
>        }
>
>        @Override
>        public void onClick(AjaxRequestTarget target) {
>                LOG.debug("toggle ...");
>                toggleComp.setVisible(!this.getModel().getObject());
>                syncImg();
>                LOG.debug("visible: " + toggleComp.isVisible());
>                target.add(toggleIcon,toggleComp);
>        }
>
>        private void syncImg() {
>                imgResource =  this.getModel().getObject() ? RES_MAXIMIZED :
> RES_MINIMIZED;
>        }
> }
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-with-tree-component-with-1-5-2-tp3956513p3978018.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error with tree component with 1.5.2

Posted by PDiefent <pd...@csc.com>.
The same problem occurs if I use a PackageResourceReference as an image model
and try to update it in an AjaxLink. When erasing the toggleIcon component
from the target.add method, the error doesn't occur.

/**
 * @author Peter Diefenthäler
 * Link to toggle visibility of a dependent component.
 * <br></br>
 * Make sure that Component is Ajax enabled:
 * <pre>comp.setOutputMarkupPlaceholderTag(true);</pre>  
 */
public class ToggleLink extends AjaxFallbackLink<Boolean> {
	private static final long serialVersionUID = 1L;
	private static final Log LOG = LogFactory.getLog(ToggleLink.class);
	private static final PackageResourceReference RES_MAXIMIZED = new
PackageResourceReference(ToggleLink.class,"icon_min_container.gif");
	private static final PackageResourceReference RES_MINIMIZED = new
PackageResourceReference(ToggleLink.class,"icon_max_container.gif");
	private final Image toggleIcon = new Image("toggleIcon",new
PropertyModel<PackageResourceReference>(this,"imgResource")); 

	@SuppressWarnings("unused")
	private PackageResourceReference imgResource;
	private final Component toggleComp;
	
	/**
	 * Constructor
	 * 
	 * @param id
	 *            Identifier
	 * @param comp
	 *            Content component to toggle visibility of
	 */
	public ToggleLink(String id, final Component comp) {
		super(id);
		this.setDefaultModel(new PropertyModel<Boolean>(comp,"visible"));
		this.toggleComp = comp;
		syncImg();
		add(toggleIcon.setOutputMarkupId(true));
	}

	@Override
	public void onClick(AjaxRequestTarget target) {
		LOG.debug("toggle ...");
		toggleComp.setVisible(!this.getModel().getObject());
		syncImg();
		LOG.debug("visible: " + toggleComp.isVisible());
		target.add(toggleIcon,toggleComp);
	}

	private void syncImg() {
		imgResource =  this.getModel().getObject() ? RES_MAXIMIZED :
RES_MINIMIZED;
	}
}

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-with-tree-component-with-1-5-2-tp3956513p3978018.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org