Ok. Problem is if component becomes invisible and needs to be removed from
server side,,....

On Mon, Mar 9, 2020 at 4:56 PM Ernesto Reinaldo Barreiro <reier...@gmail.com>
wrote:

> Hi,
>
> In our application we have some logic that looks for certain panels and
> adds them to ART using ART.addChildren. Problem we face here is: some of
> those panels might not be visible or have a  representation of them at
> client side. I'm not sure if condition bellow, about using
> isVisibleInHierarchy, is bulletproof (or correct) but a helper function as
> below seems to get rid of all client side "id not found" warnings. Is this
> something we can improve in wicket core?
>
> *public static void *addChildren(IPartialPageRequestHandler target,
> MarkupContainer parent, Class<?> childCriteria)
> {
> Args.*notNull*(parent, *"parent"*);
> Args.*notNull*(childCriteria, *"childCriteria"*);
>
> parent.visitChildren(childCriteria, *new *IVisitor<Component, Void>()
> {
> @Override
> *public void *component(*final *Component component, *final *IVisit<Void>
> visit)
> {
> *if *(component.isVisibleInHierarchy()) {
> target.add(component);
> }
> visit.dontGoDeeper();
> }
> });
> }
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


-- 
Regards - Ernesto Reinaldo Barreiro
  • addChildren in ART` Ernesto Reinaldo Barreiro
    • Re: addChildren in ART` Ernesto Reinaldo Barreiro

Reply via email to