简体   繁体   中英

openlaszlo Button and Radiogroup inerference

I am a openlaszlo beginner and I wnat to create an interactive web interface which simulates the indications of a vomplex astronomic clock. It should be possible to input eg the coodriantes and date/time or to select a realtime or timelapse modus.

I have tried to use a edittext field and button and a radiobutton group to select the informations and then to move an image according to the selsction. When I use only the edittext field and the button, then it works. The text entry is displayed in the output edittext field and the image really rotates the arc which was given. When I add the radiobutton group, then the selected arc is displayed in the output edittext field, but no rotation of the image occurs. Can someone help?

Here is the code

<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>

I've tested the code with OpenLaszlo 5.0 trunk, and it works as expected in both the SWF10 and DHTML runtime.

Here is a screenshot of the app with a resource from the LzClock widget (didn't have your SWF resource available for testing). I've entered the arc value into the textfield and clicked the button to set the rotation.

在此处输入图片说明

I've tested with Chrome and Firefox on Linux, haven't tested with Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM