w:populate breaks well-formed xml

21 views
Skip to first unread message

Thomas Hallgren

unread,
Mar 19, 2012, 4:27:51 AM3/19/12
to web4j-users
When using semantically aware editors, constructs like the one used by
w:populate breaks the syntax since the start and end elements are out
of sync. Would it be possible to wrap the whole form instead? Perhaps
inserting another tag to exclude the part that shouldn't be included,
i.e.:

<w:populate using="itemForEdit">
<form action='${formTarget}' method="post" class="user-input"
name='giveMeFocus'>
<input name="Id" type="hidden"> <input name="ParentId"
type="hidden">
<table align="center">
<tr>
<td><label alt='Required, max 255 characters'>Prediction</label></
td>
<td><textarea name='Text' alt='Max 255 characters' rows='3'
cols='40'></textarea></td>
</tr>
<tr>
<td><label>Remark</label></td>
<td><textarea name='Remark' rows='3' cols='40'></textarea></td>
</tr>
<tr>
<td><label>Outcome</label></td>
<td><select name='Outcome'>
<option></option>
<c:forEach var='item' items='${outcome}'>
<option value='${item.id}'>${item}</option>
</c:forEach>
</select></td>
</tr>
<w:populate-exlude>
<tr>
<td align="center" colspan=2><input type=submit
value="Add/Edit"></td>
</tr>
</w:populate-exclude>
</table>
</form>
</w:populate>

Scott

unread,
Mar 19, 2012, 11:47:40 AM3/19/12
to web4j-users
Agreed that the examples break the syntax. In my forms, I've been
putting the <w:populate> tag before my first <tr>, and my </
w:populate> tag after the last </tr> of the fields I want to
populate. I've also found that I can do this several times in a
single form (in case there are fields in the middle that I need to
handle differently) without a problem.

John O'Hanley

unread,
Mar 19, 2012, 7:30:57 PM3/19/12
to web4j-users
I will update the javadoc and examples to use symmetric placement of
the start and end of the populate tag. This will be updated for the
next release (likely in June).
Reply all
Reply to author
Forward
0 new messages