datawindow 的update() 方法。
1:datawindow的update()方法。 有两个可选参数:( { boolean accept {, boolean resetflag } } )。TRUE - (Default) Perform AcceptText. The update is canceled if the data fails validation.FALSE -Do not perform AcceptText. accept 参数默认为true。update()时,update()方法首先调用accepttext()方法,进行数据的验证。如果数据验证通过,update()方法成功。否则update()方法被取消,update失败。Update may trigger these events:
DBError
SQLPreview
UpdateEnd
UpdateStart
If AcceptText is performed, it may trigger these events:
ItemChanged
ItemError
2:如果在datawindow的itemchanged事件中调用accepttext(),无效。因为accepttext()可能触发an ItemChanged or an ItemError event.这样可能会形成死循环。
3:如果想在datawindow的itemchanged事件中调用update()方法,确保update()的第一个参数是false。这样在调用
update()方法时,update()方法不会首调用 accepttext(),从而accepttext()方法不会触发an ItemChanged or an ItemError事件.避免形成死循环。然而不调用 accepttext(),不会把新数据更新到数据库。使用setitem()方法。

浙公网安备 33010602011771号