Table component and wrapped checkbox component
Juan Alvarez <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
I'm reading the example of workbench application. I'm primarly
interested in table component so i went to read the source code of
LocaleList component, and i found some hard to understand thing:
<tr jwcid="tableRows">
<td><span jwcid="checkbox"/></td>
<td jwcid="tableValues" align="center"/>
</tr>
The checkbox component is wrapped into the tableRows component,
TableRows component type, i like to know why that component knows what
locales are selected, so i go to read the xml descriptor to see the
associated expresion of the checkbox component:
<component id="checkbox" type="Checkbox">
<binding name="selected" expression="checkboxSelected"/>
</component>
then go to the java source code:
public boolean getCheckboxSelected()
{
return m_setSelectedLocales.contains(getCurrentLocale());
}
public void setCheckboxSelected(boolean bSelected)
{
if (bSelected)
m_setSelectedLocales.add(getCurrentLocale());
else
m_setSelectedLocales.remove(getCurrentLocale());
}
and all its pretty logical, but i dont understand:
When a component is in a foreach component and this foreach component is
in a form component, numeric identifier are automatically appended to
the name of the component?
The framework automatically calls in the render process the method
setCheckboxSelected, for each of the checkboxes generated?
--
Juan Alvarez Fluid Signal S.A.
mailto:[email protected] http://www.fluidsignal.com/
Key fingerprint: 15C4 0986 A174 862A B607 8EEA 934F 8649 07E2 EA40
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en