2016-12-06 4 views
-1

は、私は次のようにUIコントロールを定義する方法をその可能性を知っている:sapui5での定義時にObjectIdentifierの型を割り当てる方法は?

<Text text="{ path: 'some-path', 
       type: 'sap.ui.model.type.Date', 
       formatOptions: {source: {pattern: 'dd/MM/yyyy'}, style: 'long'} 
      }"/> 

私はそのようなObjectIdentifierを定義したい場合のような構文は何ですか?

<ObjectIdentifier text="{some-path}" title="{some-path}"/> 

どのように私はタイトルテキストのための 'タイプ' を指定するのですか? 助けてください。感謝:)

答えて

1

ちょうどあなたの最初の例のように:

<ObjectIdentifier 
    text="{ 
     path: 'some-path', 
     type: 'sap.ui.model.type.Date', 
     formatOptions: {source: {pattern: 'dd/MM/yyyy'}, style: 'long'} 
    }" 
    title="{ 
     path: 'some-path', 
     type: 'sap.ui.model.type.Date', 
     formatOptions: {source: {pattern: 'dd/MM/yyyy'}, style: 'long'} 
    }"/> 
1

は、それは全く同じです。

<ObjectIdentifier text="{ path: 'some-path', 
          type: 'sap.ui.model.type.Date', 
          formatOptions: {source: {pattern: 'dd/MM/yyyy'}, style: 'long'} 
         }" 
        title="{ path: 'some-other-path', 
          type: 'sap.ui.model.type.Date', 
          formatOptions: {source: {pattern: 'dd/MM/yyyy'}, style: 'long'} 
         }" /> 

名前空間sap.ui.model.typeにはいくつかの定義済みタイプがあります。

XMLViewsでの使用は、あなたがformatterまたはtypeのいずれかを使用することができ、常に

{ path: 'some-path', 
    mode: 'sap.ui.model.BindingMode.OneWay' //See documentation of BindingMode for possible values 
    type: 'full.class.name or .propertyInController' 
    formatOptions: { .. } //object as described in the constructor documentation of the type 
    constraints: { .. } //object as described in the constructor documentation of the type 
    parameters: { .. } //object with additional binding parameters (most depending on the model type) 
    formatter: 'full.function.name or .functionInController' 
} 

です。 typeを使用する場合は、formatOptionsconstraintsを使用できます。 modeおよびparametersは常に使用できます。

あなただけpathを供給する場合は、短縮形を使用することができますが、さまざまなオプション(プロパティのバインディングとは対照的に)集約バインディング用text="{some-path}"

を:なしtypeまたはformatterありませんが、代わりにあなたがsorterを提供することができ、 filter

関連する問題