Author |
Message |
15/04/2009 07:49:20
|
mreich
Power User
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
|
|
|
15/04/2009 08:21:57
|
CaptainCasa
Power User
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 |
|
|
15/04/2009 21:48:08
|
mreich
Power User
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
|
|
|
15/04/2009 22:34:58
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5521
Offline
|
...please provide an example - Thanks!
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
15/04/2009 23:32:43
|
mreich
Power User
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 |
Download
|
Description |
|
Filesize |
4 Kbytes
|
Downloaded: |
405 time(s) |
|
|
|
16/04/2009 07:36:24
|
CaptainCasa
Power User
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 |
|
|
16/04/2009 20:32:21
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 744
Offline
|
Thanx, now everything works
|
|
|
|