Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.java.* > Newsgroup comp.lang.java.help

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2012, 10:06 AM
m.skrzetuski@gmail.com
Guest
 
Posts: n/a
Default Generate forms from a model?

Hi there,

is it possible to generate forms from models in Java? Suppose I have the following model.

someInformation|dataType:Integer|possibleValues:1, 2,3
someOtherInformation|dataType:String|maxLength:50
someBooleanInformation|lables:Yes,No
....

Is there some library out there that would generate a form from the model in the following way?

--> from someInformation line generate a JList with my possible values and validate the input on pushing submit
--> from someOtherInformation generate JTextField that is 50 chars long and validate the input on pushing submit
--> from someBooleanInformation generate JOptionPanes wit Yes and NO and validate the input on pushing submit
--> etc.

So is there any library for such dynamic form generation and validation?

Kind regards
Maciej
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 06-22-2012, 12:22 PM
Roedy Green
Guest
 
Posts: n/a
Default Re: Generate forms from a model?

On Fri, 22 Jun 2012 03:06:06 -0700 (PDT), m.skrzetuski@gmail.com
wrote, quoted or indirectly quoted someone who said :

>is it possible to generate forms from models in Java? Suppose I have the following model.


have a look at Ajax. It is reputed to make it easier to use JavaScript
for data entry.
--
Roedy Green Canadian Mind Products
http://mindprod.com
If you look in a computer programmer's freezer you will find all
kinds of containers, but none of them labeled. They do the same thing
creating files without labeling the encoding. You are just supposed to
know. Ditto with the MIME type, the separator and comment delimiters and
column names in CSV files. Ditto with the endian convention. Imagine how
much more civilised life would have been if Martha Stewart were the first
programmer.
Reply With Quote
  #3 (permalink)  
Old 06-24-2012, 04:43 PM
markspace
Guest
 
Posts: n/a
Default Re: Generate forms from a model?

On 6/22/2012 3:06 AM, m.skrzetuski@gmail.com wrote:
> Hi there,
>
> is it possible to generate forms from models in Java? Suppose I have the following model.
>
> someInformation|dataType:Integer|possibleValues:1, 2,3
> someOtherInformation|dataType:String|maxLength:50
> someBooleanInformation|lables:Yes,No



I found this little project on GitHub. I haven't used it however.

<https://github.com/aeremenok/swing-formbuilder>

I also found Jelly on the Apache website (the Apache foundation has a
LOT of Java libraries).

<http://commons.apache.org/jelly/tutorial.html>

However Jelly looks quite old, I'm not sure if it's being actively
maintained.

Overall, I don't see a lot of this sort of something-into-something else
type code for Swing. If you have complexity in your Swing components,
you'll have it in the the model as well, so you might as well just use
Swing directly. Mixing things like GUI validation and layout in your
"model" doesn't seem like the best idea to me, and I think it fell out
of vogue some years ago.




Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 11:27 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.