Neatware  Header

    Event

    When an event is ignitated its associated tasks are executed. In Snaml for Java/WML _do and _onevent methods implement the event binding.

  1. Do

    _do method completes actions on the current card. It links a widget such as a button, a key, or a voice method to an action. _do method may appear in a card or template. The _do method in a card will override the _do method in a template if they have the same name.

    _do( "type='type' label='label' name='name' optional='boolean'" );
      go|prev|noop|refresh
    do_();
    

    'type' is a required attribute. It has the value 'accept' which accepts a method; 'prev' which goes to backward; 'help' which does help; 'reset' which clears the states; 'options' which requests for options; 'delete' which deletes an item; 'unknown' which do nothing; and 'vnd.*' which specifies vendor's type.

    'label' attribute specifies a string to indicate a user widget. It will be invalid if a widget can not be dynamically labeled. 'name' attribute specifies the name of event binding. The default value is equal to the value of type attribute. If 'optional' attribute has a true value, the _do method will be ignored. Its default value is false.

    _card( "id='first_card'" );
      _do( "type='accept' label='Card2'" );
        __go( "href='#second_card'" );
      do_();
      quote( "Click Card2 and goto it" );
    card_
    
    _card( "id='second_card'" );
      quote( "Second Card" );
    card_();
    	
  2. Onevent

    It specifies an event binding of a method in its content. The 'type' attribute specifies the name of an intrinsic event.

    _onevent( "type='type'" );
      go|prev|noop|refresh
    onevent_();
    
  3. Postfield

    __postfield specifies a field name and its value. It is used to send a URL request to a server.

    __postfield( "name='name' value='value'" );
    

    The 'name' attribute specifies the field name and it is required. The 'value' attribute specifies name value.

  4. Ontimer

    It may be an attribute of _card or _template. It may also be a type value of _onevent method. Usually, it is used with the __timer method. When the timer expired this event is actived.

  5. Onenterforward

    It may be an attribute of _card or _template method. It may also be a type value of _onevent method. The event is actived when __go method is called.

  6. Onenterbackward

    It may be an attribute of _card or _template. It may also be a type value of _onevent method. The event is actived when _prev method is called.

    _card( "id='card_wait' ontimer='#card_stop'" );
      // when user enters this card with prev task
      // onenterbackward occurs
      _onevent( "type='onenterbackward'" );
        __prev();
      onevent_();
    card_();
    
  7. Onpick

    It may be an attribute of the _option method. The event is actived when a user selects an item.