-
1. Re: reRender a4j:commandButton
ilya_shaikovsky Nov 15, 2007 12:04 PM (in response to ment0r_)why you just not use js handlers?
-
2. Re: reRender a4j:commandButton
ment0r_ Nov 16, 2007 4:48 AM (in response to ment0r_)Hi,
can you specifiy js handlers? I am not sure
what you mean with that.
Thanks! -
3. Re: reRender a4j:commandButton
ilya_shaikovsky Nov 16, 2007 6:27 AM (in response to ment0r_)<h:form id="form"> <h:inputText value="#{bean.property1}"></h:inputText> <a4j:commandButton value="submit" reRender="test" id="button" onclick="disableButton();" oncomplete="enableButton()"></a4j:commandButton> <h:outputText value="#{bean.property1}" id="test"></h:outputText> <script> function disableButton(){ document.getElementById('form:button').disabled=true; }; function enableButton(){ document.getElementById('form:button').disabled=false; }; </script> </h:form>
May be not optimal but simplies way I think to disable button till the request complete with further enabling using jst client events handlers. -
4. Re: reRender a4j:commandButton
ment0r_ Nov 16, 2007 7:02 AM (in response to ment0r_)Hi,
I tried to integrate your example into my page. But now if i click the button nothing happens.
The method behind the actionListener is as well not executed. the button seems to be "dead"?
here is the code:
<h:panelGrid columns="2">
<a4j:commandButton id="submit" styleClass="submit_button" value="Submit"
actionListener="#{homePage.submit}"
ignoreDupResponses="true"
reRender="tree, inputRegion, serviceError, webServices"
onclick="disableButton()"
oncomplete="enableButton()"/>
<a4j:commandButton id="clear" styleClass="submit_button" value="Clear"
actionListener="#{homePage.clearButton}"
ignoreDupResponses="true"
reRender="inputRegion, serviceError, webServices"/>
</h:panelGrid>
script type="text/javascript" language="javascript">
function disableButton() {
document.getElementById("submit").disabled = true;
};
function enableButton() {
document.getElementById("submit").disabled = false;
};
/script>
I am off until thuesday morning (Holiday) :)
But thanks in advance for your help!
wishes
mentor -
5. Re: reRender a4j:commandButton
ilya_shaikovsky Nov 16, 2007 7:40 AM (in response to ment0r_)you should use full id in getElementById function including form id like in example.
The button is dead because of JS exception on the page I think :) -
6. Re: reRender a4j:commandButton
ment0r_ Nov 20, 2007 6:24 AM (in response to ment0r_)Hi I am back from holiday now and I have just tested to disable
the a4j:commandButton by inserting the 'form:button' tag,
but the button is still "dead"
Since I have no idea how to write like you have done here in the forum I uploaded the code here:
http://rafb.net/p/sJBQjp98.html
greets,
mentor -
7. Re: reRender a4j:commandButton
ilya_shaikovsky Nov 21, 2007 8:29 AM (in response to ment0r_)link is dead :/
-
8. Re: reRender a4j:commandButton
ment0r_ Nov 21, 2007 10:33 AM (in response to ment0r_)Sorry...
Here is a new link:
http://nopaste.com/p/amZxVUWwib -
9. Re: reRender a4j:commandButton
ilya_shaikovsky Nov 22, 2007 3:31 AM (in response to ment0r_)Just copypasted the code from the link - and it just works.
JSf 1.2_05
Facelets 1.1.14
RF 3.1.3 SNAPSHOT
Tomcat 6.0.14
FF 2.0.0.8
IE6
Opera 9.22 -
10. Re: reRender a4j:commandButton
ment0r_ Nov 22, 2007 4:07 AM (in response to ment0r_)Since you have a SNAPSHOT version, i guess you are using maven?! If so could you pls send me your pom.xml then I can check the difference to my file.
Cheers -
11. Re: reRender a4j:commandButton
ilya_shaikovsky Nov 22, 2007 5:49 AM (in response to ment0r_)no I just dowload snapshots from
http://snapshots.jboss.org/maven2/org/richfaces/ui/richfaces-ui/3.1.3-SNAPSHOT/ -
12. Re: reRender a4j:commandButton
ment0r_ Nov 22, 2007 6:21 AM (in response to ment0r_)Hi,
thanks a lot for the support, now the disabling of the button works!
Cheers
mentor