Re: using template directives with anchor tags
Stefan Armbruster <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I suppose your HTML should look like:
<div><a name="anchor1">Anchor 1</a></div>
<div><a name="anchor2">Anchor 2</a></div>
<div><a name="anchor3">Anchor 3</a></div>
html mockup:
<div class="Dir::Iterate_Start.Anchors Dir::Iterate_Next.Anchors">
<a class="Dir::Get_Data.Anchor.anchor">blabla</a></div>
<div class="Dir::Iterate_End.Anchors Dir::Discard">Nothing</div>
snip of AnchorModel.java:
public Object getItem(String key) {
if ("anchor".equals(key)) {
BLink anchor = new BLink();
anchor.setText("whatever text");
anchor.setName("anchor1");
return anchor;
} else {...
}
I haven't tested this, but give it a try. If this doesn't work, you can
set the name attribute of the <a> tag explicit by
Dir::Set_Attr.<model>.<key>.<attribute>.
Regards,
Stefan
Am Mon, 2003-09-22 um 22.57 schrieb [email protected]:
> We need a way to use templates to take data from an iterative model and encapsulate it in an anchor tag. We tried using a BAction object, but that just ended up doing a toString() on it. Then we tried constructing the anchor tag ourselves, but it ends up getting URLEncoded somewhere... So, any ideas on how to use template directives with anchor tags?
>
> Thanks,
> Scott
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda