From: Daniel Cremer Date: 2004-08-19T03:04:50+09:00 Subject: IOWA: hyperlinks and dynamic components Hi, I've been doing a tour of web application frameworks and right now I'm playing with IOWA which seems very solid indeed. One type of component I need to be able to write is one that would contain a dynamic list of hyperlinks to select choices. Such as for a menu generated by a CMS where users could create the navigation bar themselves. I would approach this by having one method called by all the hyperlinks with a parameter indicating which option was selected. I found a way to do it but I'm sure there must be a better solution. I quickly hacked a component that consisted of a hyperlink where the template including it could define the method to be invoked and a parameter to include. The menu component could then dynamically edit it's own template to include these custom hyperlinks as necessary. Is there some support in Iowa I haven't grasped that would make this easier ? thanks, -Daniel The custom component I mention is below. It would be added to the Menu component like this: .... -----SelectLink.html------ @text ---------------------------- -----SelectLink.iwa------- class SelectLink < Iowa::Component attr_reader :text def awake() @action = @attributes['action'] @param = @attributes['param'] @text = @attributes['text'] end def link_selected() @parent.send(@action, @param) end end --------------------------------------