This content has been marked as final.
Show 5 replies
-
1. Re: disable command button during ajax
gjeudy Sep 16, 2008 3:48 PM (in response to tszpinda)I think you have it mostly right, have you checked the resulting HTML page? JSF appends numeric ids to the id provided in your JSF xhtml therefore
document.getElementById('mainForm:addButtonId')
will never return anything.See this post it outlines possible solutions to tackle this problem:
http://www.seamframework.org/Community/JavascriptProblemRetrievingElement
-
2. Re: disable command button during ajax
david.spark Sep 16, 2008 4:17 PM (in response to tszpinda)I not that you have specified the attribute disable, I think it should be disabled.
-
3. Re: disable command button during ajax
tszpinda Sep 16, 2008 4:32 PM (in response to tszpinda)I'm gonna kill myself!
Thanks mate!
-
4. Re: disable command button during ajax
gjeudy Sep 16, 2008 5:10 PM (in response to tszpinda)so
document.getElementById('mainForm:addButtonId')
works fine in your case Tomek ? -
5. Re: disable command button during ajax
tszpinda Sep 16, 2008 5:28 PM (in response to tszpinda)yes it does, I think if I set the 'static' id for the element as I did for the button it works fine,
Here is generated html:
<input id="mainForm:qtyBox" type="text" name="mainForm:qtyBox" value="0" class="quantity_box" onblur="document.getElementById('mainForm:addButtonId').disabled=true; A4J.AJAX.Submit('_viewRoot','mainForm',event,{'oncomplete':function(request,event,data){document.getElementById('mainForm:addButtonId').disabled=false;}, 'parameters':{'mainForm:j_id108':'mainForm:j_id108'} , 'eventsQueue':'validation','actionUrl':'/webshop/stock.seam?javax.portlet.faces.DirectLink=true'} )" size="5" /> <input id="mainForm:addButtonId" type="image" src="/webshop/img/Add.png" name="mainForm:addButtonId" class="button, icon_button" />
Thank you,