Package javax.faces.component

Examples of javax.faces.component.UIForm


    public void encodeBegin(FacesContext facesContext, UIComponent component)
            throws IOException
    {
        org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, component, UIForm.class);

        UIForm htmlForm = (UIForm)component;

        ResponseWriter writer = facesContext.getResponseWriter();
        String clientId = htmlForm.getClientId(facesContext);
        String acceptCharset = getAcceptCharset(facesContext, htmlForm);
        String actionURL = getActionUrl(facesContext, htmlForm);
        String method = getMethod(facesContext, htmlForm);

        Map<String, List<ClientBehavior>> behaviors = null;
View Full Code Here


        {
            return;
        }
        */

        UIForm htmlForm = (UIForm)component;

        Map paramMap = facesContext.getExternalContext().getRequestParameterMap();
        String submittedValue = (String)paramMap.get(component.getClientId(facesContext) +
                                                     HIDDEN_SUBMIT_INPUT_SUFFIX);
        if (submittedValue != null && submittedValue.equals(HIDDEN_SUBMIT_INPUT_VALUE))
        {
            htmlForm.setSubmitted(true);
        }
        else
        {
            htmlForm.setSubmitted(false);
        }
       
        HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
    }
View Full Code Here

            input.setId("var1");
           
            HtmlCommandButton button = new HtmlCommandButton();
            button.setId("button1");
           
            UIForm form = new HtmlForm();
            form.setId("form1");
           
            form.getChildren().add(output);
            form.getChildren().add(input);
            form.getChildren().add(button);
            viewRoot.getChildren().add(form);
           
            markInitialState(viewRoot);
        }
View Full Code Here

    }
   
    public void testWhenSubmittedValueIsNullDefaultShouldDissapearFromRendering() {
        //See MYFACES-2161 and MYFACES-1549 for details
        UIViewRoot root = new UIViewRoot();
        UIForm form = new UIForm();
        form.setId("formId");
       
        form.getChildren().add(inputText);
        root.getChildren().add(form);
       
        Converter converter = new Converter()
        {
            public Object getAsObject(FacesContext context,
View Full Code Here

    public void encodeBegin(FacesContext facesContext, UIComponent component)
            throws IOException
    {
        org.apache.myfaces.shared_impl.renderkit.RendererUtils.checkParamValidity(facesContext, component, UIForm.class);

        UIForm htmlForm = (UIForm)component;

        ResponseWriter writer = facesContext.getResponseWriter();
        String clientId = htmlForm.getClientId(facesContext);
        String acceptCharset = getAcceptCharset(htmlForm);
        String actionURL = getActionUrl(facesContext);

        writer.startElement(HTML.FORM_ELEM, htmlForm);
        writer.writeAttribute(HTML.ID_ATTR, clientId, null);
View Full Code Here

        {
            return;
        }
        */

        UIForm htmlForm = (UIForm)component;

        Map paramMap = facesContext.getExternalContext().getRequestParameterMap();
        String submittedValue = (String)paramMap.get(component.getClientId(facesContext) +
                                                     HIDDEN_SUBMIT_INPUT_SUFFIX);
        if (submittedValue != null && submittedValue.equals(HIDDEN_SUBMIT_INPUT_VALUE))
        {
            htmlForm.setSubmitted(true);
        }
        else
        {
            htmlForm.setSubmitted(false);
        }
    }
View Full Code Here

       
        // Add a component in order to trigger a dynamic update
        UIOutput testComponent = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
        testComponent.setId("testId");
        testComponent.setValue("Some Text");
        UIForm form = (UIForm) facesContext.getViewRoot().findComponent("mainForm");
        form.getChildren().add(testComponent);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPage.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        ViewEntry entry = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNotNull(entry);
        Assert.assertEquals(RestoreViewFromPoolResult.COMPLETE, entry.getResult());
       
        //Check the component was removed
        UIForm form2 = (UIForm) entry.getViewRoot().findComponent("mainForm");
        Assert.assertNotNull(form2);
        UIOutput testComponent2 = (UIOutput) form2.findComponent("testId");
        Assert.assertNull(testComponent2);
       
        tearDownRequest();
    }
View Full Code Here

       
        // Add a component in order to trigger a dynamic update
        UIOutput testComponent = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
        testComponent.setId("testId");
        testComponent.setValue("Some Text");
        UIForm form = (UIForm) facesContext.getViewRoot().findComponent("mainForm");
        form.getChildren().add(testComponent);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPage.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        ViewEntry entry = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNotNull(entry);
        Assert.assertEquals(RestoreViewFromPoolResult.COMPLETE, entry.getResult());
       
        //Check the component was removed
        UIForm form2 = (UIForm) entry.getViewRoot().findComponent("mainForm");
        Assert.assertNotNull(form2);
        UIOutput testComponent2 = (UIOutput) form2.findComponent("testId");
        Assert.assertNull(testComponent2);
       
        tearDownRequest();
    }
View Full Code Here

        executeBuildViewCycle(facesContext);
       
        // Now let's try to remove some component programatically
        // that invalidates the view to be reused without a refresh,
        // so in the pool it should be marked as REFRESH_REQUIRED
        UIForm form = (UIForm) facesContext.getViewRoot().findComponent("mainForm");
        form.getChildren().remove(0);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

        executeBuildViewCycle(facesContext);
       
        // Now let's try to remove some component programatically
        // that invalidates the view to be reused without a refresh,
        // so in the pool it should be marked as REFRESH_REQUIRED
        UIForm form = (UIForm) facesContext.getViewRoot().findComponent("mainForm");
        UIComponent panel = form.getChildren().remove(0);
        // Add it again
        form.getChildren().add(panel);
       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        UIViewRoot root = new UIViewRoot();
View Full Code Here

TOP

Related Classes of javax.faces.component.UIForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.