hej,
I would like to dynamically add same part to form, let say I have a
form that has a section with 3 inputs : start, end and name. those
section can occur many times depending on model.
this is very easy when depending on server logic and making full page
refresh every time users add section via link.
I would like to add such section from javascript, without server
interaction. the problem I see is that I need to generate names of
inputs in section witch will contain the right index so wicket knows
where to put data, right?
example
<form>
<ol>
<li wicket:id="each.section">
<div wicket:id="form.part"></div>
</li>
</ol>
</form>
I created custom FormComponentPanel and overridden convertInput. and
added ListView to create list with panels.
when I looked on generated html, names of input where something like :
name="each.section:1:form.part:start, so I guess I could generate
something like that in JS but I wonder if this will not break wicket
logic. more even I hack those names creating elements in JS list will
not be synchronised with model on server and they will be removed when
user refreshes the page
I think the best way to do it is to make a round trip to server with
ajax and replace form content every time user clicks a button.
what do you think?
pozdrawiam
Paweł Kamiński
[email protected]
[email protected]
______________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]