Hi,

You can enable it by the flag;

<context-param>
        
<param-name>org.apache.myfaces.ENABLE_CLIENT_SIDE_VALIDATION</param-name>
        <param-value>true</param-value>
   </context-param>

Then you dont have to change anything in your page, it should start working:)

Immediate commands just skip it.

Cagatay,

On Nov 6, 2007 11:01 PM, Sansaricq Marcel-EMS002
<[EMAIL PROTECTED]> wrote:
> Hi Cagatay,
>
> I am trying to figure out how to use the sandbox client side validation
> by looking at the source code of the examples on the irian web site.
>
> More specifically, the code below is for the "Conversion&Validation with
> Standard Form".
>
> Can you clarify what triggers client side validation in the example
> below ?
>
> Or maybe you can elaborate on how to best use it.
>
> Thanks again,
>
> Marcel
>
> <%@ page session="false" contentType="text/html;charset=utf-8"%>
> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>
> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%>
> <%@ taglib uri="http://myfaces.apache.org/sandbox"; prefix="s"%>
> <html>
>
> <!--
> /*
>  * Licensed to the Apache Software Foundation (ASF) under one
>  * or more contributor license agreements.  See the NOTICE file
>  * distributed with this work for additional information
>  * regarding copyright ownership.  The ASF licenses this file
>  * to you under the Apache License, Version 2.0 (the
>  * "License"); you may not use this file except in compliance
>  * with the License.  You may obtain a copy of the License at
>  *
>  *   http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing,
>  * software distributed under the License is distributed on an
>  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>  * KIND, either express or implied.  See the License for the
>  * specific language governing permissions and limitations
>  * under the License.
>  */
> //-->
>
> <[EMAIL PROTECTED] file="inc/head.inc" %>
>
> <body>
>
> <f:view>
>
>   <h:form id="carForm">
>
>                 <t:messages forceSpan="true" layout="list" />
>
>                 <h:panelGrid columns="3">
>                         <h:outputText id="lbl_id" value="Id
> *"></h:outputText>
>                         <h:inputText id="txt_id"
> value="#{customerCreateBean.customer.id}" required="true"></h:inputText>
>                         <t:message for="txt_id" forceSpan="true" />
>
>                         <h:outputText id="lbl_name" value="Name
> *"></h:outputText>
>                         <h:inputText id="txt_name"
> value="#{customerCreateBean.customer.name}"
> required="true"></h:inputText>
>                         <t:message for="txt_name" forceSpan="true" />
>
>                         <h:outputText id="lbl_surname" value="Surname
> *"></h:outputText>
>                         <h:inputText id="txt_surname"
> value="#{customerCreateBean.customer.surname}"
> required="true"></h:inputText>
>                         <t:message for="txt_surname" forceSpan="true" />
>
>                         <h:outputText id="lbl_age"
> value="Age"></h:outputText>
>                         <h:inputText id="txt_age"
> value="#{customerCreateBean.customer.age}">
>                                 <f:validateLongRange minimum="18"
> maximum="50" />
>                         </h:inputText>
>                         <t:message for="txt_age" forceSpan="true" />
>
>                         <h:outputText id="lbl_address"
> value="Adress"></h:outputText>
>                         <h:inputText id="txt_address"
> value="#{customerCreateBean.customer.address}">
>                                 <f:validateLength minimum="2"
> maximum="5"/>
>                         </h:inputText>
>                         <t:message for="txt_address" forceSpan="true" />
>
>                         <h:outputText id="lbl_salary"
> value="Salary"></h:outputText>
>                         <h:inputText id="txt_salary"
> value="#{customerCreateBean.customer.salary}">
>                                 <f:validateDoubleRange minimum="1000"
> maximum="5000" />
>                         </h:inputText>
>                         <t:message for="txt_salary" forceSpan="true" />
>
>                         <h:outputText id="lbl_salaryBonus" value="Salary
> Bonus"></h:outputText>
>                         <h:inputText id="txt_salaryBonus"
> value="#{customerCreateBean.customer.salaryBonus}">
>                         </h:inputText>
>                         <t:message for="txt_salaryBonus"
> forceSpan="true" />
>                 </h:panelGrid>
>
>                 <h:commandButton id="btn_save" value="Create"
> action=""/>
>                 <t:commandButton id="btn_cancel" value="Cancel"
> immediate="true"></t:commandButton>
>
>         </h:form>
>
> </f:view>
>
> <[EMAIL PROTECTED] file="inc/page_footer.jsp" %>
>
> </body>
>
> </html>
>
>
> -----Original Message-----
> From: Cagatay Civici [mailto:[EMAIL PROTECTED]
> Sent: 11/06/2007 09:59
> To: MyFaces Discussion
> Subject: Re: Client side validation
>
>
> Hello,
>
> The successor of the jsf-comp's client side converter/validators
> joined the myfaces sandbox.
>
> http://example.irian.at/example-sandbox-20071106/home.jsf#ClientSideVali
> dation
>
> Regards,
>
> Cagatay
>
> On Nov 6, 2007 4:54 PM, Sansaricq Marcel-EMS002
> <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi everybody,
> >
> > I am currently using MyFaces 1.1.5, along with Tomahawk 1.1.6 and
> RichFaces
> > 3.1.0 and I want to use client side validation in my project. Trinidad
> seems
> > to provide the features I need, however, based on the warnings I see
> about
> > using RichFaces and Trinidad together mainly because of AJAX problems,
> I am
> > hesitant to use Trinidad. Due to project deadlines, I don't want to
> migrate
> > from RichFaces AJAX components to Trinidad at this time.
> >
> > It looks like the jsf-comp client validator work that Cagatay Civici
> has
> > done is no longer in development, so it's not a viable option.
> >
> > Any alternate method of using Client side validation that meshes well
> with
> > jsf will be appreciated.
> >
> > Thanks in advance for your help
> >
> > Marcel
>

Reply via email to