Hi,
Below are two sample groovy and velocity code used in my custom
application...
Sample 1
<%
String viewStatus="";
%>
#if($context.action=="view" || $context.action=="preview")
<%viewStatus="disabled='true'";%>
#end
#if($servicesDesc!="")
<%
String servicesDesc123="$servicesDesc";
String servicesDesc1= "";
String servicesDesc2= "";
String servicesDesc3= "";
String servicesDesc4= "";
..........
java.util.StringTokenizer servicesDescTokens= new
java.util.StringTokenizer(servicesDesc123,"~");
int servicesDescCount=servicesDescTokens.countTokens();
if(servicesDescCount>0)
{
if(servicesDescTokens.hasMoreTokens())
{
servicesDesc1=servicesDescTokens.nextToken();
if(!"".equals(servicesDesc1.trim()))
{
servicesDesc1="checked";
}
}
if(servicesDescTokens.hasMoreTokens())
{
servicesDesc2=servicesDescTokens.nextToken();
if(!"".equals(servicesDesc2.trim()))
servicesDesc2="checked";
}
.....
%>
Sample 2
#set($class3 = $doc.getObject("ACSFacilities.Staffing3Class").xWikiClass)
#set($prop3= $class3.get("sg_jobTitle"))
#set($jobtitles=$doc.display($prop3.getName(),"view"))
#set($prop3= $class3.get("sg_jobCode"))
#set($jobcodes=$doc.display($prop3.getName(),"view"))
#set($prop3= $class3.get("sg_classify"))
#set($classify=$doc.display($prop3.getName(),"view"))
#set($prop3= $class3.get("sg_startHourlyRate"))
#set($startHourlyRate=$doc.display($prop3.getName(),"view"))
.........
#if($jobtitles!="")
<%
String jobtitles1="$jobtitles";
String jobcodes1="$jobcodes";
String classify1="$classify";
String startHourlyRate1="$startHourlyRate";
String percentABC1="$percentABC";
String s2ndShiftDiff1="$s2ndShiftDiff";
String s3rdShiftDiff1="$s3rdShiftDiff";
String bilingualDiff1="$bilingualDiff";
String inHomeDiff1="$inHomeDiff";
String employeeCount1="$employeeCount";
java.util.StringTokenizer jobtitlesTokens= new
java.util.StringTokenizer(jobtitles1,"~");
java.util.StringTokenizer jobcodesTokens= new
java.util.StringTokenizer(jobcodes1,"~");
java.util.StringTokenizer classifyTokens= new
java.util.StringTokenizer(classify1,"~");
java.util.StringTokenizer startHourlyRateTokens= new
java.util.StringTokenizer(startHourlyRate1,"~");
java.util.StringTokenizer percentABCTokens= new
java.util.StringTokenizer(percentABC1,"~");
java.util.StringTokenizer s2ndShiftDiffTokens= new
java.util.StringTokenizer(s2ndShiftDiff1,"~");
java.util.StringTokenizer s3rdShiftDiffTokens= new
java.util.StringTokenizer(s3rdShiftDiff1,"~");
java.util.StringTokenizer bilingualDiffTokens= new
java.util.StringTokenizer(bilingualDiff1,"~");
java.util.StringTokenizer inHomeDiffTokens= new
java.util.StringTokenizer(inHomeDiff1,"~");
java.util.StringTokenizer employeeCountTokens= new
java.util.StringTokenizer(employeeCount1,"~");
int staffingCount=jobtitlesTokens.countTokens();
%>
#if($xwikiaction=="inline")
<%
if(staffingCount>0)
{
while(startHourlyRateTokens.hasMoreTokens())
{
%>
<TR>
<TD align=left><INPUT type="checkbox"
id="checkStaffing" size=6 value="checkbox"
name="checkStaffing"> </TD>
<Td align=left>
.....
Please let me know if you need more info...
Thanks.
Regards,
Rajesh
--
View this message in context:
http://n2.nabble.com/Xwiki-Forms-Error---com.xpn.xwiki.api.XWiki-threw-exce…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.