You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

[ |../../index.htm#lansa/l4wdev06_0460.htm]
現在地:

2.10.8.5 リスト内で選択されたアイテムの更新

リスト内の選択されたアイテムを更新するには、UPD_ENTRYコマンドを使用します。
この例では、社員を選択し、[昇給]プッシュ・ボタンを有効にする必要があります。賃金の増加は、選択した社員にのみ適用されます。  

例の動作を見るには、このコードをフォーム・コンポーネントにコピーします。
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(346) Left(245) Top(136) Width(623)
Define_Com Class(#PRIM_LTVW) Name(#EMPLIST) Displayposition(1) Fullrowselect(True) Height(285) Left(8) Parent(#COM_OWNER) Selectionstyle(Single) Tabposition(1) Top(28) Width(505)
Define_Com Class(#PRIM_LVCL) Name(#LVCL_1) Displayposition(1) Parent(#EMPLIST) Source(#EMPNO) Width(24)
Define_Com Class(#PRIM_LVCL) Name(#LVCL_2) Displayposition(2) Parent(#EMPLIST) Source(#SURNAME) Width(25)
Define_Com Class(#PRIM_LVCL) Name(#LVCL_3) Displayposition(3) Parent(#EMPLIST) Source(#GIVENAME) Width(33)
Define_Com Class(#PRIM_LVCL) Name(#LVCL_4) Displayposition(4) Parent(#EMPLIST) Source(#SALARY) Width(18)
Define_Com Class(#PRIM_PHBN) Name(#PB_RAISE) Caption('Give Raise') Displayposition(2) Enabled(False) Left(528) Parent(#COM_OWNER) Tabposition(2) Top(272)
Evtroutine Handling(#com_owner.Initialize)
Select Fields(#EMPLIST) From_File(PSLMST)
Add_Entry To_List(#EMPLIST)
Endselect
Endroutine
Evtroutine Handling(#PB_RAISE.Click)
Change Field(#SALARY) To('#SALARY * 1.10')
Upd_Entry In_List(#EMPLIST)
Endroutine
Evtroutine Handling(#EMPLIST.ItemGotSelection)
Set Com(#PB_RAISE) Enabled(TRUE)
Endroutine
End_Com
[ |../../index.htm#lansa/l4wdev06_0460.htm]

  • No labels