You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in nashua <nh...@hotmail.com> on 2007/11/27 18:32:57 UTC
PropertySelection binding bug T-4.1.3 ?
Folks,
I have a PropertySelection component rigged up and initialized with defaults.
But I am not sure if my binding to the user interface is broken or if this is a valid BUG.
Here is the binding
Gallery.jwc
<property name="tableSize" persist="session" initial-value="2"/>
<component id="tableSizeSelect" type="PropertySelection">
<binding name="value" value="tableSize"/>
<binding name="model" value="tableSizeModel"/>
</component>
Gallery.JAVA (some code omitted)
private static final String[] tableSizeStringOptions = new String[] { new String("50"), new String("100"), new String("500"),};
private IPropertySelectionModel tableSizeModel = null;
public abstract String getTableSize();
public IPropertySelectionModel getTableSizeModel()
{
if (tableSizeModel == null) {
tableSizeModel = new StringPropertySelectionModel(tableSizeStringOptions);
}
return tableSizeModel;
}
Gallery.html
<span jwcid="$content$">
<span jwcid="autoPagingContent@Block">
<table width="100%" border=1>
<tr>
<td width="25%" align="left" NOWRAP>
<span jwcid="@Insert" value="Table Size"/>
<select jwcid="tableSizeSelect" onchange="tapestry.form.refresh(this.form)"/>
</td>
</tr>
</table>
</span>
<form jwcid="galleryForm@Form" listener="listener:onFormSubmit">
<div id="headerSelect">
<div jwcid="@RenderBlock" block="ognl:components.autoPagingContent" />
</div>
</form>
</span>
Can anyone explain why my select keeps getting punched back to the default?
I have a method parameter binding setup as a property via JWC file. Isn't this sufficient to bind/persist the value within the component such that when the select is changed it retains to the new value?
Is this a bug?
Thanks in advance.
My workaorund has been to operate tapestry script and set the thing literally in javascript. But I should have to do this. The bindings should be working... I would hope?
var tableSizeSelectedIndex = document.forms[0].tableSizeSelect.selectedIndex;
document.forms[0].tableSizeSelect[tableSizeSelectedIndex].selected = false;
setSelected (document.forms[0].tableSizeSelect.options, '${tableSize}');
Best regards Ken in nashua
_________________________________________________________________
Share life as it happens with the new Windows Live.Download today it's FREE!
http://www.windowslive.com/share.html?ocid=TXT_TAGLM_Wave2_sharelife_112007