/** * Sets values for form components based on cookie values in the request. * */ final void setFormComponentValuesFromCookies() { // Visit all Forms contained in the page visitChildren(Form.class, new Component.IVisitor() { // For each FormComponent found on the Page (not Form) public Object component(final Component component) { ((Form)component).loadPersistentFormComponentValues(); return CONTINUE_TRAVERSAL; } }); }
/** * Sets values for form components based on cookie values in the request. * */ final void setFormComponentValuesFromCookies() { // Visit all Forms contained in the page visitChildren(Form.class, new Component.IVisitor<Component>() { // For each FormComponent found on the Page (not Form) public Object component(final Component component) { ((Form<?>)component).loadPersistentFormComponentValues(); return CONTINUE_TRAVERSAL; } }); }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE. * * @see org.apache.wicket.Component#internalOnModelChanged() */ @Override protected final void internalOnModelChanged() { visitChildren(new IVisitor<Component, Void>() { @Override public void component(final Component component, final IVisit<Void> visit) { // If form component is using form model if (component.sameInnermostModel(Page.this)) { component.modelChanged(); } } }); }
/** * Atualiza todos os componentes vinculados as instancias informadas */ private static void updateBoundedComponents(Page page, AjaxRequestTarget target, List<SInstance> instances) { page.visitChildren(Component.class, new SInstanceBoundedComponentUpdateVisitor(target, instances)); }
public static void refreshFeedback(final AjaxRequestTarget target) { Page page = WicketUtils.getPage(); if (page == null || target == null) { return; } page.visitChildren(IFeedback.class, new IVisitor<Component, Void>() { @Override public void component(Component component, IVisit<Void> visit) { if (component.getOutputMarkupId()) { target.add(component); } } }); }
/** * Called to update feedback panels. * * @param target the Ajax target, which may be null if not in an Ajax context. * @param form the form that was submitted. * @param bean the bean that the button corresponds to. */ protected void updateFeedbackPanels(final AjaxRequestTarget target) { getPage().visitChildren(IFeedback.class, new IVisitor() { public Object component(Component component) { target.addComponent(component); return IVisitor.CONTINUE_TRAVERSAL; } }); } }
/** * Called when the form inside the dialog breaks. By default adds all feedback * panels to the target * to the * @param target * @param form */ public void onError(final AjaxRequestTarget target, Form form) { form.getPage().visitChildren(IFeedback.class, new IVisitor() { public Object component(Component component) { if(component.getOutputMarkupId()) target.addComponent(component); return IVisitor.CONTINUE_TRAVERSAL; } }); }
/** * Adds all feedback panels on the page to the ajax request target so they are updated * * @param target */ private void addFeedbackPanels(final AjaxRequestTarget target) { getComponent().getPage().visitChildren(IFeedback.class, new IVisitor() { public Object component(Component component) { target.addComponent(component); return IVisitor.CONTINUE_TRAVERSAL; } }); }
/** * Adds all feedback panels on the page to the ajax request target so they are updated * * @param target */ private void addFeedbackPanels(final AjaxRequestTarget target) { getComponent().getPage().visitChildren(IFeedback.class, new IVisitor<Component>() { public Object component(Component component) { target.addComponent(component); return IVisitor.CONTINUE_TRAVERSAL; } }); }
private List<String> findSimilarComponents(final String id) { final List<String> names = Generics.newArrayList(); Page page = findPage(); if (page != null) { page.visitChildren(new IVisitor<Component, Void>() { @Override public void component(Component component, IVisit<Void> visit) { if (Strings.getLevenshteinDistance(id.toLowerCase(Locale.ROOT), component.getId() .toLowerCase(Locale.ROOT)) < 3) { names.add(component.getPageRelativePath()); } } }); } return names; }
/** * @param component */ private void checkFacebookRoot(final Component component) { Boolean found = component.getPage().visitChildren(FacebookRootProvider.class, (object, visit) -> visit.stop(true)); if (found == null) throw new MissingFacebookRootException(); }
@Override protected void respond(AjaxRequestTarget target) { getComponent().getPage().visitChildren((component, visit) -> { if (SINGULAR_JS_BEAHAVIOR_UPDATE_REGION.equals(component.getId())) { target.add(component); visit.stop(); } }); }
@Override protected void respond(AjaxRequestTarget target) { getComponent().getPage().visitChildren((component, visit) -> { if (SINGULAR_JS_BEAHAVIOR_UPDATE_REGION.equals(component.getId())) { target.add(component); visit.stop(); } }); }
/** * Called when the form inside the dialog breaks. By default adds all feedback panels to the * target * * @param target * @param form */ public void onError(final AjaxRequestTarget target, Form<?> form) { form.getPage() .visitChildren( IFeedback.class, (component, visit) -> { if (component.getOutputMarkupId()) { target.add(component); } }); }
@Override protected void respond(AjaxRequestTarget target) { getComponent().getPage().visitChildren((component, visit) -> { if (SINGULAR_JS_BEAHAVIOR_UPDATE_REGION.equals(component.getId())) { target.add(component); visit.stop(); } }); }
@Override protected void respond(AjaxRequestTarget target) { getComponent().getPage().visitChildren((component, visit) -> { if ("tabela".equals(component.getId())) { target.add(component); visit.stop(); } }); }
protected Component findComponentById(String id) { if (id == null) return null; MarkupIdVisitor visitor = new MarkupIdVisitor(id); getBehavior().getBehaviorComponent().getPage().visitChildren(visitor); return visitor.getFoundComponent(); }
protected String buildUrl() { final BrixPageParameters parameters = new BrixPageParameters(getInitialParameters()); getPage().visitChildren(PageParametersAware.class, new IVisitor<Component, PageParametersAware>() { @Override public void component(Component component, IVisit<PageParametersAware> pageParametersAwareIVisit) { ((PageParametersAware) component).contributeToPageParameters(parameters); } }); contributeToPageParameters(parameters); return constructUrl(parameters); }
protected IRequestHandler getRequestHandler() { final BrixPageParameters parameters = new BrixPageParameters(getInitialParameters()); getPage().visitChildren(PageParametersAware.class, new IVisitor<Component, PageParametersAware>() { public void component(Component component, IVisit<PageParametersAware> pageParametersAwareIVisit) { ((PageParametersAware) component).contributeToPageParameters(parameters); } }); contributeToPageParameters(parameters); IRequestHandler target = new BrixNodeRequestHandler((BrixNodeWebPage) getPage(), parameters); return target; }
protected IRequestHandler getRequestHandler() { final BrixPageParameters parameters = new BrixPageParameters(getInitialParameters()); getPage().visitChildren(PageParametersAware.class, new IVisitor<Component, PageParametersAware>() { @Override public void component(Component component, IVisit<PageParametersAware> pageParametersAwareIVisit) { ((PageParametersAware) component).contributeToPageParameters(parameters); } }); contributeToPageParameters(parameters); IRequestHandler target = new BrixNodeRequestHandler((BrixNodeWebPage) getPage(), parameters); return target; }