logo       

RE: enhydra newbie -- form data handling help/tips needed: msg#00055

java.enhydra.general

Subject: RE: enhydra newbie -- form data handling help/tips needed

If you want to get the values send from a form
you have to use the following methods:

String value = comms.request.getParameter("inputName");
formResult.setTextName(value);

It's also in the documentation.
Page 75 "The DiscRack Example"

Greetings
Thorsten


> -----Original Message-----
> From: enhydra-admin@xxxxxxxxxxx
> [mailto:enhydra-admin@xxxxxxxxxxx] On Behalf Of damar@xxxxxxxxxxxxxx
> Sent: Wednesday, February 12, 2003 10:55 AM
> To: enhydra@xxxxxxxxxxx
> Subject: Enhydra: enhydra newbie -- form data handling
> help/tips needed
>
>
> Hi,
>
> Form.html has a text field named inputName. I have the
> following code for FormResultPresentatio, which is the ACTION
> po of Form.html:
> ===============================================================
> 1.public class FormResultPresentation implements HttpPresentation { 2.
> 3. public void run(HttpPresentationComms comms)
> 4. throws HttpPresentationException, IOException,
> 5. NonUniqueQueryException, DataObjectException {
> 6.
> 7. FormResultHTML formResult;
> 8. FormHTML formHTML=new FormHTML();
> 9. HTMLInputElement value;
>
> 10.
> formResult=(FormResultHTML)comms.xmlcFactory.create(FormResult
> HTML.class);
> 11. value=formHTML.getElementInputName();//getting the
> value of inputName
> 12. formResult.setTextName(value.getAccept());
> 13. comms.response.writeDOM(formResult);
> }
>
> }
>
> ==============================================
> As per the XMLC tutorial, getElement* returns the instance of
> HTMLInputElement, so I have declared value as
> HTMLInputElement. How to send this value as string to
> setTextName(String) method of formResult?
>
> In short, I am basically trying to assign all form input
> values from Form.html to string variables in the above script?
>
> Since I am new to both Java and enhydra, I may be entirely
> wrong on my approach, any tips/pointers to relevant doc would
> be highly appreciated.
>
> Thanks.
>
> Damar
>
>
> _______________________________________________
> Enhydra mailing list
> Enhydra@xxxxxxxxxxx
> http://www.enhydra.org/mailman/listinfo.cgi/en> hydra
>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise