I don't know the answer either (and I'd be glad to know it, btw), but
what I do is that my javascript code updates form fields (hidden if
necessary) with values I want to send back :
in jspx :
...
function myfunc()
{
document.getElementById("param1").value=someValue;
TrPage.getInstance().sendPartialFormPost(myForm,
{source: "myButton"},
{});
}
...
<tr:inputText type="hidden" id="param1" value="#{myBean.param1}"/>
<tr:commandButton action="#{myBean.doSomething}" id="myButton">
in bean :
public String doSomething()
{
String s=getParam1();
...
}
Note that :
-you can hide the button as well (with inlineStyle)
-everything will work as is you clicked the button. So you can use
partialTriggers, partialSubmit, etc. referencing the button, je
javascript code will do the same.
-I think the Trinidad documentation should have a similar example. I
spent hours figuring out that "source" thing !
Regards,
Cedric
2009/10/7 Elmar Kretzer <[email protected]>:
> Hi everyone,
>
> when i am triggering a partial submit via javascript and add e.g. param1 to
> the call,
>
> how can i read the value of the param in the bean from the FacesContext ?
>
> Javascript Code:
>
> TrPage.getInstance().sendPartialFormPost(
> theForm,
> {param1: "value1", param2: "value2"});
>
> any clues?
>
> Thanks in advance
>
> Elmar