You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Troy Bull <tr...@gmail.com> on 2006/04/18 16:14:26 UTC

Question About Loading Items Into/ From Beans

Greetings:

I will start out by saying I am coming from a struts background.  When I 
program struts every one of my applications started out with kicker.do.  
This action is where I loaded up collections of DTO's (ejb 2).  Then in 
my jsp pages I would use these collections to display menus (drop downs) 
and other things. 

Now that I have switched to (or am trying to) JSF, I dont understand how 
I can access my database data.  For example, I have a page main.jsp and 
on that page I want to have a JSF data table.  I have a session facade 
bean that returns a collection of DTO's that I want in the table, how do 
I access this collection from my  page?  In the old scheme I would load 
the collection into a session scoped variable and then just iterate over 
it.  Is there some way I can tell my data table to invoke my session ejb 
facade bean?  I am really confused.

Thanks in advance for any pointers
troy

Re: Question About Loading Items Into/ From Beans

Posted by Matthias Wessendorf <ma...@apache.org>.
btw. [1] shows the complete value of UIData.getValue().
More on DataModel see [2]



[1] http://tinyurl.com/nnsg8
[2] http://tinyurl.com/moy8b

On 4/18/06, Matthias Wessendorf <ma...@apache.org> wrote:
> use in main.jsp <h:dataTable value="#{bean.list}" ...>
>
> and in constructor of your backing bean "bean" popluate the propery "list" .
>
> list can be any of these *types*:
> -  Arrays
> - java.util.List
> - java.sql.ResultSet
> - javax.servlet.jsp.jstl.sql.Result
>
> JSF isn't an action based framework.
>
> Btw. if you don't know how to define a backing bean, which is a normal
> JvaBean, please go ahead and read some *introductions* ;-)
>
> HTH,
> Matthias
>
> On 4/18/06, Troy Bull <tr...@gmail.com> wrote:
> > Greetings:
> >
> > I will start out by saying I am coming from a struts background.  When I
> > program struts every one of my applications started out with kicker.do.
> > This action is where I loaded up collections of DTO's (ejb 2).  Then in
> > my jsp pages I would use these collections to display menus (drop downs)
> > and other things.
> >
> > Now that I have switched to (or am trying to) JSF, I dont understand how
> > I can access my database data.  For example, I have a page main.jsp and
> > on that page I want to have a JSF data table.  I have a session facade
> > bean that returns a collection of DTO's that I want in the table, how do
> > I access this collection from my  page?  In the old scheme I would load
> > the collection into a session scoped variable and then just iterate over
> > it.  Is there some way I can tell my data table to invoke my session ejb
> > facade bean?  I am really confused.
> >
> > Thanks in advance for any pointers
> > troy
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com

Re: Question About Loading Items Into/ From Beans

Posted by Troy Bull <tr...@gmail.com>.
Thanks for the push in the right direction.  This worked perfectly!

Troy

Matthias Wessendorf said the following on 4/18/2006 9:25 AM:
> use in main.jsp <h:dataTable value="#{bean.list}" ...>
>
> and in constructor of your backing bean "bean" popluate the propery "list" .
>
> list can be any of these *types*:
> -  Arrays
> - java.util.List
> - java.sql.ResultSet
> - javax.servlet.jsp.jstl.sql.Result
>
> JSF isn't an action based framework.
>
> Btw. if you don't know how to define a backing bean, which is a normal
> JvaBean, please go ahead and read some *introductions* ;-)
>
> HTH,
> Matthias
>
> On 4/18/06, Troy Bull <tr...@gmail.com> wrote:
>   
>> Greetings:
>>
>> I will start out by saying I am coming from a struts background.  When I
>> program struts every one of my applications started out with kicker.do.
>> This action is where I loaded up collections of DTO's (ejb 2).  Then in
>> my jsp pages I would use these collections to display menus (drop downs)
>> and other things.
>>
>> Now that I have switched to (or am trying to) JSF, I dont understand how
>> I can access my database data.  For example, I have a page main.jsp and
>> on that page I want to have a JSF data table.  I have a session facade
>> bean that returns a collection of DTO's that I want in the table, how do
>> I access this collection from my  page?  In the old scheme I would load
>> the collection into a session scoped variable and then just iterate over
>> it.  Is there some way I can tell my data table to invoke my session ejb
>> facade bean?  I am really confused.
>>
>> Thanks in advance for any pointers
>> troy
>>
>>     
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>   


Re: Question About Loading Items Into/ From Beans

Posted by Matthias Wessendorf <ma...@apache.org>.
use in main.jsp <h:dataTable value="#{bean.list}" ...>

and in constructor of your backing bean "bean" popluate the propery "list" .

list can be any of these *types*:
-  Arrays
- java.util.List
- java.sql.ResultSet
- javax.servlet.jsp.jstl.sql.Result

JSF isn't an action based framework.

Btw. if you don't know how to define a backing bean, which is a normal
JvaBean, please go ahead and read some *introductions* ;-)

HTH,
Matthias

On 4/18/06, Troy Bull <tr...@gmail.com> wrote:
> Greetings:
>
> I will start out by saying I am coming from a struts background.  When I
> program struts every one of my applications started out with kicker.do.
> This action is where I loaded up collections of DTO's (ejb 2).  Then in
> my jsp pages I would use these collections to display menus (drop downs)
> and other things.
>
> Now that I have switched to (or am trying to) JSF, I dont understand how
> I can access my database data.  For example, I have a page main.jsp and
> on that page I want to have a JSF data table.  I have a session facade
> bean that returns a collection of DTO's that I want in the table, how do
> I access this collection from my  page?  In the old scheme I would load
> the collection into a session scoped variable and then just iterate over
> it.  Is there some way I can tell my data table to invoke my session ejb
> facade bean?  I am really confused.
>
> Thanks in advance for any pointers
> troy
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com