Reading in User Input and sending through to Java Class - SIghtly / HTL
Hi All
I am trying to create a basic search component.
It is meant to take a text input from the user and on button click submit that input. It then will display the results returned.
The component as it stands looks like this:
<p>General Search Component - Mach 12</p> <div> <form> Search: <input type="search" id="searchText" name="searchText" value="THIS IS THE SEARCH TERM"><button id="searchButton">Search</button> </form> </div> <div data-sly-use.searchResults ="${'someclasspath.core.search.SearchComponent' @ searchInput= 'I NEED THE SEARCH TERM HERE' }" data-sly-unwrap> <div class="container-fluid"> <div data-sly-list.rows = "${searchResults.searchResults}" data-sly-unwrap> <div data-sly-list.cols = "${rows}" data-sly-unwrap> <div class="col-md-3"> <div class="result"> <div>${cols.resultDate}</div> <a href="${cols.linkUrl}">${cols.title}</a> <div>${cols.description}</div> </div> </div> </div> </div> </div> </div>How do I get the value from the input box passed to the Java Class?