Hey Mario,
I don't think this is the issue.
I downloaded the latest snapshot and modified the example:
<s:inputSuggestAjax id="inputSuggestAjax"
suggestedItemsMethod="#{inputSuggestAjax.getItems}"
value="#{inputSuggestAjax.suggestValue}"
charset="utf-8"/>
generates
<input id="form:inputSuggestAjax" name="form:inputSuggestAjax"
type="text" value="" />
So the id specified is attached to the input element.
Specifying onchange also gets attached to this component.
<input id="form:inputSuggestAjax" name="form:inputSuggestAjax"
type="text" value="" onchange="alert('test');" />
Putting in a submit on event generates:
setTimeout("orgApacheMyfacesSubmitOnEventRegister('keypress','','form:inputSuggestAjax','form:button');",
50)
So that seems like it's also doing what it should be doing.
Yep. This code works as I'd expect it to work:
<f:view>
<h:form id="form">
<t:dojoInitializer bindEncoding="utf-8"/>
<s:inputSuggestAjax id="inputSuggestAjax"
onchange="alert('test');"
suggestedItemsMethod="#{inputSuggestAjax.getItems}"
value="#{inputSuggestAjax.suggestValue}"
charset="utf-8">
<s:submitOnEvent event="blur" for="button"/>
</s:inputSuggestAjax>
<h:commandButton id="button" />
</h:form>
</f:view>
It puts up an alert panel and then submits the form if I attempt to
tab out of it.
On 3/29/07, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
Hi!
> Be aware that if there is a bug in inputSuggestAjax, using
> submitOnEvent won't fix it.
Jumping up to this discussion lately .. sorry for this .. too much work
here.
It might be that the submitOnEvent do not work with inputSuggestAjax.
Do one have it running with it?
As far as I remeber inputSuggestAjax uses some sort of hidden field for
the real value to submit and a input text for the user input.
Depending on how the javascript id will be calculated the submitOnEvent
might hook on one or the other field, if its the hidden one, it won't work.
All this just top of my head, don't know if I am correct.
At least it is a dojo control which do some keyboard event control
itself ... maybe submitOnEvent has some problems with it.
If I manage to find some time tonight I'll have a look at it ... no
promise ;-)
Ciao,
Mario