public boolean isListenerForSource(final Object source) { if (!(source instanceof UIForm)) { return false; } FacesContext facesContext = FacesContext.getCurrentInstance(); if (!EnvUtils.isICEfacesView(facesContext)) { return false; } UIForm htmlForm = (UIForm) source; String componentId = htmlForm.getId() + ID_SUFFIX; if (!partialStateSaving) { for (UIComponent child : htmlForm.getChildren()) { String id = child.getId(); if ((null != id) && id.endsWith(ID_SUFFIX)) { return false; } } } // Guard against duplicates within the same JSF lifecycle for (UIComponent comp : htmlForm.getChildren()) { if (componentId.equals(comp.getId())) { return false; } } return true; } }
for (UIComponent child : htmlForm.getChildren()) { String id = child.getId(); if (null != id && id.endsWith(CAPTURE_SUBMIT_SUFFIX)) { for (UIComponent comp : htmlForm.getChildren()) { if (componentId.equals(comp.getId())) { return false;
scriptWriter.setId(componentId); scriptWriter.setTransient(true); form.getChildren().add(0, scriptWriter); form.getChildren().add(disabledWriter); form.setInView(true);
for (UIComponent child : form.getChildren()) { String id = child.getId(); if ((null != id) && id.endsWith(ID_SUFFIX)) { urlOutput.setId(fileEntry.getId() + ENCODED_URL_ID); urlOutput.setTransient(true); form.getChildren().add(0, urlOutput); output.setId(fileEntry.getId() + IFRAME_ID); output.setTransient(true); form.getChildren().add(1, output); form.setInView(true);
UIComponent child = getChildren().get(i); child.processValidators(context);
UIComponent child = getChildren().get(i); child.processDecodes(context);
output.setId(componentId); form.setInView(false); form.getChildren().add(0, output); form.setInView(true);
UIComponent child = getChildren().get(i); child.processUpdates(context);
UIComponent child = getChildren().get(i); if (child.visitTree(context, callback))
protected void setUp() throws Exception { this.jsfMock.setUp(); this.jsfMock.facesContext().getApplication().setViewHandler(new MockViewHandler()); this.jsfMock.facesContext().setResponseWriter(new MockResponseWriter(this.output, null, null)); UIViewRoot viewToRender = new UIViewRoot(); viewToRender.setRenderKitId("HTML_BASIC"); viewToRender.setViewId(VIEW_ID); this.jsfMock.facesContext().setViewRoot(viewToRender); UIForm form = new HtmlForm(); form.setId("myForm"); UIInput input = new HtmlInputText(); input.setId("foo"); form.getChildren().add(input); viewToRender.getChildren().add(form); RequestContextHolder.setRequestContext(this.context); EasyMock.expect(this.context.getExternalContext()).andStubReturn(this.extContext); EasyMock.expect(this.context.getFlashScope()).andStubReturn(this.flashScope); EasyMock.expect(this.context.getFlowScope()).andStubReturn(this.flowMap); EasyMock.expect(this.context.getFlowExecutionContext()).andStubReturn(this.flowExecutionContext); EasyMock.expect(this.flowExecutionContext.getKey()).andStubReturn(this.key); this.view = new JsfView(viewToRender, this.jsfMock.lifecycle(), this.context); }