I'm trying to bind an xp:inputRichText to a bean (ChatBean), but get this validation error when the code tries update the field to the bean:
java.lang.IllegalArgumentException: argument type mismatch
I've tried a few of different things like converters to make sure the text will be a string, printing debug messages to find out where things go wrong, changed the type of the "setChatContent()" method (that sets the input to read-only), but can't get it to work.
Am I missing something, or is it not possible? Any thoughts?
The page:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:messages id="messages1"></xp:messages>
<xp:inputRichText id="inputRichText1" value="#{Chat.chatContent}"></xp:inputRichText>
<xp:button value="Save" id="button1" type="button">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete" save="false">
<xp:this.action>
<xp:actionGroup>
<xp:executeScript script="#{javascript:Chat.saveContent();}"></xp:executeScript>
<xp:openPage name="/chat.xsp"></xp:openPage>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
The error occurs after I hit the "Save" button, which calls a method on the Chat bean (code is shortened):
public class ChatBean implements Serializable {
private static final long serialVersionUID = 1L;
private String chatContent;
public String getChatContent() {
return chatContent;
}
public void setChatContent(String chatContent) {
this.chatContent = chatContent;
}
public void saveContent() {
// TODO implement save
this.chatContent = "";
}
}