Table with add and remove row function

i want to have table that function like exactly like email table in yahoo or hotmail or any. the last column will have the checkbox an there is a button that reside on the top of the table that is used to delete all the checked data. i have tried to use AbstractTableModel with the data of type object[] but i don't know how to make the addRow and removeRow. can anyone help me i'm stuck!
[Delete all check data] <-- jButton
names | contact no | email | delete |
john | 0000000000 | [email protected] | [] <-- checkbox
tom | 0000000000 | [email protected] | [] <-- checkbox

Is this really difficult ???
Just use DefaultTableModel, use addRow method for add row, and use removeRow method to remove a row.
Just loop your all table rows, get value at first column like:
for( int i = 0; i < tableModel.getRowCount(); i++ ){
    //i assume you have checkbox in first columun of your table
    Boolean isSelected = ( Boolean )tableModel.getValueAt( i, 0 );
    if( isSelected.booleanValue() ){
        tableModel.removeRow( i );
}

Similar Messages

  • ADOBE Forms Central - add and remove rows (PDF Form)

    Hello, I am currently evaluating ‘ADOBE Forms Central' to set up a form with editable fields. I have set up a test form in ADOBE Forms Central and was unable to insert an option to add and remove rows similar to the print screen attached. Is this possible to do using ADOBE Forms Central or should I be using
    a different ADOBE application? Thank you, Liz

    A dynamic XFA PDF form can do this. You can create such forms with LiveCycle Designer, which was included with the Windows version of Acrobat Pro prior to version 11. It is now a separate product.
    XFA forms can't be used with FormsCentral, however, only Acroforms can.

  • UDO: Add and Remove rows to/from Matrix.

    Hi all,
    Yes, I know there are lots of topics about adding and removing rows but I was having trouble with these and I need some expert's opinion.
    I'm working with a Document type UDO, with 1 header table (ADAT_ONR) and 1 child table (ADAT_NR1 -  MatrixUID = "mtx_NR").
    I add the first row when the user chooses the business partner.
    If oMatrix.RowCount = 0 Then
         oMatrix.AddRow()
          oMatrix.AutoResizeColumns()
         oMatrix.Columns.Item("V_LineId").Cells.Item(1).Specific.Value = 1
    End If
    Then, the user has to press the AddRow button to add new rows, and the user can only add 1 new blank row. Later I'll change the row adding behavior to mimic B1s.
                If pVal.BeforeAction = False Then
                    Select Case pVal.ItemUID
                        Case "AddRow"
                            'ItemHandler_Click = AddRow(oCompany, oApplication, oForm, oForm.Items.Item("mtx_NR").Specific.RowCount())
                            oMatrix = oForm.Items.Item("mtx_NR").Specific
                            If oMatrix.RowCount > 0 Then
                                If Trim(oMatrix.Columns.Item("V_PltCode").Cells.Item(oMatrix.RowCount).Specific.Value) = "" Then
                                    oApplication.StatusBar.SetText(TranslateStr(oApplication, MustChoosePallet), BoMessageTime.bmt_Short)
                                    Exit Function
                                End If
                            End If
                            ItemHandler_Click = NewLine(oCompany, oApplication, oForm)
                            Exit Function
        Private Function NewLine(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, _
            ByRef oForm As SAPbouiCOM.Form) As Boolean
            NewLine = False
            Try
                oMatrix = oForm.Items.Item("mtx_NR").Specific
                Dim Index As Integer = oMatrix.RowCount
                With oForm.DataSources.DBDataSources.Item("@ADAT_NR1")
                    .Clear()
                End With
                oMatrix.AddRow()
                oMatrix.Columns.Item("V_LineId").Cells.Item(Index + 1).Specific.Value = (Index + 1).ToString
                oMatrix.FlushToDataSource()
                oMatrix.LoadFromDataSource()
                oForm.Refresh()
                NewLine = True
            Catch ex As Exception
                oApplication.MessageBox("NewLine(): " & oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
            End Try
        End Function
    When I Add or Update the data, I clear the last blank row, if it exists.
               '// In the Click Event
               If pVal.BeforeAction = True Then
                    Select Case pVal.ItemUID
                        Case "1"
                            If oForm.Mode <> BoFormMode.fm_FIND_MODE Then
                                oMatrix = oForm.Items.Item("mtx_NR").Specific
                                oMatrix.FlushToDataSource()
                                oMatrix.LoadFromDataSource()
                                If Trim(oMatrix.Columns.Item("V_PltCode").Cells.Item(oMatrix.RowCount).Specific.Value) = "" Then
                                    oForm.DataSources.DBDataSources.Item("@ADAT_NR1").RemoveRecord(oMatrix.RowCount - 1)
                                    oMatrix.DeleteRow(oMatrix.RowCount)
                                    'oMatrix.FlushToDataSource()
                                End If
                            End If
                    End Select
    My question is, Is there an easier way to Add and Delete Rows??
    BTW, I still have a problem so solve. With this code, when the user deletes a row the row numbering is incorrect. Example: if I have to rows in a matrix and I delete row nº1, row nº2 will hold the same number...
    Any Ideas?
    Thanks in advanced,
    Vítor Vieira

    Hi Victor,
    there is a Form Data event which you ca use in that try to write the code for adding a row after updating and delete a row while inserting and add a row while traversing.
    sample code.
    Sub FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean)
            Try
                Select Case BusinessObjectInfo.EventType
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD, SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE
                        If BusinessObjectInfo.BeforeAction = True Then
                            objForm = objMain.objApplication.Forms.Item(BusinessObjectInfo.FormUID)
                            oDBs_Head = objForm.DataSources.DBDataSources.Item("@Header")
                            oDBs_Detail= objForm.DataSources.DBDataSources.Item("@Line")
                            objMatrix = objForm.Items.Item("83").Specific
                            If objMatrix.VisualRowCount <> 0 Then
                                objMatrix.DeleteRow(objMatrix.VisualRowCount)
                                objMatrix.FlushToDataSource()
                            End If
                            If BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD Then
                                End If
                        ElseIf BusinessObjectInfo.ActionSuccess = True Then
                            objForm = objMain.objApplication.Forms.Item(BusinessObjectInfo.FormUID)
                            If BusinessObjectInfo.EventType =                    SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE Then
                                objMatrix = objForm.Items.Item("83").Specific
                                objMatrix.AddRow()
                                SetNewLineCharge(objForm.UniqueID, objMatrix.VisualRowCount)
                                objMatrix.FlushToDataSource()
                              End If
                        End If
                    Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD
                        If BusinessObjectInfo.ActionSuccess = True Then
                            oDBs_Head = objForm.DataSources.DBDataSources.Item("@Header")
                           oDBs_Detail = objForm.DataSources.DBDataSources.Item("@Line")
                            objMatrix = objForm.Items.Item("83").Specific
                            objMatrix.AddRow()
                            SetNewLineCharge(objForm.UniqueID, objMatrix.VisualRowCount)
                            objMatrix.FlushToDataSource()
                           End If
                End Select
                End Sub
    Hope this helps,
    OM Prakash

  • Add and Remove rows

    Hi,
    I have 2 tables, and I needed to add/remove some rows from the first table to the second.
    I've followed the tutorial: Link: [Add and Remove from a List|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/927d8c3c-0a01-0010-57b4-e89f505e2bff] and it works great!
    But the user can add two or more times the same row, so I need to avoid that. The user should be able to add every row only once!!
    I thought about some condition on button Add (for example, disable the ADD button if the same row is present in both tables, but it didnt work).
    Any ideas to achieve that?
    Thanks in advance!
    Best Regards
    Marcelo.

    Hi again Ahmed
    I've solved my problem, but now I'm facing a new issue about the same topic. 
    Following your tips, I've found a solution, but now, I need to copy a complete field of a table to the data store.
    For example, my table has 4 field (country, key, name and city), and I need to copy ALL the key values to the data store. So, if I have 4 rows in the table, let's say "key1", "key2", "key3", "key4"
    I've reached a solution, but it involves to walk throught the entire table, selecting every row automatically (I use a spinner) and "copying" every key field of every row to the data store. When I say "copying" I mean adding it to the same virtual field of the data store, that is to say, concatenating the key values one after another.
    The problem arises when the table has more than 100 records, because 100 is the top value that a spinner can reach.
    Any ideas about can bypass that limit?
    Thanks in advance, your help is really appreciated.
    Best regards
    Marcelo

  • How to add and remove rows and keep track of it

    hi all,
    i hv an issue
    im developing a page which will hv remove and add buttons for 3 categories
    on clicking it it should add r remove HTML table rows respective to which category button is pressed. and also i should track the number of rows added or deleted for a particular category.
    Is it possible with JSP
    a sample code wil also help me a lot
    thanks in advance

    i could not under how ur page structure is but i will try to tell what i used in such a situation where u have to add or remove some elements from the page based on wht the user chooses.
    I put buttons linking to the same page with a variable containing the row id in the url (http://something.com?id=10')
    while displaying the records i will be iterating througnh the data row by row and displaying the text in the table.
    but when i find a row id equal to the rowid passed i display it in another format with a form and text boxes to edit the data and a submit button to submit the data
    like...........
    while (rs.next())
         if(rs.getString("recid").trim().equalsIgnoreCase(request.getParameter("recid").trim()))
    %>
         <form name="form2" method="post" onsubmit="javascript:return ValidateForm(form2)" action="camp_update_msg_a.jsp">
         <tr class="colstyle3">
              <td width="5%" valign="middle"><%= rs.getString("questionno").trim() %></td><td><TEXTAREA NAME="question" COLS=35 ROWS=4 ><%= rs.getString("question").trim() %></TEXTAREA></td><td><TEXTAREA NAME="answer" COLS=15 ROWS=4 ><%= rs.getString("answerno").trim() %></TEXTAREA></td>
              <td><INPUT id="submit1" type="submit" value="Submit"></td><td><a href="camp_del_msg.jsp?campid=<%=request.getParameter(campid").trim() %">&recid=<%= rs.getString("recid") %>">Delete</a></td>
         </tr>
         </form>
    <%           }
    else
         { %>
         <tr class="colstyle3">
              <td width="5%" valign="middle"><%= rs.getString("questionno").trim() %></td><td><%= rs.getString("question").trim() %></td><td><%= rs.getString("answerno").trim() %></td>
              <td><a href="camp_edit_msg.jsp?campid=<%=request.getParameter("campid").trim() %>&recid=<%= rs.getString("recid") %>">Edit</a></td><td><a href="camp_del_msg.jsp?campid=<%=request.getParameter("campid").trim() %>&recid=<%= rs.getString("recid") %>">Delete</a></td>
         </tr>
    <%
    I think this information is helpful to u.......
    Good luck.............</a>

  • Problems with add() and remove() in my Doubly Circular Linkedlist code

    I have been working on this code for 6 hours and some how it won't remove correctly when the list has 0,2,4 elements.
    It will attempt to remove element at index 0 but actually removed 4. I thought it was the reference problem at first, so i did something to my add() method so that it reference head to tail, tail to head. But still, the code doesn't work.
    The problem seem to be how to remove the element at index 0. If anyone has any ideas, please let me know.
    Add:
    public void add(T item) {
              if (isEmpty()){     
                   Node<T> n = new Node<T> (null,item,null);     
                   head = n;
                   tail = n;
                   head.setNext(tail);
                   head.setPrev(tail);
                   tail.setNext(head);
                   tail.setPrev(head);
              else{
                   Node<T> n = new Node<T> (tail,item,head);
                   n.getPrev().setNext(n);
                   tail=n;
                   head.setPrev(tail);
                   tail.setNext(head);
              size++;
         }Remove:
    public T removeAt(int index) {
              Node<T> target = getNode(index);
              //System.out.println(target.getValue());
              if (index>size()||index<0){
                   throw new IllegalArgumentException
                        ("Can't remove anything out of the list.");
              if (isEmpty()){
                   throw new NoSuchElementException
                        ("Can't remove from empty list.");
              }else {
                   if (target.getNext().equals(target.getPrev())){
                        target.getNext().setNext(null);
                        target.getPrev().setPrev(null);
                   }else{
                   System.out.println("target prev: "+ target.getPrev().getValue());
                   System.out.println("target: " + target.getValue());
                   System.out.println("target next: "+ target.getNext().getValue());
                   target.getPrev().setNext(target.getNext());
                   target.getNext().setPrev(target.getPrev());
                   size--;
              return target.getValue();
         }

    size won't ever reach -1 since it won't -1 if isEmpty() returns true in getNode().
    The procedure is, if I can get the node, i will try to remove it, if i can't even get it, nothing will run in removeAt (idx) except the first line.
    public T removeAt(int index) {
              Node<T> target = getNode(index);
              if (size()==1){
                   head=tail=null;
                   size=0;     
                   return null;
              }else if (size()==2){
                   if (index==0)                      // first but not the last.
                        target.getNext().setPrev(null);
                        target.getNext().setNext(null);
                   if (index==1)                   // last but not the first.
                       target.getPrev().setPrev(null);
                        target.getPrev().setNext(null);
              }else{
                        System.out.println("target prev: "+ target.getPrev().getValue());
                        System.out.println("target: " + target.getValue());
                        System.out.println("target next: "+ target.getNext().getValue());
                        target.getNext().setPrev(target.getPrev());
                        target.getPrev().setNext(target.getNext());
                   size--;          
              return target.getValue();
         }

  • Problem with creating and deleting row in table

    Hi
    I'm using JDev11.1.1.2.0. I have a table "A" with primary key X -> CHAR(1). I have created Entity and ViewObject (with the primary key X).
    I created an editable Table with CreateInsert and Delete actions.
    When I click Insert, a new record is added and I enter some data. Then I move selection to some other row, and return back to the new row. When I press Delete, It does not delete the new row, but the previous one selected.
    In the console, when I navigate back two the new added record: <FacesCtrlHierBinding$FacesModel><makeCurrent> ADFv: No row found for rowKey: [oracle.jbo.Key[null ]].
    I tried the same scenario with a different table, that has RowID as a primary key and it works correctly.
    Any Idea why this is happening ? I suppose it's connected somehow with the primary key.
    Thanks
    agruev
    Edited by: a.gruev on Nov 26, 2009 9:47 AM

    I changed my entity: unchecked the X column to be primary key added RowID as a primary key. Now it works.
    What's wrong with my CHAR(1) as a primary key ?
    I also tried to add a Refresh button:
      <af:commandButton text="Refresh" id="cb3"/>and in the table add a partialTarget to the button. Now when I add new row and press the Refresh button - then it works.
    So it seems that the problem is when I add new row and enter data, the table is not refreshed and the row is missing it's primary key.
    Any solutions?
    Edited by: a.gruev on Nov 26, 2009 4:18 PM

  • Need to Add and Remove Columns of ADF Read Only table from Backing bean

    I have a scenario where I am trying to Populate TransientVO which is shown has a ADF Read Only Table in page.
    I have couple of Check Boxes Based on their selection I am trying to render and hide certain Columns.
    But the Issue which I am facing is only the Column Header seems to change where as the Rows and Values doesnt..
    even If I apply the expression language rendering condition on the outputText inside those columns.. ..
    So I am thinking to add and remove VO Attribute columns to the table from backing bean.
    Need some sample code snippet or a better design to achieve this. Its kind of urgent too...having an aggressive deadline :(
    Please chip in People..
    Thanks in Advance .
    TK

    Table Code..
    <af:table value="#{bindings.InventoryGridTrans.collectionModel}"
                                    var="row"
                                    rows="#{bindings.InventoryGridTrans.rangeSize}"
                                    emptyText="#{bindings.InventoryGridTrans.viewable ? 'No data to display.' : 'Access Denied.'}"
                                    fetchSize="#{bindings.InventoryGridTrans.rangeSize}"
                                    rowBandingInterval="0" id="t4"
                                    partialTriggers="::sbcSales ::sbcUsage ::cb1">
                            <af:column sortProperty="Period" sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Period.label}"
                                       id="c38">
                              <af:outputText value="#{row.Period}" id="ot33"/>
                            </af:column>
                            <af:column sortProperty="Past12SalesCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12SalesCount.label}"
                                       id="c29"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                              <af:outputText value="#{row.Past12SalesCount}"
                                             id="ot40"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12SalesCount.format}"/>
                              </af:outputText>
                            </af:column>
                            <af:column sortProperty="Past12UsageCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12UsageCount.label}"
                                       id="c40"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                       visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                              <af:outputText value="#{row.Past12UsageCount}"
                                             id="ot47"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12UsageCount.format}"/>
                              </af:outputText>
                            </af:column>
                            </af:column>
                    </af:table>

  • Trouble with parallel add and remove effect in TileList

    We have a TileList of images.  As the user drags a new image along the list (deciding where to drop it) a blank frame drops in to show them where it will be inserted when they drop it.  Therefore, I have to add and remove simultaneously, while still dragging.  For example if they are at index zero, a blank frame is in index zero.  As they move to 1, the blank frame appears to move from index zero, to index one, as the image that was at index one appears to move to index zero.  But what I'm really doing is just removing and then adding the blank frame.
    I think the following code should accomplish this.  And it works, most of the time.  Every so often, there is a delay where is does the REMOVE, and then waits until the Back.easeOut tween is complete, and then does the ADD.   It is intermittent.  Any ideas, or is there a better way to do it?  Thanks
    MXML code:
        <mx:Sequence id="myEffect">
            <mx:Parallel>
                <mx:Move
                    duration="600"
                    easingFunction="{Back.easeOut}"
                    />
                <mx:RemoveItemAction id="dcmRemoveItemActionTag"
                                     />
                <mx:AddItemAction  id="dcmAddItemActionTag"
                                   />
            </mx:Parallel>
        </mx:Sequence>
    actionscript code:
                    _sharedMedia.removeItemAt(_sharedMedia.getItemIndex(_dropPlaceHolderimage));
                    _sharedMedia.addItemAt(_dropPlaceHolderimage,dropIndex);

    hi,
    You could do this a couple of ways, you could have a slight delay set on the remove effect so that it doesn't interfere with the ease function.
    or
    You could add the item instead of an empty frame, on the dragdrop event you don't need to do anything if you get a dragexit triggered then you simply remove the item completely.
    David

  • Row Level PPR in Advanced Table with Add More Rows Button

    <br>
    I have programmatically fired PPR event on MessageChoice. But it is in Advanced Table with
    Add More Rows Button. When the value is changed in MessageChoice I Show/Hide Custom LOV
    through SPEL like this ${oa.BioEmployeePVO.EmpManagerRender} .
    But it is <b>hiding the all the ROWS</b> not just the row where the value has been changed.
    I even tried with this code and get NULL for rowReference.
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    In Processrequest()
    String pageName = pageContext.getRootRegionCode();
         Hashtable params = new Hashtable (1);
         params.put ("param1", pageName);
         Hashtable paramsWithBinds = new Hashtable(1);
        paramsWithBinds.put ("param2",new OADataBoundValueFireActionURL (mcb, "{$AttendeeType}"));
        mcb.setFireActionForSubmit ("empPositionChange", params, paramsWithBinds,false, false);
    In ProcessFormRequest() {
    if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))   
          String rowReference = pageContext.getParameter("param2");
        //    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
         Serializable[] parameters = { rowReference };
          am.invokeMethod("handlePositionChangeEvent", parameters);
    <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    HI Kumar,
    Answer to your last post is "yes".
    Now to your doubt regarding the code:
    Hi Anna
    I am trying to understand your code.
    FireAction firePartialAction = new FirePartialAction("fireHideEvent"+(i/noOfTlaColSpan));
    HideImgBean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
    1. What is this i/noOfTlaColSpan ?
    :)Forget abt this in your case it should be the event name which u r firing and capturing the it in the PFR.
    Like FireAction firePartialAction = new FirePartialAction("YOurEventName");
    and in PFR u can capture tht as:
    if("YOurEventName".equals(pageContext.getParameter(EVENT_PARAM)))
    //your logic to invoke AM method
    2. I believe this HideImgBean would be MessageChoice for me?
    :)Yep ur right
    3. This brcdOhInventoryViewUpdateVOImpl would be the Custom PVO(Extending Seeded Base VO)
    I create by adding the transient attributes?
    :)Yep ur right
    4. I cannot understand this code. Could you explain.
    :)Please look at my comments in some of the lines .I have explained wht i am doing
    if(updateIter==null)
    updateIter[0]= invViewVO.createRowSetIterator("updateIter");//This initViewVo should be ur custom VO object
    if(cnt>0)
    updateIter[0].setRangeStart(0);
    updateIter[0].setRangeSize(cnt);
    for(int i=0;i<cnt;i++)
    row = (brcdOhInventoryViewUpdateVORowImpl)updateIter[0].getRowAtRangeIndex(i);
    String selectFlag=(String)row.invokeMethod("getPartNumber");//This getPartNuber should be replaced by the Prim Key inoke methd of ur VO
    if(RowID.equals(selectFlag))
    //This is my logic to set the transient attributes based on the msgChoiceBean value ..u have to pass the value when u invoke this method
    if(reserveMethod.equals("BINARY"))
    System.out.println("In Binary");
    Boolean bVal= new Boolean("false");
    Serializable sr[]={bVal};
    Class []methodParamTypes = { bVal.getClass() };
    row.invokeMethod("setshowreservetxt",sr,methodParamTypes);
    Boolean bVal1= new Boolean("true");
    System.out.println("bVal1"+bVal1);
    Serializable sr1[]={bVal1};
    Class []methodParamTypes1 = { bVal1.getClass() };
    row.invokeMethod("setShowreservemsgchoice",sr1,methodParamTypes1);
    break;
    In my AM I am doing this. Am i doing right?:)Yep u r right
    BioPrescribersPVO is the custom VO(extending seeded base VO).
    public void handlePositionChangeEvent(String param)
    OAViewObject vo = (OAViewObject)findViewObject("BioPrescribersPVO");
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    String position = (String)row.getAttribute("AttendeeType");
    if (("PRESCRIBER".equals(position)) )
    // BioEmpManagerRender is the transient attribute in BioPrescribersPVO.
    row.setAttribute("BioEmpManagerRender", Boolean.TRUE);
    row.setAttribute("BioPresManagerRender", Boolean.FALSE);
    else
    row.setAttribute("BioEmpManagerRender", Boolean.FALSE);
    row.setAttribute("BioPresManagerRender", Boolean.TRUE);
    } // end handlePositionChangeEvent()
    // Initializing the custom VO
    /*No need to initialize the VO because this is not a PVO(Propeties View object)
    U r just using the existing VO and tht vo shloud have a primary key.Tht way u can match the rowref u r getting with the actual row from the View object*/
    public void init()
    OAViewObject appPropsVO = (OAViewObject)getBioPrescribersPVO();
    if (appPropsVO != null)
    if (appPropsVO.getFetchedRowCount() == 0)
    appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery();
    appPropsVO.insertRow(appPropsVO.createRow());
    OARow row = (OARow)appPropsVO.first();
    row.setAttribute("RowKey", new Number(1));
    handlePositionChangeEvent("");
    } // end init()
    Thanks
    Anna

  • Strange behavior in a table with dropTarget and delete action

    I am having a strange behavior in a table with drag and drop and action component to delete row.
    Steps:
    Drag the first row to the table and appears in the destination table (works well)
    Select and change the value by 156, appears an error (works fine)
    delete the row, the row disappears (works well)
    Add the first row again and the value is 156 instead of 158 (why ????)
    I guess the error is the deletion that is not correct, but do not know how?
    Can anyone help?
    I add the source code if you see where I'm wrong
    Java class:
    +public class BeanExample {+
    private ArrayList<RowExample> starttValues;
    private ArrayList<RowExample> endValues;
    +public BeanExample() {+
    super();
    +}+
    +public void setStarttValues(ArrayList<BeanExample.RowExample> starttValues) {+
    this.starttValues = starttValues;
    +}+
    +public ArrayList<BeanExample.RowExample> getStarttValues() {+
    +if (starttValues == null) {+
    starttValues = new ArrayList<BeanExample.RowExample>();
    starttValues.add(new RowExample("1", new Number(158)));
    starttValues.add(new RowExample("21", new Number(12565464)));
    +}+
    return starttValues;
    +}+
    +public void setEndValues(ArrayList<BeanExample.RowExample> endValues) {+
    this.endValues = endValues;
    +}+
    +public ArrayList<BeanExample.RowExample> getEndValues() {+
    +if (endValues == null) {+
    endValues = new ArrayList<BeanExample.RowExample>();
    +}+
    return endValues;
    +}+
    +public void validatorExample(FacesContext facesContext, UIComponent uIComponent, Object object) {+
    Number number = (Number)object;
    +if ((number.longValue() % 2) == 0) {+
    FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "ES PAR", "ES PAR");
    throw new ValidatorException(message);
    +}+
    +}+
    +public DnDAction handleDrop(DropEvent dropEvent) {+
    Transferable transferable = dropEvent.getTransferable();
    DataFlavor<RowKeySet> rowKeySetFlavor = DataFlavor.getDataFlavor(RowKeySet.class, "loteDrag");
    RowKeySet rowKeySet = transferable.getData(rowKeySetFlavor);
    +if (rowKeySet != null) {+
    CollectionModel dragModel = transferable.getData(CollectionModel.class);
    +if (dragModel != null) {+
    Object currKey = rowKeySet.iterator().next();
    dragModel.setRowKey(currKey);
    RowExample table = (RowExample)dragModel.getRowData();
    getEndValues().add(new RowExample(table.getId(), table.getValue()));
    return dropEvent.getProposedAction();
    +}+
    +}+
    return DnDAction.NONE;
    +}+
    +public void borrarFila(ActionEvent actionEvent) {+
    endValues.remove(0);            RequestContext.getCurrentInstance().addPartialTarget(FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:t2"));
    +}+
    +public static class RowExample {+
    private String id;
    private Number value;
    +public RowExample(String id, Number value) {+
    super();
    this.id = id;
    this.value = value;
    +}+
    +public void setId(String id) {+
    this.id = id;
    +}+
    +public String getId() {+
    return id;
    +}+
    +public void setValue(Number value) {+
    this.value = value;
    +}+
    +public Number getValue() {+
    return value;
    +}+
    +}+
    +}+JSF
    +<?xml version='1.0' encoding='windows-1252'?>+
    +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"+
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    +<jsp:directive.page contentType="text/html;charset=windows-1252"/>+
    +<f:view>+
    +<af:document id="d1">+
    +<af:form id="f1">+
    +<af:panelGroupLayout id="pgl1">+
    +<af:table value="#{beanExample.starttValues}" var="row"+
    rowBandingInterval="0" id="t1" rowSelection="single"
    displayRow="selected" contentDelivery="immediate">
    +<af:column sortable="false" headerText="Id" align="start" id="c2">+
    +<af:outputText value="#{row.id}" id="ot1"/>+
    +</af:column>+
    +<af:column sortable="false" headerText="Value" align="start" id="c1">+
    +<af:outputText value="#{row.value}" id="ot2"/>+
    +</af:column>+
    +<af:collectionDragSource actions="COPY" modelName="loteDrag"/>+
    +</af:table>+
    +<af:panelCollection id="pc1">+
    +<f:facet name="toolbar" >+
    +<af:toolbar id="dc_t2" >+
    +<af:commandToolbarButton shortDesc="Delete"+
    icon="/imagesDemo/delete_ena.png"
    id="dc_ctb3" immediate="true"
    +actionListener="#{beanExample.borrarFila}"/>+
    +</af:toolbar>+
    +</f:facet>+
    +<af:table value="#{beanExample.endValues}" var="row"+
    +rowBandingInterval="0" id="t2">+
    +<af:column sortable="false" headerText="Id" align="start" id="c3">+
    +<af:outputText value="#{row.id}" id="ot3"/>+
    +</af:column>+
    +<af:column sortable="false" headerText="Value" align="start" id="c4" >+
    +<af:inputText value="#{row.value}" autoSubmit="true" id="it1" validator="#{beanExample.validatorExample}"/>+
    +</af:column>+
    +<af:collectionDropTarget actions="COPY" modelName="loteDrag"+
    +dropListener="#{beanExample.handleDrop}"/>+
    +</af:table>+
    +</af:panelCollection>+
    +</af:panelGroupLayout>+
    +</af:form>+
    +</af:document>+
    +</f:view>+
    +</jsp:root>+

    I think the problem is the validator
    I changed the practical case, I added an InputText to enter new values in the first row.
    +<af:inputText immediate="true" label="new value" id="it2"+
    +valueChangeListener="#{beanExample.newvalue}" autoSubmit="true"/>+
    +public void newvalue (ValueChangeEvent valueChangeEvent) {+
    +String valor = (String)valueChangeEvent.getNewValue();+
    +Number valorNumber=null;+
    +try {+
    +valorNumber = new Number (valor);+
    +} catch (SQLException e) {+
    +}+
    +RowExample example = (RowExample) endValues.get(0);+
    +example.setValue(valorNumber);+
    +example.setId(valorNumber.toString());+
    +RichTable table = (RichTable)FacesContext.getCurrentInstance().getViewRoot().findComponent(id);+
    +RequestContext.getCurrentInstance().addPartialTarget(table);+
    +}+
    Case 1
    I drag the first row to the target table (ok)
    The new row appears (ok)
    Enter the value 77 in the InputText (ok)
    id content and value change (ok)
    Case2
    I drag the first row to the destination table
    The new row appears (ok)
    Change the value of the first row by 80 (ok)
    errors appears (by validator) (ok)
    Enter the value 77 in the InputText (ok)
    the id is changed but the value NO (*KO*)
    I do not understand the behavior
    Edited by: josefuente on 27-oct-2010 16:03

  • Need Tips to Customise Invoice with Logo and Adjust Rows and Values

    Need Tips to Customise Invoice with Logo and Adjust Rows and Values

    Hi rabisaha,
    Your logo is an image. Details on adding and working with images in Numbers can be found in Chapter 9 of the Numbers '09 User Guide.
    Rows are part of a Table. I'm not certain what you are referring to when you say "adjust rows," but the details regarding adding, removing and changing rows are in the "Working with Rows and Columns in Tables" section of Chapter 3, Using Tables in the Numbers '09 User Guide.
    Adjusting values is done by entering new values, or by revising the formulas that create values. This is also conered in the User Guide in Chapter 4, Working with Table Cells.
    The Numbers '09 User Guide is free, and may be downloaded via the Help menu in Numbers. If you intend to create Numbers tables (or to modify formulas), you may also want the iWork Formulas and Functions User Guide, available from th same location.
    For anyone new to Numbers (and for old hands as well), I recommend reading at least the first four chapters of the Numbers guide. The rest can be kept to use as a reference as needed.
    Regards,
    Barry

  • Report ID94 specific software registered with Add or Remove Programs = requested software not listed

    Hi All,
    Our company uses SCCM 2007 and we don't really have an SCCM officer here. I kind of try to get things done by googling a lot but for this i can't find a a solution so i open a thread.
    I'm a newbie to SCCM 2007 so I don't know if i'm about to ask a dumb question but here I go.
    I'm trying to pull out a report for the count of computers that run a desktop version of our Ticketing Tool.
    I found the perfect standard report for this in SCCM 2007 which is: Count of instances of specific software registered with Add or Remove Programs.
    in there i have to set two values: 1) the software that i'm willing to count, 2) the collection in which to search.
    for value number 2 I have no problems.
    my problem is in value number 1. When I click the value button to list all known software, he lists all software in a alphabetic way. problem is that it stops at letter "I"... the software i'm looking for starts with an O so it's not listed.
    also if I type the software and then click Values... it replies that it couldn't find the software.
    am I doing something wrong?

    it sound like you are using the filter option with in the old and "crappy" ASP reports. first you should stop using then and only  use the SSRS reports. secondly the filter option will only show the first 1000 rows, there is a reg key to
    allow it to show more.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • How can I implement the equivilent of a temporary table with "on commit delete rows"?

    hi,
    I have triggers on several tables. During a transaction, I need to gather information from all of them, and once one of the triggers has all the information, it creates some data. I Can't rely on the order of the triggers.
    In Oracle and DB2, I'm using temporary tables with "ON COMMIT DELETE ROWS" to gather the information - They fit perfectly to the situation since I don't want any information to be passed between different transactions.
    In SQL Server, there are local temporary tables and global.  Local temp tables don't work for me since apparently they get deleted at the end of the trigger. Global tables keep the data between transactions.
    I could use global tables and add some field that identifies the transaction, and in each access to these tables join by this field, but didn't find how to get some unique identifier for the transaction. @@SPID is the session, and sys.dm_tran_current_transaction
    is not accessible by the user I'm supposed to work with.
    Also with global tables, I can't just wipe data when "operation is done" since at the triggers level I cannot identify when the operation was done, transaction was committed and no other triggers are expected to fire.
    Any idea which construct I could use to acheive the above - passing information between different triggers in the same transaction, while keeping the data visible to the current transaction?
    (I saw similar questions but didn't see an adequate answer, sorry if posting something that was already asked).
    Thanks!

    This is the scenario: If changes (CRUD) happen to both TableA and TableB, then log some info to TableC. Logic looks something like this:
    Create Trigger TableA_C After Insert on TableA {
      If info in temp tables available from TableB
            Write info to TableC
       else
           Write to temp tables info from TableA
    Create Trigger TableB_C After Insert on TableB {
      If info in temp tables available from TableA
            Write info to TableC
       else
           Write to temp tables info from TableB
    So each trigger needs info from the other table, and once everything is available, info to TableC is written. Info is only from the current transaction.
    Order of the triggers is not defined. Also there's no gurantee that both triggers would fire - changes can happen only to TableA / B and in that case I don't want to write anything to TableC.
    The part that gets and sets info to temp table is implemented as temp tables with "on commit delete rows" in DB2 / Oracle.
    What do you think? As I've mentioned, I could use global temp tables with a field that would identify the transaction, but didn't find something like that in SQL Server. And, the lifespan of local temp tables is too short.

  • To upload a data into SAP Table with the help of RFC function in BODS

    Hi,
    Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
    I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
    In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
    I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
    but it did not help me.
    Thanks,
    Abhishek

    Hi Abhishek,
    Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
    Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
    After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
    I hope this helps.
    Jan.

Maybe you are looking for

  • X86 printer driver for 64 bit Windows 7

    I have Windows 7 (64bit) on my computer.  I want to install an x86 driver for my HP Photosmart C6280 printer so my XP laptop can print to this printer through my home network.  I started by clicking on Devices and Printer, clicked on the Photosmart p

  • How to run G4 iMovie on my Lion?

    Hello, have tracks of a video on my laptop (Lion). My existing iMovie is from a G4. This does not allow to assemble these tracks to a video. How can I obtain a iMovie version to run on my Lion laptop MAC OS 10.7.4? Regards Gunther

  • Color of Tabstrip

    Hello Experts, I am using the htmlb:tabStrip in my application and I want to change the background color in to white. the sample of code is here <htmlb:tabStrip id="tbstrp" width="95%"  bodyColor = "white"  selection="<%=selection%>" > but the color

  • My license is about to stop

    I've got this automail from Adobe that my Creative Cloud is about to be terminated. Shouldn't that be renewed automatically when we are joining the Adobe Community Professionals Program ?

  • "File Corrupt" error when opening Driver software for OfficeJet 4500 G510n-z

    I'm trying to reinstall the software for my OfficeJet 4500 G510n-z printer and I have downloaded the drivers from the HP support site multiple times.  Each time I try to open the file I get an error of "File is Corrupt" and it stops opening.  I was a