Wicket 1.5ã§HTML5ãªã¿ã°ã使ã
ã¯ããã«
ããWicket 1.5ã£ã¦HTML5ãªã¿ã°ä½¿ããã®ï¼ãã¨ããã®ã¯ãå¤ãã®äººãæ°ã«ããããã¨ãã¨æãã¾ãã
ãWicket1.5ã®æ°æ©è½ã§HTML5ã£ã½ãã®ã¯ä»¥ä¸ã®å
容ã¯ä»¥ä¸ã ãã§ãã
HTML5 components added: EmailTextField, NumberTextField, UrlTextField and RangeTextField(http://wicket.apache.org/2011/09/07/wicket-1.5-released.html)ãã
ãããªãã§ããã ãï¼ãã¨æã£ã¦ããã®ã§ããããæå¤ã¨ãããªç¨åº¦ã§è¯ãã®ãããããªããªã¼ãã¨ãããã¨ãåãã£ãã®ã§ã¡ã¢ã
ãã¡ãªã¿ã«ãJavaScriptã®Canvasã§ãªãããªæãã«ããããã¨ãããããã®ãæãã§ãããªãã°ãç¡çã§ãã(ãããªãã¨ãããããã¿ã°ã¯é¢ä¿ç¡ã)ã
inputã¿ã°ä»¥å¤ã«ã¤ãã¦
ãHTML5ã§å¢ããã¿ã°ãè¦ã¦ã¿ãã¨ãã»ã¼ãã¹ã¦ãLabelãWebMarkupContainerãå²ãå½ã¦ã¦ããã°ä½¿ãã¾ã(å³å¯ã«æ¤è¨¼ãããããããªãã§ãã)ã
ããã£ã¦ãå®ã¯å°ãã¾ããã
inputã¿ã°ã«ã¤ãã¦
ãinputã¿ã°ã«ã¯ãããããªtypeå±æ§ã追å ããã¦ãã¾ãããå°ç¨ã³ã³ãã¼ãã³ããç¡ãå ´åã§ããTextFieldã®æ´¾çã¯ã©ã¹ãä½ã£ã¦ããã°å¯¾å¿å¯è½ã§ãã
ãã¨ããã¾ãã®ããã©ãããã©ã¦ã¶ã¯æååã§å
¥åå¤ãè¿å´ãã¦ããããã§ãã
ãã¨ã¯ããããã®ã¾ã¾TextFieldã使ãã¨å®è¡æã«Wicketãã¨ã©ã¼ãåºåãã¾ãã
ãããã¯ãgetInputType()ããªã¼ãã¼ã©ã¤ããããã¨ã«ãã£ã¦è§£æ±ºãã¾ãã
ãgetInputType()ã®æ»ãå¤ã¨ãã¦ã使ãããtypeå±æ§ã®ååãè¿ãããã«ãã¦ããã°è¯ãã®ã§ãã
ããªãgetInputType()ããªã¼ãã¼ã©ã¤ããããã¨ã«ãã£ã¦åé¡ã解決ããã示ãããã«ã以ä¸ã«TextField#onComponentTag(final ComponentTag)ã®ã½ã¼ã¹ãå¼ç¨ãã¾ãã
protected void onComponentTag(final ComponentTag tag) { // Must be attached to an input tag checkComponentTag(tag, "input"); // check for text type String inputType = getInputType(); if (inputType != null) { checkComponentTagAttribute(tag, "type", inputType); } else { if (tag.getAttributes().containsKey("type")) { checkComponentTagAttribute(tag, "type", "text"); } } tag.put("value", getValue()); // Default handling for component tag super.onComponentTag(tag); }
ãã¡ãªã¿ã«TextField#getInputType()ã¯Wicket1.3.xã«ãåå¨ãã¾ã(å°ãªãã¨ãWicket1.3.6ã«ã¯ãããã¨ã確èªãã)ã
ãç´ æ´ãããã§ããã
ãããã«
ã念ã®ããã«æ¸ãã¦ããã¾ãã¨ã使ãéã¯è¦æ¤è¨¼ã§ãããid:sekomã使ããã¨è¨ã£ã¦ãããã©ä½¿ããªããã¨è¨ããã¦ãå°ãã¾ã(ããã¤ã試ããæãã§ã¯å¤§ä¸å¤«ã§ã¯ãã£ãã®ã§ãã)ã
ãã¨ã¯ããããHTML5ã§è¿½å ããããHTMLã®ã¿ã°ã¨å±æ§ä½¿ãã¾ãããä¸å¿å®é¨ã¯è¦ãã¾ããã©ãã¨è¨ããã®ã¯ãä»ã®ãæä¸ã大å¤æ°åã楽ã«ãªãã®ã§ã¯ãªãã§ããããã