You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bo...@serviceinformation.ws on 2003/09/17 18:16:04 UTC

lost ArrayList

A Foreach component appears a the template as:

<forEachProvider jwcid="@Foreach" expression="ognl:providerList"
value="ognl:provider">
....
</forEachProvider>


The class for the page containing this Foreach component contains the 
following

private ArrayList providerList;
 
public ArrayList getProviderList() {
          devOut("getting provider list");
          return this.providerList;
      }

    public void pageBeginRender(PageEvent event) {
        devOut("start begin Render");
        this.visit = (Visit)getEngine().getVisit();
        this.ratingQuery=new RatingQuery(visit.getSfData());
        String status=ratingQuery.setResultSet(visit.getRatingFilters());
        this.providerList=this.ratingQuery.getProviderList();
        devOut("list size- " + getproviderList().size());
        devOut("begin render done");
    }



Running the web application  produced the following log file, which 
indicates  getProvderList() was called by the pageBeginRender method but 
not by the Foreach component.

RatingsResults object log created Wed Sep 17 11:42:56 EDT 2003
from constructor
start begin Render
getting provider list
list size- 56
begin render done

(End of  file)

I assume that the  expression="ognl:providerList"  attribute in the the 
template component element would cause the getProviderList() method to 
be called.  I assume that this would cause another "getting provider 
list" line to be entered into the class log file.  This  did not 
happen.  The web app returned a page but the component was missing and 
evidenty there was no call to the getProviderList() method from the 
Foreach component.  There is no error message.  I need help finding out 
what went wrong.

Thanks

Bob Newsome





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: lost ArrayList

Posted by Mindbridge <mi...@yahoo.com>.
Hi,

> <forEachProvider jwcid="@Foreach" expression="ognl:providerList"
> value="ognl:provider">

The list should be passed to the 'source' parameter, not the 'expression'
parameter (actually, I don't think there is such).

Reference:
http://jakarta.apache.org/tapestry/doc/ComponentReference/Foreach.html

-mb


----- Original Message ----- 
From: <bo...@serviceinformation.ws>
To: <ta...@jakarta.apache.org>
Sent: Wednesday, September 17, 2003 7:16 PM
Subject: lost ArrayList


> A Foreach component appears a the template as:
>
> <forEachProvider jwcid="@Foreach" expression="ognl:providerList"
> value="ognl:provider">
> ....
> </forEachProvider>
>
>
> The class for the page containing this Foreach component contains the
> following
>
> private ArrayList providerList;
>
> public ArrayList getProviderList() {
>           devOut("getting provider list");
>           return this.providerList;
>       }
>
>     public void pageBeginRender(PageEvent event) {
>         devOut("start begin Render");
>         this.visit = (Visit)getEngine().getVisit();
>         this.ratingQuery=new RatingQuery(visit.getSfData());
>         String status=ratingQuery.setResultSet(visit.getRatingFilters());
>         this.providerList=this.ratingQuery.getProviderList();
>         devOut("list size- " + getproviderList().size());
>         devOut("begin render done");
>     }
>
>
>
> Running the web application  produced the following log file, which
> indicates  getProvderList() was called by the pageBeginRender method but
> not by the Foreach component.
>
> RatingsResults object log created Wed Sep 17 11:42:56 EDT 2003
> from constructor
> start begin Render
> getting provider list
> list size- 56
> begin render done
>
> (End of  file)
>
> I assume that the  expression="ognl:providerList"  attribute in the the
> template component element would cause the getProviderList() method to
> be called.  I assume that this would cause another "getting provider
> list" line to be entered into the class log file.  This  did not
> happen.  The web app returned a page but the component was missing and
> evidenty there was no call to the getProviderList() method from the
> Foreach component.  There is no error message.  I need help finding out
> what went wrong.
>
> Thanks
>
> Bob Newsome
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: lost ArrayList

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Yes, that looks like an error to me; Foreach's source parameter should be required, it should just
accept null as a potential value.

That would have flagged this situation nicely; source not bound (expression will end up as an
informal parameter).

Could you add a bug about this?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Bryan Lewis [mailto:bryan@maine.rr.com] 
> Sent: Wednesday, September 17, 2003 2:56 PM
> To: Tapestry users
> Subject: Re: lost ArrayList
> 
> 
> The word "expression" should be "source" in the template.
> 
> Normally one might expect Tapestry to give a better error 
> message about the missing 'source' binding, but it's not 
> required (believe it or not -- see the Component Reference), 
> and Foreach allows informal parameters.  Hence Tapestry 
> thinks your Foreach is being given a null list, plus an 
> informal parameter you invented named 'expression'.
> 
> 
> ----- Original Message ----- 
> From: <bo...@serviceinformation.ws>
> To: <ta...@jakarta.apache.org>
> Sent: Wednesday, September 17, 2003 12:16 PM
> Subject: lost ArrayList
> 
> 
> > A Foreach component appears a the template as:
> >
> > <forEachProvider jwcid="@Foreach" expression="ognl:providerList" 
> > value="ognl:provider"> ....
> > </forEachProvider>
> >
> >
> > The class for the page containing this Foreach component 
> contains the 
> > following
> >
> > private ArrayList providerList;
> >
> > public ArrayList getProviderList() {
> >           devOut("getting provider list");
> >           return this.providerList;
> >       }
> >
> >     public void pageBeginRender(PageEvent event) {
> >         devOut("start begin Render");
> >         this.visit = (Visit)getEngine().getVisit();
> >         this.ratingQuery=new RatingQuery(visit.getSfData());
> >         String 
> status=ratingQuery.setResultSet(visit.getRatingFilters());
> >         this.providerList=this.ratingQuery.getProviderList();
> >         devOut("list size- " + getproviderList().size());
> >         devOut("begin render done");
> >     }
> >
> >
> >
> > Running the web application  produced the following log file, which 
> > indicates  getProvderList() was called by the 
> pageBeginRender method 
> > but not by the Foreach component.
> >
> > RatingsResults object log created Wed Sep 17 11:42:56 EDT 2003 from 
> > constructor start begin Render
> > getting provider list
> > list size- 56
> > begin render done
> >
> > (End of  file)
> >
> > I assume that the  expression="ognl:providerList"  attribute in the 
> > the template component element would cause the getProviderList() 
> > method to be called.  I assume that this would cause 
> another "getting 
> > provider list" line to be entered into the class log file.  
> This  did 
> > not happen.  The web app returned a page but the component 
> was missing 
> > and evidenty there was no call to the getProviderList() method from 
> > the Foreach component.  There is no error message.  I need help 
> > finding out what went wrong.
> >
> > Thanks
> >
> > Bob Newsome
> >
> >
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: lost ArrayList

Posted by Bryan Lewis <br...@maine.rr.com>.
The word "expression" should be "source" in the template.

Normally one might expect Tapestry to give a better error message about the
missing 'source' binding, but it's not required (believe it or not -- see the
Component Reference), and Foreach allows informal parameters.  Hence Tapestry
thinks your Foreach is being given a null list, plus an informal parameter you
invented named 'expression'.


