-2

It seems to me that p:inputText does not support sending parameters via f:param. Is this true?

If yes, how could I pass the parameters?

In more details
I have a list of inputText fields generated via:

<p:dataTable value="#{EncryptionBean.epList}" var="item">
  <p:column>
  ...
     <p:inputText value="#{item.APID}" valueChangeListener="#{EncryptionBean.listenerApid}">
         <f:param value="#{item.presetName}" name="whoLaunched"/>
     <p:inputText>
  </p:column>    
<(p:dataTable>

When I catch the value change listener, I need to know which of the EncryptionBean.epList does the inputText belong to. I usualy do this with:

ExternalContext ec; 
...
String value = (String)ec.getRequestParameterMap().get("whoLaunched");

...but it does not work for inputText (as it worked for commandLink for example).

Basically, how do I pass item.presetName together with itemText value (item.APID) to the listener? I need to save those 2 in the map.

Danijel
  • 8,198
  • 18
  • 69
  • 133
  • 2
    In future questions, try to elaborate the concrete functional requirement in detail instead of asking a rhetorical question about a "possible solution". Stack Overflow is generally not interested in answering Yes-No questions which can easily be answered yourself. – BalusC Dec 20 '12 at 15:15
  • Added more details, could you have a look? Thanks so much. – Danijel Dec 20 '12 at 16:36

1 Answers1

1

This worked:

xhtml:

<p:inputText value="#{item.APID}">
    <p:ajax listener="#{EncryptionBean.listenerApid( item.presetName, item.APID )}"/>              
</p:inputText>

java bean:

public void listenerApid( String presetName, String typedAPID )
{       
    // Do something with values.
}

Ubelievable how easy it is to pass those values, just use ajax listener with arguments instead of valueChangeListener.

Danijel
  • 8,198
  • 18
  • 69
  • 133
  • 1
    Note that this was been answered in your other question: http://stackoverflow.com/questions/13974989/possible-to-execute-valuechangelistener-for-pinputtext-without-hitting-ent – BalusC Dec 20 '12 at 17:01
  • Yes, that's where I picked up the `(arg1, arg2)` idea. Thanks for that. If you want to write a more elaborate answer, I'll be glad to mark that one as accepted here too? – Danijel Dec 20 '12 at 17:03