You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Emile Kok <em...@toughguy.net> on 2001/11/15 23:07:23 UTC

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: single-record results

Posted by Dan Bachelder <ch...@chowda.net>.
Vector clients = getClients();
if(clients != null && clients.size() > 0) context.put("client",
clients.get(0));

----- Original Message -----
From: "Emile Kok" <em...@toughguy.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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" <em...@toughguy.net>
> >To: "Turbine Users List" <tu...@jakarta.apache.org>
> >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:
> ><ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> ><ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> >--
> >To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> >For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: single-record results

Posted by Emile Kok <em...@toughguy.net>.
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" <em...@toughguy.net>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>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:
><ma...@jakarta.apache.org>
> > For additional commands, e-mail:
><ma...@jakarta.apache.org>
> >
> >
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: single-record results

Posted by Emile Kok <em...@toughguy.net>.
context.put("clients", 
(getClient(data).size()==0)?"":getClient(data).get(0)); worked.

thanks for your help Dan.

At 05:15 PM 11/15/01 -0500, you wrote:
>context.put("client", getClients().get(0));
>
>?
>
>----- Original Message -----
>From: "Emile Kok" <em...@toughguy.net>
>To: "Turbine Users List" <tu...@jakarta.apache.org>
>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:
><ma...@jakarta.apache.org>
> > For additional commands, e-mail:
><ma...@jakarta.apache.org>
> >
> >
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: single-record results

Posted by Dan Bachelder <ch...@chowda.net>.
context.put("client", getClients().get(0));

?

----- Original Message -----
From: "Emile Kok" <em...@toughguy.net>
To: "Turbine Users List" <tu...@jakarta.apache.org>
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:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>