Selectively displaying certain items in a list  // logic tag in adf

Hi,
I have a tree the children of which can be of two types based on a child property. I want to be able to display only one type of children in a for loop. I could not find an <af: if > kind of tag that will let me check a child property in that i can use to filter in a for loop.
<af:menuBar>
<af:forEach var="subsystem" items="#{menuModelTree.instance}">
<af:menu text="#{subsystem.name}">
<af:forEach var="item" items="#{subsystem.childrenItems}">
????? if item.childProperty == certain type then {do the following } ??????
<af:commandMenuItem text="#{item.name}"
actionListener="#{menuModelBase.displayForm}"
action="#{item.getDestination}"/>
</af:forEach>
</af:menu>
</af:forEach>
</af:menuBar>
Thanks,

User,
JSTL has an if tag, but don't use it!
I could recommend a couple of approaches... if you only want to display one type of children, but a method in your backing bean (subsystem) that would return only the items of interest and use that in your af:forEach loop.
Second possibility would be to loop through everything, but set the"rendered" property of your af:commandMenuItem to "#{item.childProperty == certain type}"
John

Similar Messages

  • How to make JComboBox display an item not in list?

    hi,
    i'd like a gui component which is basically a jcombobox that presents a list A,B,C,D.
    The combobox is paired with another gui component which allows choosing sets of items. A etc.. represent preselected sets of items, so the user can click on A and a particular set would be selected.
    My problem is what to have the JComboBox do when the user selects a set of items that is not in the preselected defaults list. It would be nice to have the JComboBox just say "Other" at the top or something, but I can't figure out a way of doing this without putting the String "Other" in the list of items..
    does anyone have any idea of how to approach this? (I looked at making the JComboBox editable but this seems a little complicated?)
    thanks,
    asjf

    Your best option and cleanest design is to have a
    dummy data item in your list for "none of the above". thanks for the reply - this is what I'm doing at the moment. The problem is that I'm expecting testers to legitimately complain that selecting "None of the above" doesn't do anything, and doesn't really make sense ( it could make a random selection :o) )
    i think i agree that adding functionality to do this "properly" is likely to be more work/pain than its worth..
    Only an editable combobox can display something not in the list.this might help - if I could block mouse clicks to the editable area, and write to it programmatically but think this is probably quite difficult (?)
    asjf

  • How to not display certain items based upon certain criteria (Edit Form)

    I have a Edit form which was created from an interactive report I generated.
    There are 10 item fields which are listed which can be changed.
    Sometimes I want to see just 9 of the fields on the form based on what the value is of another field in the record.
    When I display the fields on the Interactive report I can filter this out by using a case statement, but how
    do I do this with the edit form as the query is not there.
    Thanks for your time in advance,
    Anon

    Use Conditions to control whether the item appears or not.
    In the item definition is a Conditions section where a large number of different types of condition can be used to determine whether the item is rendered. These include comparisons of the value of the item, or another item, items being null, and a lot of other options. Conditions are widely used throughout APEX&mdash;sometimes in subtle or noninuitive ways&mdash;so it's worthwhile studying how they're used.

  • Disable selection of certain items in ListView

    I have a ListView with different items.
    For most items I like the default multiple selection but for some items I would like to disable selection completely.
    I tried disabling the cell while it displays a non selectable item, but this only disables selection from direct events on the cell. I can still select it by clicking on an item above an then shift-clicking on an item below.
    I also tried to set the cell as empty when displaying a non selectable item. This fixes the issue with shift selection described above, but i can still select the cell by selecting an item next to it and pressing the respective arrow key.
    Does anybody have an idea?
    Thanks
    l2p

    How about this?
             final ListView<Node> fileList = new ListView<Node>();
            fileList.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observableValue, Number oldv, Number newv) {
                    if (newv.intValue() == 4) {
                        fileList.getSelectionModel().select(oldv.intValue());
            });

  • How do you display certain values in a list depending on a tag on a page?

    I have many lists on my site and I would like to create lots of different pages on my site for each customer. Then depending on which customer I am on, I would like the values in all the lists to change. For example if I have a page for 'Custmer A', I would
    like all my lists to only display values for 'Customer A', such as their orders and details. I understand that I could create a different list view for each customer on each lists but since I have so many customers this will take too long to do for my multiple
    lists, especially as I add new customers. Therefore is there a way of tagging a new page with a unique ID and then creating list views for my lists which pickup on the ID tag of the page which then displays the relevant data that contains this ID. This way
    I can duplicate this for new customers, without hvaing to creates 100s of list views. 
    Sorry for making this sounds more complicated than it is!
    Thanks

    If you were on earlier Sharepoint versions, I would have suggested using the Content Query Web Part (CQWP) to display content targeted to the user that is viewing the page. But with Sharepoint 2013, the concept is much more evolved with Managed Navigation
    and new features in CQWP.
    Have a look at the following article for start:
    Sharepoint 2013 CQWP and Managed Navigation
    Thanks, Ransher Singh, MCP, MCTS | Click Vote As Helpful if you think that post is helpful in responding your question click Mark As Answer, if you think that this is your answer for your question.

  • Windows Phone 8.1 xaml, c# ComboBox does not display selection when first item is selected from full page list.

    I have 3 comboboxes on a xaml page and most of the time when I select the first item on the full page list displayed when the number of items are > 5, the screen returns to the combobox and the box is blank. The combobox.SelectedItem is valued but it
    does not display.  This does not happen every time and I have seen this using the emulator and my windows 8.1 phone.  If I select any other item in the list they always display but when I go back and select the first item the box is blank. 
    Does anyone know what I could be doing that is causing this?

    Thanks for your help.  When I run the code below and the page is displayed, I select an item from the page list and it displays fine and then I select the first item from the page list and I do not see that selected item in the box. 
    If I remove the SelectedIndex=0 it all works fine except I do not have an item selected for the initial display.  Below should show problem and should work copy/paste in universal blank app.
    ScrollViewer x:Name="scrollViewer1">
            <StackPanel x:Name="stackPanel1" Background="Transparent">
                <ComboBox x:Name="comboBoxTestTypes" Margin="20,117.75,0,465.25" SelectedValuePath="ItemDescription" Width="310" Height="Auto" FontSize="17"
           ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Center">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding ItemDescription}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
     </StackPanel>
        </ScrollViewer>
    public sealed partial class MainPage : Page
            public ObservableCollection<ItemDetail> itemDetail;
            public MainPage()
                this.InitializeComponent();
                this.NavigationCacheMode = NavigationCacheMode.Required;
                this.itemDetail = new ObservableCollection<ItemDetail>();
            protected override void OnNavigatedTo(NavigationEventArgs e)
                PageLoad();
            public class ItemDetail
                public string ItemDescription { get; set; }
                public string ItemName { get; set; }
            private async void PageLoad()
                await initializeTypes();
                var comboBoxTestTypesItemsSource = await GetTestTypes();
                comboBoxTestTypes.ItemsSource = comboBoxTestTypesItemsSource;
                comboBoxTestTypes.SelectedIndex = 0;
            private async Task initializeTypes()
                await addTestType("Item1");
                await addTestType("Item2");
                await addTestType("Item3");
                await addTestType("Item4");
                await addTestType("Item5");
                await addTestType("Item6");
            private async Task<ObservableCollection<ItemDetail>> GetTestTypes()
                //ObservableCollection<ItemDetail> list = new ObservableCollection<ItemDetail>();
                //Random rnd = new Random();
                //for (int i = 0; i < 50; i++)
                //    list.Add(new ItemDetail() { ItemDescription = "hello" + rnd.Next(0, 1001), ItemName = rnd.Next(0, 101).ToString() });
                await getSaveDataFileDataAsync("get");
                return itemDetail;
            private async Task addTestType(string description)
                int newIdAdd = 0;
                if (itemDetail != null && itemDetail.Count > 0)
                    newIdAdd = itemDetail.Max(mT => Convert.ToInt32(mT.ItemName)) + 1;
                var addTestType = new ItemDetail();
                addTestType.ItemName = newIdAdd.ToString();
                addTestType.ItemDescription = description;
                itemDetail.Add(addTestType);
                await getSaveDataFileDataAsync("save");
            private async Task getSaveDataFileDataAsync(string getSave)
                try
                    DataContractJsonSerializer jsonSerializer1 = null;
                    string dataFileName1 = "testFileName";
                    jsonSerializer1 = new DataContractJsonSerializer(typeof(ObservableCollection<ItemDetail>));
                    if (jsonSerializer1 != null && getSave == "get")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(dataFileName1))
                            itemDetail = (ObservableCollection<ItemDetail>)jsonSerializer1.ReadObject(stream1);
                    if (jsonSerializer1 != null && getSave == "save")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(dataFileName1, CreationCollisionOption.ReplaceExisting))
                                jsonSerializer1.WriteObject(stream1, itemDetail);
                catch

  • Windows Explorer - How to select the first item once we open the explorer?

    Hi,
    In Windows Explorer - How to select the first item once we open the explorer using keyboard shortcut. I typically use downward arrow, it goes to the 2nd item in the list, then I again have to use upward arrow to go up.
    Is there a shortcut to select the first item in the list using keyboard? This is not specific to Windows 7, it has been the behavior even in previous Windows OS versions.
    Thanks,
    Mallik

    Opening a Microsoft Ticket is probably your best option. Unfortunately the change will not happen immediately and it will require multiple users to send in a ticket. I hope this ends up being resolved though.
    Good luck Mallik
    Also, don't forget to mark the post as answered so that it does not show up as unanswered to help others who search the forums.
    Agreed, MS wont change it easily. :)
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • Coverflow displays wrong items

    Coverflow does not correctly display the item from the list but another item from the same list. Sometimes the displayed item has already been deleted. In some cases, some items from the same window are being displayed correctly while others not. Any idea who the culprit is?

    Subsequent releases of iTunes have resolved this issue.

  • How to display all items titles from custom list with checkbox to select for each user

    Hi All,
    I have a requirement in a sharepoint 2013 development project.
    A custom list items will be created by admin with the following columns:
    Title
    Hyperlink
    User business unit (This column which is a metadata will be a userprofile property)
    In a page/form I have to display the list of titles with a check box based on each user business unit and each user will be allowed to check the list of titles and hit save. And then have to display the list chosen by the user in a webpart.
    If they want to modify their list they have to go to the page/form again and will uncheck the list.
    Am not sure whether I can achieve this through sharepoint out of box feature, I have not done any custom development.
    Please provide your valuable suggestions/ideas on this. Thanks for looking on this !!!

    Hi,                                                             
    Per my knowledge, there are no such OOTB features can meet your requirement, however, there is a workaround that if you can modify your requirement a bit.
    Based on your description, you want different users be able to select values from a list and generate a list own by them.
    If this is what you mean, we can do it like this:
    1. Create another list "Users" which stores the names of every users;
    2. Create a list "Result" which will be available for every user to add their own items, this list will have four Lookup columns and they look up to the "Users" list and the
    list you mentioned before;
    3. Users can add items into "Result" list by selecting the needed values from the other two list, then the items he/she created will be connected to them with the help of the
    Lookup column which looks up to the "Users" list.
    4. You can take use of the OOTB permission management of list to control the access of each item in the "Result" list, and it will be easier for you to manage and filter the
    information you needed.
    The links below about Lookup column for your reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx
    http://www.dummies.com/how-to/content/lookup-columns-in-sharepoint-2010.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • Selecting items in column/list view copying them and pasting them to

    in the past (was it OS 9 ?????? ) i would be able to select all items in a folder
    if i had a long list of titles of files ( songs ) and copy to clipboard and then paste them to text edit and have that list handy for future reference. for example if i have a DVD with 100 photos. I want to keep a file of the names only. I used to be able to select all of them copy and then paste to a document. Cant do it in TIGER????? am i wrong?
    work arounds....

    Hi, Glenn.
    How this works now appears to depend on the application into which you are pasting the results.
    If I open a folder, Select All (Command-A), Copy (Command-C), and then paste into a TextEdit document, if the contents include PDFs it actually pastes all the PDFs into the document! Looks like a change in how this works.
    If I paste into a Carbonized text editor, like Tex-Edit Plus, it pastes the file names, as expected.
    Here's a workaround:
    1. Open the Macintosh HD > Applications > Utilities folder and Lunch Printer Setup Utility. You should see a printer icon in your Dock.
    2. Drag and drop the folder whose contents you want to save a listing of to the icon in the Dock.
    3. When the Print window displays, either:• Click Preview. A print preview of the FInder info for those files appears in Preview. If you like what you see, select File > Save As... and save the output.
    • Click the PDF pop-up button and select "Save as PDF" from the list. Follow the prompts from there to save the Finder info as a PDF file.The resulting PDF saves the list you desired.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Javascript help to copy selected items from one list to another list on same site

    Hello,
    So I have a request that I am not sure how to handle. I have created a page with a list view webpart that displays all the items from one list.
    The user is then supposed to select off multiple list items and click on a button (most likely a ribbon button) that will take the selected items and copy them to another list on the same SharePoint site.
    I would like to do this with JavaScript, but have only found an example that copies library items to another library.

    Hi KansaiKel,
    According to your description, my understanding is that you want to copy selected list items to another list.
    I suggest you can use JavaScript Client Object Model to achieve it.
    Here is a code snippet for your reference:
    <script type="text/javascript">
    var context = SP.ClientContext.get_current();
    var siteUrl = 'http://sp2013sps/sites/test';
    var clientContext = new SP.ClientContext(siteUrl);
    var web = context.get_web();
    context.load(web);
    var sourceId = SP.ListOperation.Selection.getSelectedList();
    var source = web.get_lists().getById(sourceId);
    var oList = context.get_web().get_lists().getByTitle('Copy');
    context.load(oList);
    var selectedItems = SP.ListOperation.Selection.getSelectedItems(context);
    alert('debut');
    for(var i in selectedItems)
    var currentItem = source.getItemById(selectedItems[i].id);
    context.load(currentItem);
    context.executeQueryAsync(Function.createDelegate(this,test),Function.createDelegate(this,error));
    function test(sender, args){
    var itemCreateInfo = new SP.ListItemCreationInformation();
    var oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', currentItem.get_item('Title'));
    oListItem.update();
    oList.update();
    alert('done');
    function error(sender, args){ alert('error');}""
    </script>
    Here is a detailed article for your reference:
    Complete basic operations using JavaScript library code in SharePoint
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

  • Second list of items from selected item in first list

    Hi all,
    I have 2 dropdown lists in my jsp page. i am retrieving data from database for my first list box. the second list box data should be displayed when user select an item from the first list. the selected item from first list is necessary to get another list of items in second list. i dont want to use any buttons or submits. i want to redirect the data to the same page to get another list when user click one option from first list. Thanks in advance for any suggestion.

    use ajax or store the data in javascript array

  • How can i get more than 1000 items in Custom List Displaying Items?

    http://.....sites/_vti_bin/listdata.svc/AddressBook(List) allows 1000 items Only my AddressBook List, but i have more than 1000 items in my AddressBook list. I want to get items
    from AddressBook list and bind in another place using Autocomplete method like this.
    =======>>>>listurl=http://.....sites/_vti_bin/listdata.svc/AddressBook.
    and my coding in camel like below
    protected void btnpopulatedetails_Click(object sender, EventArgs e)
    SPSite objSite = SPContext.Current.Site;
    SPWeb objWeb = objSite.OpenWeb();
    objWeb.AllowUnsafeUpdates = true;
    SPList list = objWeb.Lists["Address Book"];
    SPQuery query = new SPQuery();
    query.QueryThrottleMode = SPQueryThrottleOption.Override;
    query.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + txtcustomer.Value + "</Value></Eq></Where>";
    query.RowLimit = 500;
    SPListItemCollection items = list.GetItems(query);
    function fnCustomerSearchBind() {
    if ($("input[id$='txtcustomer']").length != 0) {
    var collcustomer = searchCustomers('', urlTo, fieldto);
    $("input[id$='txtcustomer']").autocomplete({
    source: collcustomer,
    //maxLength:10,
    select: function (event, ui) {
    //debugger;
    event.preventDefault();
    $("input[id$='txtcustomer']").val(ui.item.value);
    $("input[id$='btnpopulatedetails']").click();
    return false;
    minLength: 0,
    function searchCustomers(value, listurl, fieldto) {
    var collcus = new Array();
    var custresults;
    var url =listurl + "?$filter=startswith('" + fieldto + "','" + value + "')";
    //debugger;
    $.ajax({
    cache: true,
    type: "GET",
    async:false,
    dataType: "json",
    url: url,
    success: function (data) {
    custresults = data.d.results;
    //alert(listurl);
    // alert(data.d.results);
    for (var x = 0; x < custresults.length; x++) {
    //alert(custresults[x]['To']);
    collcustList.push(custresults[x]['To']);
    //debugger;
    //debugger;
    return collcustList;
    In my research listurl=http://.....sites/_vti_bin/listdata.svc/AddressBook has 1000 items in 1st Page by default, So how to change 1st Page by default to All Pages through
    code. I think you understand my environment by look above coding, if you don't I am using office 365 sandbox solution. One more thing i know through my research Pages can be change by using Ado.Net Data Service, i tried this one but this one support windows
    server 2008 r2 only but i am using Windows Server 2012 r2. Please help me if you know the answer.

    Hi,
    Here is a blog would be helpful:
    ADO.NET Data Services returns 1000 items
    https://gilleslauwers.wordpress.com/2010/12/08/ado-net-data-services-returns-1000-items/
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How can I select an item from a list component with a seperate button

    This is a repost, I decided it'd probably be better here than
    in the general discussion board. I will try to delete the other
    one.
    Hello Everyone,
    This is my first post here. I am trying to figure out how to
    select an item within a list component with a button. This button
    is calling a function. I have searched for the past 3 hours online
    and I can't find anything about it. I thought perhaps I could set
    the selectedItem parameter, but that is read only, and I believe it
    returns an object reference rather than something like a number so
    even if i could set it, it would be pointless. I also found a get
    focus button, thought that may lead me somewhere, but I think that
    is for setting which component has focus currently as far as typing
    in and things like that. I am lost.
    Basically I am looking for a way to type this
    myList.setSelected(5); where 5 is the 5th item in the list.
    Any help would be much appreciated.

    Never mind found it. It is the property called selectedIndex
    and it is writable

  • How to display the count of a list item in Sharepoint Designer?

    How to display the count of a list item in Sharepoint Designer? please reply with the proper code line to add for this.

    Hello,
    What version of sharepoint you are using? Try below approach:
    http://sharepointlogics.com/2010/03/total-count-of-items-in-list-in.html
    Hope it could help
    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer
    Please feel free to unmark answer if does not resolves your problem.

Maybe you are looking for

  • My ipod broke, can i transfer songs from hard drive to another ipod or comp

    Yea just like the topic says, my ipod's screen broke but the harddrive is still good and i have another ipod video 30 GB, is it possible for me to transfer the old ipod's files into the new ipod? I know how to open it and all but i dont know if the n

  • How to run an "Automator" application at regular time intervals

    I would like to find out how to run an "Automator" application at regular time intervals, say at every 5 minutes. Is there any program, AppleScript or any method to do this? I would very much appreciate a help. Suwan

  • Excahnage Rate.

    Dear all, Iam facing a problem while raising a invoice from F-43, we maintained exchage rate OB08 for doller 39.10, this is my table rate, now while raising an invoice i changed the currency rate to 40.00 but after posting a document when iam viwing

  • ABAP/4 processor: EXSORT_OPEN_SORTFILE_OPENu0094

    Hi all, I have written a query and selecting some fields from BSEG . I have written a statistics and I have sorted them but I get a dump  Like “ABAP/4 processor: EXSORT_OPEN_SORTFILE_OPEN” Please tell me what to. Ranjith Singh

  • Muse protocol and port

    Hi I would like to know which PROTOCOL and Which PORT do i need to use uploading a Lightroom gallery in my muse site . Thanks