You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mirco Attocchi <am...@gmail.com> on 2008/04/10 19:18:44 UTC

h:outputLink with multiple f:param

With this code

<h:outputLink
value="#{facesContext.externalContext.requestContextPath}/Print"
target="_blank" title="Print">
<h:graphicImage url="/images/22x22/printer.png" title="Print" alt="Print"/>
<f:param name="type" value="type1"/>
<f:param name="id" value="#{row.id}"/>
</h:outputLink>

I've this uncorrect html output:

<a href="/WebApp/Print?*type=type1&amp;amp;id=34*" target="_blank"
title="Print"><img src="/WebApp/images/22x22/printer.png" alt="Print"
title="Print"></a>

Why?

I'm using MyFaces 1.2.2

Thanks in advance.

-- 
Mirco Attocchi

Re: h:outputLink with multiple f:param

Posted by Andrew Robinson <an...@gmail.com>.
Why would this be needed?

"&amp;amp;" is not valid xhtml, it should be "&amp;" right?

On Thu, Apr 10, 2008 at 11:48 AM, Christoph Ebner
<ch...@gmail.com> wrote:
> Hi Mirco,
>
> set context-param org.apache.myfaces.STRICT_XHTML_LINKS to false in your
> web.xml.
>
> regards
> christoph
>
>
>  On Thu, Apr 10, 2008 at 7:18 PM, Mirco Attocchi <am...@gmail.com> wrote:
> > With this code
> >
> > <h:outputLink
> value="#{facesContext.externalContext.requestContextPath}/Print"
> target="_blank" title="Print">
> >
> > <h:graphicImage url="/images/22x22/printer.png" title="Print"
> alt="Print"/>
> > <f:param name="type" value="type1"/>
> > <f:param name="id" value="#{row.id}"/>
> > </h:outputLink>
> >
> > I've this uncorrect html output:
> >
> > <a href="/WebApp/Print?type=type1&amp;amp;id=34" target="_blank"
> title="Print"><img src="/WebApp/images/22x22/printer.png" alt="Print"
> title="Print"></a>
> >
> > Why?
> >
> > I'm using MyFaces 1.2.2
> >
> > Thanks in advance.
> >
> > --
> > Mirco Attocchi
>
>

validatorMessage is not working

Posted by "Hoehmann, Andreas" <an...@siemens.com>.
Hello,

If have a inputfield with a validator-binding and i want define the 
validator-message via ui (and *not* in the java-code) ...
 
<h:inputText id="quantity" 
             value="#{bean.quantity}" 
             validator="#{bean.validateInput}"
             validatorMessage="#{bundle['only_multiple_of']} #{bean.totalMinimumOrderQuantity}"
             required="true">
              <f:convertNumber/>
              <a4j:support event="onkeyup" 
                           reRender="inputArea" 
                           limitToList="true" 
                           ajaxSingle="true"
                           ignoreDupResponses="true"
                           requestDelay="500"
                           focus="quantity"/>
</h:inputText>

<rich:message for="quantity" showSummary="true" showDetail="false"/>
<h:message for="quantity" showSummary="true" showDetail="false"/>

public void validateInput(final FacesContext context, final UIComponent component, final Object value) {
    boolean valid = isValid(value);
    if (!valid) {
      // the message should replaced with the "validatorMessage" in the ui
      final FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "hallo", null);
      context.addMessage(component.getClientId(context), facesMessage);
      throw new ValidatorException(facesMessage);
    }
  }

If validation fail then "hallo" is show but not the defined "validatorMessage".

I try this with ri-1.2 and mf-1.2 ... the same result.

Any ideas?

Regards
höhmi

Re: h:outputLink with multiple f:param

Posted by Mirco Attocchi <am...@gmail.com>.
Thanks Christoph,
now it's ok.

Note:
I've this problem only in jsf pages running with Trinidad. I've made same
page without Trinidad and I've no render problem.

Mirco


On Thu, Apr 10, 2008 at 7:48 PM, Christoph Ebner <ch...@gmail.com>
wrote:

> Hi Mirco,
>
> set context-param org.apache.myfaces.STRICT_XHTML_LINKS to false in your
> web.xml.
>
> regards
> christoph
>
> On Thu, Apr 10, 2008 at 7:18 PM, Mirco Attocchi <am...@gmail.com> wrote:
>
> > With this code
> >
> > <h:outputLink
> > value="#{facesContext.externalContext.requestContextPath}/Print"
> > target="_blank" title="Print">
> > <h:graphicImage url="/images/22x22/printer.png" title="Print"
> > alt="Print"/>
> > <f:param name="type" value="type1"/>
> > <f:param name="id" value="#{row.id}"/>
> > </h:outputLink>
> >
> > I've this uncorrect html output:
> >
> > <a href="/WebApp/Print?*type=type1&amp;amp;id=34*" target="_blank"
> > title="Print"><img src="/WebApp/images/22x22/printer.png" alt="Print"
> > title="Print"></a>
> >
> > Why?
> >
> > I'm using MyFaces 1.2.2
> >
> > Thanks in advance.
> >
> > --
> > Mirco Attocchi
>
>
>


-- 
Mirco Attocchi

Re: h:outputLink with multiple f:param

Posted by Christoph Ebner <ch...@gmail.com>.
Hi Mirco,

set context-param org.apache.myfaces.STRICT_XHTML_LINKS to false in your
web.xml.

regards
christoph

On Thu, Apr 10, 2008 at 7:18 PM, Mirco Attocchi <am...@gmail.com> wrote:

> With this code
>
> <h:outputLink
> value="#{facesContext.externalContext.requestContextPath}/Print"
> target="_blank" title="Print">
> <h:graphicImage url="/images/22x22/printer.png" title="Print"
> alt="Print"/>
> <f:param name="type" value="type1"/>
> <f:param name="id" value="#{row.id}"/>
> </h:outputLink>
>
> I've this uncorrect html output:
>
> <a href="/WebApp/Print?*type=type1&amp;amp;id=34*" target="_blank"
> title="Print"><img src="/WebApp/images/22x22/printer.png" alt="Print"
> title="Print"></a>
>
> Why?
>
> I'm using MyFaces 1.2.2
>
> Thanks in advance.
>
> --
> Mirco Attocchi