Sei sulla pagina 1di 2

Community

(http://www.sap.com/)
(https://community.sap.com)
(/users/login.html?
redirect_to=%2Fquestions%2F12906386%2Fsapui5-
conditionals-for-xml-view.html)
Ask a Question (https://answers.sap.com/questions/ask.html) Write a Blog Post (https://blogs.sap.com/wp-admin/post-new.php) Login (/users

Not what you're looking for? Search community questions.

Roman M (/users/799779/iroman-112.html)
(/users/799779/iroman-112.html)
SAPUI5: Conditionals for XML-View
hace 9 horas | 32 Views
estions%2F12906386%2Fsapui5-conditionals-for-xml-
ta%3D12906386%26s_csrf%3D1573255791609.373)
0
estions%2F12906386%2Fsapui5-conditionals-for-xml-
ata%3D12906386%26s_csrf%3D1573255791609.373)
Hello,

I do have an table that looks like this

Is there a possibility with XML - View, to check conditionaly name values and decide which to display?
 unbenannt.png (/storage/attachments/1747527-unbenannt.png) (17.0 kB)

SAPUI5 (/tags/500983881501772639608291559920477) | SAP Web IDE (/tags/73554900100700001351) | Software Logistics


(/tags/344331658552599549231300137890756) | logging of Web Client UI (/tags/67837800100800006410) | application (/topics/application.html)

Follow (/users/login.html?redirect_to=%2Fquestions%2F12906386%2Fsapui5-conditionals-for-xml-view.html%3Fs_action%3Dfollow%26s_csrf%3D1573255791609.373)

RSS Feed

Related questions
SAPUI5 XML View Date Format (https://answers.sap.com/questions/11878924/sapui5-xml-view-date-format.html)
By Kaan Ozdogan ( https://people.sap.com/kaan.ozdogan) , Aug 05, 2015
SAPUI5 - Routing not working between JavaScript views (https://answers.sap.com/questions/434126/sapui5-routing-not-working-between-javascript-view.html)
By Former Member ( https://people.sap.com/former.member) , Feb 15, 2018

1 Respuesta

Votos | Creado el | Más antiguo

Gabriel Alves (/users/434021/gabrielalves.html)


(/users/434021/gabrielalves.html)

hace 3 minutos

Hi Roman,
stions%2F12906386%2Fsapui5-conditionals-for-xml-
ta%3D12903524%26s_csrf%3D1573255791609.373)
iew%3D12903524%23answer-
0 It is recommended to use Filters in your model via javascript, however to achieve the same level os veri cation via XML, you can use expression
stions%2F12906386%2Fsapui5-conditionals-for-xml-
ata%3D12903524%26s_csrf%3D1573255791609.373)
iew%3D12903524%23answer-
binding or formatter as below:

/
<Table id="table" items="{/items}">
<columns>
<Column>
<header>
<Label text="Column 1"/>
</header>
</Column>
<Column>
<header>
<Label text="Column 2"/>
</header>
</Column>
<Column>
<header>
<Label text="Activity Type"/>
</header>
</Column>
<Column>
<header>
<Label text="Resource Type"/>
</header>
</Column>
</columns>
<items>
<ColumnListItem visible="{= ${value2} === '1' }">
<cells>
<Input value="{value1}" editable="{editable}"/>
<Input value="{value2}" editable="{editable}"/>
<Select items="{activityTypes}" selectedKey="{activityType}" enabled="{editable}" change="onActiv
ityTypeChange">
<items>
<core:Item key="{key}" text="{value}"/>
</items>
</Select>
<Select items="{resourceTypes}" selectedKey="{resourceType}">
<items>
<core:Item key="{key}" text="{value}"/>
</items>
</Select>
</cells>
</ColumnListItem>
</items>
</Table>

this line does the magic: <ColumnListItem visible="{= ${value2} === '1' }">
I tested and it worked ne.
PS: you need to add in your script de nition in index.html the attribute data-sap-ui-xx-bindingSyntax="complex"
Compartir

Find us on

(https://www.facebook.com/sapcommunity) (https://twitter.com/SAPCommunity) (https://www.youtube.com/c/SAPCommunities)

(https://www.linkedin.com/company/sap) (https://instagram.com/sap/) (http://www.slideshare.net/SAP) (mailto:?subject='SAP Community')

Privacy (http://sap.com/about/legal/privacy.html) Terms of Use (http://sap.com/corporate/en/legal/terms-of-use.html)

Legal Disclosure (http://sap.com/about/legal/impressum.html) Copyright (http://sap.com/about/legal/copyright.html)

Trademark (http://sap.com/about/legal/trademark.html) Cookie Preferences

Newsletter (https://www.sap.com/cmp/nl/sap-community-voice/index.html) Support (mailto:sapnetwork@sap.com)