Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Localization doesn't work in fragments.

Hello,

I have a dailog where I have the title which should be loaded from i18n model. It doesnt display anything. The other xml views works properly except fragments.

<core:FragmentDefinition

  xmlns="sap.m"

  xmlns:core="sap.ui.core">

  <SelectDialog

    noDataText="{i18n>NoProducts}"

    title="{i18n>SelectProductName}"

    search="handleSearch"

    confirm="handleClose"

    close="handleClose"

     items="{

      path: '/Products'

    }" >

    <StandardListItem

      title="{ProdGroupName}"

      description="{ProductGroup}"

      type="Active" />

  </SelectDialog>

</core:FragmentDefinition>

Fragment code is as shown above. Any idea why localization doesnt work only with fragments?

Thanks,

Rashmi

Tags:
Former Member
replied

probably the fragment need an explicit 'set' to the i18n model.

You need to set the fragment as dependant of view, so that it gets the model reference

this.getView().addDependent(fragment);

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question