Jahia Template Forum > Problems in form...

0 (0 Good)
0 (0 Bad)

Problems in form modifications

by  mllejulie »  2012/07/18 07:39

Hi all !!

Fisrt, I'm sorry but my english was not very good. I hope you understand me !!

I work in the form. I have to make the title 'modifiable' and I have to add a field (type : choiceList or radioButtons). If this field equals 'I come', I have to send a mail and if this field equals 'I don't come' I have to send an other mail.

For the moment, i have create the field named 'sendMail' and that is the description in the file definitions.cnd :

smallText    sendMail (choiceList) = 'I come' < 'I come', 'I don't come'

If this type is correct or it's preferable to use radioButtons ? If I forced to use this, how to use it ?

Secondly, how to retrieve this field in my file formDisplay.jsp ?

Hoping to have a rapid response

Julie

  (mllejulie)

Number of messages  6
Registration date
0 (0 Good)
0 (0 Bad)

Re : Problems in form modifications

by  faissah »  2012/07/20 19:12

Hello mllejulie,

Your english is actually pretty good!

I think that you should review your approach. In the definition.cnd file, you only set the field that will be editable when creating the content in the Edit mode.

In your component, when creating it on the page, the only editable field would be the title, so you don't need anything else.

smallText    sendMail (choiceList) = 'I come' < 'I come', 'I don't come'

This line would mean that when creating the content, the person creating it would have to set it to 'I come' or 'I don't come'. I believe you want the user of the website to do that. So in fact you don't need this line. You should only put 'I come', 'I don't come' in formDisplay.jsp.

In form display, put your form with the radio buttons 'I come', 'I don't come' and some javascript that would send the emai.

The only editable parameter that you to need in the JSP would be the titlle. In your jsp you can retrieve it with this syntax:

${currentNode.properties.<name of the parameter>.string} since it will probably be a string.

 

Hope this will help,

Fabrice

Fabrice  (faissah)

Number of messages  262
Registration date
0 (0 Good)
0 (0 Bad)

Re : Re : Problems in form modifications

by  mllejulie »  2012/08/08 14:57

Hello,

I work on forms and I need to change '.class' files to add functionality, let me explain:

I added fields in the file definitions.cnd and wish to retrieve the value of this field in the file myform.jsp

From what I understand, to retrieve the value of a field I have to write a function like 'getMonChamp ()' except that these functions are defined in the file formBuilderSmile.class

How do I open and edit that file? If possible of course!

Thank you

Julie

  (mllejulie)

Number of messages  6
Registration date
0 (0 Good)
0 (0 Bad)

Re : Re : Re : Problems in form modifications

by  faissah »  2012/08/10 13:27

Hello mllejulie,

You seem to be a java beginner. You .class is the compiled from of .java.

What you are looking to do is an "action". I suggest that you take a look at this documentation.

http://www.jahia.com/community/documentation/jahiapedia/actions/actions.html

Regards,

Fabrice

Fabrice  (faissah)

Number of messages  262
Registration date
0 (0 Good)
0 (0 Bad)

Problems in form modifications

by  mllejulie »  2012/08/20 14:18

Hello faissah,

Thank you for your answer.

Is it the same documentation for the version 6.1 ?

Julie

  (mllejulie)

Number of messages  6
Registration date
0 (0 Good)
0 (0 Bad)

Re : Problems in form modifications

by  faissah »  2012/08/20 14:57

No, Jahia 6.1 and 6.5 are quiet different. I suggest that you only rely on Jahia 6.5/6.6 documentation.

Regards,

Fabrice

Fabrice  (faissah)

Number of messages  262
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page