Re: jsf large form question ?
On Jul 15, 8:47 am, john <j...@preparew.com> wrote:
I have a input form like this :
=
COLUMN1 NAME1(outputText)
COLUMNNAME2(outputText) COLUMNNAME3(outputText)
ROW NAME(outputText) | 20.4 (input=
Text)
| 10.1 (inputText) =
| 3.3
(inputText) |
the problem is that I will have more than 300 rows. My question is is it
better to have hardcoded jspx like this below, or
to put dataTable which will have class like this
class Form{
private String rowName;
private String columnOneValue;
......
}
and generate that form from DB data, and how would that table in DB
looked like ?
Taking your last question first, your question is equivalent to, "I
have to design a database. What should my tables look like?"
There's no way to answer that without knowing something of the data
you wish to store. In general terms, you want to create a normalized
relational representation of data used by your domain model. You
should know what words like "normalized" mean in this context; if not,
look them up.
As to your screen form, you mention JSP and JSF and a 300-row form.
First question: How user friendly is a 300-row form on a screen? Are
you for real?
Presumably the 300 rows have similar structure, e.g., (name, comment,
value) type of thing. That would mean each row represents info from a
single entity, the same type of entity for each row. That's what a
JSF 'dataTable' is for. You specify all the iteration parameters in
the 'dataTable' attributes, and define the rows with suitable
'outputText' and 'inputText' tags.
The database lookup is NOT done directly from the screen but by the
managed backing bean that provides the values for the JSF components.
--
Lew