I'll create a test case around this example and check it out.

On 2/22/07, Peter Beshai <[EMAIL PROTECTED]> wrote:
Thanks for the fast reply... I tried it out, but I got a
NullPointerException:

java.lang.NullPointerException Stack trace

   - org.apache.tapestry.internal.TapestryUtils.computeDepth(
   TapestryUtils.java:375)
   - org.apache.tapestry.internal.TapestryUtils.orderProperties(
   TapestryUtils.java:354)
   - org.apache.tapestry.internal.services.BeanModelSourceImpl.create(
   BeanModelSourceImpl.java:110)
   -
   $BeanModelSource_110eaaa53c1.create($BeanModelSource_110eaaa53c1.java)
   - my.package.pages.Start.getModelForGrid(Start.java:54)
   - $PropertyConduit_110eaaa5416.get($PropertyConduit_110eaaa5416.java)
   - org.apache.tapestry.internal.bindings.PropBinding.get(
   PropBinding.java:54)
   -
   
org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.readParameter
   (InternalComponentResourcesImpl.java:189)
   - org.apache.tapestry.corelib.components.Grid._$read_parameter_model(
   Grid.java)
   - org.apache.tapestry.corelib.components.Grid.getDataModel(Grid.java
   :230)
   - org.apache.tapestry.corelib.components.GridColumns.getColumnNames(
   GridColumns.java:116)
   - $PropertyConduit_110eaaa542a.get($PropertyConduit_110eaaa542a.java)

which eventually filters up to give:


   - org.apache.tapestry.ioc.internal.util.TapestryException Failure
   reading parameter source of component
   my.package.pages.Start:grid_0.columns.loop: Failure reading parameter
   model of component my.package.pages.Start:grid_0:
   org.apache.tapestry.ioc.internal.util.TapestryException
   locationclasspath:org/apache/tapestry/corelib/components/GridColumns.html,
   line 3, column 106


I entered the code you gave me into the Start java file and entered:
<t:comp type="Grid" source="prop:items" model="prop:modelForGrid"/>
in Start.html.

Start.java also contains:
private Collection<MyInterface> _items = _myService.getAll();
along with getters and setters.


MyInterface essentially is:

public interface MyInterface {
    public String getDescription();
    public void setDescription(String description);
    public Date getLastModified();
    public void setLastModified(Date lastModified);
    public String getTitle();
    public void setTitle(String title);
    public Collection getCategories();
    public void setCategories(Collection categories);
    public Collection getReferences();
    public void setReferences(Collection references);
}


I'm also interested in how Grid will handle collections/how I can tell it
to.


What am I doing wrong? :-( Thanks!

On 2/22/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
>
> @Inject
> private BeanModelSource _modelSource;
>
> @Inject
> private ComponentResources _resources;
>
> public BeanModel getModelForGrid()
> {
>   return _modelSource.create(MyInterface.class, false, _resources);
> }
>
> ... and bind the Grid's model parameter to the modelForGrid property.
>
> On 2/22/07, Peter Beshai <[EMAIL PROTECTED]> wrote:
> > I am running into difficulty getting Grid to work with my data. I have a
> > collection of MyInterface which is filled with objects of
> MyInterfaceImpl.
> > The problem is that MyInterfaceImpl is package-private, which causes
> > PropertyConduit to throw an exception::
> >
> > java.lang.IllegalAccessError tried to access class
> > my.package.MyInterfaceImpl from class $PropertyConduit_110ea5beca5
> > Stack trace
> >
> >    - $PropertyConduit_110ea5beca5.get($PropertyConduit_110ea5beca5.java)
> >    -
> >
> org.apache.tapestry.internal.services.CoercingPropertyConduitWrapper.get
> >    (CoercingPropertyConduitWrapper.java:36)
> >    - org.apache.tapestry.corelib.components.GridCell.beginRender(
> >    GridCell.java:64)
> >    - org.apache.tapestry.corelib.components.GridCell.beginRender(
> >    GridCell.java)
> >    -
> >
> org.apache.tapestry.internal.structure.ComponentPageElementImpl$10$1.run
> >    (ComponentPageElementImpl.java:334)
> >    -
> >
> org.apache.tapestry.internal.structure.ComponentPageElementImpl.invoke
> >    (ComponentPageElementImpl.java:931)
> >    -
> >
> org.apache.tapestry.internal.structure.ComponentPageElementImpl.access$100
> >    (ComponentPageElementImpl.java:68)
> >    -
> >
> org.apache.tapestry.internal.structure.ComponentPageElementImpl$10.render
> >    (ComponentPageElementImpl.java:338)
> >    - org.apache.tapestry.internal.services.RenderQueueImpl.run(
> >    RenderQueueImpl.java:57
> >
> >
> > Does anyone have any suggestions on what to do? Will it require me to
> code
> > my own BeanModel for the Grid?? I find that kind of confusing, so any
> help
> > would be great :-)
> >
> > Thanks
> > --
> > Peter Beshai
> >
> > Pure Mathematics/Computer Science Student
> > University of Waterloo
> >
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Peter Beshai

Pure Mathematics/Computer Science Student
University of Waterloo



--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to