1

My code sample is below:

<h:form id="searchForm" styleClass="searchForm">
    <p:panelGrid columns="3">
        <p:commandButton id="left-overlay-btn" value="" styleClass="xschnapp-search-filter-menu" />
        <p:inputText required="true" placeholder="#{cc.attrs.searchTip}" value="#{cc.attrs.queryProperty}" />
        <p:commandButton value="&#160;" id="search" action="#{cc.attrs.searchAction}" styleClass="xschnapp-search-action" ajax="false" />
    </p:panelGrid>
    <p:defaultCommand target="search" />
</h:form>

I have mentioned p:defaultCommand as search, because I intend search button to be pressed while clicking on 3rd column search button. At the moment, since the left-overlay-btn is in the first column then this button is clicked on hitting enter, if I change the search button from column 3 to column 1, then hitting enter do hit search button. But my requirement is to this button in column 3.

Can somebody please help me.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
apts
  • 19
  • 5
  • Check accepted answer on this link: http://stackoverflow.com/questions/5485851/default-action-to-execute-when-pressing-enter-in-a-form – anotherUser Mar 31 '16 at 10:14
  • Change the focus from `left-overlay-btn` button to `search` button. – Akshay Mar 31 '16 at 11:18
  • how do i change the focus from left-overlay-btn to search button without using javascript code intervention. is there a way ? – apts Mar 31 '16 at 13:14

0 Answers0