We're trying to pass an object through primefaces-extensions remoteCommand like this:
function dispatchOurObject(ourObject) {
sendMessageToServer(ourObject);
}
This is our remoteCommand tag:
<pe:remoteCommand name="sendMessageToServer" process="@this"
actionListener="#{ourController.dispatchOurObject}">
<pe:methodSignature
parameters="com.package.OurObject" />
<pe:methodParam name="ourObject">
<pe:convertJson />
</pe:methodParam>
</pe:remoteCommand>
And last but not least, this is our method in the backing bean:
public void dispatchOurObject(OurObject ourObject) {
//Do some stuff.
}
This is the Error we're getting :
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2
EDIT: at com.google.gson.Gson.fromJson(Gson.java:803)