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
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, LizA 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 VieiraHi 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 -
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 advancei 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> -
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] | [] <-- checkboxIs 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 );
} -
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 .
TKTable 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> -
My i tunes will not work at all. I have tried all the steps given to remove my I tunes player but in my control panel, add and remove programs it does not give me an option to remove any of the apple/ I tunes. I tried to go to program files and remove all the files but access is denied. This all started about 1 1/2 years ago and with every i tunes update i got more and more errors or problems until it stopped working. At one time i could remove and reinstall i tunes to try to fix it but now i cannot do anything. I believe one of the last was i could not open i tune because it was being used or was on another network, not 100% sure its been so long and frustrating I quit trying 6 months ago. Hopefully someones got some help !!!
Thanks I appreciate your time; PhilipSee Troubleshooting issues with iTunes for Windows updates.
tt2 -
How do you add and remove links to websites in folders on Safari?
How do you add and remove links to websites in folders on Safari?
For clarification, works like a bookmark of website only it is listed in toolbar with "Most Visited", "Latest Headlines", "News", and "Popular". I have done it before but can't find it for the life of me.
Thanks! -
''locking due the age of this thread - asked and answered''
I have tried all of the suggestions given by FF in order to remove Bing from my computer but nothing seems to work. I would appreciate some advise. For instance when I go to add and remove programs I can't even find Bing listed. Looking forward to your suggestions. Thanks.
== This happened ==
Every time Firefox opened
== I first installed FirefoxRight click "Tools". Uncheck "Search Toolbars".
-
Want to add and remove GL account in report through report painter
Hi,
Thanks in advance,
1.I want to add new GL account in IS01 report i.e. Income Statement. I am trying to add through report painter but could not able to do it.
2.Also i want to delete existing GL account from report through report painter.
Any body pls suggest the steps to add and remove GL account through report painter because this report is under report painter.
Thanks,
KMRthe account is probably in account group or set. Look for that one in report painter and then go to the set or account group and remove/add the account.
-
How do I do to add and remove Shape3D objects dynamically from TransfGroup?
Hi, everyone,
How do I do to add and remove Shape3D objects dynamically from TransformGroup?
I have added two Shape3D objects in the TransformGroup and I wanted to remove one of it to add another. But, the following exception occurs when I try to use �removeChild� :
�Exception in thread "AWT-EventQueue-0" javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may be removed at javax.media.j3d.Group.removeChild(Group.java:345)�.
Why can I add Shape3D objects and I can�t remove them? Do I need to add Shape3D object in the BranchGroup and work only with the BranchGroup? If I do, I think this isn�t a good solution for the scene graph, because for each Shape3D object I will always have to use an associated BranchGroup.
Below, following the code:
// The constructor �
Shape3D shapeA = new Shape3D(geometry, appearance);
shapeA.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shapeA.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shapeA.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
shapeA.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
Shape3D shapeB = new Shape3D(geometry, appearance);
shapeB.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shapeB.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shapeB.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
shapeB.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
BranchGroup bg = new BranchGroup();
bg.setCapability(ALLOW_CHILDREN_READ);
bg.setCapability(ALLOW_CHILDREN_WRITE);
bg.setCapability(ALLOW_CHILDREN_EXTEND);
TransformGroup tg = new TransformGroup();
tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
tg.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
tg.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
bg.addChild(tg);
tg.addChild(shapeA);
tg.addChild(shapeB);
// The method that removes the shapeB and adds a new shapeC �
Shape3D shapeC = new Shape3D(geometry, appearance);
shapeC.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shapeC.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shapeC.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
shapeC.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
tg.removeChild(shapeB);
tg.addChild(shapeC);Thanks a lot.
aads�Exception in thread "AWT-EventQueue-0"
javax.media.j3d.RestrictedAccessException: Group:
only a BranchGroup node may be removed I would think that this would give you your answer -
Put a branch group between the transform and the shape. Then it can be removed.
Another thing you could try: This doesn't actually remove the shape, but at least causes it to hide. If you set the capabilities, I think you can write the appearance of the shapes. So, when you want to remove one of them, write an invisible appearance to it. -
How to remove Java Applications from "Add and Remove Programs" list?
I have deployed my Java applications (both JWS and Applet) via JNLP with allow-offline option enabled and without installer-desc option specified.
My questions are:
1. An entry is added to the Add and Remove Programs list after launching the application via JNLP. Is it due to the specification of JNLP or JWS? Is there anyway to prevent this behavior?
2. I removed my application by clearing the cache via Java Control Panel but the entry for the application is still listed in Add and Remove Programs. How can I remove the entry in the Add and Remove Programs?
I have tried following methods but neither works:
1.Go to Add and Remove Programs, and click [remove] button to the right of my application.
*Warning message like 'Application cannot be uninstalled completely' is thrown.
2.Follow instructions listed @ [Microsoft Online Support site|http://support.microsoft.com/kb/314481/en-us] to remove my application manually via Windows registry.
*Couldn't find appropriate registry entry to delete.
Thanks in advance!Hi, guys!
This issue has been officially approved as a new bug (Bug Id: 6946221) for the JDK 1.6_20(might include any release below) release.
It will take a couple of days for it to be shown up in the external Bug database. However, once it becomes available for viewing on external Bug database.I would like to encourage your valuable participation to vote on this bug to get it fixed ASAP by the SUN developer teams.
Java Bug Database @
[http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221]
Voting for the bug @
[http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221]
Thank you for your cooperation!
Edited by: Jay-K on Apr 23, 2010 12:14 AM -
Add and remove modules in Apache
Is it possible to add and remove modules within Apache (actually compile an relink Apache) with a source download form Apache.org (1.3.28?) and incorporate the necessery modules and configuration from Oracle?. I have looked for some kind of documentation for this, but ended up with nothing. Can anybody explain this?.
If you really understand apache and how oracle implements the apache server then yes you could add/remove modules if you have the source code from oracle. I dont think that you can download apache1.3.28 from apache.org and expect to use that source to build an executable that can plug into oracle.
-
Is there any API to add and remove certs from acrobat trusted identities?
Is there any API to add and remove certs from acrobat trusted identities? if this is not possible any work around for this. Please help me
No, there is not – that would be a security concern.
-
How am I able to add and remove people from a group message?
How am I able to add and remove people from a group message?
You'd need to start a new thread.
Maybe you are looking for
-
Cannot send email using PL/SQL through Enterprise Manager 10g
Hi I need to schedule a job that sends email periodically. I am using the scheduler in Oracle Enterprise Manager 10g for this. For sending the email, I am creating a PL/SQL job. The code is as follows: PROCEDURE send_test_message IS mailhost := 'iwbl
-
Hi, I am new to mac and loving every moment of it. However, l am trying to save a photo in iphoto to a disk and l am so lost. Can anyone help me. Please forgive me if l am in the wrong forum. Thanks in advance.
-
I need to run a old scanner with my macbook pro
Hi I just got an old Imacon Photo scanner, which uses the software "flexcolor 4.0.4 mac". The latest mac OS the software is compatible with would be 10.5.x (leopard). I was wondering, how I could get the scanner going with my set-up: My primary mac i
-
Instructions: Create Blu-Ray disc in Compressor with Final Cut TImeline
I searched mightily for simple instructions on how to do this. The Compressor help files are woefully inadequate in providing a simple walkthrough to do this. Burning a Blu-ray directly from Final Cut does not allow one to optimize the conversion lik
-
Itunes Store does not start up. Rest of itunes is ok. Solution?
Greetings, Called Apple on my itunes store problem with iMac. Was told by one guy it would cost 49 $ CHF € ?? or whatever. Called again and was told to reinstall my OSX 10.6. Seems too drastic. Also was told that maybe setting up another account wo