[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Rendered attribute in buttons  XML
Forum Index -> Development
Author Message
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 744
Offline

Hi,

I've question about the rendered attribute, I make some buttons visibility depending on a certain bean property, I've created a String property renderdButtonXXX for each button.
The depending property is set in the beans constructor, after this but also in the constructor, the renderedButtonXXX is set to e.g. to false, but still shows up?!
Is there something special to consider?

Markus
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5521
Offline

...no...
I somehow assume that the bean is not coming up on server side (please take a look into the server log) - e.g. fails in the constructor?
Set a label next to the button in which you directly output the rendered-property (label text="#{d.xxx.xxx.renderedButtonXXX"), then you can double check if the value really is "false".
Björn

Björn Müller, CaptainCasa GmbH
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 744
Offline

Hi Björn,

I set a label next to the button and it shows false, but the button is still visible, also no error in the log?
It's very strange, when I set the property fix to false:
protected String m_renderedButton = "false";
Aslo nothing happen, when I write "false" in the property field rendered in the Editor Tool the button disappears in the preview?!
When I use this property in the enabled property the button get's disabled?!
Very, very strange ...

Markus
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5521
Offline

...please provide an example - Thanks!
Björn

Björn Müller, CaptainCasa GmbH
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 744
Offline

ok, I'll try

I zipped two managed beans incl. their JSP pages.
The userdetail is rowincluded in entitydetail
 Filename example.zip [Disk] Download
 Description
 Filesize 4 Kbytes
 Downloaded:  405 time(s)

[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5521
Offline

Hi,

thanks - now it's clear (but I did not know so far, as well). The JSF-rendered attribute is quite restrictive when it comes to data type resolution: it requires a boolean-property. In your example the property is a String property.

CaptainCasa attribuets more or less "eat what they get", so convert from String to the required data type. That's the reason, why e.g. "enabled" is working.

After converting your render...properties to boolean it works.

Björn

Björn Müller, CaptainCasa GmbH
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 744
Offline

Thanx, now everything works
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team