ObjectListDataProvider and DataTable

Hi, have an issue and can't solve it yet.
I have a page with DataTable in JSC2 bound to ObjectListDataProvider stored in SessionBean. I need to add row to the begining of the table. InsertRow() method of ObjectListDataProvider has been declared, but not implemented yet :-(. AppendRow() method is working, but I need to add row to the begining of the table?
I've tried to insert new row into the ObjectListDataProvider's wrapped list, but after page has been redisplayed I've got an issue - first row in DataTable has not empty fields, as I guess, it should be, but, still has old values - values of the table's row wich was first before new row was inserted, and page was redisplayed (It should be noted also, that Integer, Date type values not preserved but in the new first, but Strings only). It looks strange for me.
May be I've missed something? What is the correct way to insert row into the ObjectListDataProvider and why first row values are preserved?
Thanks anyway.
Roman.

Hi Giri,
I guess it was an issue related to virtual forms. When I look at jsp page code I found that fields I've added to virtual form were not in sync with the actual state of my jsp page. Probably because later, I renamed it and moved inside Group Panel. Jsp page code still contained references to old fields. I think that this should be tested - if virtual form jsp code updated whenever components moved inside layout panels etc. But I have no time for this now. :-(
What relates to inserting row inside table - I've switched back to dataTable from standart Components - cause it binds directly to List which has insert functionality.
Thanks,
Roman.

Similar Messages

  • Need example of backing bean for selectBooleanCheckbox and dataTable

    Does anyone have an example backing bean for selectBooleanCheckbox and dataTable combination?
    I am trying to figure out how to create a dataTable with one column of checkboxes, when the checkboxes are selected, need to get a collection of all records that were selected.
    Also need to identify one of the columns in the records that were selected and send it to the EJB services to do update.
    columns in dataTable are userid and name. Both are string values.

    What is the difference between myDataItem, myDataItems and myDataList in MyBean.java?
    Where did myDataItem and myDataList come from? It isn't declared or initialized in MyBean.java

  • Difference between panelGrid tag and dataTable

    hi,
    what is the difference between panelGrid tag and dataTable tag in jsf

    A panelGrid is useful when you have a fixed number of rows and columns. Each child component of the panelGrid is specified explicitly and arranged in a grid by the parent component.
    A dataTable is useful when you have a collection of homogeneous data of indeterminate size. You specify the columns of the dataTable and it will iterate over your data creating one row per datum.

  • ComboBox and DataTable

    Hey All,
    I have found a lot of posts on here about adding values to a combo box using the valid values collection. I am trying to assign a datatable to the Combobox in my case. I add my datatable in the xml and assign a query to it. Then I assign that to the databind property of the combobox and when the form loads it only displays the 1st record in the query.
    Any ideas what I am doing wrong?
    I basically just want to display the list of item groups in my combo box without manually adding these to the valid values collection.
    Curtis

    Hi Curtis.
    If it can help you this is some methods used in my programs:
    1) ValidValues in xml file
    <item uid="cType" type="113" left="100" tab_order="0"
             width="150" top="10" height="14" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="1"
             right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0"
             AffectsFormMode="1">
      <AutoManagedAttribute />
      <specific AffectsFormMode="1" TabOrder="0">
       <ValidValues>
        <action type="add">
         <ValidValue value="A" description="AAA" />
         <ValidValue value="E" description="EEE" />
         <ValidValue value="B" description="BB" />
         <ValidValue value="D" description="DD" />
        </action>
       </ValidValues>
      <databind databound="1" table="@TABLE_A" alias="U_TYPE" />
    </specific>
    </item>
    2) Add ValidValues to combobox.
    Private Sub CreateForm()
        Dim oForm As SAPbouiCOM.Form
        Dim oComboBox As SAPbouiCOM.ComboBox
        Set oForm = SBO_Application.Forms.Add("MYFORM")
        oForm.DataSources.UserDataSources.Add "DS", dt_SHORT_TEXT, 20
        Set oComboBox = oForm.Items.Add("cCombo1", it_COMBO_BOX).Specific
        oComboBox.DataBind.SetBound True, "", "DS"
        oComboBox.ValidValues.Add "A", "Value A"
        oComboBox.ValidValues.Add "B", "Value B"
        oComboBox.ValidValues.Add "C", "Value C"
    End Sub
    3) Add Linked Table for field.
    See this thread [User defined Valid values in SBO|User defined Valid values in SBO;
    4) Recordset
    See this thread [Fill values in combobox from database table|Fill values in combobox from database table;
    5) LoadSeries Method (look SDK Help)
    Other ways  I don't know.
    Best regards
    Sierdna S.

  • Components Do the Wrong thing.... (listbox and datatable)

    Okay - this one may be a "don't do that" but here goes....
    Create a new project.
    On Page1. Drag a DataTable out, drop a Table on it. (should fill out the columns, yes?) It does.
    Now, in Project Navigator, create a new folder (foo) in the WebPages folder.
    Select the new folder. Right-click, and add a new Page2. Double-click to get the design view of foo/Page2.jsp
    Drag a DataTable out, drop a Table on it - notice how only titles are there? Notice no dummy datarows? (yes, the row property has been set to 0 and changing it has no effect.)
    If you deploy and test this app, the dT on Page1 works, the dT on foo/Page2 does not and you can't get it to work bu messing about with the properties. Interesting note, Page2's dataTable's value prop is "#{Page2.dataTable1Model}" no notion of the foo/Page2 (or would it be #{foo$Page2.dataTable1Model} ?)
    The related thing happens when you use listBoxes. I get a Validation error on the foo/Page2, where Page1's list box works fine (although in this case there is something evil in the listBoxConvertor - try the popup in the prop sheet, it gets squirrely) although this could be related to the firefox listBox/Validation issue elsewhere in the forum.
    So, I'm stuck trying to get some of these auto components to work down in the various namespaces of my app.....
    Ideas?

    Hi,
    This problem has been noticed earlier too and a bug has already been filed for the same.
    Thank you for bringing this to our notice.
    Cheers :-)

  • Info matrix and datatable

    hi all,
    I have this problem...
    when i populate  matrix with the datatable  at the column with decimal-number. i've 4 decimal like this (123233,2342)
    How can i reduce decimal to 2 digit???
    bye

    Hello.
    When You bind column to database what kind of fields do You have ?
    There are 4 types of fields in UserDataSources.
    This are field in userdata:
    dt_LONG_NUMBER  Long number  0 
    dt_SHORT_NUMBER  Short number  1 
    dt_QUANTITY  Quantity  2 
    dt_PRICE  Price  3 
    dt_RATE  Rate  4 
    dt_MEASURE  Measure  5 
    dt_SUM  Sum  6 
    dt_PERCENT  Percent  7 
    dt_LONG_TEXT  Long text  8 
    dt_SHORT_TEXT  Short text  9 
    dt_DATE  Date  10 
    You can use one from the dt_Price, dt_Rate, dt_Measure, dt_Sum <- one from there is that you search for.
    If You create table - you use UserTableMD ? It yes, then put type : db_Float and then PutSubType: one from the:
    Rate -> st_Rate
    Sum -> st_Sum
    Price -> st_Price
    Quantity -> st_Quantity
    Sorry for my english.
    Hope it helps.
    Kamil Wydra

  • Problem with checkbox and datatable

    Hi,
    I have a checkbox in one column of the data table. The checkbox is to be disabled if the status (which is another column in the table) is set to Completed. For all other rows, the checkbox is to be enabled. What happens is that, the checkbox is either enabled for all the rows or disabled for all the rows...
    This is how i have implemented it.
    public void setCheck(){
    int rows = dataTable1.getRowCount();
    OrderRunStatusBean osb = new OrderRunStatusBean();
    for (int i =0;i<rows;i++){
    dataTable1.setRowIndex(i);
    osb = (OrderRunStatusBean)dataTable1.getRowData();
    if (osb.getStatusName().equalsIgnoreCase("Completed")){
    dataTable1.setRowIndex(i);
    chkSelect.setDisabled(true);
    else
    chkSelect.setDisabled(false);
    Thanks!!!!
    -Tabitha
    PS
    I'm facing the same trouble with selecting and deselecting a checkbox as well.

    Hallo Tabitha,
    create a method called isDisabled() in your <Page>.java class containing the logic by which you want to disable the checkbox, for example:
         * Getter for property disabled.
         * @return Value of property disabled.
        public boolean isDisabled() {
            TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");
            String category = (String) trdp.getValue("MUSICCATEGORIES.MUSICCATEGORY");
            return category.equals("Rock");
        }This example is connected to a TableRow and returns true when the value of the database field is "Rock".
    Then bind the disabled property of the checkbox to the 'disabled' property:
    Click on the right of the disabled property in the Properties window, select the option 'Use Binding', select the 'Bind to an object' tab, select the Page1.disabled property and click on OK.
    Deploy and run the project.
    Hope this helps.
    Ciao,
    Fabio

  • ObjectListDataProvider and table

    hi,
    i had like to retrieve with jdbc 2 cols from a table in an object class that
    extends ObjectListDataProvider.
    when i try to bind the ui:table, i can't find the objectListDataProvider created.
    does someone get an example with the ObjectDataProvider class ?
    thanks.
    regards,

    i found good help with the url
    http://blogs.sun.com/winston/entry/objectlistdp_sample_project

  • Get the values from datatable?

    hi,
    my form having some textinputs with validators.
    and datatable.
    my datatable i am displaying data with boolean check box.
    when select check boxes , and click on remove button
    I am getting values in managed bean if no form validations for text inputs.
    now how to skip validations while click on remove button.
    thanks
    siva

    thanks solve problem.
    siva

  • Make-to-order. Requirement linked to Quotation and not to Sales Order

    After we have changed our Make-To-Order Materials from unvaluated sales order stock to valuated Sales Order Stock we do face a problem with the Requirement for those Sales Orders lines which are started with a Quotation. After running MRP a planned Order is created (ok) but the Planned Order is linked to the Quotation line and not to the Sales order line. When converting the Planned order to a Production order the AFPOD-KDAUF field is the number of the Quotation and unfortunately not the Sales Order number.
    The Quotation looks ok. Item category is AGN and Schedule line category is BN (no MRP). When converting the Quotation into a Sales Order the Item category change to TAN and schedule lin category is now CP.
    The copy rules QT -> OR (VTAA) shows copying requirement = 501 Schedule qty >0 and DataT = 201 General Schedule line Data
    Anyone got a clue about where to look? ¨
    Thanks in advance
    Ken

    Hi Guys
    Thanks for your proposals.
    The Materials involved are standard items (FINI -> NORM) and our Set-up with item category TAN works perfectly when we create a Sales Order without a Quotation first. And the way we solve the problem manually right now is to convert the Quotation and delete in line item and recreate them manually. 
    I found that if i delete the requirement type in the Quotation and then convert the Quotation into a Sales Order then the Planned with be linked to the Sales Order = perfect.
    Any other ideas
    Best
    Ken

  • Error creating window handle and out of memory

    Hello everyone !
    I am having a .Net Windows application (VB.Net) that creates a lot of reports (the same report document for different clients and dates) for exporting them to PDF.
    While the first 75 reports are performed well the 76th report causes an error while creating the window handle and I get an out of memory error as well.
    Searching this forum and the internet I tried a lot of things to get this problem solved:
    - closing, disposing any report as well as setting it to nothing after exporting it to disk (also doing this for used dataset and datatable)
    - doing a single report operation in an own class that is set to nothing immediately after use
    - using garbage collector (methods: "Collect" and "WaitForPendingFinalizers")
    - defining the report, used dataset and datable within "using .. end using" blocks
    - take a single report object for all exports (implemented as singleton)
    - using a background thread to handle report and operation on it
    - changing registry entry "PrintJobLimit" to an higher value as well as to -1
    But none of my tries helped me so far, it's always the 76th report that collapses.
    Interesting thing: Exporting as PDF is not needed for causing the error (switched this off for all reports to test any difference).
    My system:
    - Visual Studio 2008 and .Net 3.5 Service Pack 1
    - Crystal Reports Basic for Visual Studio 2008 Service Pack 1
    Any help is appreciated.
    Thank You very much,
    M.Deister
    Edited by: M.Deister on Sep 20, 2011 2:17 PM

    Hello,
    Saving the report as RPT doesn't save the data which is why it's failing to log on, you have to export it to RPT format, then use that in your test.
    Also, I assume you are using the Report Engine. Try using InProc RAS to load and run the report.
    Just a few lines of code change is all it needs.
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ReportDefModel;
    using CrystalDecisions.ReportAppServer.CommonControls;
    using CrystalDecisions.ReportAppServer.CommLayer;
    using CrystalDecisions.ReportAppServer.CommonObjectModel;
    using CrystalDecisions.ReportAppServer.ObjectFactory;
    using CrystalDecisions.ReportAppServer.DataSetConversion;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    using CrystalDecisions.ReportSource;
    using CrystalDecisions.Windows.Forms;
         public class frmMain : System.Windows.Forms.Form
            CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
    private void btnOpenReport_Click(object sender, System.EventArgs e)
        rptClientDoc = new CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument(); // ReportClientDocumentClass();
        openFileDialog.Filter = "Crystal Reports (*.rpt)|*.rpt|Crystal Reports Secure (*.rptr)|*.rptr";
        //openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
        openFileDialog.FilterIndex = 1;
        //rptClientDoc.MinorVersion();
         if (openFileDialog.ShowDialog() == DialogResult.OK)
              object rptName = openFileDialog.FileName;
            try
                rpt.Load(rptName.ToString(), OpenReportMethod.OpenReportByTempCopy);
                rptClientDoc = rpt.ReportClientDocument;
                btnReportName.Text = rptName.ToString();
                //btnReportName.Text = rptClientDoc.DisplayName.ToString();
            catch (Exception ex)
                MessageBox.Show("ERROR: " + ex.Message);
                return;
            rptClientDoc = rpt.ReportClientDocument;
    Don

  • Query between two Datatables

    Hello
    I'm very new to using Datasets and Datatables so forgive my ignorance; I have extensively searched through the forums but am having problems working out the best way forward. I have two Datatables in an application which are derived from an SQL Data Connection
    using stored SQL queries. The two tables are dtIncrementComplianceManagers and dtIncrementCompliance. 
    At run time, I need the application loop through the rows of dtIncrementComplianceManagers and each time create a new datatable which contains all the rows in dtIncrementCompliance that share the ManagerEmail field with the current row in dtIncrementComplianceManagers .
    This would be used to compose an email to the manager regarding their staff and the application would then move on to the next manager. 
    As an SQL query it would look like this 
    SELECT A.*
    FROM dtIncrementComplianceas A, dtIncrementComplianceManagers as B
    WHERE A.ManagerEmail = B.ManagerEmail
    I'm not sure how to user a query of the existing datatables to populate a new table. This is where it would be located:
    Public Sub RunManagerEmails()
    Me.DtIncrementComplianceManagersTableAdapter.Fill(Me.HRRecruitmentDataSet.dtIncrementComplianceManagers)
    Me.DtIncrementComplianceTableAdapter.Fill(Me.HRRecruitmentDataSet.dtIncrementCompliance)
    For Each Row As DataRow In HRRecruitmentDataSet.dtIncrementComplianceManagers.Rows
    <-----NEW CODE TO GO HERE---->
    Next Row
    End Sub
    Any help would be much appreciated. 

    Hello Leo,
    >>I'm not sure how to user a query of the existing datatables to populate a new table. This is where it would be located
    You could use LINQ to DataSet which has a similar syntax with SQL query:
    LINQ to DataSet
    In your case, you could perform a JOIN operation:
    Query Expression Syntax Examples: Join Operators (LINQ to DataSet)
    For storing the result to a new datatable, you could use the CopyToDataTable:
    https://msdn.microsoft.com/en-us/library/bb386921(v=vs.110).aspx
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Matrix + DataTable re-SELECT problem(s)

    Hi,
    I try to do something like this:
    ScreenPainter -> Simple form with matrix and DataTable as data source for it. All Matrix columns are bounded by aliases to data source. In the Matrix and DT I have got one DOUBLE (price) field and two DATE fields - my sources of problems.
    At the begining everything is OK but next I try to do something like this:
    dt -> DataTable
    mx -> Matrix
    query = "select * from [dbo].[@MY_TABLE] where my_col1 = 'foo'"; // original SELECT statement is without WHERE clause
    dt.Clear();
    dt.ExecuteQuery(query);
    mx.Clear();
    mx.LoadFromDataSource();
    And there are surprises (for me ) because after that, in the DOUBLE field I've got "hash" value and DATE fields are in STRING format eg. 20081103 instead of 08/11/03
    I checked out what values are in DataTable after ExecuteQuery and they are OK.
    Any suggestion(s)?
    BR and Thx,

    Before requery you must unbind the columns inmatrix and bind it again.  I wrote the sample code today to Lars, look there.

  • ObjectListDataProvider issues

    Hello,
    I've got a table bound to an ObjectListDataProvider and everything displays appropriately using the work arounds described in some of the ohter threads. So, I'm not having an issue getting and displaying my list of objects.
    My issue is that I need to allow the user to edit a particular object out of that list so I've added an "Edit..." button to the table. When the button is clicked, I want to find the appropriate object in the list bound to the data provider and allow the user to use data in that object for other purposes on another screen.
    I know how to get the appropriate RowKey and all that stuff for normal dataproviders but for some reason it seems as though the action code associated to the button in this table just doesn't get executed, at all.
    Is there something I'm missing? Has anyone else tried to do anything like this with a table bound to an ObjectListDataProvider? It's just not behaving the same way as the other scenarios I'm using with "normal" providers.
    The action code is just not being executed.
    Any help is appreciated.
    Thanks,
    TJ

    However,
    I can't seem to get the table to recognize that new
    data provider that exists in my session bean.
    Any thoughts as to what I might be missing? I've
    tried building, closing and all that but it just
    doesn't show up as an available data provider???I can't wait until they fix this! That is why, in our blog, I say "Note: You might need to build the project, then close and re-open the project in order for the design-time mechanisms to see the FoodListDataProvider."
    This has got to be a real pain for people, trying to figure out why they can't see the data provider. Here is Winston's write-up on this bug and the other one that you have encountered: http://blogs.sun.com/roller/page/winston?entry=objectlistdp_sample_project

  • Data tables and insertRow() method

    I've seen this question a number of times and no answers yet. Is it possible to create a CRUD page with a data table, without creating additional fields outside of the table, I mean, I saw an example with a single page tabular CRUD, but in order to insert a new row, I had to type the new values outside the table, ain't ther a way to do it with the table only? I've tried appendRow, insertRow (which would be the ideal way, since when a table is paginated it doesn't work). I'm sure it shouldn't be that hard, i'm struggling with this for some days now. Could anyone help me? Thanks.
    My scenario:
    I have a dataprovider, inside my page, that extends ObjectListDataProvider and is set to a class defined by me -> .setObjectClass(UfDTO.class)
    I fill the dataProvider list through another list fetched from the sessionbean:
    .setList(getSessioBean1.getUfList());
    I can delete rows from a checkbox I put into the data table, refresh the data and everything works ok, what i am trying to do, but doesn't work is:
    ufListDataProvider.cursorFirst();
    RowKey first = ufListDataProvider.getCursorRow();
    ufListDataProvider.canInsertRow(first); => returns false!
    If I try the appendRow() it works, but once I try to save, the values entered on the data tables field are lost.

    Yes, I've already looked at the tutorials, there, however, the cachedRowSet is used, and the db table is directly bound to the jsp table, but I don't this tight coupling.
    I can call the appendRow method, however when i call the setValue() method on my properties, they remain null. Just to make thigs clearer, I didn't bind my Hibernate entities to the dataProvider, I used another object that is transformed into one or more entities.
    That's what I have:
    an POJO named UfDTO
    public class UfDTO() {
    private Integer id;
    private String name;
    ...(getters and setters)
    on the SessionBean1
    ObjectListDataProvider listDataProvider...
    listaDataProvider.setObjectType('com.campo.dto.UfDTO);
    public String btnAdd_action(){
    if(listDataProvider.canAppendRow()){
    RowKey rk = ufListDataProvider.appendRow();
    ufListDataProvider.setValue("id", new Integer(0));
    ufListDataProvider.setValue("id", new String());
    return null;
    The code runs fine, with no exceptions, and when I am debugging I can see that after the call to appendRow() a new object is created under the 'appends' properties of the listDataProvider, but even after the calls to setValue, the values of the UfDTO properties into the appends remain null.

Maybe you are looking for