Using request parameters, you could also create a managed property in a
managed bean in your FacesConfig. Use EL to bind the request property
to your bean. Your bean would then be able to generate the results
needed for the bindings on your page. :) It removes the need to do
anything too fancy...
Andrew Robinson wrote:
I don't think that this is not the best way of doing this. The
UICommand may not decide to decode the way you think it will. What I
would recommend doing is using request parameters. In an on-load style
method of your page, check for the existence of that request parameter
and execute your method.
Or you can create a custom servlet to do this. See
http://wiki.apache.org/myfaces/InvokingJsfPagesWithStandardUrls
Also, a view will only decode and go through the lifecycle if the view
was already created. In your attempt, there is no view to deserialize
for the page, and thus no decode and then no actions and the submitted
values will be thrown out.
Using a servlet or on-load method I really think is the right way to go.
As for on-load functionality check out JBoss-Seam jsf-comp on-load or
the shale view handler.
On 5/10/07, Todd Nine <[EMAIL PROTECTED]> wrote:
Hi all,
I'm trying to call a JSF application from a plain HTML form on a
different
subdomain (and server). Its a search so I only have 1 input field.
I have
include the code below. I need to call the method "performSearch" on
the
bean that's associated with my searchResults.jsf page. It renders
the page,
but never invokes the method. What do I need in my form to do this?
<script type="text/javascript">
function clearForm(textField) {
textField.value = "";
}
</script>
<div class="searcher">
<p>Search</p>
<form name="frmSearch" action="searchResults.jsf" method="post"
enctype="application/x-www-form-urlencoded">
<input id="searchTerms" name="searchTerms" type="text"
value="Search"
onclick="clearForm(this);" class="searchInput"
onfocus="clearForm(this);" />
<input id="performSearch" name="performSearch" type="image"
src="images/btn_go.jpg" style="align:right;" class="go_btn" />
</form>
</div>