WicketSapporo2013_03.key

Similar documents
S2Wicketの紹介

Resigtration Manual (Japanese)

ビットリアカップ2007けいはんなサイクルレースリザルト

yume_P01-056


校友会16号-ol.indd


Page 1

浦安ライオンズクラブ81獅子吼.indd

<348C8E8D862E696E6464>

JSplus23蜿キ.indd

国文研ニューズ35.indd

- 1 -

%

2

ID010-2

地域と文化資産


Wicket as Meta-Framework

(Microsoft PowerPoint - ClickFramework.ppt [\214\335\212\267\203\202\201[\203h])

Seasar.NET入門

2

2



2

Oracle JDeveloper 10g ADF Creation Date: Jul 07, 2004 Last Update: Jul 08, 2004 Version 1.0

Microsoft PowerPoint - Tutorial_6.ppt

前ページからの続き // テキストボックス02 id 属性で取得 // id 属性で取得する場合は一意に決まるので 何番目かの指定は不要 var textbox02elem = document.getelementbyid("text_box02_id"); if ("001" == statee

Prog2_12th

101NEO資料

intra-mart マスカット連携ガイド

1

とても使いやすい Boost の serialization

JavaScript 演習 2 1

Prog2_2nd

Oracle BPEL Process Managerを使用したJD Edwards EnterpriseOne顧客信用情報の問合せ

WebOTXマニュアル

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版  

Sinatra と MongoDB 今回は Sinatra で MongoDB の操作を体験してみます 進捗に合わせて ドライバから Ruby で使える便利な ORM の紹介をします

NAC(CCA): ACS 5.x 以降を使用した Clean Access Manager での認証の設定

第7回 Javascript入門

Exercise 41: Create a Drill Down Report

SmartBrowser_document_build30_update.pptx

ファイルを直接編集する画面を切り替えることができる. 図 3 標準のレイアウトを削除する (2) グラフィカル レイアウト画面で LinearLayout(Vertical) を追加するパレットウィンドウの レイアウト の中にある LinearLayout(Vertical) をドラッグして, 編集

d_appendixB-asp10appdev.indd

スライド タイトルなし

設 定 を 変 更 する 前 に 反 映 させたい Group と Profile が 選 択 されているかをご 確 認 下 さい A. General Settings A- インターフェイスの 外 装 色 を 変 更 する (Customize Colours) この 項 目 では インターフェ


Prog2_6th

JavaScript の使い方

2009 Web B012-1

スケジューリングおよび通知フォーム のカスタマイズ

Webプログラミング演習

PowerPoint プレゼンテーション

虎石01-02/コース 5校*.eps

SVG資料第10回目(その2) Ajaxによる同期通信と非同期通信の違い


PowerPoint プレゼンテーション

untitled

JavaScript演習

201506_Web版作成支援_簡易操作マニュアル

SMILE-BS_人事給与

C o n t e n t s Top Message

レポート-hyo1-4.ai

Contents

プライシング:デフレ下の収益向上, 実現価格アップ:販促コストのマネジメント, 金融サービスにおける戦略的プライシング, The Untapped Power of Pricing, 産業財企業の最適プライシング, Precision Pricing for Profit, Growth, and Advantage

Lotus Domino XML活用の基礎!

.\...i j

Ruby演習テキスト1

Webプログラミング演習

セレクタ? セレクタ (Selector 選択 指定するもの ) は どのタグにスタイルを付けるのかを指定するためのものです セレクタ { プロパティ : 値 ; どのタグにスタイルを付けるかの指定 { スタイルの設定名 : スタイルの設定値 ; body { color: red; body を選

PowerPoint プレゼンテーション

Oracle ESB レッスン03: ESB CustomerData SOAP

目次 はじめに... 3 システムの必要条件... 3 サンプルアプリケーションの作成... 3 手順 手順 手順 手順 手順 手順 終わりに... 23

54 5 PHP Web hellow.php 1:<?php 2: echo "Hellow, PHP!Y=n"; 3:?> echo PHP C 2: printf("hellow, PHP!Y=n"); PHP (php) $ php hellow.php Hellow, PHP! 5.1.2

ohp.mgp

java_servlet2_見本

Prog2_6th

JavaプログラミングⅠ

JavaScript プログラミング 4.Web ブラウザのオブジェクト 4-4 window オブジェクト 4-5 location オブジェクトと history オブジェクト 4-6 link オブジェクト 08T4082A 野太樹

spring drive

Microsoft Word - JAPANESE - Setup Login Credentials.doc

fp.gby

intra-mart im-JavaEE Framework

Jude を DSL エディタとして使う -Jude API 活用法 年 11 月 14 日稚内北星学園大学東京サテライト校浅海智晴 本日のテーマ Why Jude API What Jude API How Jude API 1

WebOTXマニュアル

Contents Logging in 3-14 Downloading files from e-ijlp 15 Submitting files on e-ijlp Sending messages to instructors Setting up automatic

名称未設定

Microsoft Word - no06.doc

Prog2_2nd

アプリ版居宅介護支援システム簡単操作マニュアル 2017 年度版 総合案内 サポートデスク Copyright(C) 2010 ITSS All Rights Reserved.

PowerPoint プレゼンテーション

HTML

チュートリアル Part 2 の概要 チュートリアル Part 2 では サンプルデータのマニホールドブロックを使用して ilogic で Excel スプレッドシートと関連付けて マニホールドブロックの各形状や部品番号に関するルールを作成 実行して ilogic のルールに基づいて Excel ス

10th Developer Camp - B5


Visio-.v...[..1.vsd

S2Pradoの紹介

Microsoft PowerPoint - OOP.pptx

Transcription:

1

2

3

4

5

<body> <p(wicket:id="label1">message1(is(here.</p> </body> 6

import(org.apache.wicket.markup.html.webpage; ( public(class(simplepage(extends(webpage({ ( ((public(simplepage()({ ((((//" ((} ( } 7

//"1." String(message1(=(" "; ( //"2." Model IModel<String>(model1(=(new(Model<>(message1); 8

//"3."Model HTML wicket:id Label(label1(=(new(Label("label1",(model1); ( //"4." add add(label1); 9

<body> <p(wicket:id="label1"> </p> </body> 10

<body> <p(wicket:id="label1">message1(is(here.</p> </body> Label( label1 ) getobject Model return String WicketSapporo <body> <p(wicket:id="label1">wickethsapporo </p> </body> 11

12

13

Page 1 Link Page 2 Link Page 3 HistoryBack History@Back@ @2 Page1 Stateful!! Link Page 4 14

15

16

17

18

19

20

"... " "...... " 21

public(class(calculator({ ( ((public(int(add(int(x,(int(y)({ ((((return(x(+(y; ((} ( } public(class(calculatortest({ ((private(calculator(calculator; ( ((@Before ((public(void(setup()({ ((((calculator(=(new(calculator(); ((} ( ((@Test ((public(void(add 0 1 1 ()({ ((((int(actual(=(calculator.add(0,(1); ((((assertthat(actual,(is(1)); ((} (@Test ((public(void(add 3 4 7 ()({ ((((int(actual(=(calculator.add(3,(7); ((((assertthat(actual,(is(7)); ((} @@ } 22

23

new(wickettester(webapplication); private!wickettester!tester;! @Before public!void!setup(){!!tester!=!new!wickettester(new!wicketapplication()); } 24

25

tester.startpage(webpage); @Test public!void!test1()!{!!//"!!tester.startpage(new!homepage()); } 26

tester.assertrenderedpage(class); @Test public!void! ()!{!!//"HomePage!!tester.startPage(new!HomePage());!!//" "HomePage.class"!!tester.assertRenderedPage(HomePage.class); } 27

tester.assertlabel("id",(string); @Test public!void! (){! tester.startpage(homepage.class);! //message1 "!"! tester.assertlabel("message1",!" "); } 28

tester.executeurl("./foo/bar");! @Test public!void! CleanURL ()!{!!//"URL!!tester.executeUrl("./foo/communityId/123");!!//" "FooPage.class"!!tester.assertRenderedPage(FooPage.class);!!//"communityId 1000!!tester.assertLabel("communityId",!"123"); } 29

WicketTester#clickLink tester.clicklink("id",(boolean); idのlinkコンポーネントのonclickメソッドが実行される クリックされた後の結果を 他のassertメソッドでチェックする 第2引数はAjaxが有効な環境でのクリックかどうか 省略するとtrue 使用例 @Test public!void!barpageに遷移される()!{!!tester.startpage(new!ws01indexpage());!!//"tobarpage"linkコンポーネントがクリックされる!!tester.clicklink("tobarpage");!!//"simplepageクラスのページに遷移されるか!!tester.assertrenderedpage(barpage.class); } 30

//"id tester.assertvisible("id"); //"id tester.assertinvisible("id"); //"id tester.assertenabled("id"); //"id tester.assertdisabled("id"); //"id tester.assertrequired("id") 31

tester.assertcomponentonajaxresponse("id"); @Test public!voiddlink wmc ()!{!!tester.startpage(new!homepage());!!tester.clicklink("link");!!//"link Ajax wmc!!tester.assertcomponentonajaxresponse("wmc");!!//"wmc!!tester.assertinvisible("wmc"); } 32

tester.executeajaxevent("id",!string); @Test public!void!click (){!!tester.startpage(homepage.class);!!tester.assertlabel("label",!" ");!!!!//"Ajax "click"!!tester.executeajaxevent("label",!"click");!!tester.assertlabel("label",!" "); } 33

tester.executealltimerbehaviors(markupcontainer); executebehavior(behavior) @Test public!void!timerbehavior clock ()!{!!WebPage!page!=!tester.startPage(new!AjaxTimerPage());!!//"Page TimerBehavior.!!tester.executeAllTimerBehaviors(page);!!//"TimerBehavior add.!!tester.assertcomponentonajaxresponse("clock"); } 34

tester.startcomponentinpage(component); @Test public!void!panel ()!{!!//" FooPanel!!tester.startComponentInPage(new!FooPanel("foo"));!!//"FooPanel Label1!!tester.assertLabel("foo:label1",!"Hello!")); } 35

tester.assertcomponent("id",(class); tester.assertmodelvalue("id",(object); tester.getlastrenderedpage(); tester.getcomponentfromlastrenderedpage("id"); 36

37

tester.newformtester("form",!false); @Test public(void(formtest1()({ ((tester.startpage(new(homepage()); ((//"Form ""(FormTester(formTester(=(tester.newFormTester("form"); } 38

formtester.setvalue("id",!string); formtester.select("id",!int); formtester.selectmultiple("id",!int...); 39

!formtester.submit(); @Test public!void!form submit Label ()!{!!tester.startpage(new!formpage()); DD//"nameLabel DDtester.assertLabel("nameLabel",!"");!!FormTester!formTester!=!tester.newFormTester("form");!!formTester.setValue("name",!"foo");!!formTester.submit(); DD//"nameLabel submit DDtester.assertLabel("nameLabel",!"foo"); } 40

tester.assertfeedback("id",dstring...); assertinfomessages(string...)d asserterrormessagesd(string...) 41

42

tester.getsession(); @Test public!void! ()!{!!MySession!session!=!(MySession)!tester.getSession();!!session.setSigned(false);!!tester.startPage(SignedPage.class);!!tester.assertRenderedPage(ErrorPage.class); } 43

44

45

<dependency>!!<groupid>org.apache.wicket</groupid>!!<artifactid>wicketyguice</artifactid>!!<version>6.12.0</version> </dependency> <dependency>!!<groupid>com.google.inject</groupid>!!<artifactid>guice</artifactid>!!<version>3.0</version> </dependency> <dependency>!!<groupid>org.apache.wicket</groupid>!!<artifactid>wicketyspring</artifactid>!!<version>6.12.0</version> </dependency> <dependency>!!<groupid>org.springframework</groupid>!!<artifactid>springycontext</artifactid>!!<version>3.2.5.release</version> </dependency> 46

@Override public!void!init()!{!!super.init();!!/*" "*/!!initguice(); }! protected!void!initguice()!{!!//"wicket!!getcomponentinstantiationlisteners().add(new!guicecomponentinjector(this)); } 47

//" @ImplementeBy @ImplementedBy(Foo.class) public!interface!ifoo!{!!public!boolean!bar();!!!/*" "*/ } public!class!bazpage!extends!webpage!{!!!//guice @Inject!!@Inject!!private!IFoo!foo;!!!/*" "*/ } 48

@Before public(void(setup()({ ((tester(=(new(wickettester(new(wicketapplication()({ ((((@Override ((((protected(void(initguice()({ ((((((//" Module ((((((Module(module(=(new(Module()({ ((((((((@Override ((((((((public(void(configure(binder(binder)({ ((((((((((IFoo(foo(=(mock(IFoo.class); ((((((((((//"IFoo ((((((((((binder.bind(ifoo.class).toinstance(foo); ((((((((} ((((((}; ((((((getcomponentinstantiationlisteners().add(new(guicecomponentinjector(this,(module)); ((((} ((}); } 49

@Override public(void(init()({ ( ((/*" "*/ ( ((initspring(); } ( protected(void(initspring()({ ((AnnotationConfigApplicationContext(ctx(=(new(AnnotationConfigApplicationContext(); ((//" Bean ((ctx.scan("com.exmaple"); ((ctx.refresh(); ((getcomponentinstantiationlisteners().add(new(springcomponentinjector(this,(ctx)); } ApplicationContext xml 50

//"Spring bean @Component OK @Service public(class(foo(implements(ifoo({ ((@Override ((public(boolean(bar()({ ((((/*" "*/ ((} } public!class!bazpage!extends!webpage!{!!!//spring @SpringBean!!@SpringBean!!private!IFoo!foo;!!!/*" "*/ } 51

@Before public(void(setup()({ ((tester(=(new(wickettester(new(springapplication()({ ((((@Override ((((protected(void(initspring()({ ((((((//" ((((((IFoo(foo(=(Mockito.mock(IFoo.class); ((((((//" ApplicationContextMock ((((((ApplicationContextMock(ctxm(=(new(ApplicationContextMock(); ((((((ctxm.putbean("foo",(foo); ((((((getcomponentinstantiationlisteners().add(new(springcomponentinjector(this,(ctxm)); ((((} ((}); } 52

53

54

new!model<t>(t); new!listmodel<t>(t); 55

56

CompoundPropertyModel new!compoundpropertymodel<t>(t); wicket:idを元に オブジェクトのフィールド変数が コンポーネントのモデルオブジェクトとして自動参照されるモデル 使いこなすとコード量を少なくでき データの取り扱いも楽 Bean Component( foo ) CompoundProperty Model add add 参照 Component( bar ) Model Component( baz ) Model bar 自動参照 baz 自動参照 57

IModel<UserLunch>!userLunchModel!=!new!CompoundPropertyModel<>(new!UserLunch()); Form<UserLunch>!form!=!new!Form<UserLunch>("form",userLunchModel)!{!!!!!!//" }; add(form);! //" "userlunch" "name" TextField<String>!nameField!=!new!TextField<>("name"); form.add(namefield);! //" "userlunch" "lunch" RadioChoice<String>!radioChoice!=!new!RadioChoice<>("lunch",!lunchesModel); form.add(radiochoice); 58

new!abstractreadonlymodel<t>()!{!!!@override!!public!t!getobject()!{!!!!//"!!!!//"!!} }; 59

new!loadabledetachablemodel<t>()!{!!!@override!!public!t!load()!{!!!!//"!!!!//"!!!!//"!!} }; 60

61