How to make a new row as selected in adf table

Hi,
I am adding a new row to my table as below.
DCBindingContainer bindingContainer =
(DCBindingContainer)ADFUtil.evaluateEL("#{bindings}");
DCIteratorBinding iter = bindingContainer.findIteratorBinding("IfwSystemBrandView1Iterator");
ViewObject vo = iter.getViewObject();
row = vo.createRow();
row.setNewRowState(Row.STATUS_INITIALIZED);
vo.insertRow(row);
This code is adding a new row at the end of the table.
I want this new row to be selected after it gets added.
How to achieve this??
Thanks,
Praveen

You should mention your JDev version!!!!
in 11g you can archive this like
BindingContext bctx = BindingContext.getCurrentInstance();
BindingContainer bindings = bctx.getCurrentBindingEntry()
DCIteratorBinding dcIterator =
(DCIteratorBinding) bindings.get("IteratorBindingName");
Row rw = dcIteratorBinding.getRowSetIterator().createRow();
rw.setNewRowState(Row.STATUS_INITIALIZED);
//insert row to iterator
dcIteratorBinding.getRowSetIterator().insertRow(rw);
//make new row the current
dcIteratorBinding.setCurrentRowWithKey(
rw.getKey().toStringFormat(true));or better if you have access to the table (
private void createRowInTable(RichTable table){
CollectionModel model = (CollectionModel ) table.getValue();
JUCtrlHierBinding _binding = (JUCtrlHierBinding) model.getWrappedData();
DCIteratorBinding dcIteratorBinding= _binding.getDCIteratorBinding();
Row rw = dcIteratorBinding.getRowSetIterator().createRow();
rw.setNewRowState(Row.STATUS_INITIALIZED);
//insert row to iterator
dcIteratorBinding.getRowSetIterator().insertRow(rw);
//make new row the current
Key k = rw.getKey();
dcIteratorBinding.setCurrentRowWithKey(k.toStringFormat(true));
}Timo

Similar Messages

  • How to add entire new row at the top of table in pdf report from c# windows forms using iTextSharp

    Hi for past 3 days i was thinking and breaking my head on how to add entire new at top table created in pdf report from c# windows forms with iTextSharp.
    First: I was able to create/export sql server data in form of table in pdf report from c# windows forms. Given below is the code in c#.
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Text;
    using System.Data;
    using System.IO;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    namespace DRRS_CSharp
    public partial class frmPDFTechnician : Form
    public frmPDFTechnician()
    InitializeComponent();
    private void btnExport_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    PdfPTable inner = new PdfPTable(1);
    inner.WidthPercentage = 115;
    PdfPCell celt=new PdfPCell(new Phrase(new Paragraph("Institute/Hospital:AIIMS,NEW DELHI",FontFactory.GetFont("Arial",14,iTextSharp.text.Font.BOLD,BaseColor.BLACK))));
    inner.AddCell(celt);
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(inner);
    doc.Add(table);
    doc.Close();
    The code executes well with no problem and get all datas from tables into table in PDF report from c# windows forms.
    But here is my problem how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    As the problem i am facing is my title or Header(DCS Clinical Report-Technician wise) is at top of my image named:logo5.png and not coming to it's center position of my image.
    Second the problem i am facing is how to add new entire row to top of existing table in pdf report from c# windows form using iTextSharp?.
    given in below is the row and it's data . So how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    as you can see how i create my columns in table in pdf report and populate it with sql server data. Given the code below:
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    So my question is how to make my column headers in bold?
    So these are my questions.
    1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?
    I know that i have to do some modifications to my code but i dont know how to do it. Can anyone help me please.
    Any help or guidance in solving this problem would be greatly appreciated.
    vishal

    Hi,
    >>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?<<
    I’m sorry for the issue that you are hitting now.
    This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
    http://sourceforge.net/projects/itextsharp/
    Thanks for your understanding.
    Regards,
    Marvin
    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.

  • How to make a single row as editable in a table view?

    Hello Friends,
    As per the requirement,i have created a new table view with table row level actions. But I am able to achieve the delete functionality. But for edit action, if i lock the corresponding entity also it is not becoming as edit.
    Let me know any ideas to achieve this??
    Thanks in Advance.
    Regards,
    Ravi

    Hi Raviteja,
    In your row level buttons if you want to edit a row you have to fallow this steps..
    1) get the selected record by using index.
    2) get the action mean which action you want to perform ( edit or delete like).
    3) lock the current entity.
    4) get the custom or comp controller instance based on get the current record.
    5) edit the row..
    sample code for this..
    DATA:
         lv_index          TYPE int4,
         lr_current        TYPE REF TO if_bol_bo_property_access,
         lr_entity         TYPE REF TO cl_crm_bol_entity,
         lv_event          TYPE string,
         lv_dummy          TYPE string,
         lr_core           TYPE REF TO cl_crm_bol_core,
         lv_one_click_lock TYPE sysubrc,
         lr_col            TYPE REF TO if_bol_bo_col,
         lr_coco           TYPE REF TO component ctrl class name (impl class),
         lr_cuco           TYPE REF TO custom cntrl class name ( impl.)
       CALL METHOD cl_thtmlb_util=>get_event_info
         EXPORTING
           iv_event = htmlb_event_ex
         IMPORTING
           ev_index = lv_index.
       CHECK lv_index IS NOT INITIAL.
    * Get the current entity
       lr_entity ?= me->typed_context->urcnode->collection_wrapper->find( iv_index = lv_index ).
       CHECK lr_entity IS BOUND.
    * Get the action clicked on
       SPLIT htmlb_event_ex->event_defined AT '.' INTO lv_event lv_dummy.
    * Try to lock the current entity
       lv_one_click_lock = cl_crm_uiu_bt_tools=>set_one_click_lock( me->typed_context->cnode->collection_wrapper ).
       CASE lv_event.
    *   Edit the current Partner
         WHEN 'EDIT'.
           IF lv_one_click_lock <> 2 AND lr_entity->is_send_active( ) = abap_true.
             lr_coco ?= me->comp_controller.
             CHECK lr_coco IS BOUND.
             lr_current = lr_coco->typed_context->cnode->collection_wrapper->find( iv_bo = lr_entity ).
    *       if entity is not yet there: add it to component controller collection
             IF lr_current IS NOT BOUND .
               lr_coco->typed_context->cnode->collection_wrapper->add( lr_entity ).
               lr_current = lr_coco->typed_context->cnode->collection_wrapper->find( iv_bo = lr_entity ).
             ENDIF.
             CHECK lr_current IS BOUND.
             lr_cuco ?= me->get_custom_controller( 'compname/cnameCuCo' ). "#EC NOTEXT
             lr_cuco->typed_context->cnode->on_new_focus( lr_current ).
             me->set_editable( ).
           ENDIF.
    if this is not work then go through this link..
    OCA edit button problem
    Thanks & Regards,
    Srinivask

  • How can I filter the rows displayed on an ADF Table ? pls help urgent..

    Hi All,
    I have a page with ADF readonly table, based on who is logging in I want to filter the rows to be displayed when the page is firstly loaded. This page is called from the main menu.
    I have created a custom method in the Application Module Impl :
    public void setInvoiceFilter () {
    ViewObject vo = findViewObject("BrowseInvoice1");
    ViewCriteria vc = vo.createViewCriteria();
    ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
    vcr1.setAttribute("Userid","xxxx");
    vc.add(vcr1);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    The question is : where and how should I call this method ?
    is this a correct approach ?
    Thank you very much for your help,
    xtanto

    I assume you're talking about a JSF application.
    I think you should be able to do this in the constructor of a backing bean.
    1) Add an operation binding, bound to your service method, to the page's pageDefinition.
    2) On the JSF page flow Overview tab, add a managed property to the backing bean. Call it, say, myMethod, give it type oracle.bindings.OperationBinding, and give it the value #{bindings.nameOfYourOperationBinding}
    3) Add a myMethod field of type OperationBinding, with getter and setter, to your backing bean class.
    4) In the backing bean class's constructor, add code like:
    myMethod.execute();This will execute the method every time the page is loaded.
    Now, if you want to execute the method only the first time the page is loaded, it's a bit trickier. You need to set, and use, a session variable:
    Map sessionVars = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
    if (sessionVars.get("hereBefore") == null)
      myMethod.execute();
      sessionVars.put("hereBefore", "true");
    }

  • How to get selected row data of an ADF table in HashMap?

    Hi,
    Can anyone please tell me how to selected row data of an ADF table in HashMap like :
    Object obj = pageTable.getSelectedRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)obj;
    Now in above code I want the convert rowData in HashMap.
    Can anyone please tell me how to do that? Its urgent.
    Thanks,
    Vik

    Vik,
    No need to ask the same question 3 times...
    In [url http://forums.oracle.com/forums/message.jspa?messageID=4590586]this post, Nick showed you how to get the Row.
    If it were so urgent, you could have done a little reading of the javadocs to come up with code like this (not tested, up to you to do that)
    HashMap m = new HashMap();
    Row r = get it like Nick showed you to;
    Object values[]=r.getAttributeValues();
    String names[]=r.getAttributeNames();
    for (int i=0; i<r.getAttributeCount(); i++)
    m.put(names, values[i]);

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • How to make a new section visible in the server published version

    I use UPK 12 Client.
    When I click "Link a new section" in an existing Module, I can see it in the outline in the left pane in my UPK 12 Developer. When I then check-in all items, click Publish > select c: drive (a test folder) > Publish entire outline, the outcome includes the new section created.
    When I do the exact same procedure, but choose to click Publish > server (which is set up for my UPK) > Publish entire outline, the outcome does NOT include the new section created, but everything else yes.
    How to make the new section visible in the server published version?
    Thanks!
    Sille

    Hi Sille,
    Are you publishing over knowledge center? or is it publishing to a network drive? Once you check in the section save the module once and try again. See if it makes any difference.
    best regards,
    SD

  • 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                                                                                                                                                                                                                                                                                                                                           

  • A have a white screen how to make a new installation of my computer

    A have a white screen how to make a new installation of my computer

    More details would help...what have you done to get to a white screen?  Were you in the process of reinstalling Mac OS X?  Or something else?
    In general, to reinstall Mac OS X, restart the Mac and hold the Command and R keys.  From the Utilities drop down select Install Mac OS X and the system will download the installer.  You w I'll then follow the instructions to install.
    By the way, you posted in the iMac PPC forum, this belongs in Yosemite from what you show on your info line, I will ask for relocation.

  • HT4759 How to make a new icloud?

    How to make a new i cloud ??

    If you want to change to a new iCloud accout you'll have to delete the account, create a new account with the other ID, and migrate your data to the new account.
    Before deleting the account, if you have any photos in photo stream that are not in your camera roll or backed up somewhere else save these to your camera roll or you will lose them.  To do this, open the photo stream album in the thumbnail view, tap Edit, tap all the photos you want to save, tap Share, then tap Save to Camera Roll.
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account. When prompted about what to do with the iCloud data, be sure to select Keep On iPhone.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.

  • How to make a new file folder on screen?

    How to make file folder on screen?
    How to make a new window in browser?

    me1965 wrote:
    How to make file folder on screen?
    How to make a new window in browser?
    Don't know what OS you have so this info is for ICS.
    To make a folder on screen, long press on one app and drag and drop it on top of another app.  You will kinda see both apps there now and when you touch it a folder will open up and you can choose one of the apps.  You will also now be given a chance to name the folder.
    To open a new window in the chrome browser, tap on the menu button (the 3 verticle dots in the upper right hand corner of the screen) and click "new tab"
    If you have a different OS, let us know and someone will post the answer to your questions.

  • How to insert a new row in the middle of an set of rows

    Hi
    How to insert a new  row in the middle of an set of rows ? and How to Reset the line id after the new row added ?
    Regards,
    Sudhir B.

    Hai,
    just try this,
    Instead of using omatrix.Addrow(1,-1) use like
    omatrix.AddRow( RowCount , Position)
    RowCount
    The number of rows to add (default is 1)
    Position
    The position of the new rows (0-based; default is -1, meaning append row to the end)
    After adding rows in matrix For, sno.
    for i=1 to omatrix.visualrowcount
    otext=omatrix.getcellspecific("columnid",i)  '--where columnid is the unique id of the sno column
    otext.value=i
    next i
    Hope this helps you.
    Thanks & Regards,
    Parvatha Solai.N

  • How can I add new row/column into existing jTable?

    Hi add!
    Can you help me how can I add new row/column into existing jTable?
    Tnx in adv!

    e.g
    Create two buttons inside the Table ( "Add New Row" ) and ("Add new Column")
    their handlers are:
    add new row:
    //i supose u already have
    DefaultTabelModel tablemodel = new DefaultTableModel(rowdata, columnNames);
    //and   
       JTabel jtable = new JTable(tablemodel);
    // Handler (row)
    jbtAddRow.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent e) {
          if(jtable.getSelectedRow() >= 0 )
              tablemodel.insertRow(jtable.getSelectedRow(), new java.util.Vector());  
           else  
                tablemodel.addRow(new java.util.Vector());
        });to add new columns its the same but inside actionPerformed method:
    ask for e.g "Whats the name for the new column"
    then,
       tablemodel.addColumn(nameOfColumn, new java.util.Vector());   Joao
    Message was edited by:
    Java__Estudante

  • I can't make a new level through selection (Adobe Photoshop Elements 9/Windows 7)

    It doesn't work: make a new level through selection. It shows every time an error message:It don't work because of a bug.

    dh991408 a écrit:
    Yes I want to create a new layer with a selection, but i doesn't work. An error messae says that there's a bug.
    *I serarch on this page, but the page told me that the forum is just in english
    Just in english? Not necessarily, you'll find discussions in German too, and forum users can use the 'translate' button on the right part of the bottom action bar.
    I can understand German and if it's a question I can't answer myself, I'll provide the translation if you wish for more competent users. I don't use the projects myself, as I prefer to work totally manually; if you state which kind of Elements project you are doing, others may better understand your problem.
    Generally, copying a selection on a new layer is done with the keyboard shortcut 'Ctrl J'.
    Can you give the exact error message in German?

  • How to make a "new photo to publish" be considered "published" without actually publishing it?

    how to make a "new photo to publish" be considered "published" without actually publishing it?
    I have some photos that are really just stubs that represent the other "real" photos to publish.
    I don't want to have to do a mock export/rendering of them just to make them appear published.
    Any ideas?
    Rob

    In one of my plugins I have a requirement to download and add photos from the remote server and populate the newly created published collection in Lightroom.  In this routine, I use the following code to add the images to a published collection using the method provided by Don above.
    [code]
    catalog:withWriteAccessDo('createcollection', function()
         newcollection = v:createPublishedCollection(h.title)
         newcollection:setRemoteId(h.id)
    end)
    catalog:withWriteAccessDo( 'NPGSetUpdates', function()
         newphoto = catalog:addPhoto(newpath)
         newcollection:addPhotoByRemoteId(newphoto,p.id,p.url,true)
    end)
    [/code]
    The biggest thing here is that adding a photo like this requires the code to reside within the withWriteAccessDo block.

Maybe you are looking for