[SOLVED] Check if an element is contained in a list by EL

Hello.

I use JDeveloper 11.1.1.7.0

The bean to support, I have a List < String > attribute, with the getter and setter, and I need to check if a string is contained inside.

I tried this expression:

#{myBean.myList.contains(label)}

But it fails and the message is that the characters ( ) has found instead of [,., or eq,... ]

How can I do this in an EL expression?

Thanks in advance. Concerning

*****************************************************************

SOLVE EDIT: Follow the explanations of Frank. More details at http://adf-tools.blogspot.com.es/2010/09/adf-function-call-from-el-statement-in.html

*****************************************************************

Hello

create a customized with the strings in the list hash table and expose the hash as a property table.

for example

1 / public class MyHashMap extends HashMap

2 replace the get (String) of the hash method to return true / false dependent on whether or not the string you passed is in the plane

3. in your bean Manager defines a private property MyHashmap includeMap = new MyHashMap();

4. create a setter/getter for includeMap

5. fill the card with strings of LIST includeMap.pu (String, String)

6. use EL like

#{myBean.includeMap ['StringToTest']}

Frank

Tags: Java

Similar Questions

  • validation to check him point does not contain any special characters except ' - '.

    Hi all

    I have a question and the need to create a validation so that the item does not contain special characters (or numbers or spaces) other than salvation fen. That is to say, the element must contain only alphabets or ' - '. Tried to use the Is_Alpha function, but do not know how to handle this exception to the use of '-' in validation. So please, can someone suggest me a solution.

    Thank you
    Vignesh

    Vignesh,

    You can create Validation based on return Boolean and returns a False when the element has charecters other than 'A - Z' (charecters upper and lower) and - (hifen).

    if trim(translate(upper(:P1_ENAME), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-'
                                                      '                                                  ') is null then
       return false;    -- replacing all the alphabets and hifen with spaces... trim will leave an empty string(which is null)
    else
       return false;
    end if;
    

    Based on the following sql instructions...

    sql> select nvl(trim(translate(upper('ASDFG---'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-',
      2                               '                           ')),'Null Value')
      3     from dual;
    
    NVL(TRIM(T
    ----------
    Null Value
    
    sql> ed
    Wrote file afiedt.buf
    
      1  select nvl(trim(translate(upper('9999Asf---'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-',
      2                               '                           ')),'Null Value')
      3*    from dual
    sql> /
    
    NVL(
    ----
    9999
    
  • How to combine elements from container in expressions?

    Hi, dear ALL

    We combine items in the table in braces. For example: Locals.arrayOfStrings = {"Hello", "World"}

    My question is - we could combine elements in the container?

    Thanks in advance,

    Max

    Hi Max,.

    There are two options you can try here.  I could take a look at these two methods and see which works best for your application.

    For the first method, you will need to have predefined groups.  You can then combine these cluster together in a table.  The format of this method is.

    Locals.MyArray = {Locals.MyContainer1. Locals.MyContainer2} + {Locals.MyContainer3}

    The second option will use an array of arrays rather than an array of containers, but you will get the same functionality.  You can create an empty local variable (table of containers) and then run the followign statement:

    Locals.MyArray = {{1, 'test'}, {2, 'test'}} + {{5, 'everybody'}}

    The results of these two methods are attached.  Your previous posts, I think that's what you want to do.  You see, we started with an empty array of containers, and in any case we have need to use SetNumElements.

  • Using c# to check if the main report contains a sub report in the Crystal Reports Viewer

    Hello

    I currently have a web form application, which displays a crystal report already created using the crystal reports Viewer. In this report, the format is a few pages of the main report, followed by a few pages of the report of void. However, when the user first opens the application, all they see is the main report. Unless they click on the subpage of report the report viewer do not recognize as one of void, even if the user is on the page of report of void.

    I was wondering if there are ways to use the c# code to check if some pages of the main report contains a report without user sup a goes through each page of the report?

    Thanks a lot for your help!

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • A conditional branch Oracle OSB: check if the input message contains a string

    I get an XML message with 4 different message structures. I'm trying to read the message and then apply specific actions according to the type of message. So let's say that I get a 'get' conform to the"Schema" and 'MessageB' meets 'plan B '.

    In my proxy that reads the message, so I added in a conditional branch. In the branch, I select:

    Variable: body

    Selected XPath: fn:contains(.,_'MessageA>')

    The foregoing is not validated. Then I noticed that there may be that one condition of branch so it would not work. As I want to do something like:

    If fn:contains($body,_'MessageA>') then do Action

    if FN: Contains($Body, 'MessageB>') then do Action B

    Then I wanted to confirm if an IF statement inside a stadium is the only way to go or is it possible to make this conditional branching?

    Hi nrayan,.

    You can use fn:boolean to check if the node exists, for example fn:boolean($body/MessageA), it returns true if get is not a $body node, and false if...

    Kind regards

    Rui Lopes

  • Boxed PS Elements 13 contains only the Mac Version

    Version in dual-media from PS 13 items retail box contains two DVDs, both marked MAC OS. They are the same and will not be installed on my Windows System. (1) how do I get Windows DVD version?  (2) can I download and install the trial version and use the serial number of the box?

    You should be able to install from a download and use the serial number of the purchase... you should see about getting a replacement who resell it to you.

    PES 10, 11, 12, 13 - http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html

  • Failed to create the application (first) Workbench ("failed to create the application, check if the application name contains an invalid string).

    Connection to the local server to Livecycle (ss4 trial) works, set up normally - 1.0 repository service provider service provider is "RepositoryProviderService".

    Error message is ambiguous and the issue is certainly not with the name of the application. This is a new installation, so this may be a common pitfall with installation or configuration.

    Thanks Aditaya. I didn't know the DesignTimeService. There is no problem, and I had already checked the other parameters.

    Looking at the logs it turns out that the JVM memory failed. Increase the memory solved the problem.

  • How to check the slider back row contains data or not

    Hi all


    How to check whether or not the cursor returned row contains data in one of its field.


    Thank you and best regards,
    Prakash P

    Use ROWCOUNT %
    Use % NOTFOUND

    example of

    DECLARE
    
       id    number;
       desc varchar2(10);
       CURSOR cursor_one IS
          SELECT
              id, desc
          FROM
              table;
    BEGIN
       OPEN cursor_one;
       LOOP
          FETCH cursor_one INTO id, desc;
          EXIT WHEN cursor_one%ROWCOUNT > 20 OR cursor_one%NOTFOUND;
       ...
       END LOOP;
       CLOSE cursor_one;
    END;
    
  • How to check the selected elements of a selectManyListbox in an OS doDML?

    Hello

    I have a VO based on in EO. During the doDML (UPDATE) of this OS, I want to check what are the components of an af:selectManyListbox have been selected.
    How could I get the items activated in the selectManyListbox (which belongs to the ViewController) in the doDML of an EO method (which belongs to the model)?

    Thank you very much

    HTTP, Yes, as long as you do everything in the same request. Something like:

    your_AM_Method (list)
    {
    put things into a global temporary table
    Commit (which will cause DB Report, citing doDML() as well)
    }

  • How to check if an element exists

    Hello

    I have a code as shown below. My problem is that I put that if the cursor exists, then allow the user to drag and change the size of the image on that where it clicks. If the cursor is not there, create an If you click on "image".

    The application works if I start it up and click on an image, but if I have mousewheel on the slider and done disappears, even if I click on the image, the cursor does not.

    Could someone give me some ideas about what I've done wrong here?

    Thanks in advance.

    Alice

    Hello

    I found a get autour by checking if the value of the slider is 0 and if she is, recreate the slider, and that seems to work now. If anyone is interested, here is the code:

  • How can I check if my windows xp contains all the appropriate files he needs?

    I downloaded the sp3 update, my computer was messed up since the load down. I have reinstall my xp sp2 version, I had to remove fo all my files, & all reinstall. My computer has never been the same since. It does not save my settings, it does not work properly. It wouldn't let me install my street & 2006.It travel would not let me install the new 2011 version. I'm stuck on what to do. Please help me. Thank you for your time.Dan.

    Hello, yes the reinstallation of Windows XP sp2 has been a success, the computer crashes always upward when I try to install S & T 2006. I scanned my computer with my Zone Alarm program. I tried the scan of microsoft also. I don't find any problem. It is published in S & T forums. Thank you for your time. Dan.

  • Wireless keyboard not working not properly. (Microsoft Wireless MultiMedia Keyboard) (SOLVED, CHECK MY ANSWER)

    Hello, I replaced my monitor, but my keyboard did not work properly and when I spam a letter as "aaaaaaaaaaaa" very long, it stops and I have to press it again. Can someone help me? I have the same situation in a game when I'm pressing certain keys that I have. It is very annoying... So I posted here because my keyboard and mouse are both of Microsoft,

    Microsoft Wireless MultiMedia Keyboard 1.1

    Microsoft Wireless Optical Mouse 2000.

    I would be very appreciate all solutions on it: P

    I tried putting in new battery, restart, re - detect the mouse and keyboard but did not work!

    Solution:

    Put your detector near the keyboard (or right in front of him), as I do

    It worked perfectly. I also tried to hand over to the old place, and the problem appeared. So I put it in front of the keyboard and the problem disappeared!

  • Type of object change the channel on a null value when passed an element that contains one script to another since 5.5 upgrade

    So, I came across a few weird things after our upgrade of the vCO 5.1 to 5.5.  A really strange thing that's happened is one of my workflows started by raising an error saying "TypeError: cannot find the function replace in article xyz" where xyz is the value of the string.  I put in a record of debugging and comes to connect the object type, and sure enough, right at the end of the scriptable job, it was saved as a string, but at the beginning of the next task, that it has been saved as null, I think for the object type.  I tried all sorts of things to fix.  Finally, I just combined the two into a single scriptable objects and the error disappeared.  Now I see this pop up in another workflow.  Has anyone else seen elsewhere?  No idea what's going on?

    Paul

    Hi Paul,.

    How is the value of this string is assigned in the first task of the scriptable object? What is a simple assignment of a simple value (something like "mystrobj = 'abc';"), or is it more complex assignment involving concatenations, as ' mystrobj = 'a' + 'b';'? In the new JS engine Rhino 1.7R4, result of concatenation is not of type string as it used to be in 1.7R3, but of type ConsString, which leads to problems.

    If this is the case, before leaving the first script task, you can try to 'flatten' the simple string value by invoking the method valueOf(), something like mystrobj = mystrobj.valueOf ();

    If there is no concatenations involved, could join a workflow example demonstrating the problem?

  • Mail OS 10.11.4 shows not contained in the list of the mailbox

    Hi, since I have updated my MBP (early 2011) to OS X version 10.11.4 display the folders in the list of the mailbox is empty (see example below). I tried to find a solution and did a search on the Internet, but with no recourse yet. How to solve this problem?

    Please stop Mail. Force quit if necessary.

    Back up all data before proceeding.

    If you use OS X 10.11 ("El Capitan") or version later, triple - click anywhere in the line below on this page to select:

    ~/Library/Mail/V3/MailData

    If you use an older version of Mac OS X, use this line:

    ~/Library/Mail/V2/MailData

    Copy the selected text in the Clipboard by pressing Control-C key combination. In the Finder, select

    Go ▹ go to folder

    in the menu bar. Paste in the box that opens by pressing Command + V, then press return.

    A file window opens. In it he must be files with names as follows:

    Index of the envelope

    ExternalUpdates.storedata

    Move these files to the desktop, leaving the window open. Other files in the folder can have names more long that begin as above. Move these files, if any, in the trash.

    Mail recovery. It should invite you to re - import your messages. You can get a warning that the index is corrupted and that Mail must quit smoking. Click OK. Generally speaking, the process takes a few minutes, but this can take hours if you have gigantic mailboxes. In this case, you will be able to speed things up temporarily by adding your file to the list of personal information protection in the Spotlight preferences pane. Remove it when Mail has finished importing.

    If the import operation stalls or fails with an error message, quit Mail, delete the two new index files (maintenance of the original that you moved to the desktop) and try again. According to several reports, the second attempt can succeed if one does not.

    Test. If Mail now works as expected, you can delete the files that you moved to the desktop. If not, post your results.

  • Pass a CVI struct containing a type listed in TestStand?

    Hello

    I have a CVI struct that contains an enumerated type.  I want to call a CVI function with this structure as an argument of TestStand.  I created a similar structure (type of container) in TestStand and the other fields of the struct appear to be passed to CVI TestStand ok, but the enum field is always zero.  No idea what I can do?  I don't want to change the CVI enum and struct definitions.

    Example:

    typedef enum {OPTION_A = 0, OPTION_B = 1} eOption Option;

    typedef struct stMyStruct {}

    Double;

    int b;

    Option c;

    } MyStruct;

    Thank you!

    It turns out that my definition of type of container TestStand didn't exactly match the CVI struct, with respect to the sizes of the fields.  Once I fixed the defintion of container TestStand to make the memory of packaging exactly match my CVI struct, enum field passed very well (I defined the field enum as a signed integer of 32 bits in the container TestStand properties).  I didn't need to create a public service or a type for my CVI dll library.

    Thank you!

Maybe you are looking for

  • I don't see any part of firfox

    Firefox extends beyond the window

  • Where can I buy a Windows 7 recovery DVD?

    Although I made an image of the Win7 DVD system before my HD crashed completely, but after the installation of the new HD I get error message: PXE - E61: media test failure and "no image file cannot be found on this PC. If my image is corrupt, where

  • HP-Pavilion 17 Notebook pc / printer offline

    I have a printer Canon MF-4800. Fine prints of the internet from my wifes HP computer. My HP Pavilion 17 is connected to the printer. Print a page of test ok. Error message when I try to print online. Says printer offline. The printer is online. Symb

  • My hp will not go past the blue screen

    I tried everything I can think of. Safe mode Restore and system recovery Cleaning system nothing will make me past the blue screen Model number G62-244 Please help me!

  • Can I re - open a dialog when a user clicks the Ok button?

    Hi allI would like to catch missing entry (selection of the menu drop-down) in an Illustrator scripted dialog box and return the user to the dialog box, as it was before he clicked on ok.Now the script logic goes in this direction: var windowResource