webtier@glassfish.java.net

Re: [webtier] Problem with attribute rendered

From: Joel Weight <digitaljoel_at_gmail.com>
Date: Fri, 4 Jun 2010 13:59:23 -0600

Without seeing more, it's hard to say exactly, but could it be that you are
having a validation problem with other controls? I notice that your cancel
button is not marked as immediate. Also, are you saying that if you remove
the "rendered" attribute from that button and change nothing else then
things function correctly?

joel

On Fri, Jun 4, 2010 at 12:43 PM, <webtier_at_javadesktop.org> wrote:

> I have problem with attribute "rendered". I use it to manage visibility of
> buttons. Visibility works correctly. But when this attribute is set(button
> shown) and I click button,method doCancelEditBuilding does not called.
> Instead of redirecting to building_list.xtml page, current page refreshes
> but some fields of it's bean reset.
> BuildinBean.java:
> @ManagedBean
> @RequestScoped
> public class BuildingBean extends SuperBean{
> private static final long serialVersionUID = 1L;
>
> private Building currentBuilding = new Building();
>
> public String doCancelEditBuilding(){
> currentBuilding = new Building();
> return "building_list";
> }
>
> //getters, setters
> }
>
> building_details.xhtml:
> <h:commandButton type="image" action="#{buildingBean.doCancelEditBuilding}"
> image="/i/cancel.png" rendered="#{empty buildingBean.currentBuilding.id
> }"/>
>
> I use jsf 2.0, it's implementation mojarra 2.0.3.
> Can you help me with my problem?
>
> P.S. Sorry for my english...
> [Message sent by forum member 'pmshik']
>
> http://forums.java.net/jive/thread.jspa?messageID=472805
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>