Roger wrote:
Hi
I'm trying to get indexed lists working so that I can get any amendments back
into my model. At the moment I've got
In the last line, did you confirm that count has the correct value?
What if the list is empty? (in that case count has never been set)
<s:textfield name="valueables[%{#count}].text" value="%{text}"/>
The issue could relate to how valueables is being constructed. Are you
creating it, or leaving it to the framework to create it? It should be
able to add extra elements to a list
For added entertainment, could anyone point me to a dojo/javascript tutorial
that would allow me to add a further empty line when ever the user completes
an empty line without, if possible, submitting the form? Or someother
technique that allows the addition of unknown number form fields?
in pure javascript:
var inputEl = document.createElement("input");
inputEl.type ="input";
inputEl.name ="valueables["+count+"]";
var parentEl = document.getElementById("thePositionId");
parentEl.appendChild(inputEl);
and so on. or
parentEl.innerHTML = "<input type='text' name=valueables["+count+"]">";
and so on.
where count is an argument passed to your function (eg in response to a
click in the next empty row)
You'll find plenty of tutorials along those lines. The latter approach
is faster but vulnerable to more browser querks.
Good javascript libraries include function to make the DOM manipulation
less verbose.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]