Dear Stripes users,
I'm trying to create a dynamic user interface for stored procedures.
Suppose we've got a stored proc with a datetime and a bit input. In my Java
code this would be represented as a ParameterInput<Date> and a
ParameterInput<Boolean>. The user interface (JSP) should reflect these types
and show a date-input field and a checkbox. (The date input field can be a
custom tag that wraps a stripes:text input and adds some javascript calendar
stuff).
The object graph looks like this:
"my action bean" ActionBean -> "selectedStoredProcedure" StoredProcedure ->
"inputs" Map<String,ParameterInput>
The problem is when this form is posted:
I have a Stripes type converter that constructs the "selectedStoredProcedure"
from the (posted value of the) name of the stored procedure. So far no problem.
Now I want to write a type converter that constructs a ParameterInput from the
(posted) value for a certain parameter. To be able to create the right type of
ParameterInput I actually need some extra information (which parameter for
which stored procedure). Today my solution is to post the name of the stored
procedure, the name of the parameter and the value together (javascript hackery
behind the scenes). From this String I can then construct the right
ParameterInput in my TypeConverter.
This is obiously a dirty solution, and it would be a lot better if I could
access the constructed "selectedStoredProcedure" in the typeconverter for
ParameterInput. Do you have any ideas of how to do this?
Now that I've written this down I realize that it might be better to look for
an alternative to using a custom TypeConverter. I guess it would be nice to
know how others would implement something like this in Stripes?
Kind regards,
Egon Nijns
IT
e...@uzleuven.be<mailto:e...@uzleuven.be>
tel. +32 16 34 78 09
UZ Leuven | campus Gasthuisberg | Herestraat 49 | B - 3000 Leuven |
www.uzleuven.be<http://www.uzleuven.be/>
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users