Package javax.faces.component

Examples of javax.faces.component.UIForm


        {
            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


    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

    public void setUp() throws Exception
    {
        super.setUp();

        UIForm form = new UIForm();

        commandLink = new HtmlCommandLink();
        outputLink = new HtmlOutputLink();
        outputLink.setValue("http://someurl");
        outcomeTargetLink = new HtmlOutcomeTargetLink();

        form.getChildren().add(commandLink);

        writer = new MockResponseWriter(new StringWriter(), null, "UTF-8");
        facesContext.setResponseWriter(writer);
        facesContext.getApplication().setNavigationHandler(new NavigationHandlerImpl());
      


        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.getRenderKit().addRenderer(
                commandLink.getFamily(),
                commandLink.getRendererType(),
                new HtmlLinkRenderer());
        facesContext.getRenderKit().addRenderer(
                form.getFamily(),
                form.getRendererType(),
                new HtmlFormRenderer());
        facesContext.getRenderKit().addRenderer(
                outputLink.getFamily(),
                outputLink.getRendererType(),
                new HtmlLinkRenderer());
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

     */
    @Nullable
     public static UIForm getEnclosingForm(UIComponent component)
         throws IllegalArgumentException
     {
         UIForm ret = null;
         while (component != null)
         {
             if (component instanceof UIForm)
             {
                 if (ret != null)
View Full Code Here

    private String getInitInputsJavaScriptComponentId(AbstractConfigurationComponent configUIComponent) {
        return configUIComponent.getId() + INIT_INPUTS_JAVA_SCRIPT_COMPONENT_ID_SUFFIX;
    }

    private void addPropSetModalPanel(ConfigurationSetComponent configurationSetComponent) {
        UIForm configSetForm = FacesComponentUtility.getEnclosingForm(configurationSetComponent);

        // Add the modal panel as a sibling of the configSet form.
        HtmlModalPanel modalPanel = FacesComponentUtility.createComponent(HtmlModalPanel.class);
        String modalPanelId = ConfigurationSetComponent.getPropSetModalPanelId(configurationSetComponent);
        modalPanel.setId(modalPanelId);
        modalPanel.setWidth(715);
        modalPanel.setHeight(535);
        modalPanel.setTrimOverlayedElements(false);
        modalPanel.setStyle("overflow-y: auto;");
        modalPanel.setOnbeforeshow("sizeAppropriately('configSetForm:" + modalPanelId + "')");
        modalPanel.setOnresize("keepCentered('configSetForm:" + modalPanelId + "')");

        // Insert the modal panel as a sibling of the configSet form, just after the form in the component tree.
        int index = getComponentIndex(configSetForm);
        configSetForm.getParent().getChildren().add(index + 1, modalPanel);

        // Add the propSet form as a child of the modal panel.
        HtmlForm propSetForm = new HtmlForm();
        modalPanel.getChildren().add(propSetForm);
        String propSetFormId = ConfigurationSetComponent.getPropSetFormId(configurationSetComponent);
View Full Code Here

        return configurationSetComponent.getId() + "PropSetForm";
    }

    @Nullable
    public HtmlModalPanel getPropSetModalPanel() {
        UIForm configSetForm = FacesComponentUtility.getEnclosingForm(this);
        return (HtmlModalPanel) configSetForm.getParent().findComponent(getPropSetModalPanelId(this));
    }
View Full Code Here

                propertyDefinitionSimple.isReadOnly(), null, propertySetComponent.getListIndex(), input, false,
                propertySetComponent.getReadOnly(), false);
        }

        // the 'APPLY' button
        UIForm form = FacesComponentUtility.getEnclosingForm(input);
        StringBuilder html = new StringBuilder();
        html.append("<button type='button' class='" + CssStyleClasses.BUTTON_SMALL + "' onclick='");
        if (isOptional(propertyDefinitionSimple)) {
            html.append("setAllValuesForOptionalProperty(new Array(");
            for (PropertyInfo propertyInfo : propertyInfos) {
View Full Code Here

    public void encodeBegin(FacesContext facesContext, UIComponent component)
            throws IOException
    {
        RendererUtils.checkParamValidity(facesContext, component, UIForm.class);

        UIForm htmlForm = (UIForm)component;

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

        writer.startElement(HTML.FORM_ELEM, htmlForm);
        writer.writeAttribute(HTML.ID_ATTR, clientId, null);
        writer.writeAttribute(HTML.NAME_ATTR, clientId, null);
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.