驚艷於一個相容於ColdFusion,但是可免費商用的Railo,跌跌撞撞的研究過程,希望能有同好一起交流指教。

2009年7月2日 星期四

[BUG] cfinput type="dateField"

舊程式碼版本: ColdFusion 8.0
Railo Server版本: 3.1.0.015

轉換舊程式語法時出現一些錯誤,這個錯誤是由 cfinput type="dateField" 造成的,以下是舊程式碼

<cfset zhtw_mon = '一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月'>
<cfset zhtw_day = '日,一,二,三,四,五,六'>
<cfformaction="test.cfm" method="post">
<cfinput dayNames="#zhtw_day#" monthnames="#zhtw_mon#" type="dateField" name="testdate" label="Start Date:" mask="YYYY/MM/DD">
</cfform>


在ColdFusion 8.0可順利執行


但是在Railo會出現錯誤:

Railo 3.1.0.015 Error (Application)
Message: value of attribute [daynames] must contain a string list with 7 values, now there are 7 values



如果把中文標題去除:

<cfform action="test.cfm" method="post">
<cfinput type="dateField" name="testdate" label="Start Date:" mask="YYYY/MM/DD">
</cfform>



在 CF 8.0正常, 在 Railo 會出現另一個錯誤

Railo 3.1.0.015 Error (Application)
Message: type [datefield] is only allowed if form format is flash



但是氣結的是, 強迫在CFform中加入format="flash"

<cfform action="test.cfm" method="post" format="flash">



CF 8.0 可以自動轉換成Flash模式


在 Railo還是會出現另一個錯誤

Railo 3.1.0.015 Error (Application)
Message: format [flash] is not supported, only the following formats are supported [html]




這部份可能要等新版 Railo解決此問題(或許需要外掛某個Flash Engine);在此之前只能改用其他 CF 語法後端檢查或是不能偷懶自己改寫 Javascipt語法

沒有留言:

張貼留言