Multiple DataSourceRef in DataTable component

Dear All,
I'm a newbie using JDeveloper 9.0.3 to develop a JSP application. I wonder if I can pass more than one DataSource to the DataTable component so that I can customize the component to get data from to DataSourceRef. Can anybody help?

Dear All,
I'm a newbie using JDeveloper 9.0.3 to develop a JSP application. I wonder if I can pass more than one DataSource to the DataTable component so that I can customize the component to get data from to DataSourceRef. Can anybody help?

Similar Messages

  • Jsf datatable component + java.sql.SQLException

    I get the following error when implementing a JSF DataTable component using
    JDeveloper 10.1.3.1.
    javax.faces.FacesException: java.sql.SQLException: Io exception: Socket closed
    I am able to follow the article in this link:
    http://www.oracle.com/technology/oramag/oracle/06-jan/o16jsf.html
    I can get the table generated, but it occurred to me that the example in this article does not include logic to close the statement, resultset, and connection. Sure enough, I jumped out to the database and there were numerous inactive connections hanging around from my application.
    I added the following code before the return null statement from the article:
    finally {
    try {
    rs.close();
    stmt.close();
    c.close();
    catch (Exception e) {
    System.out.println("after close");
    So I need to know the proper procedure to closing the resultset, statement, and connection using a jsf datatable component.

    You need to make sure you're using the Oracle9i JDBC driver, or using the Oracle 8.1.7.2 JDBC driver as I mentioned above.
    If you are using JDeveloper9i release 9.0.2 or 9.0.3, the driver you need is in <jdevhome>\jdbc\lib
    Otherwise, you can also download the drivers from OTN.

  • How to bind table data to datatable component and show all the table data??

    I bind table to datatable component !
    The datatable has four rows,
    but the datatable alway show the first row data in its four rows,why??

    do you mean at design time or at runtime?
    at design time, the datatable uses generic fields to
    show if data type is numeric, text, date, etc...
    If this is at runtime,
    - what driver are you using?
    - how did you bind the data to the table?
    - what is the resulting code in the Java backing file?
    hth,
    -Alexis

  • Displaying ResultSet in DataTable component

    Say my program codes have created a ResultSet object by applying some SQL query into the database tables.
    Now I just want to display the contents of that ResultSet object in the JSC DataTable component. Is it possible? If so, how?
    Thank you.

    Hi,
    I think i have found a way to do what we want to do :
    As written in Winston Prakash's Weblog (http://blogs.sun.com/roller/page/winston),
    1) I have created a java class "ResultRowDataProvider" that extends ListObjectDataProvider and that contains a method that fill a list from the resultset. (Later, this list will be automatically used to fill the Table Component)
    That is to say :
    public class ResultRowDataProvider extends ObjectListDataProvider{
    private List resultList = new ArrayList();
    /** Creates a new instance of ResultRowDataProvider */
    public ResultRowDataProvider() {
    setUserResizable(true);
    public void fillResultList(ResultSet rs){
    try{
    rs.beforeFirst();
    while(rs.next())
    resultList.add(new ResultRow(rs.getString(1), rs.getString(2)));
    } catch(SQLException sqle){}
    setList(resultList);
    public int getNbRows(){
    return this.resultList.size();
    2) I have created a java class "ResultRow" where I defined private attributes that the ResultRowDataProvider will provide.
    That is to say :
    public class ResultRow(){
    private String field1;
    private String field2;
    public ResultRow(String field1, String field2){
    this.field1 = field1;
    this.field2 = field2;
    public String getField1(){
    return this.field1;
    public String getField2(){
    return this.field2;
    public void setField1(String field1){
    this.field1 = field1;
    public void setField2(String field2){
    this.field2 = field2;
    3) I finally added the following line to the init( ) method in SessionBean1.java :
    resultRowDataProvider = new ResultRowDataProvider();
    Then it is compulsory to clean and build the project, to close the project and to reopen it so that the table component layout will take into account the ResultRowDataProvider.
    I chose it, but it didn't display the two fields I defined (field1 and field2)
    whereas Winston said it should display them. So I defined the table columns myself using as value : #{currentRow.getValue('field1')} for the field1 column.
    It worked at runtime.
    Now jetsons, I would like to tell you that I personnaly wanted to fill programmatically the Table Component because I am using an Oracle 9.2.0.1 database. In the first version of my project, i used the CachedRowSet. Then I read that i had to use OracleCachedRowSet using ocrs12.jar. But after many bugs at runtime, I had a look to forums and I read that :
    "JDBC drivers provided by Oracle are not suitable for Sun Java Studio Creator, and are not supported. Oracle drivers currently available do not fully implement the JDBC 3.0 Specification. Sun Java Studio Creator requires certain schema information at design time that Oracle drivers do not provide."
    In fact we can use DataDirect but ...
    Filling programmatically a Table Component is a database-independant way ;)
    Thank you for your help jetsons and MISS_DUKE.

  • Multiple instances of same component become non-editable

    I have created a simple component for authors to add links. They enter anchor text, link destination, title attribute, via textfield. They set the target attribute via a dropdown list, xtype=selection. The issue we run into, is that if the author has entered multiple instances of the same component on a page, the dropdowns become non-editable after they are set the first time. They cannot be edited changed until the page edit view/content finder is closed and reopened.
    Scenario:
    1. User drag/drops component
    2. User makes selection from dropdown xtype=selection
    3. User drag/drops same component again to allowed parent
    4. User make selection from dropdown xtype=selection in second instance of component
    5. User can no longer change the selection in either instance of the component without closing and reopening edit view/content finder.
    6. User closes and reopens edit view/content finder.
    7. Again, both instances of the dropdown xtype=selection become non-editable after first selection of an option until the edit view/content finder is closed and reopened.
    When there is only one instance of the component on the page, the drop downs/xtype=select remain editable at all times.
    In addition to this particular scenario, I've had to work around some other issues of multiple instances of a component, where only one instance on a page works at all, the data gets crossed/jumbled between instances of the same component, etc.
    My question is first, how might I solve for the scenario fully called out in this question? Secondly, is there some methodology to making multiple instances of the same component track themselves individually, work together on the same page, play nicely with each other?
    Any assistance is appreciated.

    Using request scope would be a workaround.
    I'm looking for view distinct state for the associated component tree for the session (i.e. managed bean state, whether its separate instances of the bean or copies of serialized state I don't care)
    My views require conversational-like state handling that I don't want stored on the client.

  • Selecting multiple rows from List-component

    Hi
    Could someone give me an example how to programmatically select multiple rows from List-component?
    I know that this selects one row: lst_example.selectedIndex = 1;
    But how about selectin indexes 1,2 and 4 for example?

    selectedIndices
    A Vector of ints representing the indices of the currently selected item or
    items...
    var si:Vector.<int> = new Vector.<int>;
    si.push(1);
    si.push(2);
    si.push(4);
    list.selectedIndices = si;

  • Selecting multiple rows in datatable

    Hi all,
    i want to select multiple rows in datatable using checkbox or radiobox.. after selecting more than one row, user will click on "add" button and that list will be maintained by array. but i can't figure out how do i select multiple entries...
    means how would i get to know which rows are selected ?
    please help me out..
    thanx in advance
    Venkatesh

    Pointer here is : bind datatable to a datatable object in the backing bean, get the state of the checkboxes there and perform the desired operation.
    HTH,
    Sachin

  • Jsf datatable inside datatable component rendering problem.

    I am creating an online survey application using JSF with IceFaces component library. The survey can have any number of questions. Each question can be any one of the types checkbox, radio button, etc with multiple options.
    For this, I am using a datatable to dynamically add a question to the survey. Inside that datatable, I am using another datatable to add option to the survey.
    Now the problem is, if I keep on click on add question button, in the outer data table, question is being added without any issue. Once I click on inner data table to add a option to any of the added questions, I am able to add. But after that, if I click again on add question button, it is not working.
    This is my xhtml code:
    <ice:dataTable id="icePnlQuestionAdd" var="questAdd" value="#{createSurveyManagedBean.surveyQuestionList}">
    <ice:column>
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <th><ice:outputText value="Question English" style="white-space: nowrap;" /></th>                                        
    <td colspan="15">                              
    <ice:inputText id="QuestionEn" style="width:485px;" value="#{questAdd.questionEn}" />
    </td>
    </tr>
    <tr>
    <ice:dataTable id="icePnlOptionAdd" var="optionAdd" value="#{questAdd.surveyQuestionOptionList}">                               <ice:column>
    <th><ice:outputText value="Option " /></th>
    <td><ice:inputText id="OptionEn" value="#{optionAdd.optionEn}" /></td>
    </ice:column>
    </ice:dataTable>
    </tr>
    </table>
    </ice:column>
    </ice:dataTable>
    This is the add question method:
    public String addQuestion() {
    SurveyDTO addSurveyQuestionDTO = new SurveyDTO();          
    questionNum = surveyQuestionList.size();          
    addSurveyQuestionDTO.setQuestionNum(questionNum);
    surveyQuestionList.add(addSurveyQuestionDTO);
    return "createSurvey";
    This is the add option method:
    public String addOption() {
    FacesContext context = FacesContext.getCurrentInstance();          
    if (context.getExternalContext().getRequestParameterMap().get("questionNum") != null) {
    String questionNum = (String) context.getExternalContext().getRequestParameterMap().get("questionNum");
    int selectedQuestionNum = Integer.valueOf(questionNum);                    
    SurveyQuestionOptionDTO surveyQuestionOptionDTO = new SurveyQuestionOptionDTO();
    surveyQuestionList.get(selectedQuestionNum).getSurveyQuestionOptionList().add(surveyQuestionOptionDTO);
    return "createSurvey";
    }

    Bind the h:datatable in the jsp to UIDataTable component in your java code. Then when the action method is invoked, use DataTable.getWrappedObject() to get the model. Cast the model to whatever your type is (List, Array...) and then iterate through the model to process individual rows.

  • Need advice for dispalying multiple rows with datatable.

    Hi All,
    We have to design a conference booking search form which contains nX48 table.
    n -> indicates the conference rooms and 48 are the time slots(30 mins gap).
    While booking a conference room user enteres from time and to-time and from and to dates.
    In our search form, user searches with in the range of dates and times.
    We give a option for user to view according to date wise or room wise.
    Now main prblm is that we are capturing from and to times but how do we represent in data table.
    out of 48 columns assume only 4 slots are booked i.e 1200 hrs to 1400 hrs. so we need to display an image in that columns and up on clicking on that cell we have to produce data regarding that booking.
    In our pojo we have to and from time variables , but how can we display in datatable..should have to take a 48 column pojo.., if so how can I get the data at intersection point?
    Please do help me...
    Regards,
    Kranthi Kiran

    You could certainily create a 48 or 96 column grid. I would assume a simple "bar" image would go into that grid. You can create a method that gets called to determine if the image is rendered or not. Use a stylesheet (inline style) to set the width of the grid.
    While making a table with 48 column definitions is somewhat messy it is certainly no harder than cut and paste. The messy part is how to implement the boolean getter (DI) call to determine if a cell image is rendered as this would require 48 or 96 unique method definitions (one for each time slot). If you are will to do this then the solution is straight forward with a table.
    As for clicking on the image cell that is not an issue and easily handled.
    You have not mentioned what component suite you want to use. May I recommend that you take a look at Apache Trinidad (MyFaces project) or Oracle's ADF offering.
    If not you could do this with two tag iterators (e.g. tr:iterator) but fussing with trying to make sure you get cell alignment might be hard to do since you would not have a "master" grid in which you would be rendering your data.
    Could also write your own component ... but suspect you don't want to go there.
    You will find that they provide a robust table implementation that also supports the concept of "details", sort of a drill down capability that you can add to see additional information associated with a summary line in a table.

  • Solution need for multiple xml and Flowlist component

    Hi! I am using multiple xml and AFComponents AS3 Flowlist component. I am having an issue with the thumbnails in the Flowlist component after about 20 or so user clicks, the images no longer appear, yet the threaded data is still there. http://www.littlewinggames.com/
    I have tried changing some publish settings: hardware acceleration to Level-1 Direct and script time limit increased to 30???
    Can anyone please help me to find a solution? Greatly appreciated! Lisa [email protected]

    Ben,
    Normally when you have multiple cameras you would log into the web interface and change the http port of at least one of them. The default port is 80. We normally would change one camera to use http port 1024 and the second 1025. Then you simply forward port 1024 to the first camera and 1025 to the second in the router. Just remember that when you attempt to access the cameras after you change the port it will look like this: :1024">http://:1024 (locally and remotely) Please reply if you have further questions.

  • Hibernate datatable component

    Hi,
    I'm building a component to display a datatable from a hibernate select statement. I want to have pagination and a sorting mechanism.
    The problem now is that my component goes two times to the database. First time when he restores my view (lifecycle 1) and secondly when he creates my response (lifecycle 6).
    I'm sure somebody was before me to create a component like this, but I can't find docs on the internet. Does somebody know where I can find a component like this. Note, I don't want to use spring, keep it clean only JSF and hibernate.
    Thx in adv,
    Pieter

    hi;
    actually you should not make a db connection in restoreview Phase, instead restore your datasource from the viewstate
    in your components encoding phase you should make db queries.
    please take look to the following code.
    @Override
    public Object saveState(FacesContext context) {
    Object values[] = new Object[2];
    values[0] = super.saveState(context);
    values[1] = label;
    return ((Object) (values));
    @Override
    public void restoreState(FacesContext context, Object state) {
    Object values[] = (Object[])state;
    super.restoreState(context, values[0]);
    label = (String)values[1];
    http://asahin.net

  • Multiple copies of a component?

    Is there a way to take a single .mxml component and make multiple copies of it?
    I've got an app where the user can page through various screens.  Each screen should fade out and slide away while the next one slides in.  There has to be two copies active at any given time because the user should see both the old and new animating simultaneously.  I've got it working with an ActionScript class but positioning elements, setting properties, etc, is much harder than with an MXML component.
    For example, I've got an Image object, but I can't set the horizontalAlign, verticalAlign properties like you can in MXML.  They just don't seem to be exposed in ActionScript.  Or maybe I'm doing it wrong?
    What's the best/simplest way to achieve what I want?

    horizontalAlign, verticalAlign etc. are style properties, so in AS you need setStyle()
    myObj.setStyle("horizontalAlign", "center");
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Help, how to apply multiple style to a component

    In HTML we can write class="styleA styleB" to apply multiple
    style, but it's not allowed in flex3.
    So is there a way to walk around? like
    .styleB{
    //include styleA
    }

    You have to combine all songs into one file by using software, for example Audacity.
    PS: I owe this knowledge to a post by Victoria Bampton.

  • Create a datatable component

    I want to create a HtmlDataTable component in my java code.
    I do this at the moment, but seems that nothing happens:
    FacesContext context = FacesContext.getCurrentInstance();
            Application app = context.getApplication();
            HtmlDataTable table = (HtmlDataTable) app.createComponent(HtmlDataTable.COMPONENT_TYPE);
            UIColumn column = (UIColumn) app.createComponent(UIColumn.COMPONENT_TYPE);
            HtmlOutputLink link = (HtmlOutputLink) app.createComponent(HtmlOutputLink.COMPONENT_TYPE);
            HtmlOutputText text = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
            context.getViewRoot().getChildren().add(table);
            table.getChildren().add(column);
            column.getChildren().add(link);
            link.getChildren().add(text);
            table.setVar("item");
            table.setValueBinding("value", app.createValueBinding("#{menuBean.myList}"));
            link.setValue("#");
            text.setValueBinding("value", app.createValueBinding("#{item}"));What is wrong?

    You create a new table as a child of UIViewRoot.
    But UIViewRoot's rendersChildren property is false;
    that means encodeChildren method is not invoked.
    Encodeing of other components under <f:view> is done by the corresponding
    Tag Handler; whereas your new table has no corresponding one.
    I think you should create a new table under some component
    whose rendersChildren property is true (e.g. PanelGrid).

  • Rules property in the JSF dataTable component

    Does anyone know how to use this or if there is any documentation on how to use this? Is this how one can, for example, create rows of subtotals?
    Any assitance would be greatly approciated.
    Thanks
    =========================================================
    <h:dataTable value="#{ObjectSearchBackingBean.ota}" var="ot"
                               id="searchResults" rendered="true"
                               binding="#{ObjectSearchBackingBean.searchResults}" cellpadding="3" cellspacing="0"
                               styleClass="dataTable" headerClass="dataTableHeader"
                               rowClasses="dataTableRowWhite,dataTableRowGrey"
                               rules="groups">

    rules attribute:
    "Code specifying which rules will appear between cells within this table. Valid values are: none (no rules, default value); groups (between row groups); rows (between rows only); cols (between columns only); and all (between all rows and columns)."

Maybe you are looking for

  • 500 Internal Server Error: An unknown error has occurred

    When I open my browser, it immediately displays this error message. No matter what web site I navigate to, I get this message. I have no problems with Internet Explorer, so I know this is limited to Firefox. I've been gone for the past 5-6 days and j

  • Itunes wont open on my phone or desktop, itunes wont open on my phone or desktop

    itunes wont open in my iphone 5S or desktop

  • Where are iOS update files located on my Mac in Lion?

    Since Lion I can't seem to find the iOS update files on my Mac.  Which leads to my next question can I delete the latest update 4.3.5 and redownload it for a restore? Thanks, Bryan

  • ALV GRID DATAS to TXT

    i wanted to write all data on grid to a txt file at the end of to program. this is my code. not all program but considered parts. Regrads. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'      EXPORTING        i_background_id    = 'ALV_BACKGROUND'        i_buf

  • Ghost mail?

    I seem to be getting "incoming mail" but it is not showing up in any of my mailboxes. It has been happening for awhile. Most often it indicates that there are two messages incoming and they are quick and small. Just now I noticed an indication that t