''Because a simple to use interface should also be simple to program.'' [TP] Æjaks combines the server-side [Ajax] windowing system [Echo2] with the powerful simplicity of the Tcl language. The result is a rich development environment in which to develop Ajax-based web applications, often with much less code to write. Download, documentation, source code, mailing list, etc. now online at: http://aejaks.sourceforge.net/ '''24 September 2008 - version 1.1 released, changes at [http://aejaks.sourceforge.net/CHANGES.txt]''' ---- ''' Sample Programs''' Here are sample programs for Tcl/Tk and Æjaks, side-by-side to compare. Neither of these will look very pretty, as I have left out any sort of whitespace padding and grid type of layout. Tk Aejaks -------------------------------------- ---------------------------------------- # classic Tk style! Tk has reasonable # Aejaks looks pretty awful without some # (but dated) default style per OS # style, try without and you will agree. tk_bisque . setDefaultStyle bisque # Tk doesn't need a top frame for # Aejaks can only pack one component or # this simple example, but we will # container into ".", so we create a # add one for consistency # top level Column # Tk 'frames' don't have a set shape, # Aejaks 'Column' will always pack # but order child widgets based on # children into column orientation. # pack options. # Row containers are similarly row oriented. frame .top Column .top pack .top Pack .top frame .top.row1 Row .top.row1 label .top.row1.l1 -text X Label .top.row1.l1 -text X # Tk has 'entry' widget # Aejaks has 'TextField' widget entry .top.row1.x TextField .top.row1.x # pack with options '-side left' # Pack knows parent is a Row pack .top.row1.l1 .top.row1.x \ Pack .top.row1.l1 .top.row1.x -side left pack .top.row1 Pack .top.row1 frame .top.row2 Row .top.row2 label .top.row2.l1 -text Y Label .top.row2.l1 -text Y entry .top.row2.y TextField .top.row2.y pack .top.row2.l1 .top.row2.y \ Pack .top.row2.l1 .top.row2.y -side left pack .top.row2 Pack .top.row2 frame .top.row3 Row .top.row3 # exit button runs tcl 'exit' # exit button runs Window 'exitApp' method button .top.row3.exit -text Exit \ Button .top.row3.exit -text Exit \ -command exit -command {. exitApp /} pack .top.row3.exit -side left Pack .top.row3.exit button .top.row3.mult -text Multiply \ Button .top.row3.mult -text Multiply \ -command doMultiply -command doMultiply label .top.row3.result Label .top.row3.result pack .top.row3.mult .top.row3.result \ Pack .top.row3.mult .top.row3.result -side left pack .top.row3 Pack .top.row3 # not an ideal proc, since we have # ditto # tied the gui widgets to actual # " # code. Easily fixable, but this # " # will suffice for comparisons # " proc doMultiply {} { proc doMultiply {} { # entry widgets have a 'get' method # TextFields use 'cget -text' (soon will have 'get') set x [.top.row1.x get] set x [.top.row1.x cget -text] set y [.top.row2.y get] set y [.top.row2.y cget -text] set res "can't multiply $x * $y" set res "can't multiply $x * $y" catch {set res [expr { $x * $y }]} catch {set res [expr { $x * $y }]} .top.row3.result configure -text $res .top.row3.result configure -text $res } } ---- [LV] Anyone know of a web site which makes use of this package, so a demo of the capabilities can be seen? [TP] answers: '''localhost''' is your best bet for now. The distribution file aejaks-0.7-exe.tar.gz or aejaks-0.7-exe.zip has '''everything''' you need, except a Java installation. This makes Æjaks a ''batteries included'' distribution, that's why it's such a big file. (There are even ''backup batteries'' yet to be utilized, waiting for a future release. :-) The Æjaks website has a specific page [http://aejaks.sourceforge.net/Documentation/Running/index.html] on starting the server with the sample apps. In short: 1. unpack the distribution. 1. change to the directory that was unpacked. 1. '''run.sh''' (Windows users '''run.bat'''). 1. point your browser to http://localhost:8080/ 1. ''Now, be amazed that you're running this on your browser.'' Now, if you just want to see the flavor of the toolkit, the [Echo2] page at NextApp has some demo programs to run. Surf on over to: http://nextapp.com/platform/echo2/echo/demo/ Anything that is done with the Java-based demos can be completely done in Tcl with Æjaks. The 0.4 release of Æjaks doesn't include the Extras and Chart widgets in Tcl yet, but you can still make use of those through the TclJava interfaces [http://tcljava.sourceforge.net/docs/TclJava/contents.html] if you really want. (Avoid the ''Test'' applications on the NextApp demo page.) [TP] ''06 July 2007'' - Version 0.5 now includes Echo2 Extras, ChartDisplay, and FileTransfer widgets. patrick@zill.net says: Have looked over this and it looks pretty astounding. Can't wait to get me hands dirty with this. ---- 2007-01-17 [VI] One cool app! I am writing some of our internal tools using this. Is there any way to (prompt the user to) load or save a file? Or everything has to be done on their server? [TP] Echo2 has a FileTransfer library jar, and it is included in the Æjaks ./lib directory. Æjaks doesn't yet have Tcl support for FileTransfer, it is on my To-Do list. You should be able to use it now using Jacl's ''java'' package to interface directly. See the FileTransfer example on the NextApp Echo2 Wiki [http://wiki.nextapp.com/echowiki/Echo2FileTransferExample]. [TP] ''06 July 2007'' - Version 0.5 now includes Echo2 Extras, ChartDisplay, and FileTransfer widgets. ---- 2007-01-25 [MRJC] Is there a reason why the Tk Convention of lower case windowing commands can't be supported? Tk Aejaks (NOW) -------------------------------------- ---------------------------------------- pack .top.row1 Pack .top.row1 Tk Aejaks (POSSIBLE??) -------------------------------------- ---------------------------------------- pack .top.row1 pack .top.row1 [TP] Æjaks is not compatible with Tk, and I believe it would be confusing to name widgets and commands the same as Tk. The '''Pack''' command has different syntax from '''pack'''. However, if you would really like to use '''pack''' in Æjaks, Tcl provides an easy way to alias commands, see [interp alias]. ---- [IL] 2/2/2007 I can try to put up a demo app of this provided it doesn't conflict with my main tomcat setup. Check back sometime after the weekend :). Update: I can't seem to find an easy .war for this for those of us that already have a container set up. Did I miss it somewhere? [TP] The .war file is included in any of the download files, in the ./war/ directory after unpacking. I haven't made a .war available as separate download yet, but I'll make one available for the next release. [IL] - Right, I saw that one, and deployed it, but it can't seem to run the demos by itself, so I started messing around with the web.xml in order to try get it to work, but gave up and used the Jetty demo which worked fine. After the next release, I can try again, I'd like to put this on my host. [TP] ''06 July 2007'' - Version 0.5 distribution includes AejaksDemo.war, ready to deploy in a running Java web server. ---- [VI] 15-MAR-2007 Probably doesn't belong here - I'd like to build something like this for the GWT (http://code.google.com/webtoolkit/) - any ideas on how I could start? [Roy Keene] VI, Maybe a good start: [Porting a Tk GUI to A Web Browser] especially TkWeb (by me) :-) ---- [SAF] 05-June-2007 Looks pretty good. Since this all server based, I assume there is no way to have an offline caching mode like JavaFX, Apollo, GoogleGears, etc.? [TP] Correct. ---- [NEM] ''12 May 2007'': The example apps on the Echo2 webpage seem to be quite [MDI] in nature, i.e. the browser window becomes a mini window manager. Can you configure Æjaks to open native windows instead of using these "fake" windows? [TP] Basically, no. I don't know the exact specifics, but probably has a lot to do with the Javascript context per browser window. There are additional Echo2 UI widgets such as Tab and Accordion panes that might help to organize an application. These are supported by Æjaks in the current SVN sources. [TP] ''06 July 2007'' - Version 0.5 includes AccordionPane, TabPane, and TransitionPane containters. ---- [XO] ''17-June-2007'': I did a little tweak on running [Snit] under [Jacl]; with minor modification, I was able to run Snit inside Jacl, but the [tcltest] script '''snit.test''' is a bit difficult to port though (jacl supports tcltest V1.0 which is very different from the tcltest V2.2 required by snit.test). So I have not run the snit regresstion test under jacl. It took me a while to figure out that there is a little trick to make the Snit package work like it does under Tcl. I thought I could simply copy the snit folder under D:\jacl140\lib folder, and I would be able to fire away ''package require snit''. Jacl didn't work out that way, until I specified the property ''-DTCLLIBPATH D:\jacl140\lib'' when invoking the java command. But this trick doesn't work for [Aejaks], I don't know why? [TP] Jacl processes the TCLLIBPATH property and adds paths listed to the ''auto_path'' global variable, but you should use Unix-style pathnames and separators, even with running on Windows. An equal sign is also required between the property name and its value. The correct usage on the java command line would be: ''-DTCLLIBPATH=D:/jacl140/lib'' ---- [Chang LI] Glad to test Aejaks. Several questions: (1)Where is the directory that I can put my own tcl code? (2)Where is the directory to add a Tcl library? (3)How can I write HTML page with Jacl? [TP] Please see the documentation, it should answer all of your questions. Specifically, for your questions (1) and (2), see: http://aejaks.sourceforge.net/Documentation/Configuration/index.html. For (3) you do not write HTML, you write Tk-like widget commands instead, see: http://aejaks.sourceforge.net/Documentation/Programmer's_Guide/index.html or the example above. [MHo]: 1. Shure I missed something. If aejaks says I should close a window - how do I do this...? There is no such thing as a ''close symbol'' or ''system menue''... I could move and resize, ok, but...? [TP] Hmm, there should be a 'X' in the top right corner of windows that allow themselves to be closed. If not, please send a screenshot to me, and follow up on the mailing list. Are you somehow blocking images from be loaded on your browser? 1. On my WinXP, something's going wrong. If I started an application, say '''.../aejaks/app?AEJAKS_SCRIPT_NAME=widget_tour.tcl''', then the previously called app appears... and if I alter a procedure in the /samples dir, aejaks ignores the changes until restarting the server. Seems a kind of caching occures... Maybe my ''SeaMonkey'' fools me. [TP] This is because Aejaks is entirely '''stateful''', not ''stateless'' as other HTTP applications. Aejaks (Echo2 really) uses a JSESSIONID cookie to maintain state with your window session objects and your Jacl interpreter. You should use the 'Exit' button or menu 'Exit' menu selection to quit the applications. 1. On windows, long running service applications should be implemented and running as so called ''windows services''. Is there a way to turn the whole jetty stuff into such a true windows service which survives logoff etc.? [TP] Should be possible, see http://docs.codehaus.org/display/JETTY/Win32Wrapper. ---- [TP] Please use care when editing this page so that the code formatting is left as is. ---- !!!!!! %| [Category Development] | [Category Internet] | [Category Ajax] |% !!!!!!