Filter argument as collection

Hi, I'm trying to create a query on the Data Modeler in Flash Builder to retrieve some elements from an entity in this case is Client which have a clientId, basically I'm creating a filter with this query: jpql:Select c from Client as c Where c.clientId in (:IDs) but I don't know how to specify that the IDs query argument is going to be a collection, array or something like that, I tried using IDs as a string and passing the formated string like this 1,2,3 but it gives me a Cast error. Any thoughts on how to handle this?

You could store a list of all countries (and the same for sectors) that are currently checked in a field and then filter based on all items in this list. Handle the Checked and Unchecked events (or the corresponding events for the TreeView) for
the ComboBox to add and remove items from the collection respectively. Something like this:
private readonly List<string> _selectedCountries = new List<string>();
private void CheckBox_Checked(object sender, RoutedEventArgs e)
CheckBox chk = sender as CheckBox;
CountriesClass slc = chk.DataContext as CountriesClass;
if (slc != null)
string slc_value = slc.CountryName;
if (!_selectedCountries.Contains(slc_value))
_selectedCountries.Add(slc_value);
myPeopleIndex = new ObservableCollection<PeopleClass>(myPeopleIndex.Where(r => _selectedCountries.Contains(r.Name)).OrderBy(r=>r.Name));
ViewResult.ItemsSource = myPeopleIndex;
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
CheckBox chk = sender as CheckBox;
CountriesClass slc = chk.DataContext as CountriesClass;
if (slc != null)
string slc_value = slc.CountryName;
if (_selectedCountries.Contains(slc_value))
_selectedCountries.Remove(slc_value);
myPeopleIndex = new ObservableCollection<PeopleClass>(myPeopleIndex.Where(r => _selectedCountries.Contains(r.Name)).OrderBy(r => r.Name));
ViewResult.ItemsSource = myPeopleIndex;
Hope that helps.
Please upload a reproducable sample of your issue to OneDrive and post the link to it here if you need any more help on this.
Please also remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

