How to dynamically create selecItems in a pgae from a table

To those who may be able to help:
I am using JDeveloper 10.1.3.4. In my application, I need to put a number of selectItem tags such as radio buttons on a page. What is difficult about this is that it can not be known in advance how many radio buttons there will be, because is depends on how many rows will be selected from a table, even though it is known that the number of selected rows will not exceed 3. I am considering using the radio button because it looks better on the page, and the user must select only one.
A few sample rows from the table:
TERM    AVAILABLE  SWITCHED
200809  N          OFF
200902  N          ON
200906  Y          ON
200909  Y          ONThe SQL of the view object from this table/(entity object) is:
SELECT Terms.TERM
FROM TERMS Terms
WHERE AVAILABLE = 'Y' AND SWITCHED = 'ON'I am able to drag the selected two rows from the data control palette. But it is just a table. What I need is to ask the user to select one of them. What is the easiest way to achieve that?
Many thanks for your help!
Newman

Hi, Sireesha,
I almost succeed in the backing bean, except one last line when adding the new SelectItem into the list. Here is the code:
    private List<SelectItem> termList;
    public void setTermList(List<SelectItem> termList) {
        this.termList = termList;
    public List<SelectItem> getTermList() {
        return termList;
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb =    fc.getApplication().createValueBinding("#{data}");
        BindingContext bc = (BindingContext)vb.getValue(fc);
        DCDataControl dc = bc.findDataControl("ZBOVModuleDataControl");
        ApplicationModule am = (ApplicationModule)dc.getDataProvider();
        ZBOVModuleImpl zbovam = (ZBOVModuleImpl)am;
        TermsForStudentsImpl termsOpen = (TermsForStudentsImpl)zbovam.getTermsForStudents1();
        System.out.println("Number of rows: " + termsOpen.getEstimatedRowCount());
        long size = termsOpen.getEstimatedRowCount();
        for (int i = 0; i < size; i++) {
            Row currRow = termsOpen.getRowAtRangeIndex(i);
            String term = (String)currRow.getAttribute("Term");
            String termDesc = translateTerm(term);
            SelectItem selectItem = null;
            selectItem = new SelectItem(term, termDesc);
            // The code runs fine except when the one line below is uncommented
            //termList.add(selectItem);
            System.out.println(term + ": " + termDesc);
    public String translateTerm(String yyyymm) {
        String year = yyyymm.substring(0,4);
        String semester = null;
        String month = yyyymm.substring(4,6);
        if (month.equals("02")){
            semester = "Spring";
        } else if (month.equals("06")) {
            semester = "Summer";
        } else if (month.equals("09")) {
            semester = "Fall";
        return semester + " " + year;
    }The page in the front is blank except one line of static text, and nothing in the page binds to the termList in the backing bean yet. When the line {color:red}termList.add(selectItem);{color} is commented out, the page runs and the console prints out:
09/08/17 03:17:25 Number of rows: 3
09/08/17 03:17:25 200809: Fall 2008
09/08/17 03:17:25 200902: Spring 2009
09/08/17 03:17:25 200906: Summer 2009But uncommenting that line will cause a NullPointer error, and the error message says that the SelectTerm class can not be instantiated (I wrap round the long line of error message in the browser into several shorter lines):
javax.servlet.jsp.JspException: javax.faces.FacesException:
   javax.faces.FacesException: Can't instantiate class: 'zbov.viewcontroller.backing.student.SelectTerm'..
   class zbov.viewcontroller.backing.student.SelectTerm : java.lang.NullPointerExceptionI am stuck here. Do you have any idea what is wrong and how to get around this?
Thank you for helping.
Newman

Similar Messages

  • How to dynamically create a treeview in sharepoint using javascript or jquery

    How to dynamically create a treeview in sharepoint using javascript that displays spsites ,spweb,splist

    Hi,
    In SharePoint 2010, we can customize web service and use Server Object Model to get all the SharePoint sites, webs and lists, then call the web service using jQuery and using the jQuery Treeview plugin to display the data.
    The following articles for your reference:
    Walkthrough: Creating a Custom ASP.NET Web Service
    https://msdn.microsoft.com/en-us/library/office/ms464040%28v=office.14%29.aspx?f=255&MSPPError=-2147217396
    Using Jquery to call an ASMX service in sharepoint 2010
    http://stackoverflow.com/questions/9035539/using-jquery-to-call-an-asmx-service-in-sharepoint-2010
    jQuery-ui Treeview
    https://plugins.jquery.com/btechcotree/
    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 set dynamically created query in GridControl?

    How set dynamically created query in GridControl?
    Thank you

    If your dynamic query is based on an Entity object, then you can probably use RowSetInfo setQueryInfo method.
    The argument to this method is a 'Query' object. There are three flavours provided in the oracle.dacf.dataset
    package.
    oracle.dacf.dataset.QueryViewInfo
    defines an updateable SQL query based on a predefined BC4J View Object.
    oracle.dacf.dataset.QueryStatementInfo
    Creates a view object based on an arbitrary SQL statement.
    oracle.dacf.dataset.QueryInfo
    Creates a View Object from an Entity Object and additional SQL clauses. The View Object will have
    that Entity Object as its sole Entity Object base.
    If in your application you are able to specify the name of the entity, then you can use the QueryInfo method to define your
    query. Please try the following.
    SessionInfo si = ....
    void runDynamicQuery()
    RowSetInfo rsi = new RowSetInfo();
    AttributeInfo ai = new AttibuteInfo(..);
    ai.setName(..);
    rsi..addChild(ai);
    si.addChild( rsi)
    rsi.setQueryInfo( new QueryInfo( ...../* include entity name */ .... ));
    rsi.setName(....);
    rsi.open(true);
    grid.setDataItemName(...);
    Hope this helps,
    Sathish.

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • How can you create a writable PDF document from a PPT presentation ?

    How can you create a writable PDF document from a PPT presentation ? Upper part with the image , lower part with a free space in order to take notes for students during presentation or course.
    Thanks.
    B

    You can make a PDF file out of you notes and handouts but using the Adobe PDF printer.
    Open your PowerPoint Document then go to “File” “Print”
    Select ‘Adobe PDF” Printer
    Under slides, select which way you want to print. Note it will not print to a printer but to a PDF file.
    After then go into printer Properties and Setup PDF properties, do the following: (see second image below)
    Default: PDF/A 1-b
    Adobe Security: none (change as needed)
    Adobe Output folder: Prompt for Adobe file name
    Adobe Page size: Letter (change as needed)
    Check the following check boxes
    View Adobe PDf Results,
    Add Document Information,
    Rely on system fonts only,
    Delete Log files for successful jobs.
    Select OK
    A pop will ask you where you want to save the document. The file extension should be PDF. After giving the file name select okay and the file should popup as a PDF. Down side is if you want to speaker notes included then you will have to do another file, like wise with just screen shots then combine into one PDF document.
    I used Acrobat IX Pro. So to do this you need Acrobat IX or X Pro.
    Hope this will help.
    Tiger26

  • How do I create a single PDF Portfolio from an Outlook 2011 email with multiple non-pdf attachments?

    How do I create a single PDF Portfolio from an Outlook 2011 email with multiple non-pdf attachments?
    Email has 3 attachments--some are not pdf. I'd like all three converted into pdf files along with the email itself, and all appear in the email's pdf portfolio.

    I would also like an answer to this question. 
    I am trying to convert an Outlook email to a PDF, then all attachment are appended to the PDF as pages instead of attachments. 

  • How do i create a playlist in itunes from my iphone 4s?

    how do i create a playlist in itunes from my iphone 4s?

    denisefromnj wrote:
    On my iphone 4s I have 2 songs in the purchased category that I want to manually move into an existing playlist.  I can not figure it out.
    If the existing playlist is a regular (non-smart) playlist, then you can edit it directly on the iPhone. Just select the playlist and you should see an "Edit" button at the top, above the songs.  If you don't see that, then it must be a smart playlist since those can't be edited on the device. Once you tap the Edit button you would then navigate to the song you want to add and press the blue + sign to the right of the song, then press Done when you're finished.
    One caveat though, if you auto-sync your iPhone, the changes you make will not be preserved -- the playlist will revert to how it was next time you sync to iTunes.  So if you want to edit a playlist on your iPhone and then transfer it to iTunes, you have to create a new (empty) playlist on your iPhone, add the playlist that you wanted to edit to the new playlist, then add or delete more songs to the new playlist.  When you auto-sync, the new playlist will transfer to your iTunes library.
    But if you manually manage your iPhone, the playlist should remain in its edited state even if you connect to your library (but admittedly its been awhile since I tried manual mode).

  • How do I create. A single PDF from multiple files? PDF pack on iOS

    How do I create. A single PDF from multiple files? PDF pack on iOS
    The primary reason I signed up for. PDF Pack was to create a single PDF from multiple image files and other PDFs .
    Is this possible? If so how
    thanks in advance
    rich

    Hi Rich,
    The combine files feature isn't available when you're using Reader for iOS. However, you can log on to the web interface at Adobe Acrobat.com using your Adobe ID and credentials, and use the Combine Files feature there.
    Please let us know if you need further assistance.
    Best,
    Sara

  • How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?

    How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?
    Let's say the SQL Server and Oracle Database are in the same Company Internet Network.
    I have the code, but I do not know how to use it. Such as what is System DSN Name? Where could I get it. What does it look like?
    Do I need to install any Oracle Client Software in order to link from SQL Server to Oracle? Or SQL Server has the built-in drivers installed already that I can directly create a Linked Server from SQL Server to Oracle?
    I need to know details. Thanks.
    USE master
    go
    EXEC sp_addlinkedserver
         @server  = '{Linked Server Name}'
        ,@srvproduct = '{System DSN Name}'
        ,@provider  = 'MSDASQL'
        ,@datasrc  = '{System DSN Name}'
    EXEC sp_addlinkedsrvlogin
         @rmtsrvname = '{Linked Server Name}'
        ,@useself  = 'False'
        ,@locallogin = NULL
        ,@rmtuser  = '{Oracle User Name}'
        ,@rmtpassword = '{Oracle User Password}'

    You need an OLE DB provider for Oracle. There is one that ships with Windows, but it only supports very old versions of Oracle. Oracle has an OLE DB provider that you can use. I don't know if it's part of Oracle Client or how it is bundled.
    You should not use MSDASQL or any DSN.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can one create a paint color generated from a photo using Kuler?

    How can one create a paint color generated from a photo using Kuler?

    The best way to remove a pattern is to use a Fast Fourier Transform.  There's a free plugin (as well as examples and instructions) here:
    http://dl.dropboxusercontent.com/u/6795661/4N6site/improc/fftplugin/examples.htm
    Using the plugin requires editing the individual colour channels, which PSE does not natively allow.  You'll need the reasonably-priced Elements+ addin:
    http://elementsplus.net/
    Here's a crop at 100% of the result I got:
    The pattern is much reduced.  With some experimenting, you can probably do a little better.
    Ken

  • Using Compressor 4, How do you create a droplet to transcode from final cut files to mp4, mp3 and m4v formatting?

    Using Compressor 4, How do you create a droplet to transcode from final cut files to mp4, mp3 and m4v formatting?

    Take a look at this section; it's pretty clear.
    Compressor offers settings for each of the output formats you want. (For example, the m4v sttings for Apple Devices.)
    Good luck.
    Russ

  • HT2534 how can i create an account in itunes from Bangladesh ?

    how can i create an account in itunes from Bangladesh ?

    If you go to the artist's/group's page in the store then you should be able to do it e.g. search for the artist in the store, and on the right-hand side of the results page there should be list of content categories that match that search, and below it a link for the artist
    Click on the artist's name to go to a screen listing their items, and at the top right of that screen there should be a 'share' icon'
    Click on that and on the popup you should have an option for 'alert me' (I haven't used it but I assume that it works).
    You can see what alerts that you have, and remove them, by logging into your account via the Store > View Account menu option - on your account's screen there should be an Alerts link

  • How can i creat CRC 32 CHECK WITH THE lookup table as attached.

    how can i creat CRC 32 CHECK WITH THE lookup table.attached
    i creat one,but not match the result number C++ version
    result number C++ version:
    FE 00 18 02 40 1E 65 43 00 03 E8        CRC32=>78 1F E9 06
    FE 01 18 02 40 1E 65 43 00 03 E8        CRC32=>F8 8F 49 61
    FE 02 18 02 40 1E 65 43 00 03 E8        CRC32=>7D FF B4 7F

    due to some reason i can not attach the table.but you can find it herehttp://lavag.org/topic/15325-crc32/,it in the CRC.llb 84.03K =>CRC-32 Table.ctl thanks a lot

  • HT2731 How do I create an iStore USA account from South Africa. Is it possible using a South African credit card.

    How do I create a USA iStore account from South Africa. Is it possible with a South African credit card.

    Hi ...
    Afraid not ...
    Your credit or debit card credentials must be associated with the same country where you reside.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

  • ¿How can I to get the selected index from a table in sapui5?

    I have a multiselect table for each item I need to open a Dialog and bind then the table.
    How Can I to obtain the index position from my table?
    var myTable = sap.ui.getCore().byId(this.sId);
    var myItem = sap.ui.getCore().byId(myTable.getSelectedItem());
    Thanks in advance.

    Hi,
    You can also use getSelectedContexts of table instance to get the selected indices of sap.m.Table
    var aContexts = myTable.getSelectedContexts(true);
    for(var i = 0 ; i < aContexts.length ; i++)
    var selectedIndex = parseInt(aContexts[i].sPath .split("/")[2]);
    Thanks,
    Rumeshbabu S

Maybe you are looking for

  • ITunes not installed correctly   Error 7 Windows error 126   Please help

    iTunes not installed correctly.  Error 7    Windows error 126    Any suggestions would be greatly appreciated!  Thank you!

  • Problems with AppleWorks drawing docs under Snow Leopard

    Since I installed Snow Leopard, I've encountered two major problems: (Problem 1) AppleWorks gets corrupted when dragging a picture file (.jpg or .png) from the desktop into a drawing document. Various dialogs (e.g. "Format : Document..." or "Format :

  • How to display stored procedure results in SJSC table?

    I have been able to create a cached rowset and debug/watch the results, but do not understand how to transfer those results to a Table component. Can anyone point me in the right direction? Details: In SessionBean1.java, I declared the stored procedu

  • VJet Editor stopped working.

    I have VJet 0.10 installed on Eclipse Luna 4.4.2. Since this morning, every time I try to open a file with the VJet Editor I get this error message: Quote:Editor could not be initialized. The "Details" button provides this stack trace: java.lang.Null

  • Why are my form tabs changing order?

    I am manually setting form fill tabs in a multi-page document and each time I set a page and save, one of the previous pages reverts to the default order. Any idea why this is happening or how to prevent it?