On Tue, April 19, 2005 10:46 am, Michael J. said: > Struts-only or JSP-only solution is not good enough. The more portable > is the better, so when I read Frank's proposal I thought, why those > input controls are generated with custom tags? What if controls were > created with Javascript? Custom tags would be generating setup > parameters for these Javascript instead of generating input controls > directly. The result is greater portability for the control library: > basically, it would be a pure Javascript library.
You may not believe this, but I started down this path something like five years ago... In fact, I still have the first POC I threw together. It treated a web UI much like SWING in the sense that you wouldn't actually write markup, you would write code instead. Now, this is a **BAD IDEA** imho, and I recognize that now, but it is interesting and somewhat relevant none the less. Here's an example: <html> <head> <link rel="StyleSheet" href="VisML_Styles.css" type="text/css"> <script language="javascript" src="VisML_Base.js"></script> <script language="javascript" src="VisML_Spinner.js"></script> <script language="javascript" src="VisML_Swapper.js"></script> <script language="javascript" src="VisML_Button.js"></script> <script> var myGUI = new VisML("myGUI"); function createGUI() { myGUI.createComponent(myGUI.componentButton, "Button1", "lyrComponent"); myGUI.Button1.registerCallback(myGUI.eventOnClick, Button1_onClick); myGUI.Button1.setLabel("This is a button - CLICK ME"); myGUI.createComponent(myGUI.componentSpinner, "Spinner1", "lyrComponent"); myGUI.Spinner1.setMinimum(5); myGUI.Spinner1.setMaximum(15); myGUI.Spinner1.setValue(10); myGUI.createComponent(myGUI.componentSwapper, "Swapper1", "lyrComponent"); myGUI.Swapper1.setWidth(80); myGUI.Swapper1.addItem(myGUI.Swapper1.swapperSource, "Item #1", "I1"); myGUI.Swapper1.addItem(myGUI.Swapper1.swapperSource, "Item #2", "I2"); myGUI.Swapper1.addItem(myGUI.Swapper1.swapperSource, "Item #3", "I3"); myGUI.Swapper1.addItem(myGUI.Swapper1.swapperSource, "Item #4", "I4"); } function Button1_onClick() { alert("You clicked the button!"); } </script> </head> <body onLoad="createGUI()";> <td height="160" align="center"><div id="lyrComponent"> </div></td> </body> </html> I was starting to create custom widgets as well, aside from the usual... the spinner is just like a spinner in windows with the up and down arrows, and the swapper is two textboxes side to side where you can move items from one side to another and reorder them. All of them could be rendered in a completely custom way, i.e., they didn't have to use the base HTML button at all (although they did the first time around). Your idea is interesting because if we created a taglib to basically create the code you see above, that could be something interesting. Just provide for the ability for the event callbacks to be server-side and it begins to look kinda cool. I also was beginning to create layout managers, which would be another logical addition. Frank --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]