In order to build an Echo2 component in the traditional way before converting it into GWT, I first need to pick a widget to build. I’d like to build one that hasn’t been done yet. I have one in mind: and edit-in-place label. The basic idea is that you can click on a bit of static text and have it turn into an input field with submit and cancel buttons. You can see the idea and an example of how to do it with prototype.js described here. Nothing too earth shattering, but useful nonetheless.
To see if this has already been done in Echo2, we have to look at five sources of components:
- Echo2 – the base set of components. Lots of interesting items that you can see at work in this demo app.
- Echo2Extras – and extra set of components distributed by NextApp — AccordionPane, BorderPane, ColorSelect, CalendarSelect, etc.
- Echo2Chart – charting widgets based on JFreeChart.
- EchopointNG – the definitive collection of third party Echo2 components, including a tree widget. The docs on this are a little iffy, so you have to piece it together from the NG demo app and the Javadoc. Trees, expanding boxes, RichTextArea. Good stuff, but no edit-in-place.
- Echo2 Contrib – the mysterious set of components that lives as a set of zip files in the Echo2 developers forum. Home of drag-and-drop, etc. Hard to say if it’s in there, but I can’t find it. BTW, someone should take ownership of this. I’d be happy to, if noone else has.
No edit-in-place to be found.
So the edit-in-place component looks like a good candidate. Unfortunately, the power of Echo2 gets in the way here. There is a way of building an edit-in-place component just by composing existing Echo2 components. It didn’t take me more than 10 minutes to put the following demo together (click on the name, edit, save or cancel). There is one drawback, however: clicking on the label initiaties a roundtrip to the server. Ideally we only want a roundtrip if there is a listener registered on the click. So a more efficient version of the edit-in-place widget is still a good idea.
OK, next week we take a shot at a first version of this component.
