Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Show locale error message in datasource

$
0
0
I have the following datasource.

<DataSource
schema="VTTPC"
dbName="OracleDev"
tableName="company_second"
ID="company_second"
dataSourceVersion="1"
generatedBy="v9.1p_2014-07-18/EVAL Deployment 2014-07-18"
serverType="sql"
>

<fields>
<field sqlType="decimal" sqlLength="6" name="COMPANYID" type="sequence" primaryKey="true" required="false" ></field>
<field sqlType="varchar" sqlLength="100" name="COMPANY" length="100" type="text"></field>
<field sqlType="decimal" sqlLength="8" name="PRICE" type="float"></field>
<field sqlType="decimal" sqlLength="8" name="PCHANGE" type="float">
<validators>
<validator type="serverCustom">
<serverCondition language="javascript"><![CDATA[
if (record.get("PRICE") != null && record.get("PRICE") !== undefined) {
value > record.get("PRICE");
} else {
value > dataSources.get("company_second").fetchById(record.get("COMPANYID")).get("PRICE") ;
}
]]></serverCondition>
<errorMessage>PCHANGE cannot be smaller than PRICE..... </errorMessage>
</validator>

</validators>
</field>
</DataSource>



But I want to show the error message "PCHANGE cannot be smaller than PRICE..... " based on the locale setting

In JSp I have define the following locale setting and it work.
.
.
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
.
.
<fmt:setBundle basename='myProperties.Prop.Pop'/>
.
.
<SCRIPT>

var msg = {
errmsg1: "<fmt:message key="errmsg1" />",
errmsg2: "<fmt:message key="errmsg2" />"
};

alert((msg.errmsg1);
.
.
</SCRIPT>
.
.

My problem is I do not know how to put the the locale error message into the DataSource.

Is there any example?

Many Thanks

Viewing all articles
Browse latest Browse all 4756

Trending Articles