Adding and "empty" row to an ArrayCollection
Hi,
I've got an ArrayCollection named CompanyList which has been
populated by a webservice.
Each "row" structure is the same.
I want to add a new row with the same elements as an existing
row.
I'm trying the followng, but of course the new row is being
bound to the first row, which is powerfull... just not what I want!
I'm hoping of course there's a simple way to do this :-)
Can anyone enlighten me?
var newRow:Object = companyList[0];
companyList.addItem(newRow);
companyList[companyList.length - 1].pkey = '0';
companyList[companyList.length - 1].name = '';
I think you need to do the following:
var newRow:Object = {};
companyList.addItem(newRow);
companyList[companyList.length - 1].pkey =
companyList[0].pkey;
companyList[companyList.length - 1].name =
companyList[0].name';
Similar Messages
-
Adding and deleting "rows" in pdfs
I need to know the best way to edit pdfs. What I have are files that resemble a table setup in Word. I would need to add and delete "rows" of information which are also set up in columns. I also may need to edit some of the text in a row.
What is the best tool for me to use? Acrobat? Illustrator? We are currently using v.10 on Macs. Is there a fairly simple way to accomplish this?I don't think there is a good way to do this. Except for very simple edits, it's better to edit the source document and recreate the PDF. If there is no source document available, you can try exporting to Word from Acrobat and see if you get something usable.
-
Adding and Removing Rows from a Table
So first time user here so hold on. I am creating a form in Adobe, using the LiveCycle Designer. It has help files on creating a table and having it grow as data is entered. So I create a table and follow the steps but nothing happens. Not sure what I am doing wrong here.
CustomerTable.Row1.instanceManager.addInstance(1);
This is code for my button. It is place in the first data row of the table. I inserted a subform so that I could have to buttons there.
I labeled everything accordingly (my table is called 'CustomerTable'). When I go to previeiw or save it and open as a regular pdf i will not give me more rows to enter information in. Is this syntax wrong or am I just retarded today?
BenPost your question in the LiveCycle Designer forum.
-
Hi Guys,
I got a query like this
with time (select sysdate time from dual),
select all.* from (
select nvl(col1,'Total') col1,nvl(col2,'Total') col2,count(col3) col3 from tbl_output group by cube(col1,col2)
union all
select col1,'Total input' col2,count(col3) from tbl_input group by col1,col2) all
and it gets me total input and output and some detailed rows,
Now i want to calculate the remainder of total input and output,
how to do this?
Because I need to add rows / substract rows marked with total not columns?
Hope i make any senseuser12228228 wrote:
Because I need to add rows / substract rows marked with total not columns?
Hope i make any senseUhm, sorry... Can you post a small, yet complete example of what you want to achieve. Post the CREATE TABLE and INSERT statements along with the expected outcome and the logical behind the expected outcome. -
Matrix Empty row Binding Problem
Hi ,
i created one matrix using screen painter.. all my columns are binded
with user defined fields.(Doc Rows Table). if my total row count is 5.
and i deleted 2 rows using rightclick deleterow event. after adding if i see the same document it display the 2 empty rows and 3 rows with my details.. actually its showing that deleted row also.my UDT also having empty row details..
how to resolve this?
Regards,
Ganesh KHi Geetha,
i think you misunderstood my scenario. while adding no empty rows
are displayed, even if i deleted some added row details.After adding,
while retriving the same document the problem occurs.if am not clear let me know..
As you told, beforeAction = false of Add will be new form with Add mode.so not possible to check that old matrix. otherwise we can delete the empty details from database using query..in beforeaction false pval.actionsucess true part...
regards,
Ganesh k. -
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 -
Calculate accurate datagrid height with variableRowHeight and without any empty row
hi ,
how can i calculate accurate datagrid height with variableRowHeight="true" and without getting any empty row.
Currently i am calculating datagrid height on updateComplete event of datagrid as follows:
public function onUpdateComplete() : void
this.datagrid.headerHeight=50;
datagrid.height= datagrid.measureHeightOfItems(0, this.datagrid.dataprovider.length)+this.datagrid.headerHeight;
with following datagrid properties:
<mx:DataGrid
dataProvider="{dataArrayCollection}" width="100%" rowCount="{dataArrayCollection.length}"
id="datagrid" updateComplete="onUpdateComplete()" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0"
fontSize="12" wordWrap="true" variableRowHeight="true" verticalScrollPolicy="off" >
With this approach the issue is, i am getting scrollbar on datagrid's container. I want scrollbar for datagrid instead of its container so that i can have only rows to be scrollable and not the header. Also, if i set verticalScrollPolicy of datagrid as "auto", i get empty rows.
So,is there any way to have datagrid with following properties:
variable row height
no empty rows
word wrap for headers as well as for rows
Scrollbar for grid i.e. header should remain fix ,only rows should be scrollable
no horizontal scrollbar
TIAhttp://blogs.adobe.com/aharui/2010/10/mx-datagrid-list-and-variablerowheight
.html -
Adding and Deleting Multiple Rows or Columns
How do you add or delete more than one row or column at a time.
Robby! wrote:
That's a great finding!
I just wrote a feedback requesting a shortcut like this.
It is a pity though that they desing it to work only if you select the header of the row/column. It should be enabled to work from within any cell in the table.
Who wrote such an error ?
These interesting shortcuts behave flawlessly even if the cursor was in D18 for instance.
(a) I never saw them in the delivered resources.
(b) they aren't responding to the OP's question which was about "Adding and Deleting Multiple Rows and Columns"
Yvan KOENIG (from FRANCE vendredi 3 octobre 2008 18:39:01) -
Revision: 1564
Author: [email protected]
Date: 2008-05-05 18:02:42 -0700 (Mon, 05 May 2008)
Log Message:
Added an empty modules/thirdparty directory, which is where our versions of Apache's Batik and Velocity code will live.
Bugs: -
Doc: No
QA: No
Reviewer: Pete F
Added Paths:
flex/sdk/trunk/modules/thirdparty/We are using Microsoft SQL Server 2008 . but it's well with MySQL & JBoss
-
Advanced Table delete empty rows
Hi
I added logic to add 10 empty rows and to delete the empty rows when the form is submitted. But somehow it only deletes the rows in current screen of the Advanced Table. if there are 15 rows and I click next to go the last 5 and submit the form it deletes only the 5 empty rows but not the other 10 rows in the previous section.
where am I doing wrong?
Thanks
Row [] row = null;
ExpAttendeesVORowImpl rowi = null;
if( expattendeesvoimpl1 != null )
row = expattendeesvoimpl1.getAllRowsInRange();
System.out.println("No of items "+row.length);
for (int i=0;i<row.length;i++)
pageContext.writeDiagnostics(this, "in loop ", 2);
rowi = (ExpAttendeesVORowImpl)row;
pageContext.writeDiagnostics(this, " in loop row "+ rowi.getName(), 2);
if((rowi.getName() == null))
pageContext.writeDiagnostics(this, "deleting row"+ rowi.getName(), 2) ;
rowi.remove();
Thanksyou could instead try using:
expattendeesvoimpl1.getFilteredRows("Name", null); -
Adding a blank row to a JTable when a user begins to edit a current row
Hi, this may be a daft question, but I've been looking through the forum and didnt find anything that really helped me. So I'm posting this in the hope someone will be a ble to point me in the right direction.
In my current application I have a JTable. It currently contains a single emptry row. What I wish to happen is when a user begins to edit that empty row a new blank row is added to the bottom of the table.
I'm using a custom table model, as there maybe data loaded from a Oracle database at a later date and have included an "addRow()" method which will add the blank row.
What i'm struggling with is a way to detect when the user has started to edit the blank row and so when to call my "addRow()" method.
I tried experimenting with propertyChange listeners but they didnt seem effective. Could someone please provide me with either a solution or a pointer in the right direction.
Thanks for your helpWhat I wish to happen is when a user begins to edit that empty row a new blank row is added to the bottom of the table.Well a user could start to edit the last row, but then they could use the escape key to cancel the cell editing. So I would only add the empty row once a cell has actually been updated.
For this I would use a TableModelListener. The listener will only fire when the data in a cell is changed. So once the event is received you simply check if the row of the edited cell is the last row of the table. -
Update empty row / column values
here is the sample data
Col_1 -- col_2-----col_3-------col_4------col_5------col_6
9--------111---------45-----------21
7--------877
2--------456
8--------765
I am trying to update the col_3,col_4,col_5,col_6 like
Col_1 -- col_2-----col_3-------col_4------col_5------col_6
9--------111---------45-----------21--------4654------6534
7--------877---------67-----------42
2--------456---------845----------4563
8--------765
How to insert/update the col_3,Col_4,Col_5,col_6 by adding values in sequence, I want insert the values in 2nd row then 3rd row etc.
how to select next empty row of the particular column without including the other column values in where condition.
Using ROWNUM or ROWID it's possible selecting the next row of the particular column ?
Thanks in advance.following query i use for something:
with
week1 as (select decap as decap_w1,desrvid as desrvid_w1 from drdiskspace where deweek = to_char(sysdate,'WW')-1),
week2 as (select decap as decap_w2,desrvid as desrvid_w2 from drdiskspace where deweek = to_char(sysdate,'WW')-2),
week3 as (select decap as decap_w3,desrvid as desrvid_w3 from drdiskspace where deweek = to_char(sysdate,'WW')-3),
week4 as (select decap as decap_w4,desrvid as desrvid_w4 from drdiskspace where deweek = to_char(sysdate,'WW')-4),
week5 as (select decap as decap_w5,desrvid as desrvid_w5 from drdiskspace where deweek = to_char(sysdate,'WW')-5),
week6 as (select decap as decap_w6,desrvid as desrvid_w6 from drdiskspace where deweek = to_char(sysdate,'WW')-6),
week7 as (select decap as decap_w7,desrvid as desrvid_w7 from drdiskspace where deweek = to_char(sysdate,'WW')-7),
week8 as (select decap as decap_w8,desrvid as desrvid_w8 from drdiskspace where deweek = to_char(sysdate,'WW')-8),
week9 as (select decap as decap_w9,desrvid as desrvid_w9 from drdiskspace where deweek = to_char(sysdate,'WW')-9),
week10 as (select decap as decap_w10,desrvid as desrvid_w10 from drdiskspace where deweek = to_char(sysdate,'WW')-10)
select desrvnaam || ' ' || desrvschijf, decap, decap_w1, decap_w2, decap_w3, decap_w4, decap_w5, decap_w6, decap_w7, decap_w8, decap_w9, decap_w10
from drdiskspace, drserver, week1, week2, week3, week4, week5, week6, week7, week8, week9, week10
where drdiskspace.deweek = to_char(sysdate,'WW')
and drdiskspace.desrvid=drserver.desrvid
and drdiskspace.desrvid=desrvid_w1
and drdiskspace.desrvid=desrvid_w2
and drdiskspace.desrvid=desrvid_w3
and drdiskspace.desrvid=desrvid_w4
and drdiskspace.desrvid=desrvid_w5
and drdiskspace.desrvid=desrvid_w6
and drdiskspace.desrvid=desrvid_w7
and drdiskspace.desrvid=desrvid_w8
and drdiskspace.desrvid=desrvid_w9
and drdiskspace.desrvid=desrvid_w10
and drdiskspace.desrvid=:P200_ZOEK;
greatz,
Jan Louis -
If I set up a page in Table mode I can specify that I wish to have one or more empty rows when I open the page.
In forms mode you don't have the same option. I would like to open the page and in case of no rows would like to have a new row added without having to push the Add Row button.
Can this be done?The technique Ibrahim describes is in itself correct for general ADF apps. However, in this specific situation you should not use an invokeAction binding because that does not fire the JHeadstart-specific JhsPageLifecycle.onCreate method which truly sets the page in "createMode"ensuring the correct buttons and titles are displayed/hidden.
See this thread for the correct technique:
Re: Insert Mode
Steven Davelaar,
JHeadstart Team. -
HGrid line detail is returning empty rows
Hi All,
I am working with HGrid component. I have followed OAF Developer Guide information as follows.
1. Created 2 VOs like PoHeaderVO, POLineVO
2. Created VL with HEADER_ID as source attribute and dest attribute
3. Added a HGrid component
4. Added a Tree component as Child to Hgrid
5. Set ViewInstnace and ViewAttribute to nodeDef1
6. Set ancestor name and view link instance name to childNode1
I am able to run the page. It is showing all header detail. When i expand the header details, it showing the respective number of empty rows for line details.
Anybody can suggest me, what is missed?
Thanks in Advance.
Purushoth...Hi..
Any input for this issue...
Thanks in advance..
Regards,
Purushoth -
Set default 3 empty rows on edit (in the table view)
Hi
i need to add 3 empty rows, currently only 1 rows gets added by default on edit..
i tried using the add method of collection wrapper.. i did not find any differrence..
its adding only one row.
has anyone worked on similar requirement or any help on this..
thanks
Dinesh.hi Ravi,
thank you very much for the reply, but i even gave 10,10 but there is no change in the display..
even before edit and after.. in the insert button.. i am able to add 3 new empty rows but on edit
its not working.. through collection wrapper->Add or insert methods..
is there any other way to insert new empty rows through program on edit or is there any configuration...
thanks
DInesh
Maybe you are looking for
-
What is new AT&T iPhone MMS date? I see integrated messaging feature
Okay, I heard that this was to happen at then end of Summer, then end of July. So what is the new date? I see Integrated Messaging counters in my AT&T profile as of this week. Should we expect another update to sync with iTunes to get it working?
-
Hiding some fields in default selection screen in hr abap created by pernr
Hi experts, I have created default selection screen,in that in the Period option I wants display only 'Today'. And in the selection criteria i wants to display personnel number,companycode,personnelsubarea,employee status and instead of payroll area
-
Hi All, I have deleted pages after doing this SE71 and clicked on pages button then gone to EDIT->Delete element and selected the Next page & deleteed I received error messages during the payment program process and the generation of the cheque print
-
How to fill data in PDF form?
Hi All, I have a pdf forms(about 100). Now I need to open that forms in the browser. User can fill that form and that data should be filled in the database/XML file. Then when user come again then that form details must be displayed in that form. Ple
-
Problem with linking PDF documents using named destinations
Linking from one PDF document to another PDF document using named destinations viewed in Reader works great but once the documents are viewed inside a browser environment the link will only open the go to document and will not go to the named destina