myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Marinschek" <>
Subject Re: Question about filling page objects
Date Fri, 01 Feb 2008 11:28:27 GMT
Are you using JSF1.2? Check out f:setPropertyActionListener for
changing from a list-page to a detail-page.



On 2/1/08, Martyn Hiemstra <> wrote:
> Hi All
> My company has chosen to use jsf in a new project. I myself am used to
> SpringMVC which works perfectly for my needs but I figured, why not try
> jsf since I have to use. I am running into a problem which is a pretty
> huge problem in jsf. Maybe someone can explain it to me how to solve my
> problem. It's also possible that I dont understand the concept correctly.
> I want to redrect a user to a page where they can edit their address. In
> Spring MVC I would redirect the user to /
> As you can see I would pass the id of the logged in person to the url
> and the controller will verify that the passed id is the same as the
> currently logged in user and then the controller will load the users
> address and display it on the screen.
> I want to do the same in jsf. I have a user profile page and on that
> page, users can edit their address by pressing a button. I have attached
> an action to the button and created the method in the Page object. This
> method is editAddress. In jsf if I want to redirect to the edit address
> page but it turns out that I cant supply parameters in the navigation
> xml file. I read on the Internet that I have to load the edit address
> page using it's bean name and then fill in the information in the edit
> address bean and then return the flow id. That I must return the flow id
> is great because that way no url's are defioned in page objects but that
> I must load the page bean with the following code is really and I mean
> really hard to understand:
> FacesContext facesContext = FacesContext.getCurrentInstance( );
> ExpressionFactory factory = facesContext.getApplication(
> ).getExpressionFactory( );
> EditAddressPage page = factory.createValueExpression(
> facesContext.getELContext( ), PAGE_NAME, Object.class
> ).getValue(FacesContext.getCurrentInstance().getELContext());
> I then need to fill the edit address page with the address data. I
> thought jsf was supposed to be easy to use but this is ridiculous. Can
> someone please tell me if there is a much easier way to pass information
> onto a page either via a parameter or some other way, preferably via
> parameters and as a redirect instead of an internal forward.
> Thanks in advance,
> Martyn


Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

View raw message