2013-07-29 3 views
0

지난 2 일 동안 RapidSpell CheckerZK 웹 응용 프로그램으로 데모 코드 Here을 실행할 수 있습니다. 데모 코드를 얻을 수 있습니다. 난 내 웹 응용 프로그램에서 동일한 코드를 사용하기 위하여려고하는 경우 이제 내 페이지는 개별 페이지의 모든 것이 잘 작동하지만 난이에 위의 라인을 추가하는 동안 내 페이지가 코드ZK + RapidSpell Checker 통합?

Executions.createComponents("/my_detail.zul", comp, arguments); 

아래 탭 내에서 동적으로 생성 될 때 경우 ZUL 빠른 맞춤법 검사기를 실행하는 데 필요한 파일

<?script type="text/javascript" content=" zk.afterMount(function() 
{rsw_setupTextBoxes(true);});"?> 

    <script src="a.rapidspellweb?t=r&amp;n=RapidSpell-AYT.js" /> 
    <script type="text/javascript"> 
     rapidSpell.setParameterValue('default', 'UserDictionaryFile', 
     '~/userdictionaries/1.txt'); 
    </script>  

.

여기에서 데모를 볼 수 있습니다. zul 잘 작동합니다.

<window title="Hello World!!" border="normal" width="100%" > 
    <?script type="text/javascript" content=" zk.afterMount(function() 
{rsw_setupTextBoxes(true);});"?> 
    <style src="./sans-style.css" /> 
    <script src="a.rapidspellweb?t=r&n=RapidSpell-AYT.js" /> 
    <script type="text/javascript"> 
     rapidSpell.setParameterValue('default', 'UserDictionaryFile', 
     '~/userdictionaries/1.txt'); 
    </script > 
    <label value="You are using: ${desktop.webApp.version}" /> 
    <textbox rows="10" ></textbox> 

</window> 

답변

0

페이지에 직접 연결하면 동적으로 생성되지만 페이지가 동적으로 생성되면 일부 js 오류가 발생하는 것이 좋습니다.

var initTimer = setInterval (function() { 
    if (window.rapidSpell) { 
     rapidSpell.setParameterValue('default', 'UserDictionaryFile', 
      '~/userdictionaries/1.txt'); 
     clearInterval(initTimer); 
    } 
}, 500); 

편집 : 수 보드의 조시가 제공하는 편집을 적용, 대체이 아마 JS 라이브러리 '후'실행해야합니다 몇 가지 코드를 실행에 의한

아래처럼 뭔가를 시도 할 수 있습니다, 너무 일찍로드 자바 스크립트 자바 스크립트에 의해

전화 필수 기능,

예와 zscript 부분

<script type="text/javascript"> 
    <![CDATA[ 
     zk.afterMount(function(){ 
      setTimeout(function() { rapidSpell.setParameterValue('default', 'UserDictionaryFile', '~/userdictionaries/AmandaDic.txt');}, 2000); 
      setTimeout (function() { rsw_setupTextBoxes(true);}, 4000); }); 
    ]]> 
</script> 
+0

아무런 예외가 없지만 페이지가 내부 zul 일 때 맞춤법 검사가 작동하지 않습니다. 샘플 전쟁을 어떻게 보냅니 까? –

+0

https://sourceforge.net/projects/에서 다운로드 할 수 있습니다. zkspellchecker/files/zkspellchecker.war/다운로드 –

+0

index.zul spellchecker가 작동하지만 모달 창이 열렸을 때 작동하지 않는 것을 여기서 볼 수 있습니다. –