Similar Messages

  • Subquery is not allowed within FILTER arguments

    In a report I need to show two columns of same type but with values obtained with different criterias.
    The criterias are difined in 2 different reports
    Report
    Month, ColumnA , ColumnB, Number_of_Nights
    ColumnA refers to the actual column Member_id= criteria are defined with REPORT1 (where joined date between X and Y and market code=Z)
    ColumnB refers to the actual column Member_id=criteria are defined with REPORT2 (where joined date between A and B and market code=C)
    I can not use on ColumnA the normal filter and than filter based on results from another request, because it would apply to columnB as well.
    I need therefore to use the filter from the "Edit Formula" screen and than filter on a column and select REPORT1 for ColumnA and REPORT2 for ColumnB.
    This approach doesn't seem to work because I return :
    [nQSError: 10058] A general error has occurred. [nQSError: 22033] Subquery is not allowed within FILTER arguments. (HY000)
    How do you manage such reports?
    Thanks!!
    Edited by: user6185307 on 14.05.2012 06:00
    Edited by: user6185307 on 14.05.2012 06:01
    Edited by: user6185307 on 14.05.2012 06:02

    Try creating the report in one go...
    Instead of creating a subquery, and then a subquery using that subquery, and finally a "master" query, create the "master" query first, and within the conditions, create your subquery as you go along.
    I'm not sure whether this would work, as I don't currently have access to Discoverer!
    Alternatively, subqueries are rarely the most efficient way of processing information, so consider writing a PL/SQL function to do some of the work for you.

  • Filter or Smart Collection for Exported Images?

    I want to keep track of the images I export. (in most cases to skydrive).  Can I set up a filter or criteria for a smart collection to do this?
    Thanks

    You perhaps have the free uploader rather than the full plug-in which costs about $10 and can be used with the LR Publish Service function which identifies modified photos that need re-publishing and gives you a record of what has been uploaded, in the form of a collection.
    See this link, but you need to go directly to the developer’s website for the latest version.
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=3302522

  • SCEP Reports - Filter by ANY collection

    Hi,
    The SCEP reports in SCCM 2012 can only be run against a machine or by a collection which has a specific SCEP deployment going to it.  We deploy SCEP at a top level so all devices get it but I want to be able to run reports against any collection so
    we can report on infections by department for example.  I had a go at modding the reports but didn't get far.  Has anyone already customized these reports for this or is there another way?
    Thanks

    Found the answer myself, note to RTFM next time!
    Collections are available for selection in the following cases:
    When you select View this collection in the Endpoint Protection dashboard on the Alerts tab of the <collection name>Properties dialog box
    When you deploy an Endpoint Protection antimalware policy to the collection.
    When you enable and deploy Endpoint Protection client settings to the collection.
    First option sorted it!

  • Liquid: How to filter on specific items in a web app collection

    I am trying to write some logic in Liquid that will show/hide certain html based on the value of a specific property of the webapp.
    I am trying to limit users to being able to create only one item of each type based on this filter.
    So in this case, the user has the option to create a 1 Bedroom Cabin, 2 Bedroom Cabin, 3 Bedroom Cabin or a 4+ Bedroom Cabin. I want them to be able to create only one of each type of cabin. I am pretty sure if/else statements are not a good way to check for this as I would be checking not only if the certain cabin type exists, but also for each situation of if say they have created a 1 Bedroom Cabin and a 4+ Bedroom Cabin. The way I am currently trying to accomplish it, I would have to write a ton of If/Else statements to check for all of these possibilities.
    Also, I notice that this code only checks if the type exists. So, if there are 4 web app items, all of these if/then statements below will evaluate to true. This is not the behavior I am looking for.
    Is there a different filter in Liquid to accomplish what I am trying to do? It seems as though my ability to iterate and do custom logic on collections is a bit limited right now in the current system. Any help would be greatly appreciated. Thanks.
    {module_webappscustomer id="28157" filter="all" render="collection" collection="listingsApp" template=""}
    <select name="CAT_Custom_1" id="CAT_Custom_1" class="cat_dropdown">
        <option value=" ">-- Please select --</option>
         {% for item in listingsApp.items %}
              {% assign accomodation = item.['Accommodation Type'] %}
              {% if accomodation == "1 Bedroom Cabin" %}
                   <option value="2 Bedroom Cabin">2 Bedroom Cabin</option>
                   <option value="3 Bedroom Cabin">3 Bedroom Cabin</option>
                   <option value="4&#43; Bedroom Cabin">4&#43; Bedroom Cabin</option>
              {% endif %}
              {% if accomodation == "2 Bedroom Cabin" %}
                   <option value="1 Bedroom Cabin">1 Bedroom Cabin</option>
                   <option value="3 Bedroom Cabin">3 Bedroom Cabin</option>
                   <option value="4&#43; Bedroom Cabin">4&#43; Bedroom Cabin</option>
              {% endif %}
              {% if accomodation == "3 Bedroom Cabin" %}
                   <option value="1 Bedroom Cabin">1 Bedroom Cabin</option>
                   <option value="2 Bedroom Cabin">2 Bedroom Cabin</option>
                   <option value="4&#43; Bedroom Cabin">4&#43; Bedroom Cabin</option>
              {% endif %}
              {% if accomodation == "4 Bedroom Cabin" %}
                   <option value="1 Bedroom Cabin">1 Bedroom Cabin</option>
                   <option value="2 Bedroom Cabin">2 Bedroom Cabin</option>
                   <option value="3 Bedroom Cabin">3 Bedroom Cabin</option>
              {% endif %}
         {% endfor %}
    </select>

    If I understand your intent, I’d loop once over listingsApp.items, setting a boolean to represent the ‘already used’ state of each accommodation type. Then I could use those to control the options:
    <select>
        {% unless hasAlreadyUsed1BRC -%}
            <option value="1 Bedroom Cabin">1 Bedroom Cabin</option>
        {% endunless -%}
        {% unless hasAlreadyUsed2BRC -%}
            <option value="2 Bedroom Cabin">2 Bedroom Cabin</option>
        {% endunless -%}
    </select>

  • Filter quick collection issue

    Don't know if this is an issue only seen in LR 2.2 or if it's prevalent in older versions as well. I'm on 2.2 for Mac.
    I've added a bunch of images from one folder to a quick collection and working in the quick collection I've assigned star ratings to them. When I filter the quick collection using "rating = *****" I get 18 results while I have actually assigned a 5 star rating to 42 images that reside in the quick collection. When I switch back to the folder containing the images and filter it using the same "rating = *****", I get all those 42 results.
    Unless I'm doing something wrong I can not count on filtering in the quick collection. Is this the way it's supposed to work?

    Dang, Dorin, how could I have overlooked it: I had the (quiet inconspicuous) "no label" filter set to ON. Overlooked it maybe 20 times! Hadn't you stated you don't see this behaviour, I wouldn't have looked again for the 21st time.
    Thanks for replying, both of you. Problem solved + a nice link to bookmark for future reference.
    Thanks again!

  • How can I display images that are not included in any collection?

    How can I display images that are not included in any collection (some filter or smart collection)? A smart collection with parameters "Collection - contains - empty field" does not work. Lightroom 5.

    Thank you! Good idea! I ordered letters of the alphabet (space separated), and it works.

  • Custom Metadata and the Filter Bar

    A couple of month ago this was posted by another member/LR user:
    I'm running Lightroom 2.3 on a WinXP system.  I'm trying to use the library filter mechanism to display a subset of images based upon the values of some custom metadata fields.
    All of the values for a given field are correctly displayed in the filter's drop-down list, but if I select one that contains embedded blanks, I'll get an empty set ("No photos in selected folder").  Take a look at the attached "embedded_blanks" screen shot.  I should see one image, but instead don't see any.  (BTW, an embedded underscore ['_'] will cause the same behavior, so there are probably other characters as well.)
    There are also problems if I select the "No Value" option (which should show be the items for which the metadata hasn't been set).  The attached "no_value" screen shot shows an example of this.  Instead of showing 1 image, Lightroom is showing 4 -- all of the ones that do have a value!
    Has anyone seen this before?  I don't know where to check to see if this is a known problem.
    One of the answers from a community expert confirmed it was a known problem, but not widely known.  I have thus far installed v2.5 and this is still not working as it should - pretty much the same problem as above.  I have created (and filled) certain thematic custom metadata fields specifically so I would be able to use them for the filter bar/Smart Collections and of course am a bit disappointed.  The good news is that my limited testing shows that v3b has indeed corrected this issue YEAH!
    In the meantime, does anyone know if this was corrected in v2.6?  It appears from the release notes that this as for camera updates only so I was not planning on installing unless somehow this problem was addressed.
    Thanks!
    Jeff

    I don't think so. But it does appear to be fixed in the LR3Beta as you say.
    John

  • Use wildcard in LDAP search with filter and filter args fails

    Hi,
    I'm writing a function that receives the search filter and the filter arguments and returns the attributes of the found entries but I'm having problems when I pass the wildcard '*' as argument. For example I'm looking for cn=* but instead it looks for cn=\2a (searches for cn containing *).
    I'm using the InitialLdapContext function:
    public NamingEnumeration<SearchResult> search(String name,
    String filterExpr,
    Object[] filterArgs,
    SearchControls cons)
    throws NamingException
    The problem occurs in the class com.sun.jndi.toolkit.dir.SearchFilter format method where it replaces the filter place holders with the filter arguments. There it calls getEncodedStringRep to the arguments and that function returns the wildcard '*' escaped.
    Is it supposed to behave like that? I don't have problems using the search function search(String name, String filterExpr,Object[] filterArgs, SearchControls cons) but I'd like to be able to separate the filter and the filter arguments.

    That's a forum artefact, as the boldface should make obvious.
    My point is that you should specify the wildcard in the filter string, not as an argument. See http://download.oracle.com/javase/6/docs/api/javax/naming/directory/DirContext.html#search(javax.naming.Name,%20java.lang.String, java.lang.Object[],%20javax.naming.directory.SearchControls). (The forum will break that link too.) The argument asterisk is being escaped in accordance with what it says there. Or maybe you can escape it yourself as an argument as \0x2a.

  • Filtering immutable/unmodifiable collections

    Hi,
    I need a general purpose collection filter:
    Given a collection, return another collection that excludes certain members of the first collection. Additionally I'd prefer that the new collection retains other attributes of the original (e.g. Comparator if SortedSet etc).
    I considered cloning the given collection and then removing undesired elements. Is there a clean way to do this?
    In jakarta commons I notice something that comes close (http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons/collections/src/java/org/apache/commons/collections/CollectionUtils.java), however it modifies the original collection.
         * Filter the collection by applying a Predicate to each element. If the
         * predicate returns false, remove the element.
         * <p>
         * If the input collection or predicate is null, there is no change made.
         * @param collection  the collection to get the input from, may be null
         * @param predicate  the predicate to use as a filter, may be null
        public static void filter(Collection collection, Predicate predicate) {
            if (collection != null && predicate != null) {
                for (Iterator it = collection.iterator(); it.hasNext();) {
                    if (predicate.evaluate(it.next()) == false) {
                        it.remove();

    copy constructors. I can't remember the last time I
    made a class I wrote cloneable.Me neither :) However, I frequently use existing clone() methods in the collections framework (e.g. Vector.clone() etc.)
    Is there a reason you need a completely generic
    method
    to do this? (other than the appeal of writing
    beautiful code).I'm writing a utility. I don't want to build in restrictions if I can help it.
    Do you actually have an application that requires
    this
    functionality where you actually use every collection
    type?Not sure I get your drift ... The client application currently uses Vector(legacy), ArrayList, HashSet, TreeSet and LinkedHashSet (no LinkedList yet). So there aren't too many implmentations at all. However, I'd like the filter method to be general (see above).
    And .clone() won't work for some reason?Can I clone/copy without code like:
    if(collection instanceof <particular-collection-implementation>) {
    }which I'm trying to avoid (for reasons above) ?

  • Filtering array collections

    I am trying to filter an array collection.
    It is a list of rooms. The rooms have a type, "Boardroom",
    "Classroom" etc.
    Also they have equipment properties which are set with a
    boolean value.
    ex. Screen = true, Whiteboard = false etc.
    What I want to do is filter the array collection using
    multiple conditions.
    Scenario:
    Choose room type from combo. --- this works great :)
    Screen(Check if needed) ---- Here is where my problem lies,
    When I check the box, the false results are filtered out great! But
    if I uncheck the box, only the false results are shown. However,I
    would like to show both true and false results for the screen
    property. If it is unchecked it means the user is not interested in
    screens thus the data doesn't need to be filtered for that
    property.
    I have tried various ways.
    This is where I'm at so far
    private function filterByRoomType():void{
    allRooms.filterFunction = roomTypeFilter;
    allRooms.refresh();
    private function roomTypeFilter(item:Object):Boolean{
    seatingText.text = "+"+seatingSlider.value;
    if(roomTypeCombo.selectedItem=="All"){
    return item.SeatingCap >= seatingSlider.value&&
    item.Desks >= deskSlider.value&&
    item.Beds >= bedSlider.value&&
    item.Screen == screenCB.selected;
    }else{
    return item.RoomType ==
    roomTypeCombo.selectedLabel&&
    item.SeatingCap >= seatingSlider.value&&
    item.Desks >= deskSlider.value&&
    item.Beds >= bedSlider.value&&
    item.Screen == screenCB.selected;
    I have tried changing "item.Screen == screenCB.selected" to
    "item.Screen == screenCB.selected||false;" but with no joy.
    Once I get the screen checkbox working I would like to
    increase the amount of checkBoxes(properties) the user can search
    on.
    This one has got me ripping my hair out, any help would be
    muchly appreciated
    thanks
    bazjapan
    Oh yes, This is a room object.
    package dto
    [Bindable]
    public class Room
    public var RoomID:int;
    public var RoomName:String="";
    public var RoomType:String="";
    public var SeatingCap:int;
    public var Desks:int;
    public var Beds:int;
    public var Screen:Boolean;
    public var OHP:Boolean;
    public var Sink:Boolean;
    public var FlipChart:Boolean;
    public var Hoist:Boolean;
    public function Room(obj:Object = null)
    if (obj != null)
    this.RoomID = obj.RoomID;
    this.RoomName = obj.RoomName;
    this.RoomType = obj.RoomType;
    this.SeatingCap = obj.SeatingCap;
    this.Desks = obj.Desks;
    this.Beds = obj.Beds;
    this.Screen = obj.Screen;
    this.OHP = obj.OHP;
    this.Sink = obj.Sink;
    this.FlipChart = obj.FlipChart;
    this.Hoist = obj.Hoist;

    That change won't make an iota of difference logically if
    screenCB.selected = false. You're doing:
    if (item.Screen == false || false)
    What it looks like you want to say is
    (screenCB.selected ? item.Screen == screenCB.selected : true)
    HTH =)

  • Collection Class

    I have import two classes class1, class2 in a Class3 program. Class1 contains get and set methods. Class2 and Class3 coding is as follows. In Class2, I have passed the Class1 object. Now my problem is when I try to get the values in Class3 through get method of class1 using Collection class, I get only null values. Kindly tell me how to correct my problem.
    class c2
             public Collection selecting(Class1 c1) throws Exception
                        ResultSet rs = null;
                        PreparedStatement ps = null;
                        Connection con = null;
                        Collection result = new ArrayList();
                        con = getConnection();
                        id =  c1.getId();
                        String sql = "select * from table1 where id=?";
                        ps = con.prepareStatement(sql);
                        ps.setInt(1,id.intValue());
                        rs = ps.executeQuery();
                        while(rs.next())
                                   c1.setName("Name"));
                                   c1.setDesc("Desc"));
                                   result.add(c1);
    }     class c3
             public static void main(String[] arg)
                     e=Integer.valueOf(request.getParameter("id"));
                     c1.setCategoryId(e);
                     Collection sel = c2.selecting(c1);
                     Iterator i = sel.iterator();
                     while(i.hasNext())
                             s=c1.getName();
                             f=c1.getDesc();
                             out.println("<b> "+s+","+f+"<br>");
    }

    Don't Mistake me. I have send only a part of program. I have used return statement in my program. I need solution for ,how to get the values from Collection class object when a class object is passed as argument.
    Collection sel = c2.selecting(c1);Here c1 is object of class1 which contains methods like
    getName(),
    getDesc(),
    setName(),
    setDesc();

  • How to query a Collection for Collection rules (Powershell only)

    I have :
     $Collection = gwmi -computer MyServer -namespace "root\sms\Site_XXX" -class "SMS_Collection"
     $MyCollection = $collection | where { $_.Name -eq "TEST" }
    $MyCollection have a property named CollectionRules
    I could'nt manage to read this property,
    nor $MyCollection.CollectionRules
    nor  $MyCollection.CollectionRules | % { $_ }
    is Working.
    Any help on this ?

    Hi, 
    the above code works, but if you have a large environment then it may take a long time to run as you are querying for every collection before looking for the 'TEST' collection.
    The following code only looks (filters) for the specific collection so should execute much faster.
    $Collection = gwmi -computer MyServer -namespace "root\sms\Site_XXX" -class "SMS_Collection" -filter "Name='TEST'"
    $Collection.Get()
    $Collection.CollectionRules | % { $_ }
    Another method of doing the same would be this:
    $Collection = Get-WMIObject -computer MyServer -namespace "root\sms\Site_XXX" -query "Select * FROM SMS_Collection WHERE Name = 'TEST'"
    $Collection.Get()
    $Collection.CollectionRules | % { $_ }
    Hope you or someone else may find this useful :)

  • Filter by color mode

    Hello,
    the filter panel is a good idea. However, it would be good to be able to filter from a collection just the images that are for example RGB. I didn´t find that option.
    Is it possible to add filters yourself?
    mj

    I'll second this request!

  • LR 3 ratings filter

    I'm still on my 30 day trial of LR3. Moving from one Collection to another seems to reset the ratings filter. In LR 2.x it used to recall the last ratings filter of each Collection and revert to it when ever you click back to it. Is this a "feature" of LR3 or a bug? If a feature, how do I turn it off?

    This needs to be an option. I work between many folders in any given day, and having to turn my filters back on everytime I return to a folder is frustrating!! To say the least! And now that I learn that it is deemed that we are not bright enough to make the desicison for ourselves to have a sticky filter or not is just infurating!
    I spend several hours a day in LR when I am not in the field. I have many different clients. I have relied on LR remembering, by filter, where I was in each folder as I work between different clients jobs. This is just unacceptable.

