ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: XForms :: XForms ÐÐΪ£¨Actions£©

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

XForms
XForms ½éÉÜ
XForms Ä£ÐÍ
XForms ÃüÃû¿Õ¼ä
XForms ʵÀý
XForms XPath
XForms ÊäÈë¿Ø¼þ
XForms Ñ¡Ôñ¿Ø¼þ
XForms Êý¾ÝÀàÐÍ
XForms ÊôÐÔ
XForms ÐÐΪ£¨Act..
XForms º¯Êý
Xforms Êý¾ÝÀàÐͲ..

XForms ÐÐΪ£¨Actions£©


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-29 ÐÞ¸Ä:2008-01-24 ä¯ÀÀ:1862 :: ::

XForms Actions are handling response to events.
XForms ÐÐΪ¿É´¦Àí¶ÔʼþµÄÏìÓ¦¡£


The Message Action
ÐÅÏ¢ÐÐΪ

The XForms element <message> defines a message to be displayed in the XForms user interface.
XForms ÔªËØ <message> ¿É¶¨ÒåÒ»ÌõÏÔʾÔÚ XForms Óû§½çÃæµÄÏûÏ¢¡£

Look at this simplified example:
Çë¿´Õâ¸ö¼ò»¯µÄÀý×Ó£º

<input ref="fname">
<label>First Name</label>
<message level="ephemeral" event="DOMFocusIn">

Input Your First Name
</message>
</input>

In the example above, the message "Input Your First Name" should be displayed as a tool tip when the user focus in on the input field.
ÔÚÉÏÃæµÄÀý×ÓÖУ¬µ±Óû§°Ñ½¹µã¼¯ÖÐÔÚ´ËÊäÈëÓòʱ£¬"Input Your First Name" ÕâÌõÏûÏ¢¿É×÷Ϊ¹¤¾ßÌáʾ±»ÏÔʾ´¦Àí£º

The event="DomFocusIn" defines the event to trigger the action.
event="DomFocusIn" ¿É¶¨Òå´¥·¢ÐÐΪµÄʼþ¡£

The level="ephemeral" defines the message to be displayed as a tool tip.
level="ephemeral" ¿É¶¨Òå×÷Ϊ¹¤¾ßÌáʾÀ´ÏÔʾµÄÏûÏ¢¡£

Other values for the level attribute are modal and modeless, defining different types of message boxes.
level ÊôÐÔµÄÆäËûÖµÊÇ modal ºÍ modeless£¬¿É¶¨ÒåÏûÏ¢¿ò£¨¶Ô»°¿ò£©µÄ²»Í¬ÀàÐÍ¡£


The Setvalue Action
Setvalue ÐÐΪ

The XForms element <setvalue> defines a value to be set in response to an event.
XForms ÔªËØ <setvalue> ¿É¶¨ÒåÔÚ¶Ôij¸öʼþ×ö³öÏìӦʱ±»ÉèÖõÄÖµ¡£

Look at this simplified example:
Çë¿´Õâ¸ö¼ò»¯µÄÀý×Ó£º

<input ref="size">
<label>Size</label>
<setvalue value="50" event="xforms-ready"/>

</input>

In the example above, the value 50 will be stored in the instance element <size> when the form opens.
ÔÚÉÏÃæµÄÀý×ÓÖУ¬µ±±íµ¥´ò¿ªÊ±£¬Öµ 50 »á±»´æ´¢ÔÚʵÀýÔªËØ <size> ÖС£

ÆÀÂÛ (0) All