w3pop.com :: ÍøÂçѧԺ :: XForms :: XForms ÐÐΪ£¨Actions£©
XForms ÐÐΪ£¨Actions£©
::
XForms Actions are handling response to events.
XForms ÐÐΪ¿É´¦Àí¶ÔʼþµÄÏìÓ¦¡£
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"> |
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 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"> |
In the example above, the value 50 will be stored in the instance element <size> when the form opens.
ÔÚÉÏÃæµÄÀý×ÓÖУ¬µ±±íµ¥´ò¿ªÊ±£¬Öµ 50 »á±»´æ´¢ÔÚʵÀýÔªËØ <size> ÖС£
ÆÀÂÛ (0)
All