Maybe you are looking for

  • Cisco NAC server hang issue

    Hi All Cisco NAC Experts,  I am currently experiencing a Cisco NAC NAC3315-SVR hang issue. The issue was already happened for few time on the same server and the symptom when NAC server hung includes no response to ICMP ping, no response to SSH reque

  • Customer - spl gl indicators

    Hi, I have a requirement as below.  One of my client is using different special gl indicators for different purpose. spl gl indicator    D -tution fee - Account no:123456 spl gl indicator    I - residence -account no:234569 Now he wants to use a sing

  • .avi files and Final Cut

    When I try to import an .avi file Final Cut says .avi files are not optimal and I need to recapture the footage - but all I need is to import an already edited .avi file from my desktop to Final Cut, if it supports .avi files why can't I import them?

  • Open ERP transaction within CRM 2007 using wizard for transaction launcher

    Hello everybody, I am trying to launch a SAP ERP transaction within SAP CRM 2007 using the transaction launcher wizard. First I maintained all necessary setting for the RFC connections (in ERP and CRM) using for example transaction SM59 and BD87, e.g

  • Download lion dmg

    Hi all! I bougth a Lion copy about a year ago. Now I want to do a clean install on my Mac so I've to download the dmg of Lion from App store. Anyway from App Store I can't no more find my Lion purchased copy. Any idea to solve this problem?