You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mi...@expeditors.com on 2006/01/31 02:54:24 UTC
RenderBlock / ValidField Labels
Ok, so I've headed down the RenderBlock path for dynamic components. I'm
getting some success, and I'm beginning to see the light, but I'm not sure
how to handle the issue of setting the label for a ValidField.
How do you change the label?
In my page's .java file I have a method that returns the block that should
be displayed:
public Block getBlockFromList()
{
Block b = null;
ValidField vf = null;
if (forWhateverReason)
{
b = (Block) getPage().getComponent("DynTextfieldBlock"); // set
block to use
vf = (ValidField) getPage().getComponent("DynValidfield"); // can
get valid field assoc with block
// what do I do here to change the label?
// the label's value will be read from the db here.....
}
}
.page
<component id="formComponent" type="RenderBlock">
<binding name="block" expression="getBlockFromList()"/>
</component>
<component id="DynValidfieldBlock" type="Block">
</component>
.html
<span jwcid="DynValidfieldBlock">
<span jwcid="DynValidfieldLabel"/><span jwcid="DynValidfield"/>
</span>
suggestions?
Thanks,
- Mike