在Xojo WebApp上,我創建了一個TextFieldClass
,其屬性爲「布爾值必需」。如何動態地訪問Xojo上的子類的屬性?
在網頁上,我有一些TextFieldClass
對象。
我想要做的很簡單...我想在網頁上做一個self.ControlCount
,並檢查所有帶有「true」值的屬性的textFieldClass
實際上是否包含內容。 ?
容易,對不對?
Dim i as integer
Dim c As textFieldClass
For i=0 To self.ControlCount
if self.ControlAtIndex(i) isa textFieldClass then
**c=self.ControlAtIndex(i) // i got an error… expected class textFieldClass, but got class webObject…**
End If
Next
如果我嘗試:
Dim i as integer
Dim c As WebObject
For i=0 To self.ControlCount
if self.ControlAtIndex(i) isa textFieldClass then
c=self.ControlAtIndex(i)
**if c.required then // I got an error… Type "WebObject" has no member named "required"**
// do something here…
end if
End If
Next
感謝您的幫助!