----- Original Message ----- 
From: <bo...@serviceinformation.ws>
To: <ta...@jakarta.apache.org>
Sent: Wednesday, September 17, 2003 12:16 PM
Subject: lost ArrayList


> A Foreach component appears a the template as:
>
> <forEachProvider jwcid="@Foreach" expression="ognl:providerList"
> value="ognl:provider">
> ....
> </forEachProvider>
>
>
> The class for the page containing this Foreach component contains the
> following
>
> private ArrayList providerList;
>
> public ArrayList getProviderList() {
>           devOut("getting provider list");
>           return this.providerList;
>       }
>
>     public void pageBeginRender(PageEvent event) {
>         devOut("start begin Render");
>         this.visit = (Visit)getEngine().getVisit();
>         this.ratingQuery=new RatingQuery(visit.getSfData());
>         String status=ratingQuery.setResultSet(visit.getRatingFilters());
>         this.providerList=this.ratingQuery.getProviderList();
>         devOut("list size- " + getproviderList().size());
>         devOut("begin render done");
>     }
>
>
>
> Running the web application  produced the following log file, which
> indicates  getProvderList() was called by the pageBeginRender method but
> not by the Foreach component.
>
> RatingsResults object log created Wed Sep 17 11:42:56 EDT 2003
> from constructor
> start begin Render
> getting provider list
> list size- 56
> begin render done
>
> (End of  file)
>
> I assume that the  expression="ognl:providerList"  attribute in the the
> template component element would cause the getProviderList() method to
> be called.  I assume that this would cause another "getting provider
> list" line to be entered into the class log file.  This  did not
> happen.  The web app returned a page but the component was missing and
> evidenty there was no call to the getProviderList() method from the
> Foreach component.  There is no error message.  I need help finding out
> what went wrong.
>
> Thanks
>
> Bob Newsome
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org