The exception is thrown when this = content and path = myForm:enumChoice
It seems the content has no other children as it only contains a parent member field

I already tested the stateful version and can confirm it works OK which made me hope I could write a similar version for stateless pages as well.

Am 06.12.2012 13:00, schrieb Martin Grigorov:
On Thu, Dec 6, 2012 at 12:57 PM, Karsten Gaul <karsten.g...@exedio.com>wrote:

Hi Martin,

myContent is the id of the StatelessAjaxLazyLoadPanel which contains a
constant

private static final String LAZY_LOAD_COMPONENT_ID = "content";

which is used in getLazyLoadComponent(String markupId). 'myContent'
contains the lazy load component 'content'.

StatelessAjaxLazyLoadComponent is added to a WebMarkupContainer which
itself is added to MyPage.

If you look at the source of AjaxLazyLoadPanel the 'content' (added in
onBeforeRender) is replaced in the respond method of the Behavior. Could
that be the reason why it is not a container?

The default (stateful) version works OK, so the problem seems to be that
when the Ajax call is made a new page is created (this is what stateless
means) and when it tries to find the lazy panel or its component (I'm not
sure which one) it fails to find it.
The debugger will tell you what exactly happens.


Regards,
Karsten

Am 06.12.2012 12:37, schrieb Martin Grigorov:

On Thu, Dec 6, 2012 at 11:53 AM, Karsten Gaul <karsten.g...@exedio.com>**
wrote:

  Trying to:
/// StatelessAbstractDefaultAjaxBe****havior ///


@Override
      public CharSequence getCallbackUrl(final boolean
onlyTargetActivePage)
      {
          final CharSequence url = super.getCallbackUrl(**

onlyTargetActivePage);
          final PageParameters params = getPageParameters();
          // NOTE: quick hack to remove old and obsolete "random"
parameter
from request (see wicket-ajax.js)
          if (params!=null && params.containsKey("random"))
              params.remove("random");
          return StatelessEncoder.****appendParameters(url, params);

      }

StatelessEncoder appends params to WebRequestEncoder
stateless hint -> true
In the StatelessAjaxLazyLoadPanel I'm using this Behavior instead of the
usual AbstractDefaultAjaxBehavior

/// My Page ///

onInitialize()
{
      add( new StatelessAjaxLazyLoadPanel("****myContent")

  Here we see "myContent" id.

           {
              private static final long serialVersionUID = 1L;

              @Override
              public Component getLazyLoadComponent( String markupId )
              {
                  return new MyContentPanel( markupId );
              }

              @Override
              public PageParameters getPageParameters()
              {
                  return pageParameters;
              }
          } );
}

/// MyContentPanel ///

Form form = new Form("myForm");
form.add( new DropDownChoice<Enum>("****enumChoice"));
add(form);


java.lang.****IllegalArgumentException: Component is not a container
and so
does not contain the path myForm:enumChoice:

[Component id = content]

  Here it complains about "content". What is the relation between
'myContent'
and 'content'  component ?

Which component adds the StatelessAjaxLazyLoadPanel ?


        at org.apache.wicket.Component.****get(Component.java:4500)
  Put a breakpoint here and see what is in the context. What is 'this',
what
in its 'children' member field.
'myForm' has children with 'enumChoice' inside, then 'enumChoce' becomes
'this and you need to see how to get to the lazy load panel and its lazy
load component.


        at org.apache.wicket.****MarkupContainer.get(**
MarkupContainer.java:354)
      at org.apache.wicket.****MarkupContainer.get(****
MarkupContainer.java:354)
      at org.apache.wicket.****MarkupContainer.get(****
MarkupContainer.java:354)
      at org.apache.wicket.****MarkupContainer.get(****
MarkupContainer.java:354)
      at org.apache.wicket.****MarkupContainer.get(****
MarkupContainer.java:354)
      at org.apache.wicket.****MarkupContainer.get(****
MarkupContainer.java:354)


Would that be sufficient?

Thanks,
Karsten


Am 06.12.2012 11:30, schrieb Martin Grigorov:

  Show us some code and the real exception.

On Thu, Dec 6, 2012 at 11:26 AM, Karsten Gaul <karsten.g...@exedio.com
**
wrote:

   Hi guys,

I still have no clue. Any suggestions? A work-around would also be much
appreciated. I need to stay stateless but I definetely need this lazy
loading as I have to wait for a soap response every 10 mins and for
user
experience issues need to display some loading component/icon as
provided
by AjaxLazyLoadPanel.

Thanks,
Karsten

Am 05.12.2012 09:38, schrieb Karsten Gaul:

    Hi,

  I'm trying to use the functionality of an AjaxLazyLoadPanel in a
stateless page but this doesn't seem to work as the injected content
is
not
a container and the following exception is thrown:

java.lang.******IllegalArgumentException: Component is not a
container
and
so does not contain the path componentid:******containedcomponentid:

[Component id = content]

        at org.apache.wicket.Component.******get(Component.java:4500)
        at org.apache.wicket.******MarkupContainer.get(**
MarkupContainer.java:354)


I wrote a StatelessAbstractDefaultAjaxBe******havior overriding


geCallbackUrl which I use in my StatelessAjaxLazyLoadPanel.

This doesn't seem to be the way. Anyone have any hints?

Thanks,
Karsten


------------------------------******--------------------------**--**
--**---------
To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
http://apache.org**>
<users-unsubscribe@**wicket.**apache.org <http://wicket.apache.org><
users-unsubscribe@**wicket.apache.org<users-unsubscr...@wicket.apache.org>
For additional commands, e-mail: users-h...@wicket.apache.org


   ------------------------------******--------------------------**
--**

--**---------
To unsubscribe, e-mail: users-unsubscribe@wicket.****apa**che.org<
http://apache.org**>
<users-unsubscribe@**wicket.**apache.org <http://wicket.apache.org><
users-unsubscribe@**wicket.apache.org<users-unsubscr...@wicket.apache.org>
For additional commands, e-mail: users-h...@wicket.apache.org




------------------------------**------------------------------**---------
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.org<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

Reply via email to