|
Improvements Helma's skin and macro features allow you to easily create layouts following the same hierarchical structure the represented data was built of. <a href="mailto:<% this.email %>"><% this.firstname %> <% this.lastname %></a><br />I think the three macros in this skin are pretty self-explanatory. They all refer to the current HopObject by this (ie. this will be evaluated to a Person HopObject at runtime) and three of the five custom properties we defined for it. Each of them will be replaced by the corresponding HopObject's property value. Save this skin as link.skin in the Person directory. The code for actions performed on an object is stored in hac files which are just text-files with a senseful name and the file-extension hac - for instance edit.hac. The default action for an object is stored in main.hac We will now define the default action for the application's Root object and change the file called main.hac in the Root folder to contain code that looks like this: apps/addressbook/Root/main.hac:
var str = "";
for (var i=0; i< root.size(); i++) {
var person = root.get(i);
str += person.renderSkinAsString("link");
}
res.data.title = "Helma Address Book";
res.data.body = str;
renderSkin("html");
If everything is done right, Helma will now render the skin Person/link.skin for each person HopObject using the corresponding object data. And so your browser display should look much more beautiful:Hannes Wallnoefer Robert Gaggl Tobi Schaefer See how easy Helma skins and macro work? And in effect, you create very flexible and modular web applications. And you even can use your own custom macros just continue reading...
... comment
ultraniblet,
Friday, 29. June 2007, 16:19
Error retrieving NodeIDs
Hi, I was getting "java.lang.RuntimeException: Error retrieving NodeIDs"
Until I read this document: http://helma.org/docs/howtos/mysql/ ... link ... comment |
navigation
Download
Community
Weblog
Mailing Lists
IRC Channel
Documentation
Introductions
Tools
Reference
Project
Roadmap
Bug Reporting
Source
Wiki
Tags
Updates
Related Projects
search
|
||||