velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tkch...@netcourrier.com
Subject Retrieve form elements from a velocity page
Date Wed, 29 Oct 2003 17:43:43 GMT
Hi, 
I have recently started learning velocity. I am now trying to use it as the view in my Struts
application. But I am facing the following problem: "retrieve data displayed in my form elements."

Elements used :
- creationAdminOfForm : the logical name of my FormBean as defined in my struts-config.xml;
I have tried $form.bean instead.

- siret : the property I am trying to retrieve the value in my Action.
the remaining parts are javascript formattings.

In my velocity page I write:
============================
<input name="siret" type="text" id="siret" value="$!creationAdminOfForm.siret" size="17"
maxlength="17" onFocus="MM_changeProp('siret','','style.backgroundColor','yellow','INPUT/TEXT')"
onKeyUp="remplissage(this.value)" onBlur="MM_changeProp('siret','','style.backgroundColor','#FFFFFF','INPUT/TEXT');EstSiretValide(this.value)"></td>

In my action class I simply call :
================================== 
public ActionForward execute(ActionMapping mapping, ActionForm anActionForm, HttpServletRequest
request, HttpServletResponse response) throws Exception {
        CAdminForm cAdminForm = (CAdminForm)Form;
        System.out.println("code : "+cAdminForm.getCode());
}


The form is well displayed but when I fill and submit, I have a surprising result; nothing
displayed!!! I try with other forms elements (checkBox, select); the result is still the same.

Please tell me WHAT I AM MISSING HERE? Please tell me where I can find web page examples formatted
with velocity, containing form elements such as checkBoxes, select, textField, etc... 

Thanks 
 
 

-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 € TTC/min)
Minitel: 3615 NETCOURRIER (0,16 € TTC/min)


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


Mime
View raw message