0

adfmf-feature に設定があり、amx ページで を使用して取得し <amx:inputText label="url" id="it1" value="#{preferenceScope.feature.adf.mobile.sample.ProfilePage.showProfileImage.showImage}"/>ます。

しかし、HTML に同じ形式を使用すると<input type="username" name="xyz" id="user" value= "#{preferenceScope.feature.adf.mobile.sample.username}" />、結果を得ることができません。#{preferenceScope.feature.adf.mobile.sample.username}テキストボックスの出力として自分自身を取得します! ここでの値は、識別のみを目的としています。それらは私のアプリケーションのそれぞれのIDと一致します

Javascript側で書くべきですか?または、値を取得して設定する他の方法はありますか?

ありがとうございました

4

3 に答える 3

2

設定値を取得して HTML ページのフィールドに挿入するには、JavaScript API adf.mf.el.getValue(expression, onSuccess, onFail) を使用する必要があります。

あなたの場合、以下を行うことができます

<script type="text/javascript">
function getPrefVal(){
      adf.mf.el.getValue("#{preferenceScope.feature.adf.mobile.sample.ProfilePage.showProfileImage.showImage}",
      onSucess,onFail);
}
function onSucess(req, res) {
    //alert( res[0]['value']);
    $("#user").val(res[0]['value']);
} 
function onFail (req, res) {
          alert("Get Value Failed :" + adf.mf.util.stringify(res));
}
//use the below code instead of $(document).ready() or deviceready 
document.addEventListener("showpagecomplete", getPrefVal, false);
</script>

<input type="username" name="xyz" id="user" value= "" />
于 2013-09-02T08:35:15.770 に答える
0

私の質問への答えはここにあります

http://deepakcs.blogspot.in/2013/08/adf-mobile-how-to-get-preferences-value.html

于 2013-09-05T08:47:45.480 に答える