You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Moestl, Wolfgang" <Wo...@softwareag.com> on 2009/05/06 08:44:45 UTC

[Trinidad] Howto do PPR using clientside events like onkeyup?

Hi,

I have to do a PPR page update if the user changes the content of an
<tr:inputText>, resulting in changing the table data according to the
inputText value (filtering the table content).
Using the inputText autosubmit feature is not sufficient as this one
triggers the PPR when the inputText looses the focus.

What I need is triggering a PPR cycle each time the user changes the
inputText value,
thus with each key stroke, using for example the onkeyup event.

What I came up with is letting the onkeyup event raising a hidden
command button which in turn causes the PPR to happen. 
Unfortunately the PPR caused this way does not include transmit the
inputText value to the server, thus the table does dot get updated
accordingly.

How can I do a PPR using clientside events like onkeyup or how can I
include the inputText value in a PPR raised by another control?

My code so far:

<tr:inputText id="myFilter" 
    label="Filter:"
    value="#{myBean.filter}"
    required="no"
    onkeyup="document.getElementById('hiddenButton').click()" /> 


<tr:commandButton id="myHiddenButton" 
    text="..." 
    immediate="true" 
    partialSubmit="true"/>


<tr:table id="myTable"
    value="#{myBean.tableContent}"
    var="entry"
    rows="15"
    partialTriggers="myHiddenButton" >
...
</tr:table>

Thanks a lot, any hint is appreciated!

Cheers,
Wolf