Thread Rating:
  • 472 Vote(s) - 2.79 Average
  • 1
  • 2
  • 3
  • 4
  • 5
入力チェックについての質問です
04-03-2014, 06:35 PM,
#2
RE: 入力チェックについての質問です
{import * from CURL.LANGUAGE.REGEXP}

{define-class public Check-name {inherits StandardStringCell}
{constructor public {default}
{construct-super}
}
||置換前
field before_text:String=""

||置換後(数字)
field after_text_suuji:String = ""

||チェックする値(数字)
field chk_suuji:String = "[0-9]"

{method public {note-grid-focus-out}:void
{super.note-grid-focus-out}

||フォーカスを受けていたセルの値を保存する(置換前)
set self.before_text = {String {super.get-data}}

||置換する(数字)
set self.after_text_suuji =
{regexp-subst
self.chk_suuji
,self.before_text
,""
,replace-all?=true
}

||
{if {self.before_text.equal? self.after_text_suuji}
then
{set self.background = "white"}
else
{popup-message "・数字が入力されています"}
{after 0s do {self.become-active}}
{set self.background = "red"}
}
}
}

{let people:RecordSet=
{RecordSet
{RecordFields
{RecordField "名前"}
,{RecordField "年齢"}
}
,{RecordData 名前 = "テスト君" , 年齢 = "25"}
,{RecordData 名前 = "テストさん", 年齢 = "37"}
}
}

{let test:RecordGrid=
{RecordGrid
record-source = people
,{RecordGridColumn "名前" ,width=50,cell-spec = Check-name}
,{RecordGridColumn "年齢" ,width=50}
}
}

{let hozon:CommandButton=
{CommandButton
label="保存"
,{on Action do
{people.commit}
}
}
}

{value
{VBox
test
,hozon
}
}


Messages In This Thread
RE: 入力チェックについての質問です - by rom - 04-03-2014, 06:35 PM
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('1063')