Hi Martin,

I have created a quickstart and filed an issue (WICKET-4551). Thank you for 
your help.

J.

On 10.05.2012 10:17, Martin Grigorov wrote:
Hi,

I'd say that it is by design.
Component#canCallListenerInterface(Method) has been added recently
because a user wanted its image to be shown in a disabled panel.
File a ticket with a quickstart with the code from your earlier mail
and I'll try to find what is the problem.


On Thu, May 10, 2012 at 10:16 AM, Jürgen Lind<juergen.l...@iteratec.de>  wrote:
Since no further replies to this issue came up, the question remains whether
this is "works as
design" or a bug. Should I file an issue on this? And could maybe one of the
developers explain
why the Component#isEnabledInhierarchy is final? After reading some core
code, I would guess that
maybe overriding that method could achieve the intended behavior...

J.


On 09.05.2012 16:36, Jürgen Lind wrote:

Ok, I stripped down everything to a very basic setup that should work
according to Martins
suggestions and the wicket documentation. Any ideas why
canCallListenerInterface is never called
here?

J.

import java.lang.reflect.Method;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;


public class SandboxPage extends WebPage {

    public SandboxPage() {
      WebMarkupContainer container = new WebMarkupContainer("container") {
        @Override
        public boolean isEnabled() {
          return false;
        }
      };
      AjaxLink<Void>    link = new AjaxLink<Void>("link") {
        @Override
        protected boolean isLinkEnabled() {
          System.out.println(".... le");
          return true;
        }

        @Override
        public boolean canCallListenerInterface(Method method) {
          System.out.println(".... cc");
          return true;
        }

        @Override
        public boolean isEnabled() {
          System.out.println(".... ie");
          return true;
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
          System.out.println("clicked...");
        }
      };

      container.add(link);
      this.add(container);
    }
}

<?xml version="1.0" encoding="utf-8"?>
<html>
      <div wicket:id="container">
        <div wicket:id="link">Click me!</div>
      </div>
</html>


On 09.05.2012 14:29, Jürgen Lind wrote:

Hi Martin,

thanks for the hint, unfortunatly, it does not work :-( I've been looking
through the relevant
code and the approach seems right, however at some point, the returned
values seem to be ignored
and the link is still disabled (i.e. the onclick-handler is not
rendered)... I will have to
investigate further...

J.

On 09.05.2012 13:05, Martin Grigorov wrote:

Hi,

I think it is possible to do that for links.
You'll need to override
org.apache.wicket.markup.html.link.AbstractLink#isLinkEnabled() and
org.apache.wicket.Component#canCallListenerInterface(Method)

The first is needed to not render the link as disabled. The second is
needed to be able to actually execute the links logic.

The second method is added in 1.5.x.

On Wed, May 9, 2012 at 1:47 PM, Jürgen Lind<juergen.l...@iteratec.de>
  wrote:

Hi Martin,

that was my initial approach. However, I would like the collapsible
panels
to keep their
state between form submits, therefore I would need some sort of
Javascript
state management
or I would simply use ajax links for that purpose. Which is what I
would
prefer... A later
post already mentioned that this wont be too easy, so maybe I will have
to
go back to JS...

J.


On 09.05.2012 11:16, Martin Grigorov wrote:


Hi,

Why don't use plain Javascript for this. It will be faster because it
wont make roundtrip to the server and wont be disabled as a Wicket
component ?

On Wed, May 9, 2012 at 12:06 PM, Jürgen Lind<juergen.l...@iteratec.de>
wrote:


Hi,

I have a little problem in my application and maybe someone has an
idea
how
to solve it:
I have a complex form that is structured using a custom collapsible
AJAX-panel to show/hide
certain parts of the form. Now, if a user does not have the write
permission
for the form, the
form is disabled and therefore all input elements as well (which is
good).
However, for
obvious reaons, I would like the collapsible panels to remain
enabled.
How
could I achieve
this? I have already tried to have the ajax-link for the panel to
always
return true from
isEnabled, but that seems to be overriden by the parent component.
Any
ideas
where to look?

Cheers,

Jürgen


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






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







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



--
Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbH                Fon: +49 (0)89 614551-44
Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
82008 Unterhaching           Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel


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






Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbH                Fon: +49 (0)89 614551-44
Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
82008 Unterhaching           Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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

Reply via email to