cancel
Showing results for 
Search instead for 
Did you mean: 

Localization doesn't work in fragments.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

SandipAgarwalla
Active Contributor

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);

Former Member
0 Kudos

Thanks Sandip. It works

Answers (0)