-2

I have simple user search application. On first click data is not getting loaded or form not submitting.

    <p:inputText id="search" value="#{userview.search}" label="search"
                    style="margin-right:30px;font: 13px verdana,helvetica,arial,sans-serif;line-height: 21px;color: #000;
                text-decoration: none;width:320px;height:20px;" />
                <p:watermark for="search"
                    value="Enterprise Username/ Firstname/ Lastname" id="watermark" />

                <p:commandButton value="Search" id="ajax1"
                    action="#{userview.searchResult}" update="formId"
                    style="font-size: 16px;background-color: #007a67; color: initial;text-shadow: none;
        font-weight: 600;" />

<p:dataTable var="user" value="#{userview.users}" id="searchData"
            rendered="#{userview.users!=null}" style="margin-top:20px"
            filteredValue="#{userview.users}"
            paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
            rows="10" paginator="true" rowsPerPageTemplate="5,10,15">

            <p:column headerText="Enterprise Username"
                style="width:150px">
                <h:outputText value="#{user.userid}" />
            </p:column>
Kukeltje
  • 11,924
  • 4
  • 19
  • 44
Prashant Vhasure
  • 718
  • 2
  • 6
  • 16
  • Do your log files show anything? And the browser network debug? – Oscar Pérez Sep 09 '19 at 07:43
  • 2
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: [mcve] and http://idownvotedbecau.se/nomcve/ and show search effort (https://idownvotedbecau.se/noresearch) and also read https://stackoverflow.com/help/tagging (see my edit) – Kukeltje Sep 09 '19 at 07:50
  • And copy-past your title in a search engine and add 'jsf' in front of it and start reading... Lots of info – Kukeltje Sep 09 '19 at 11:21
  • And please be responsive to our comments... https://stackoverflow.com/questions/11408130/hcommandbutton-hcommandlink-does-not-work-on-first-click-works-only-on-second – Kukeltje Sep 16 '19 at 05:29
  • So you really don't want help? – Kukeltje Sep 19 '19 at 15:12

1 Answers1

-2

My suggestion: set p:commandButton attribute ajax=false, remove update attribute, put h:messages in the page, click on the button and you will see errors

Armen Arzumanyan
  • 1,521
  • 1
  • 24
  • 51