myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Hörsch <hoer...@his.de>
Subject disabled <f:ajax /> not working (?)
Date Fri, 29 Jun 2012 08:56:02 GMT
Hi,

I tested to disable all <f:ajax /> temporally on my page 
(programatically, for testing reasons).
The behavior that I would expect is that the button then submits as 
without the f:ajax tag.

But instead of this, the whole button is kind of disabled. This is also 
the case if I disable the f:ajax directly:
<h:commandButton value="Show">
<f:ajax execute="@this" render="@form" disabled="true" />
<f:setPropertyActionListener target="#{flash.show}" value="true" />
</h:commandButton>

In the HTML the button has an onclick with 'return false'. Is this the 
desired  behavior?
As I discovered so far this 'return false' is in the end depend on 
AjaxBehavior.getHints().

"getHints(): This method returns an unmodifiable Set containing the 
ClientBehaviorHint SUBMITTING."
(http://javaserverfaces.java.net/nonav/docs/2.1/javadocs/javax/faces/component/behavior/AjaxBehavior.html)

But why does the AjaxBehavior pretend to be 'SUBMITTING' while 
generating no script?

If I change it to return an empty set if it is disabled it works as 
expected.

Greetings
dennis

-- 
HIS Hochschul-Informations-System GmbH
Goseriede 9 | 30159 Hannover | www.his.de

Dennis Hörsch
Unternehmensbereich Hochschul-IT
Arbeitsbereich Personalmanagement
Telefon +49 (0)511 1220-403
E-Mail hoersch@his.de

Registergericht: Amtsgericht Hannover, HRB 6489
Geschäftsführer: Prof. Dr. Martin Leitner
Vorsitzender des Aufsichtsrats: Prof. Dr. Andreas Geiger



Mime
View raw message