You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Bjørn T Johansen <bt...@havleik.no> on 2005/08/23 10:26:38 UTC

Populating a web page?

In Struts I can use the action method to call some method to get the data and populate the
form, but what is the best way of doing this in myfaces (JSF)?
I.e I am on one page and going to another, but before rendering the other page I need to
get some data from a database...


Regards,

BTJ

-- 
-----------------------------------------------------------------------------------------------
Bjørn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

Re: Populating a web page?

Posted by Rick Reumann <ri...@gmail.com>.
I think this is where something like Shale will help - having your 
backingBean implement ViewControlloer 
http://struts.apache.org/shale/features.html#view You would use the 
prerender() method to populate your form with what you needed. I'm new to 
all of this (JSF/Shale) but in the process of trying to get something like 
this to work.**

On 8/23/05, albartell <al...@gmail.com> wrote:
> 
> The way I do it is to have page1.jsp make a call to a backing bean method
> that fills global variables with data. Note that my backing beans that do
> this are defined in the session scope. Another way to do it would be to 
> pass
> the necessary information via the <f:param> tag. You can imbed that tag
> within a commandLink, for instance, and when the user clicks the button 
> the
> appropriate action method will be executed, and in that action method you
> can retrieve the value passed on <f:param>.
> 
> HTH,
> Aaron Bartell
> 
> -----Original Message-----
> From: Bjørn T Johansen [mailto:btj@havleik.no]
> Sent: Tuesday, August 23, 2005 3:27 AM
> To: users@myfaces.apache.org
> Subject: Populating a web page?
> 
> In Struts I can use the action method to call some method to get the data
> and populate the form, but what is the best way of doing this in myfaces
> (JSF)?
> I.e I am on one page and going to another, but before rendering the other
> page I need to get some data from a database...
> 
> 
> Regards,
> 
> BTJ
> 
> --
> 
> ----------------------------------------------------------------------------
> -------------------
> Bjørn T Johansen
> 
> btj@havleik.no
> 
> ----------------------------------------------------------------------------
> -------------------
> Someone wrote:
> "I understand that if you play a Windows CD backwards you hear strange
> Satanic messages"
> To which someone replied:
> "It's even worse than that; play it forwards and it installs Windows"
> 
> ----------------------------------------------------------------------------
> -------------------
> 
> 


-- 
Rick

RE: Populating a web page?

Posted by albartell <al...@gmail.com>.
The way I do it is to have page1.jsp make a call to a backing bean method
that fills global variables with data. Note that my backing beans that do
this are defined in the session scope. Another way to do it would be to pass
the necessary information via the <f:param> tag.  You can imbed that tag
within a commandLink, for instance, and when the user clicks the button the
appropriate action method will be executed, and in that action method you
can retrieve the value passed on <f:param>.

HTH,
Aaron Bartell 

-----Original Message-----
From: Bjørn T Johansen [mailto:btj@havleik.no] 
Sent: Tuesday, August 23, 2005 3:27 AM
To: users@myfaces.apache.org
Subject: Populating a web page?

In Struts I can use the action method to call some method to get the data
and populate the form, but what is the best way of doing this in myfaces
(JSF)?
I.e I am on one page and going to another, but before rendering the other
page I need to get some data from a database...


Regards,

BTJ

--
----------------------------------------------------------------------------
-------------------
Bjørn T Johansen

btj@havleik.no
----------------------------------------------------------------------------
-------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange
Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
----------------------------------------------------------------------------
-------------------