0

I was trying to excute an ajax call on search button issue is 404 error.

Main form loads goods, lightbox(jquery works) and when clicking on search issue is 404, debugged to see if method gets call nothing beging called on ajax command button.

<h:form id="mainForm">
    <h:commandButton onclick="showLig();" value="Find Person"/>
    <div id="moreInfo" class="lightbox" style="display: none;">
        <ui:include src="external.xhtml"/>
    </div>
</h:form>

external xhtml

<h:inputText id="personSearch" value="#{bean.holdingValue}" ></h:inputText>
<h:commandButton value="Search">
    <f:ajax render="@form" execute="personSearch" listener="#{controller.method}"/>
</h:commandButton>
<h:dataTable id="someTable" value="list" var="x">
    blah..
</h:dataTable>
Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
userJ
  • 65
  • 1
  • 11
  • You are placing `h:form` inside another `h:form` which is wrong.. – Vikas V Jul 11 '13 at 17:19
  • possible duplicate of [h:commandLink / h:commandButton is not being invoked](http://stackoverflow.com/questions/2118656/hcommandlink-hcommandbutton-is-not-being-invoked) check points 2 and 6. – Luiggi Mendoza Jul 11 '13 at 17:20
  • sorry.. my bad.. i actually edited my question. – userJ Jul 11 '13 at 17:26
  • Does your *external.xhtml* file contains a ``? If so, you're still having nested `
    `s which is invalid HTML.
    – Luiggi Mendoza Jul 11 '13 at 17:27
  • i dont have nested form, in external.xhtml – userJ Jul 11 '13 at 17:28
  • I'm not 100% sure but the problem might be having a `listener` in your ``. Just remove it and add the `action` attribute for `` pointing to the method you want to execute. – Luiggi Mendoza Jul 11 '13 at 17:33
  • Also, for your first `` that executes `showLig()`, it would be good to add `return false;` in order that it doesn't submit the form. – Luiggi Mendoza Jul 11 '13 at 17:36
  • Sure. i tried it but nothing happens when i click on search button, atleast after having ajax tag was able to see 404 error – userJ Jul 11 '13 at 17:39
  • @Jay, what exactly is the resource that cannot be found, i.e. what is the 404 referencing as a missing resource? – kolossus Jul 12 '13 at 10:56
  • its actually not able to communicate with my controller i tried out of light box and see if am am able to communicate with controller and light box is actually from the jquery lightbox method and after trying to see f12 broweser console and tamper data my request actually trying to unknow web address. – userJ Jul 12 '13 at 18:07

0 Answers0