Vector clients = getClients();
if(clients != null && clients.size() > 0) context.put("client",
clients.get(0));

----- Original Message -----
From: "Emile Kok" <[EMAIL PROTECTED]>
To: "Turbine Users List" <[EMAIL PROTECTED]>
Sent: Thursday, November 15, 2001 5:46 PM
Subject: Re: single-record results


> got this: ERROR -- Turbine.handleException: Array index out of range: 0
> tried resolving with: context.put("clients",
> (getClient(data)==null)?"":getClient(data).get(0));, but that doesn't
work.
>
> cheers
> Emile
>
> At 05:15 PM 11/15/01 -0500, you wrote:
> >context.put("client", getClients().get(0));
> >
> >?
> >
> >----- Original Message -----
> >From: "Emile Kok" <[EMAIL PROTECTED]>
> >To: "Turbine Users List" <[EMAIL PROTECTED]>
> >Sent: Thursday, November 15, 2001 5:07 PM
> >Subject: single-record results
> >
> >
> > > when returning a single record from a doSelect for display in a
template,
> > > can anyone suggest a way of making the fields accessible against the
> > > object.  If using a vector, one would have to use a for each loop to
> >return
> > > an object to assign input parameters against, or is there an easier
> > > way?  If there isn't, then instead of returning Vector from a
doSelect,
> > > what would be the alternative?  ie. instead of
context.put("clients_list",
> > > getClients());, I'd like context.put("client", getClient()); - to be
> > > referenced directly in the template: $client.Name.
> > >
> > > thanks
> > > Emile
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> > >
> > >
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to