Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8746

SAPUI5: Hiding a via setVisibility not working

$
0
0

I have an xml view with a sap.m.List that holds some sap.m.InputListItems:

 

<List id="listJobParams">  


  <headerToolbar> ... </headerToolbar>


  <InputListItem label="Partition" id="listItemPartition" visible="false">

    <Select id="partition" selectedKey="{/partition}" />

  </InputListItem>


  ...

</List>

 

 

Based on certain conditions, I want to either hide the the entire List or only certain InputListItems, using the setVisibility(true|false) method.

Hiding/showing input list items based on a condition works fine, but hiding/showing the entire list does not work.

 

 

The problem: once the list has been hidden via this.byId("listJobParams").setVisibility(false), it is not possible to show the list again using this.byId("listJobParams").setVisibility(true);

There is no error in the js console, but also the list does not show up. So I wonder why the InputListItem behave differently than the List.

 

 

Controller code (called from within onInit() method):

 

_refreshJobDetailInput : function (channelId, eventId, data) {

  // hiding/showing input list item

  this.byId("listItemPartition").setVisible(data.jobType=='singlePartitionIndexingJob');

   

  // hiding/showing the entire list DOES NOT WORK; once hidden, it will never appear again, even though the condition is true (and logs as true in the console)

  this.byId("listJobParams").setVisible(data.jobType=='singlePartitionIndexingJob');

},


The method is available and documented for `sap.m.list`'s parent class (https://openui5.hana.ondemand.com/docs/api/symbols/sap.m.ListBase.html#setVisible)


Viewing all articles
Browse latest Browse all 8746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>