el式を使用してリストまたは配列のすべての要素を動的に取得したい。jqueryを使ってオートコンプリートコンボボックスでEL式を使用してリストまたは配列のすべての要素を取得
私は以下のコードを使用しています。私が変数istatusを使用する場合、それは動作していません。もの以下
${claimNotificationForm.chattels[istatus].objectValue}
..
${claimNotificationForm.chattels[0].objectValue}
${claimNotificationForm.chattels[1].objectValue}
ISTATUS値に基づいて、EL式が評価されるべきであるように、どのように私はここに変数を使用することができるように取り組んでいます。
以下は、これを使用しているjspコードです。
_createAutocomplete: function() {
var x = this.element[0].id; //value is combobox-0
var status = x.substr(x.length - 1); // value is 0 which is in string
var istatus = parseInt(status); // converted to int
this.input = $("<input>")
.appendTo(this.wrapper)
.attr("title", '<fmt:message key="page.claim.personalclaimnotification.injury.select_info" />')
.val("${claimNotificationForm.chattels[0].objectValue}") //works fine with 0,1,2... I have to use 'istatus' here
.css({
color: function(index, value) {
if (this.value == '<fmt:message key="page.claim.search.object.name" />') {
return "#777";
}
},
fontStyle: function(index, value) {
if (this.value == '<fmt:message key="page.claim.search.object.name" />') {
return "italic";
}
},
width: "286px"
})
.attr("maxlength", 256)
.addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left")
.autocomplete({
delay: 0,
minLength: 3,
source: $.proxy(this, "_source")
})
です。あなたはistatus値を印刷して、それが何であるかを調べることができますか? console.log(istatus)を使用するか、または警告(istatus)。 –
また、「JSTLコアライブラリの角括弧/ EL式がjqueryコード内で動作しない」という別の質問をすることもできます。そのようなもの –
はい。それをします。 @Faraz –