Examples of UIForm


Examples of javax.faces.component.UIForm

    /**
     * Returns a mode of Focus component
     */
    public Mode getMode() {
        UIForm form = (UIForm) RendererUtils.getInstance().getNestingForm(this);
        if (form == null) {
            return Mode.VIEW;
        }

        return Mode.FORM;
View Full Code Here

Examples of javax.faces.component.UIForm

    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(facesContext, htmlForm);
        String actionURL = getActionUrl(facesContext, htmlForm);
        String method = getMethod(facesContext, htmlForm);

        writer.startElement(HTML.FORM_ELEM, htmlForm);
View Full Code Here

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);
        }
       
        HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
    }
View Full Code Here

Examples of javax.faces.component.UIForm

        while (parent != null && !(parent instanceof UIForm))
        {
            parent = parent.getParent();
        }

        UIForm nestingForm = null;
        String formName;
        DummyFormResponseWriter dummyFormResponseWriter;
        if (parent != null)
        {
            //link is nested inside a form
            nestingForm = (UIForm)parent;
            formName = nestingForm.getClientId(facesContext);
            dummyFormResponseWriter = null;
        }
        else
        {
            //not nested in form, we must add a dummy form at the end of the document
View Full Code Here

Examples of javax.faces.component.UIForm

     */
    private void writeBackground(FacesContext context, HtmlPlanner planner,
            ResponseWriter writer) throws IOException
    {
        //a planner component should always be inside a UIForm
        UIForm parentForm = getParentForm(planner);

        if (parentForm == null)
        {
            throw new NullPointerException("No parent UIForm found");
        }
View Full Code Here

Examples of javax.faces.component.UIForm

     * @throws IOException when the entries could not be drawn
     */
    protected void writeEntries(FacesContext context, HtmlSchedule schedule,
            ScheduleDay day, ResponseWriter writer) throws IOException
    {
        UIForm parentForm = getParentForm(schedule);
        TreeSet entrySet = new TreeSet(comparator);

        for (Iterator entryIterator = day.iterator(); entryIterator.hasNext();)
        {
            ScheduleEntry entry = (ScheduleEntry) entryIterator.next();
            entrySet.add(entry);
        }

        for (Iterator entryIterator = entrySet.iterator(); entryIterator
                .hasNext();)
        {
            ScheduleEntry entry = (ScheduleEntry) entryIterator.next();
            writer.startElement(HTML.TR_ELEM, schedule);
            writer.startElement(HTML.TD_ELEM, schedule);

            if (isSelected(schedule, entry))
            {
                writer.writeAttribute(HTML.CLASS_ATTR, "selected", null);
            }

            writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%", null);

            //draw the tooltip
            if (showTooltip(schedule))
            {
                writer.writeAttribute("onmouseover", getTooltipText(entry,
                        schedule), null);
            }

            if (!isSelected(schedule, entry) && !schedule.isReadonly())
            {
                writer.startElement("a", schedule);
                writer.writeAttribute("href", "#", null);

                String clientId = schedule.getClientId(context);
                StringBuffer mousedown = new StringBuffer();
                mousedown.append("document.forms['");
                mousedown.append(parentForm.getClientId(context));
                mousedown.append("']['");
                mousedown.append(clientId);
                mousedown.append("'].value='");
                mousedown.append(entry.getId());
                mousedown.append("'; document.forms['");
                mousedown.append(parentForm.getClientId(context));
                mousedown.append("'].submit()");
                writer
                        .writeAttribute("onmousedown", mousedown.toString(),
                                null);
            }
View Full Code Here

Examples of javax.faces.component.UIForm

    private void writeBackground(FacesContext context, HtmlSchedule schedule,
            ResponseWriter writer) throws IOException
    {
        //a calendar component should always be inside a UIForm
        UIForm parentForm = getParentForm(schedule);

        if (parentForm == null)
        {
            throw new NullPointerException("No parent UIForm found");
        }
View Full Code Here

Examples of javax.faces.component.UIForm

        maximizeEntries(entries, numberOfColumns);

        //now determine the width in percent of 1 column
        float columnWidth = 100 / numberOfColumns;

        UIForm parentForm = getParentForm(schedule);

        //and now draw the entries in the columns
        for (Iterator entryIterator = entrySet.iterator(); entryIterator
                .hasNext();)
        {
            EntryWrapper wrapper = (EntryWrapper) entryIterator.next();

            if (isSelected(schedule, wrapper))
            {
                writer.startElement(HTML.DIV_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, "entry-selected", null);
                writer.writeAttribute(HTML.STYLE_ATTR, wrapper.getBounds(
                        schedule, columnWidth), null);

                //draw the tooltip
                if (showTooltip(schedule))
                {
                    writer.writeAttribute("onmouseover", getTooltipText(
                            wrapper.entry, schedule), null);
                }

                //draw the contents of the selected entry
                writer.startElement(HTML.DIV_ELEM, null);
                writer.writeAttribute(HTML.CLASS_ATTR, "text", null);
                writer.writeAttribute(HTML.STYLE_ATTR,
                        "height: 100%; width: 100%;", null);
                writer.startElement(HTML.SPAN_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, "title", null);
                writer.writeText(wrapper.entry.getTitle(), null);
                writer.endElement(HTML.SPAN_ELEM);
                writer.startElement("br", schedule);
                writer.endElement("br");
                writer.startElement(HTML.SPAN_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, "subtitle", null);
                writer.writeText(wrapper.entry.getSubtitle(), null);
                writer.endElement(HTML.SPAN_ELEM);
                writer.endElement(HTML.DIV_ELEM);
                writer.endElement(HTML.DIV_ELEM);
            }
            else
            {
                //if the schedule is read-only, the entries should not be
                //hyperlinks
                writer.startElement(
                        schedule.isReadonly() ? HTML.DIV_ELEM : "a", schedule);

                //draw the tooltip
                if (showTooltip(schedule))
                {
                    writer.writeAttribute("onmouseover", getTooltipText(
                            wrapper.entry, schedule), null);
                }

                if (!schedule.isReadonly())
                {
                    writer.writeAttribute("href", "#", null);

                    String clientId = schedule.getClientId(context);
                    StringBuffer mousedown = new StringBuffer();
                    mousedown.append("document.forms['");
                    mousedown.append(parentForm.getClientId(context));
                    mousedown.append("']['");
                    mousedown.append(clientId);
                    mousedown.append("'].value='");
                    mousedown.append(wrapper.entry.getId());
                    mousedown.append("'; document.forms['");
                    mousedown.append(parentForm.getClientId(context));
                    mousedown.append("'].submit()");
                    writer.writeAttribute("onmousedown", mousedown.toString(),
                            null);
                }
View Full Code Here

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

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);
        }
       
        HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.