Query regarding inserting a new row at first row data table

hi all,
I have a doubt regarding the insertion of new row in data table.I am now using the following code
if (skillDataProvider.canAppendRow()){
RowKey rowkey = skillDataProvider.appendRow();
skillDataProvider.setCursorRow(rowkey);
String skillID=getSkilID();
skillDataProvider.setValue("Skill.SkillID", rowkey, skillID);
int rowID=Integer.parseInt(rowkey.getRowId());
tableRowGroup1.setFirst(rowID);
Its working fine.But this code gives me provision to add the data at the last of the table.I need it to be at the first row.I tried
RowKey rowkey=skillDataProvider.insertRow(skillDataProvider.getRowKey(String.valueOf(0)));
but it shows some null pointer exception.Can anyone help me?
Thanks in advance
Sree

I think AChervov has the right idea here.
CachedRowSetDataProvider.canInsertRow(beforeRow) returns false, so you cannot insertRow().
Therefore, you'll need to control the sort order yourself. I'd add a sort field to the database. Then use TableRowGroup.setSortCrtieria() to control the table display order. Or commit the append to the database immediately and reselect (refresh) the provider (assuming the provider has the desired "order by").

Similar Messages

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • Row action event on data table does not occur when rows added dynamically

    Row action event on data table does not occur (only refreshes the page) when the rows in the data table are added dynamically at run time using button click and java bean.
    please tell me a way to catch the row click event when adding rows dynamically to data table. i m using RAD 6.0 to develop Faces jsp pages.
    thanks
    amit

    i got the answer

  • Alv colour row select first row

    Hi. I hava an alv with colour in some rows. When i want to select another row distint the first, it always goes to de first row and it doesn't allow me select other row.
    how can i solve this to select for example the third row.
    thanks.

    Hi,
    Are you programatically setting the selection of the ALV row anywhere in your program? This might happen if you set the lead selection of the node in the WDDOMODIFYVIEW method of your view. Can you please check that ? Also you can try changing the selection mode of your ALV:
    lo_config_model_value = lo_interfacecontroller->get_model( ).
    lo_config_model_value->IF_SALV_WD_TABLE_SETTINGS~SET_SELECTION_MODE(CL_WD_TABLE=>E_SELECTION_MODE-AUTO).
    Best Rgds,
    Viqar.

  • How to get the duplicate rows in dynamically generate data table [list items collection] and send emails in sharepoint2010

    Hi,
    i have share point list like  below
    ID   name AdminEmail Useremail   URl   DueDate   UploadSatus
    1    ppp     [email protected]  [email protected]    url  some date    uploaded
    2    yyy       [email protected]   [email protected]   url somedate    empty
    3  xxx         [email protected]   [email protected]    url   somedate   empty
    4  jjj           [email protected]    [email protected]  url     somedate   emp
    AdminEmail and UserEmail  are lookup column
    i using query the list using caml query
    inside of foreach i am checking  two condition like below
    one is upload status in not empty
    i need to send to mail to admin user  this part i have done my adding all list items which have datatable apply group by working fine
    in send condition i am checking difference between DueDate And current date value
    if the value is =1 or -1
    if the value is i
    thank
    i am getting the
    table like below
    ID   name AdminEmail Useremail   URl   DueDate   Upload
    2    yyy       [email protected]   [email protected]   url   somedate    empty
    3  xxx         [email protected]   [email protected]    url   somedate   empty
    4  jjj           [email protected]    [email protected]  url     somedate   empty
    my issue is here  how can i get the dynamic table rows which are same values of AdminEmail and user email  one set and distintict rows are another set
     sets which are same emails are same
    3  xxx         [email protected]   [email protected]    url   somedate   empty
    4  jjj           [email protected]    [email protected]  url     somedate   empty
    set 2
    2    yyy       [email protected]   [email protected]   url   somedate    empty
     how can i get this separate this can any one tell i need to send mail only one time to user [adim and user] .planing to aviod duplicate mail
    Srinivas

    your case better to use the two data tables to store the data
    DataTable dt = list.Items.GetDataTable();
    foreach (DataRow row in dt.Rows)

  • Regarding visibility on/off of inputText bos inside data table

    Hi
    i taken one check box in the first column of data table in JSF,and based on click event of check box i want to enable or disable inputText box/outputText box which is there in other columns in the dat table.
    please help me how to enable or diable the inputText box on the click event of check box.
    Thanks
    Ramakant

    Hello Again,
    I am in the process of writing a custom validator that generates the client side validation for me so I don't have to do anything more the use a tag and give it an error message and it will validate.
    So far things fave been going well except when I use a data table and have the components that are being validated inside the data table.
    In the validator tag I have
      protected FacesContext context = null;
      protected Application application = null; 
      protected UIComponentTag parentTag = null;
      protected UIComponent parentComponent = null;
      public int doStartTag() throws JspException {
        this.context = FacesContext.getCurrentInstance();
        this.application = this.context.getApplication();
        this.parentTag = UIComponentTag.getParentUIComponentTag(pageContext);
        this.parentComponent = parentTag.getComponentInstance();
        return super.doStartTag();
      public int doEndTag() throws JspException {
        String id = parentComponent.getClientId(context);
        /***** Output script that uses the id goes here *****/
    Accourding to the UIComponent JavaDoc getClientId() method should return a consistant value but it is not. When called from within the jsf components renderkit it provides
    [i]Form:Datatable:Row:Component
    But from in my validator it returns
    Form:Datatable:Component
    Which is obviously incorrect. I'm not sure why this is occurring or if it is fixable.
    Thanks again for any help that can be provided.

  • Query Regarding to create new TNS

    Hi,
    I want to create new TNS . Kindly suggest me how I create new TNS?

    I assume "new TNS" means a new connection string (TNS alias). If so, then use Net Configuration Assistant from Oracle menu.
    In alternative you can manually edit your tnsnames.ora, but I strongly recommend the first one.

  • Query regarding insert statement ( help me)

    how to insert 10 rows at a time???
    wheather it is possible??

    Hi user648016!
    What you are looking for is called "Multi Table Insert".
    INSERT ALL
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date, sales_sun)
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date+1, sales_mon)
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date+2, sales_tue)
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date+3, sales_wed)
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date+4, sales_thu)
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date+5, sales_fri)
    INTO sales (prod_id, cust_id, time_id, amount)
    VALUES (product_id, customer_id, weekly_start_date+6, sales_sat)
    SELECT product_id, customer_id, weekly_start_date, sales_sun,
    sales_mon, sales_tue, sales_wed, sales_thu, sales_fri, sales_sat
    FROM sales_input_table;
    For more information about this look here:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#i2163698
    Hope this helps!

  • How to insert a new field without refreshing the data

    Hi,
    I have data of 3 years in a cube. I have to enhance a new field in that cube and i want the data will come from now onwards. I dont wanna have the data for the past 3 years.
    Can anyone tell me how i can load the data of that field into the cube without refreshing the cube as cube has too much data.
    Roma

    Hi Roma,
    It depend up on whether you are adding Cgharacteristic or Key figure. If you are adding key figure then no need to worry.
    Just create the new keyfigure, add this in all your data flow and activate all the objects and assign proper transformation.
    from next load you will get data for this field.
    If you are addign data the this is a bit difficult than key figure. addign characteristic is nothing but you are making changes to your cube dimensions.
    when you are changing your cube dimensions, you should delete the data before you transport the objects.
    You can try once to transport the objects with out deleting data. If it fails then you have to delete the data from Cube.
    Regards,
    Venkatesh.

  • Insert a new Dropdown UI-Element in a Table header

    Hello,
    i need to insert a Dropdown UI-element in a Table header, i was looking in the forum and the Web, BUT i didnt find anythinf that can help.
    please schow me how can I insert a DropDown UI-Element in the Header.
    thank you all

    Hello,
    You can normally create a table. Insert a table column and for the table column you need to give Dorpdown by Key / index as a cell editor.
    Thanks,
    Raju Bonagiri

  • Delete a Row from a Nested Data Table

    Hi... Good day...
    I have a dataTable nested within another DataTable.
    I want to delete a Row from the nested DataTable on clicking a remove Button at the Last column of the Nested DataTable, Jus in the browser.
    How to accomplish this using JavaScript?
    Here is my Code Snippet..
    <h:dataTable value="#{myListBean.rpts}" binding="#{myListBean.parent}" var="item" headerClass ="header" rowClasses = "whiteRow,grayRow" cellspacing="0" cellpadding="4" border = "0"  id = "dataTable">
    <h:column>
         <h:graphicImage id="expand" value="static/images/plus.gif" onclick="showNested(this);" rendered="#{item.schedImgurl=='static/images/scheduled.gif'}"/>
          <div id="#{item.rptId}">
          <h:dataTable id="orderLines" binding="#{myListBean.child}"  value="#{item.scheduleList}" var="schedItem" style="display: none;">
          <h:column>
           <h:outputText value="#{schedItem.scheduleID}" style="display:none;" />
             <f:facet name="header" >
                   <h:outputText value="Scheduled Criteria"/>
              </f:facet>
             <h:outputText value="#{schedItem.scheduleCriteriaName}" />
             <span onMouseOver="JavaScript:showScheduleTooltip(event,'#{schedItem.toolTipCriteraia}')" onMouseOut="JavaScript:hideTooltip()">...</span>
          </h:column>
            <h:column>
           <f:facet name="header" >
          <h:outputText value="Frequency"/>
          </f:facet>
           <h:outputText value="#{schedItem.scheduleFrequency}" />
          </h:column>
          <h:column>
           <f:facet name="header" >
           <h:outputText value="On"/>
           </f:facet>
           <h:outputText value="#{schedItem.scheduleStartDate}" />
          </h:column>
          <h:column>
            <input type="button" value="Remove"onclick=" Remove();"/>
          </h:column>
    </h:dataTable>
    </div>
    </h:column>
    </h:dataTable>Whatz that I need to do inside the Remove() JavaScript Function ?

    Ram_J2EE_JSF wrote:
    How to accomplish this using JavaScript?Using Javascript? Well, you know, Javascript runs at the client side and intercepts on the HTML DOM tree only. The JSF code is completely irrelevant. Open your JSF page in your favourite webbrowser and view the generated HTML source. Finally just base your Javascript function on it.

  • Sql query to Load only new records,or update old records

    Hi,
    I need a query (not stored procedure) to insert only new records otherwise update existing records.
    I tried by creating "Merge statement in SQl", but the sql query is wrong,it is not updating,always inserting records(replicating..1,2,4,8,16,32..).
    below is my sample query,
    Here "FACT_mytbl -FCT" is my fact table.(which need to update if already records found ,otherwise insert as new records).
    *Inside select ---the table   E_tbl1,E_tbl2  is the business logic table ,using this two table only ,"FACT_mytbl" was created  .So the "S" alias will be the source
    table and "FCT" will be target table. based on this we have to insert or update records.   
      ---Query starts-------------------------------------                    
     MERGE INTO [FACT_mytbl]  FCT
     USING  (
           SELECT 
           FCT1.ID
          ,FCT1.PKcol1
          ,FCT1.FKcol1
          ,FCT1.col1
          ,FCT1.col2
         , FCT1.col3     
       FROM  [FACT_mytbl] FCT1 WITH(NOLOCK)        
       LEFT JOIN dbo.E_tbl1 CT WITH(NOLOCK)
    ON CT.PKcol1=FCT1.PKcol1
       LEFT JOIN dbo.E_tbl2 CT1 WITH(NOLOCK)
    ON CT1.PKcol1=FCT1.PKcol1
       ) S  
       ON FCT.PKcol1 = S.PKcol1 
     WHEN MATCHED AND (FCT.PKcol1 ! = S.PKcol1 ) THEN
     UPDATE SET       
           FCT.col1
          ,FCT.col2
          ,FCT.col3     
     WHEN NOT MATCHED THEN 
     INSERT VALUES
           S.ID
          ,S.PKcol1
          ,S.FKcol1
          ,S.col1
          ,S.col2
         , S.col3     
    --query ends----------------
    any suggestions,
    Thanks,
    R.B

    Hi Bhupesh_Rajasekaran,
    According to your description, if you want to insert only new records which does not exist in destination and update existing records which does exist in destination. We usually accomplish these in two statement.
    1.A join statement to update records.
    2.A insert statement for new records.
    Also we can use MERGE in SQL Server to insert, update at the same time. You specify a "Source" record set and a "Target" table, and the join between the two. You then specify the type of data modification that is to occur when the records between the two
    data are matched or are not matched. For more information, there is an similar example about merge in SQL Server, you can review the following article.
    http://www.codeproject.com/Tips/590085/Merge-in-SQL-Server
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to set the first row as selected in single selection of table

    when the page renders how do we make the first row as selected for single selection in a table.
    Thansk a lot for your help

    set the selection Attribute's value to 'Y' for the first row. Thats enough.
    eg;
    Row row=vo.first();
    row.setAttribute("SelectionAttribute", "Y");
    --Prasanna                                                                                                                                                                                                                                                                                                                                           

  • First row is repeting while accessing multiple rows through Database adapte

    Hi,
    Iam using Database adapter in BPEL process to retrive the data from remote database.In Database adapter i have selected select operation and passing input parameter.
    Actually that adapter needs to return 10 different rows though output variable of that adapter.
    Its returing 10 rows but the first row is repeting 10 times.
    Iam not able to get 10 rows.only first row is repeting.
    Please help me in this.
    Thanks in Advance

    Hi Arik,
    I got the solution.The problem is primary key only.
    Your solution correct.
    Thank u very much for answering this question quickly.
    I have changed the primary key its working fine.
    Could u please explain me what is the problem with primay key exactly.
    Thanks in advance,
    Sreeni

  • Cash flow start date and first posting date in REFX-RECN contract

    Hi,
    While reviewing old contracts, I have noticed that in contracts where first posting date is mentioned,  the cash flow start date is not editable in contract change screen.  In contracts where first posting date is not mentioned, the cash flow start date is editable in the change screen.
    Is this standard system behaviour?  Because i have read in the forum that cash flow start date is not editable after first posting of the conditions.
    I tried to change the field status of cash flow start date through RECACUST,  but despite keeping the field status as display,  the cash flow start date remains editable.
    Please help on how to make the field status not editable.
    sadhana

    Hi Sidhharth,
    Thanks a lot for your immediate reply.
    I still have one query.  You have written that
    Where First posting date is not updated it indicates that posting of the contract is yet to be done,not a single posting has been performed hence Cashflow date is editable.
    This means first posting date is always filled up after condition is posted.  but in our system i find that the date is blank and greyed out even after the 1st posting.
    Could it be due to having several conditions in the contract - some with one time posting, some with monthly posting?  eg.most of our contracts have atleast two contions - one for deposit which is one time payment, one for rent.  the first posting date is updated in individual condition for rent in conditions tab  but first posting date in terms tab is blank.     But even in single condition contracts, the first posting date is not getting updated in term tab (the field gets greyout out once contract is activated)
    Thanks once again.
    Sadhana.

Maybe you are looking for