Package org.apache.myfaces.shared_tomahawk.renderkit.html.util

Examples of org.apache.myfaces.shared_tomahawk.renderkit.html.util.FormInfo


        }

        HtmlSchedule schedule = (HtmlSchedule) component;
        ResponseWriter writer = context.getResponseWriter();
        String clientId = schedule.getClientId(context);
        FormInfo parentFormInfo = RendererUtils.findNestingForm(schedule, context);
        String formId = parentFormInfo == null ? null : parentFormInfo.getFormName();

        for (Iterator dayIterator = schedule.getModel().iterator(); dayIterator
                .hasNext();)
        {
            ScheduleDay day = (ScheduleDay) dayIterator.next();
View Full Code Here


        writer.endElement(HTML.TD_ELEM);
        writer.startElement(HTML.TD_ELEM, schedule);
        writer.writeAttribute(HTML.STYLE_ATTR, "width: 99%; vertical-align: top;", null);

        final String clientId = schedule.getClientId(context);
        FormInfo parentFormInfo = RendererUtils.findNestingForm(schedule, context);
        String formId = parentFormInfo == null ? null : parentFormInfo.getFormName();

        final int rowHeight = getRowHeight(schedule);
        final int headerHeight = rowHeight + 9;
        writer.startElement(HTML.DIV_ELEM, schedule);
        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
View Full Code Here

    protected void writeEntries(FacesContext context, HtmlSchedule schedule,
            ScheduleDay day, ResponseWriter writer) throws IOException
    {
        final String clientId = schedule.getClientId(context);
        FormInfo parentFormInfo = RendererUtils.findNestingForm(schedule, context);
        String formId = parentFormInfo == null ? null : parentFormInfo.getFormName();

        TreeSet entrySet = new TreeSet();

        for (Iterator entryIterator = day.iterator(); entryIterator.hasNext();)
        {
View Full Code Here

    public void decode(FacesContext facesContext, UIComponent component) {
        super.decode(facesContext, component)//check for NP

        if (component instanceof UICommand) {
            String clientId = component.getClientId(facesContext);
            FormInfo formInfo = findNestingForm(component, facesContext);
            String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
                HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo));
            if (reqValue != null && reqValue.equals(clientId)) {
                component.queueEvent(new ActionEvent(component));
View Full Code Here

                                               ResponseWriter writer,
                                               UIComponent component,
                                               String clientId)
        throws IOException {
        //Find form
        FormInfo formInfo = findNestingForm(component, facesContext);
        if (formInfo == null) {
            String path = RendererUtils.getPathToComponent(component);
            String msg = "Link is not embedded in a form. Change component/tag '" + clientId + "' from javax.faces.*/<h:tagName /> " +
                "to org.apache.myfaces.*/<t:tagName />, or embed it in a form.  This is not a bug. " +
                "Please see: http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3 " +
                "The path to this component is " + path + ". If you need to render a special form and a JSF-form's attributes are not enough," +
                "consider using the s:form tag of the MyFaces sandbox.";
            throw new IllegalArgumentException(msg);
        }
        UIComponent nestingForm = formInfo.getForm();
        String formName = formInfo.getFormName();

        StringBuffer onClick = new StringBuffer();

        String commandOnclick;
        if (component instanceof HtmlCommandLink) {
            commandOnclick = ((HtmlCommandLink) component).getOnclick();
        }
        else {
            commandOnclick = (String) component.getAttributes().get(HTML.ONCLICK_ATTR);
        }
        if (commandOnclick != null) {
            onClick.append(commandOnclick);
            onClick.append(';');
        }

        if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm())) {
            onClick.append("submitForm('");
            onClick.append(formInfo.getForm().getClientId(facesContext));
            onClick.append("',1,{source:'");
            onClick.append(component.getClientId(facesContext));
            onClick.append("'");
            // See Jira Issue 1809 https://issues.apache.org/jira/browse/MYFACES-1809
            onClick.append(getChildParametersTrinidad(component));
View Full Code Here

        HtmlRendererUtils.writePrettyLineSeparator(facesContext);

        int selectedIndex = tabbedPane.getSelectedIndex();

        FormInfo parentFormInfo = RendererUtils.findNestingForm(tabbedPane, facesContext);
        if (parentFormInfo == null)
        {
            writeFormStart(writer, facesContext, tabbedPane);
        }
View Full Code Here

        super.decode(facesContext, component)//check for NP

        if (component instanceof UICommand)
        {
            String clientId = component.getClientId(facesContext);
            FormInfo formInfo = findNestingForm(component, facesContext);
            if (formInfo != null)
            {
                String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
                        HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo));
                if (reqValue != null && reqValue.equals(clientId)
View Full Code Here

        if (component instanceof UICommand)
        {
            renderCommandLinkEnd(facesContext, component);

            FormInfo formInfo = findNestingForm(component, facesContext);
           
            if (formInfo != null)
            {
                HtmlFormRendererBase.renderScrollHiddenInputIfNecessary(
                        formInfo.getForm(), facesContext, facesContext.getResponseWriter());
            }
        }
        else if (component instanceof UIOutcomeTarget)
        {
            renderOutcomeLinkEnd(facesContext, component);
View Full Code Here

    {
        ResponseWriter writer = facesContext.getResponseWriter();
        Map<String, List<ClientBehavior>> behaviors = null;

        // h:commandLink can be rendered outside a form, but with warning (jsf 2.0 TCK)
        FormInfo formInfo = findNestingForm(component, facesContext);
       
        if (HtmlRendererUtils.isDisabled(component) || formInfo == null)
        {
            writer.startElement(HTML.SPAN_ELEM, component);
            if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
View Full Code Here

    }

    protected void renderCommandLinkEnd(FacesContext facesContext, UIComponent component)
            throws IOException
    {
        FormInfo formInfo = findNestingForm(component, facesContext);
       
        ResponseWriter writer = facesContext.getResponseWriter();
        if (HtmlRendererUtils.isDisabled(component) || formInfo == null)
        {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.shared_tomahawk.renderkit.html.util.FormInfo

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.