struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Pereira" <rodpereira...@gmail.com>
Subject Re: Struts-Faces: validator
Date Fri, 09 Feb 2007 12:47:19 GMT
Hi all,
I am still facing problems with JS validation.

I'll post my code here, if somebody could help me, I'd appreciate.

struts-config.xml

  <form-beans >

  	<form-bean name="testForm"
type="org.apache.struts.validator.DynaValidatorForm">
  		<form-property name="test" type="java.lang.String" />  	
  	</form-bean>

  </form-beans>

  <action-mappings >

    <action path="/testAction" attribute="testForm" name="testForm"
scope="request" type="test.action.TestAction">
      <forward name="success" path="/test.faces" />
    </action>

  </action-mappings>

validation.xml

		<form name="testForm">

	         <field property="test" depends="required">
	               	<arg0 key="error.test.required"/>
	         </field>
	
	    </form>

test.jsp

	<s:form action="/testAction" onsubmit="return validateTestForm(this);">
	
		<h:outputText value="Test: " /> <h:inputText value="#{testForm.test}" />
		<br/>
		<h:commandButton type="submit" value="Send" id="btSend"/>
	
		<s:javascript formName="testForm" dynamicJavascript="true"
staticJavascript="false"/>
  		<script language="Javascript1.1" src="staticJavascript.jsp"></script>
  		
	</s:form>

It has been a week I am trying to make this work.... :-(

Thanks,
Rodrigo Pereira

On 2/6/07, Rodrigo Pereira <rodpereira.rj@gmail.com> wrote:
> Hi Peter,
> if you could send it to me at rodpereira.rj@gmail.com I would appreciate.
> No matter what I do, it does not call onsubmit validate js function. :-(
>
> Thanks,
> Rodrigo Pereira
>
> On 2/6/07, Peter Bliznak <bliznak@rogers.com> wrote:
> > Hi Rodrigo,
> > yes you can use commandButon.
> > Btw have you look at example code coming with Struts 1.3.5?
> > Peter.
> > PS
> > If you still have problem to make it work let me know I will send you some code
to nail it down.
> >
> > Rodrigo Pereira <rodpereira.rj@gmail.com> wrote: I am already doing this.
> > Can I use h:commandButton to submit ( call onsubmit ) struts-faces form?
> >
> > Thanks,
> > Rodrigo Pereira
> >
> >
> > On 2/4/07, Martin Gainty  wrote:
> > > Kevin--
> > >
> > > I would suggest implementing the validation.xml packaged within struts as the
basis for your validation efforts
> > > Feel free to ping the list if you have any questions
> > >
> > > HTH,
> > > Martin--
> > > ---------------------------------------------------------------------------
> > > This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain information that is privileged,
proprietary , confidential and exempt from disclosure. If you are not the intended recipient,
you are notified that any dissemination, distribution or copying of this communication is
strictly prohibited.
> > > ---------------------------------------------------------------------------
> > > Le présent message électronique (y compris les pièces qui y sont annexées,
le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de
caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous
vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
> > > ----- Original Message -----
> > > From: "Simons Kevin"
> > > To: "Struts Users Mailing List"
> > > Sent: Sunday, February 04, 2007 8:46 AM
> > > Subject: Re: Struts-Faces: validator
> > >
> > >
> > > > Rodrigo,
> > > >
> > > > AFAIK that was possible.
> > > >
> > > > Regards,
> > > > ----- Original Message -----
> > > > From: "Rodrigo Pereira"
> > > > To: "Struts Users Mailing List"
> > > > Sent: Saturday, February 03, 2007 10:39 PM
> > > > Subject: Struts-Faces: validator
> > > >
> > > >
> > > >> hi All,
> > > >> does anybody know if validator work with struts-faces?
> > > >> I have read a lot of tutorials on the Internet, but no success at
all....
> > > >>
> > > >>
> > > >> Thanks,
> > > >> Rodrigo Pereira
> > > >>
> > > >> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > >> For additional commands, e-mail: user-help@struts.apache.org
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> No virus found in this incoming message.
> > > >> Checked by AVG Free Edition.
> > > >> Version: 7.5.432 / Virus Database: 268.17.20/664 - Release Date: 2/02/2007
> > > >> 15:42
> > > >>
> > > >>
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message