uklance / tapestry-stitch

Sample components and concepts in Tapestry 5
MIT License
14 stars 7 forks source link

Question about launching from a form #7

Closed pbajoit closed 11 years ago

pbajoit commented 11 years ago

I would like to launch the progress bar programmatically or when the form is submitted, how to do?

<t:form t:id="searchForm">
        <t:textfield t:id="query" size="60" />&nbsp;
        <input type="submit" value="Search" />
</t:form>

<t:stitch.progressLink task="task">
        <p:label>
            <div class="btn-primary">Start</div>
        </p:label>
</t:stitch.progressLink>

ie how to properly associate the input Submit with the progressLink?

uklance commented 11 years ago

I think that you would do this by tweaking progressLink.js to add request parameters to the url. The request parameters would come from the clientside values in your form. Your task factory [eg getTask() in my example] would then get the values from the request and pass them to your ProgressTask constructor.

So, you wouldn't actually be submitting the form (ie there would be no POST) but it would achieve the same thing.