From: <sim...@us...> - 2007-11-24 22:15:37
|
Revision: 626 http://zkforge.svn.sourceforge.net/zkforge/?rev=626&view=rev Author: simon_massey Date: 2007-11-24 14:15:41 -0800 (Sat, 24 Nov 2007) Log Message: ----------- refactored to use the zk3 "forward" feature. Modified Paths: -------------- trunk/foodToGo/src/main/webapp/zul/restaurant.zul Modified: trunk/foodToGo/src/main/webapp/zul/restaurant.zul =================================================================== --- trunk/foodToGo/src/main/webapp/zul/restaurant.zul 2007-11-24 19:21:37 UTC (rev 625) +++ trunk/foodToGo/src/main/webapp/zul/restaurant.zul 2007-11-24 22:15:41 UTC (rev 626) @@ -20,36 +20,25 @@ <rows> <row> <label id="RestaurantNameLabel" value="Restaurant Name:" /> - <textbox id="namebox"> - <attribute name="onChange"> - <!-- - fire an invented event onto the Macro Component itself which is the spaceOwner - see restaurant-marco.zs for the defintion of the macro class. the annotation - data binder responds as we have the following annotation in index.zul: + <!-- + forward the onChange event to the spaceOwner's onNameChange + the annotation data binder responds as we have the following + annotation in index.zul: save-when:self.onNameChange; - the annotation will call a setter on the POJO entity loaded from the database - --> - <![CDATA[ - Events.sendEvent(spaceOwner, new Event("onNameChange", spaceOwner)); - ]]> - </attribute> - </textbox> + the annotation will call a setter on the POJO entity loaded from the database + --> + <textbox id="namebox" forward="onChange=onNameChange"/> </row> <row> <label id="RestaurantTypeLabel" value="Restaurant Type:" /> - <listbox id="typeselect" mold="select" rows="1"> - <attribute name="onSelect"> - <!-- - fire an invented event onto the Macro Component itself which is the spaceOwner - see restaurant-marco.zs for the defintion of the macro class. the annotation - data binder responds as we have the following annotation in index.zul: + <!-- + forward the onSelect event to the spaceOwner's onTypeChange + the annotation data binder responds as we have the following + annotation in index.zul: save-when:self.onTypeChange; - the annotation will call a setter on the POJO entity loaded from the database - --> - <![CDATA[ - Events.sendEvent(spaceOwner, new Event("onTypeChange", spaceOwner)); - ]]> - </attribute> + the annotation will call a setter on the POJO entity loaded from the database + --> + <listbox id="typeselect" mold="select" rows="1" forward="onSelect=onTypeChange"> <listitem label="- - - Please Select - - -" value="" /> <listitem label="Italian" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |