I have some issues with using Java Script and SCA. After look some examples,
I have noticed the usage of this structure:
#SCDL:
<composite>
<component name="Calendar">
<t:implementation.widget location="uiservices/calendar.html"/>
<service name="Widget">
<t:binding.http uri="/calendar"/>
</service>
<reference name="calendarRef" target="CalendarComponent">
<t:binding.jsonrpc/>
</reference>
</component>
<component name="CalendarComponent">
<implementation.java class="package.Class"/>
<service name="CalendarService">
<t:binding.jsonrpc/>
</service>
</component>
</composite>
#Java Script
<script type="text/javascript" src="calendar.js"></script>
<script language="JavaScript">
//@Reference
var calendarRef = new Reference("calendarRef");
function init() {
try {
calendarRef.someMethod();
}
catch(e){
alert(e);
}
}
</script>
However, if I execute this, I get a "TypeError: calendarRef is undefined".
Am I missing something?
Thanks
--
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas
(Unicamp), Brazil