hlship 2005/06/21 04:53:32
Modified: examples/Workbench/src/java/org/apache/tapestry/workbench/palette
Palette.java
annotations/src/java/org/apache/tapestry/annotations
InjectPageAnnotationWorker.java
annotations/src/test/org/apache/tapestry/annotations
TestInjectPageAnnotationWorker.java
Log:
Fix a bug where the type of injection was not being set by @InjectPage.
Use @InjectPage in the Workbench.
Revision Changes Path
1.8 +8 -3
jakarta-tapestry/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/Palette.java
Index: Palette.java
===================================================================
RCS file:
/home/cvs/jakarta-tapestry/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/Palette.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Palette.java 9 Jun 2005 18:38:58 -0000 1.7
+++ Palette.java 21 Jun 2005 11:53:32 -0000 1.8
@@ -16,7 +16,9 @@
import java.util.List;
+import org.apache.tapestry.IPage;
import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.annotations.InjectPage;
import org.apache.tapestry.contrib.palette.SortMode;
import org.apache.tapestry.form.IPropertySelectionModel;
import org.apache.tapestry.form.StringPropertySelectionModel;
@@ -38,17 +40,20 @@
* Invoked before [EMAIL PROTECTED] #formSubmit(IRequestCycle)} if the
user clicks the "advance" button.
*/
- public void advance(IRequestCycle cycle)
+ @InjectPage("PaletteResults")
+ public abstract PaletteResults getResultsPage();
+
+ public IPage advance()
{
// Since Palette and palette.Results come from
// a library now, we need to make sure
// the namespace id is part of the name.
- PaletteResults results = (PaletteResults)
cycle.getPage("PaletteResults");
+ PaletteResults results = getResultsPage();
results.setSelectedColors(getSelectedColors());
- cycle.activate(results);
+ return results;
}
private IPropertySelectionModel colorModel;
1.2 +1 -0
jakarta-tapestry/annotations/src/java/org/apache/tapestry/annotations/InjectPageAnnotationWorker.java
Index: InjectPageAnnotationWorker.java
===================================================================
RCS file:
/home/cvs/jakarta-tapestry/annotations/src/java/org/apache/tapestry/annotations/InjectPageAnnotationWorker.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InjectPageAnnotationWorker.java 19 Jun 2005 16:21:15 -0000 1.1
+++ InjectPageAnnotationWorker.java 21 Jun 2005 11:53:32 -0000 1.2
@@ -42,6 +42,7 @@
InjectSpecification is = new InjectSpecificationImpl();
is.setProperty(propertyName);
+ is.setType("page");
is.setObject(injectPage.value());
spec.addInjectSpecification(is);
1.2 +1 -0
jakarta-tapestry/annotations/src/test/org/apache/tapestry/annotations/TestInjectPageAnnotationWorker.java
Index: TestInjectPageAnnotationWorker.java
===================================================================
RCS file:
/home/cvs/jakarta-tapestry/annotations/src/test/org/apache/tapestry/annotations/TestInjectPageAnnotationWorker.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestInjectPageAnnotationWorker.java 19 Jun 2005 16:21:15 -0000
1.1
+++ TestInjectPageAnnotationWorker.java 21 Jun 2005 11:53:32 -0000
1.2
@@ -45,6 +45,7 @@
InjectSpecification is = (InjectSpecification)
spec.getInjectSpecifications().get(0);
assertEquals("myPage", is.getProperty());
+ assertEquals("page", is.getType());
assertEquals("SomePageName", is.getObject());
assertNull(is.getLocation());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]