2012-12-27 61 views
2

我是openlaszlo初學者,我想創建一個模擬複雜天文鐘的指示的交互式web界面。應該可以輸入例如coodriantes和日期/時間,或者選擇實時或時間間隔模式。openlaszlo按鈕和Radiogroup接口

我試圖使用edittext字段和按鈕和單選按鈕組來選擇信息,然後根據selsction移動圖像。 當我只使用edittext字段和按鈕時,它就起作用了。文本條目顯示在輸出的edittext字段中,圖像確實旋轉了給定的弧線。當我添加單選按鈕組時,所選弧將顯示在輸出edittext字段中,但不會出現圖像旋轉。有人可以幫忙嗎?

這裏是我測試過用OpenLaszlo 5.0主幹代碼的代碼

<canvas> 
<!-- Load of the image --> 
<view name="Zeiger" x="100" y="100" resource="images/Kal_Ring_Stundenzeiger.gif" id="HandID"> 
    <!-- Methode to rotate the image, Arc is set by the argument --> 
    <method name="rotate" args="Arc"> 
     var increment = 0 + Arc; 
    var dur = 700; 
    this.animate('rotation',increment,dur); 
    </method> 
</view> 

<!-- Control unit --> 
<view name="Bedienung" x="200" y="10"> 
    <simplelayout axis="y" inset="8"/> 

    <text text="Output:"/> 
    <edittext id="outputID" text = "0"/>  

    <text text="Arc:"/> 
    <edittext id="WinkelID" text = "51"/> 

    <button x="000" y="160"> 
    Rotation 
    <!-- Handler to execute the Method --> 
    <handler name="onclick"> 
     var x = WinkelID.getText(); 
     HandID.rotate(x); 
     outputID.setAttribute('text',x); 
    </handler> 
    </button> 
    <!-- when I remove the radiogroup, then the image rotates --> 
    <radiogroup id="group1ID"> 
    <handler name="onselect"> 
     var Arcchoice = this.getValue(); 
     HandID.rotate(Arcchoice); 
     outputID.setAttribute('text',Arcchoice); 
    </handler> 
    <radiobutton value="0" text="0°" selected="true"/> 
    <radiobutton value="90" text="90°"/> 
    <radiobutton value="180" text="180°"/> 
    <radiobutton value="270" text="270°"/> 
    <radiobutton value="360" text="360°"/> 
    </radiogroup> 
</view> 

</canvas> 
+0

您使用哪種OpenLaszlo版本,運行時和瀏覽器?你是否在所有瀏覽器和運行時都看到這個問題?目前使用的最好的OpenLaszlo版本是5.0(trunk),因爲許多bug被修復爲5.0,這在4.9中還沒有被修復。 –

回答

0

,和它的作品如預期在SWF10和DHTML運行兩者。

下面是使用LzClock小部件的資源(沒有可用於測試的SWF資源)的應用程序的屏幕截圖。我在文本字段中輸入了弧的值,並單擊按鈕來設置旋轉。

enter image description here

我曾與Chrome和Firefox在Linux上測試,都不能與Windows測試。

+0

謝謝Raju,我已經使用了Lazlo 4.9.0,在更新到5.0.X後,它在我的Windows 7電腦上工作。 –

+0

是的,不幸的是,這麼多bug在5.0版本中得到修復,但是這麼長時間沒有任何官方發佈。很多人遇到4.9問題,不知道使用5.0會更好。 –