You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by laiqinyi <xb...@126.com> on 2008/02/22 10:02:28 UTC
how to create the component dynamic?
Well, I wanne build a Survey-System!
Now there're some Questions in the Survey-System, and will default some answer-item for user to choice!
following is the example of Question
1,It's the weather good today?(A.B.C. would be radio)
A.yes, Sunny
B.no, Rainy
C.so so
I think all the component shall be created at run time! but some question has 5 items some has 3 items,
some is a TextField which filled by user, some is CheckBox or Radio.
How to do with this?
Mead
Re: how to create the component dynamic?
Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
repeater / listview.. And panels with form components.
I actually started a survey thing some time ago.. The hard part is if
you want to have paths/trackbacks...
regards Nino.
laiqinyi wrote:
> Well, I wanne build a Survey-System!
> Now there're some Questions in the Survey-System, and will default some answer-item for user to choice!
> following is the example of Question
> 1,It's the weather good today?(A.B.C. would be radio)
> A.yes, Sunny
> B.no, Rainy
> C.so so
> I think all the component shall be created at run time! but some question has 5 items some has 3 items,
> some is a TextField which filled by user, some is CheckBox or Radio.
> How to do with this?
>
> Mead
>
>
>
>
>
--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: how to create the component dynamic?
Posted by Stefan Fußenegger <st...@gmx.at>.
Hi Mead,
I'd say that wicket is a real cool choice to accomplish this (I know what
I'm talking about as I hacked such a tool in PHP years ago in my programming
infancy ;) )
There is no general answer though. But for different question types you
could do
if (type == DROP_DOWN_QUESTION) add(new DropDownQuestionPanel("panel",
question);
else if (type == RADIO_QUESTION) add(new RadioQuestionPanel("panel",
question);
// you got the idea
you could also create the panels dynamically by giving a type such as
"com.foo.questiontype.DropDown" using reflection. This way you could create
a quite flexible solution, where you could drop in just another jar to add
new question types.
If it comes to different numbers of possibilities, RepeatingView might be a
good choice.
Best regards and good luck
Mead-2 wrote:
>
> Well, I wanne build a Survey-System!
> Now there're some Questions in the Survey-System, and will default some
> answer-item for user to choice!
> following is the example of Question
> 1,It's the weather good today?(A.B.C. would be radio)
> A.yes, Sunny
> B.no, Rainy
> C.so so
> I think all the component shall be created at run time! but some question
> has 5 items some has 3 items,
> some is a TextField which filled by user, some is CheckBox or Radio.
> How to do with this?
>
> Mead
>
>
>
>
>
-----
-------
Stefan Fußenegger
http://talk-on-tech.blogspot.com // looking for a nicer domain ;)
--
View this message in context: http://www.nabble.com/how-to-create-the-component-dynamic--tp15630091p15631519.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org