[ https://issues.apache.org/jira/browse/MYFACES-3696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13635172#comment-13635172 ]
Leonardo Uribe edited comment on MYFACES-3696 at 4/18/13 2:04 PM: ------------------------------------------------------------------ I have checked it again and it does not work only in cases where org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE is set to true and tomahawk is present and autoscroll is on. It seems we need to include the check in that location, but I prefer check both isPartialRequest() and isAjaxRequest() (according to the spec both are different). Thanks Dennis for provide this patch. was (Author: lu4242): I have checked it again and it does not works only cases where org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE is set to true and tomahawk is present and autoscroll is on. It seems we need to include the check in that location, but I prefer check both isPartialRequest() and isAjaxRequest() (according to the spec both are different). Thanks Dennis for provide this patch. > Button rendering itself after ajax request loses type and other attributes > -------------------------------------------------------------------------- > > Key: MYFACES-3696 > URL: https://issues.apache.org/jira/browse/MYFACES-3696 > Project: MyFaces Core > Issue Type: Bug > Affects Versions: 2.1.10 > Reporter: dennis hoersch > Assignee: Leonardo Uribe > Fix For: 2.0.18, 2.1.12 > > > The renderer for command buttons and command links inserts a special form > submit script inline before the first button (or link) on a page is rendered > by calling > 'org.apache.myfaces.shared.renderkit.html.HtmlJavaScriptUtils.renderFormSubmitScript(FacesContext)' > I have a CommandButton with ajax behavior that renders also itself like this: > <h:form id="testForm"> > <h:commandButton > value="do somethings"> > <f:ajax execute="@this" render="@this" /> > </h:commandButton> > </h:form> > After the ajax request is done and the markup is replaced by the Javascript > function _Dom.outerHtml() the html in the browser ends up with this: > <input > type="text/javascript" > onclick="...submit code ..." > value="" /> > and is not a 'button' anymore (Firefox renders it as text input field). > The cause is that the update response for the button contains as first > element the inline script code. > Is it necessary to render the inline script on ajax requests? > Changing HtmlJavaScriptUtils to insert it only on non-ajax request the > example above works as expected at the first glance. > HtmlJavaScriptUtils.java > public static void renderFormSubmitScript(FacesContext facesContext) > throws IOException > { > if (facesContext.getPartialViewContext().isAjaxRequest()) > { > return; > } > ... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira