XForms Tutorial > I-6.2.4. The trigger Element

이 폼 컨트롤은 HTML의 <input type="button">과 유사한 유저인터페이스를 제공하며, 특정 Action에 따라 다른 컨트롤과 연결하고자 할 경우 많이 사용된다. 예를 들어 trigger 엘리먼트를 클릭하였을 때 서버로 데이터 조회를 요청하라든지, 다른 업무 화면으로 이동하라든지 등 특정 작업을 수행하고자 할 때 사용되는 컨트롤이다.

Common Attributes

  • Common, UI Common, Single Node Binding(Options)
Data Binding Restrictions
  • Binds to any node
  • his form control does not directly interact with form data
  • but is affected by model item properties of the bound node
Sample
…(생략)...
<xforms:model>
 <xforms:instance>
  <root>
   <info>
    <text> 버튼 클릭 </text>
    <hint> 버튼을 클릭하세요. </hint>
   </info>
  </root>
 </xforms:instance>
</xforms:model>


<script for="btn_trigger" event="onclick">
 alert("버튼 클릭");
</script>

</head>

<body>
 <xforms:trigger id="btn_trigger"> 
  <xforms:label ref="info/text" /> 
  <xforms:hint ref="info/hint" />
 </xforms:trigger>
</body>
...(생략)...

댓글 없음: