tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Bolka <andreas.bo...@gmx.net>
Subject Re: Optional Centering
Date Tue, 26 Aug 2003 23:23:45 GMT

Tuesday, August 26, 2003, 9:09:54 PM, Joel wrote:

> I want to have my page optionally centered. I wrapped the top
> <center> with a Conditional and the bottom </center> with a
> Conditional. Of course, Tapestry complains that the nested html
> isn't well formed. How do I get this functionality?

------
.html:
------
<style>
  .center { text-align: center; }
  .default { text-align: left; }
</style>
...
<div jwcid="centerDiv">
  ... page content ...
</div>

------
.page:
------
<component id="centerDiv" type="Any">
  <binding name="class" expression="centerDivClass" />
</component>

------
.java:
------
public String getCenterDivClass() {
  return isCentered() ? "center" : "default";
}

[may contain some typos :)]

-- 
Best regards,
 Andreas                            mailto:andreas.bolka@gmx.net



Mime
View raw message