I have some difficulties creating dynamic forms in my scala playframework application. I am quite new to Play!, and got stuck with the following task: Fields of my form is specified in the database somehow. I need to render the form and (this is the most important) recieve the data from the user. Is there any way to use the Forms scala api for this task? At the moment I have solved the issue "by hand" - getting values directly from the request, but don't like my solution.
On Tuesday, November 6, 2012 3:29:57 PM UTC+2, Mike V. Girkin wrote:
> I have some difficulties creating dynamic forms in my scala playframework > application. > I am quite new to Play!, and got stuck with the following task: > Fields of my form is specified in the database somehow. I need to render > the form and (this is the most important) recieve the data from the user. > Is there any way to use the Forms scala api for this task? > At the moment I have solved the issue "by hand" - getting values directly > from the request, but don't like my solution.
Yes, I have. I have no problems with creating "static" forms, when the content of the form is known at the moment of writing code.
The problem is, that my form is completely dynamic. Number and type of fields is defined in the database, and could be different.
First, I don't understand how to write the dynamic mapping for the fields, and also I could not understand how to supply *apply *and *unapply*function, if the number of parameters unkown.
среда, 7 ноября 2012 г., 0:31:48 UTC+4 пользователь Artem Kozlov написал:
> Artem.
> On Tuesday, November 6, 2012 3:29:57 PM UTC+2, Mike V. Girkin wrote:
>> I have some difficulties creating dynamic forms in my scala playframework >> application.
>> I am quite new to Play!, and got stuck with the following task:
>> Fields of my form is specified in the database somehow. I need to render >> the form and (this is the most important) recieve the data from the user.
>> Is there any way to use the Forms scala api for this task?
>> At the moment I have solved the issue "by hand" - getting values directly >> from the request, but don't like my solution.
Investingated the sources of Play framework, and found out, that it is
impossible to achieve the goal I set.
Solved the problem by leaving out Forms api, and used mappings and
contstraints from the Play framework.
> Yes, I have. I have no problems with creating "static" forms, when the
> content of the form is known at the moment of writing code.
> The problem is, that my form is completely dynamic. Number and type of
> fields is defined in the database, and could be different.
> First, I don't understand how to write the dynamic mapping for the
> fields, and also I could not understand how to supply *apply *and *unapply
> * function, if the number of parameters unkown.
> среда, 7 ноября 2012 г., 0:31:48 UTC+4 пользователь Artem Kozlov написал:
>> Artem.
>> On Tuesday, November 6, 2012 3:29:57 PM UTC+2, Mike V. Girkin wrote:
>>> I have some difficulties creating dynamic forms in my scala
>>> playframework application.
>>> I am quite new to Play!, and got stuck with the following task:
>>> Fields of my form is specified in the database somehow. I need to render
>>> the form and (this is the most important) recieve the data from the user.
>>> Is there any way to use the Forms scala api for this task?
>>> At the moment I have solved the issue "by hand" - getting values
>>> directly from the request, but don't like my solution.
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framework+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
On Thursday, November 8, 2012 9:27:49 AM UTC-5, Mike V. Girkin wrote:
> Hi all!
> Investingated the sources of Play framework, and found out, that it is > impossible to achieve the goal I set.
> Solved the problem by leaving out Forms api, and used mappings and > contstraints from the Play framework.
> 2012/11/7 Mike V. Girkin <mikeg...@gmail.com <javascript:>>
>> Good day!
>> Yes, I have. I have no problems with creating "static" forms, when the >> content of the form is known at the moment of writing code.
>> The problem is, that my form is completely dynamic. Number and type of >> fields is defined in the database, and could be different.
>> First, I don't understand how to write the dynamic mapping for the >> fields, and also I could not understand how to supply *apply *and *
>> unapply* function, if the number of parameters unkown.
>> среда, 7 ноября 2012 г., 0:31:48 UTC+4 пользователь Artem Kozlov написал:
>>> Artem.
>>> On Tuesday, November 6, 2012 3:29:57 PM UTC+2, Mike V. Girkin wrote:
>>>> I have some difficulties creating dynamic forms in my scala >>>> playframework application.
>>>> I am quite new to Play!, and got stuck with the following task:
>>>> Fields of my form is specified in the database somehow. I need to >>>> render the form and (this is the most important) recieve the data from the >>>> user.
>>>> Is there any way to use the Forms scala api for this task?
>>>> At the moment I have solved the issue "by hand" - getting values >>>> directly from the request, but don't like my solution.
>> To post to this group, send email to play-fr...@googlegroups.com<javascript:>
>> .
>> To unsubscribe from this group, send email to >> play-framewor...@googlegroups.com <javascript:>.
>> For more options, visit this group at >> http://groups.google.com/group/play-framework?hl=en.