add a component (submitLink) multiple times?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

add a component (submitLink) multiple times?

oliver.stef
This post was updated on .
How can I add a component (submitLink) multiple times?

like this:

List<String> categories = Arrays.asList("English", "Japanese", );  

for (String str : language)
{
     form.add(new SubmitLink("Name",str)
    {
    @Override
    public void onSubmit() { ...}
   }
}

and HTML:

<sapn wicket:id="Name"> 

Any ideas?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: add a component (submitLink) multiple times?

oliver.stef
How can I add a component (submitLink) multiple times?

like this:

List<String> categories = Arrays.asList("English", "Japanese", );  

for (String str : language)
{
     form.add(new SubmitLink("Name",str)
    {
    @Override
    public void onSubmit() { ...}
   }
}

and HTML:
#  
 

Any ideas?


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/add-a-component-submitLink-multiple-times-tp4649936p4649939.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: add a component (submitLink) multiple times?

Michal Margiel
Hello,

No, your code is not correct.  You should use some kind of repeaters, like
ListView:

https://cwiki.apache.org/WICKET/listview-and-other-repeaters.html

2012/6/13 oliver.stef <[hidden email]>

> How can I add a component (submitLink) multiple times?
>
> like this:
>
> List<String> categories = Arrays.asList("English", "Japanese", );
>
> for (String str : language)
> {
>     form.add(new SubmitLink("Name",str)
>    {
>    @Override
>    public void onSubmit() { ...}
>   }
> }
>
> and HTML:
> #
>
>
> Any ideas?
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/add-a-component-submitLink-multiple-times-tp4649936p4649939.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Pozdrawiam/Best regards
Michał Margiel

http://www.confitura.pl (dawniej Javarsovia)
http://www.linkedin.com/in/MichalMargiel
http://www.margiel.eu
Reply | Threaded
Open this post in threaded view
|

Re: add a component (submitLink) multiple times?

Martin Grigorov-4
In reply to this post by oliver.stef
Hi,

Use a repeater like ListView or RepeatingView around them.

On Wed, Jun 13, 2012 at 8:23 PM, oliver.stef <[hidden email]> wrote:

> How can I add a component (submitLink) multiple times?
>
> like this:
>
> List<String> categories = Arrays.asList("English", "Japanese", );
>
> for (String str : language)
> {
>     form.add(new SubmitLink("Name",str)
>    {
>    @Override
>    public void onSubmit() { ...}
>   }
> }
>
> and HTML:
> #
>
>
> Any ideas?
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/add-a-component-submitLink-multiple-times-tp4649936p4649939.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: add a component (submitLink) multiple times?

Tom Götz
In reply to this post by oliver.stef
I don't know exactly what you are trying to do, but you could have a look at RepeatingView.

   -Tom


On 13.06.2012 at 19:23 oliver.stef wrote:

> How can I add a component (submitLink) multiple times?
>
> like this:
>
> List<String> categories = Arrays.asList("English", "Japanese", );  
>
> for (String str : language)
> {
>     form.add(new SubmitLink("Name",str)
>    {
>    @Override
>    public void onSubmit() { ...}
>   }
> }
>
> and HTML:
> #  
>
>
> Any ideas?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]