Hi Bevin,

If i wrote in my template this:
<input type='text' name='agree' value="${v PARAM:agree}${/v}"/>
and declare "agree" property as String in my element
public void setAgree(final String agree) {
   this.agree = agree;
}

then field is rendering OK and i can get value from this property.

But if i make
<input type='checkbox' name='agree' value="${v PARAM:agree}${/v}"/>
and declare "agree" property as boolean in my element
public void setAgree(final boolean agree) {
   this.agree = agree;
}

then field is rendering but i can't get right value. It always returns
false even i selected this checkbox.

Also can you show example of generateField. I tired to find any
examples on wiki but without success.

Sunday, November 19, 2006, 11:50:41 AM, you wrote:

GB> Hi Maxim,

GB> you can generate individual field by using a FormBuilder:

GB> http://rifers.org/docs/api/com/uwyn/rife/site/ 
GB> FormBuilder.html#generateField(com.uwyn.rife.template.Template,% 
GB> 20com.uwyn.rife.site.ConstrainedProperty,%20java.lang.String[],% 
GB> 20java.lang.String)

GB> You can obtain the form builder from the template instance or  
GB> instantiate it yourself:

GB> template.getBeanHandler().getFormBuilder()

GB> To receive the value, you can simply use the getParameter* methods
GB> from the element itself, or add a setAgree(boolean value) method to
GB> the element implementation and it will be injected. Don't forget that
GB> you have to declare the fact that this 'agree' parameter is part of
GB> the submission either for example through XML, or by an annotation on
GB> the setAgree method that you just added:

GB> http://rifers.org/wiki/display/RIFE/Annotations+support+for+element
GB> +declaration

GB> Hope this helps.

GB> Best regards,

GB> Geert

GB> On 19 Nov 2006, at 00:23, Maxim Grigoriev wrote:

>> I've got a form which consists of bean  with its properties and
>> fileupload element and checkbox "I have read, understand and agree to
>> the User Agreement".
>> "agree" checkbox isn't a property of the editing bean.
>> How can i generate this checkbox and get value from it in my Element?
>> Because when i use in template this code:
>> <!--V 'FORM:CHECKBOX:agree'/-->
>> then nothing is rendered.
>> But if i just write
>> <input type='checkbox' name='agree' value='1'>
>> then i can't get its value in Element.

GB> --
GB> Geert Bevin
GB> Uwyn "Use what you need" - http://uwyn.com
GB> RIFE Java application framework - http://rifers.org
GB> Music and words - http://gbevin.com




-- 
Best regards,
 Maxim                            mailto:[EMAIL PROTECTED]

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to