I like it. I think there could be some mods to the API though. Instead of a "isHomePage" shouldn't that be stored at the application level (not per page). For example, there could be a .add() method on the Application that accepted a boolean for homepage ( add(new Page(), true); ).
On a slightly different note, when the component layer get started up things like Label() will be wonderful with this. Great work Geert! Cheers, Tyler On 6/27/06, Geert Bevin <[EMAIL PROTECTED]> wrote:
Hi everyone, I went to a Wicket presentation at TSSJS Europe and suddenly it dawned on me that nothing prevents RIFE to also support the way Wicket creates a component hierarchy. Basically they use the 'extends' keyword to create custom components and use the 'new' keyword together with composition (add method) to create the hierarchy. I quickly hacked together an experimental API that supports this and included it as an attachment. You need to latest snapshot of RIFE for this to work (http://rifers.org/downloads/rife/snapshots/rife-1.5M3- snapshot-20060627/). The archive contains almost the same functionalities as the stateful counter example (http://rifers.org/09_stateful_counters - http:// rifers.org/09_stateful_counters/src/), except that I added an additional embedded 'Label' element to test the hierarchy of page fragments. Of course this API is very experimental and I'm sure there are many problems and oversights. It allows you to create sites like this though: Application application = new Application() .add(new Page("hello") { public void processElement() { print(getHtmlTemplate("home")); } public boolean isHomePage() { return true; } public void setupComponents() { add(new PageFragment("Counter") { public void setupComponents() { add(new PageFragment("Label") { public void processElement() { // ... } }); } // ... public void processElement() { // ... } }); } }); What do you think, is it a good idea to add this capability to the core framework? Take care, Geert -- Geert Bevin Uwyn "Use what you need" - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com _______________________________________________ Rife-users mailing list [email protected] http://lists.uwyn.com/mailman/listinfo/rife-users
_______________________________________________ Rife-users mailing list [email protected] http://lists.uwyn.com/mailman/listinfo/rife-users
