Add a new Row to a table in HCM forms and Processes
Dear All,
I am haunted with the problem of adding a new line to a table on clicking a "ADD new Line" button on the Adobe form, how can this be achieved.
What I have done
I have created the table and followed the instruction of OSS note 1043692, i have kept a 1 initial line. Though this adds a line everytime I click on add new line as I have maintained 1 initial line, but this creates a problem in next stage of approval as it shows an extra line(because of the 1 initial line maintained).
Anybody has any other logic of adding a new line to a tabular display in HCM P&F(Infotype 0014)
Note : I have tried all ways of adding extra lines through Javascript, though it adds lines, it is not captured. So I have dropped the idea of javascript.
Did you resolve this?
Similar Messages
-
HCM Form and Process ERROR No error agents maintained in table T5ASRERRORAG
Hi All,
I am setting up HCM form and Process and I am done with Setting up new scenario and form and workflow steps. When I do the check consistency for Processes I get these 4 error below and not sure what do i do about these error
No error agents maintained in table T5ASRERRORAGENTS
Case type for Step Object H_SO is not defined
Case type for Scenario Obj. H_FO is not defined
Case type for Process Object H_PO is not defined
Any help will be appreciated.
Thanks,
-AshwaniSome elaboration would help here a LOT! Would it be possible to get some more info about it?
I am following this tutorial: http://help.sap.com/saphelp_erp60/helpdata/EN/42/f273461e5132c3e10000000a1553f6/frameset.htm
and didn´t find any "sub-chapters" about this. am I missing something? Or could you tell me the number of the tutorial step which I performed in a wrong way or did NOT performed?
Thank you, cheers Otto -
How to add a new row in rich table when a button clicks which isinatemplate
i am new to j developer 11g. i have problem when i click a reset button located in the template
will clear all data from the rich table and it is in a add mode,ie table with only one empty row
Regards
rajesh
Edited by: [email protected] on Mar 10, 2009 11:30 PMHi,
and here is a blog entry about global buttons in templates
http://thepeninsulasedge.com/frank_nimphius/2007/11/23/adf-faces-rc-implementation-strategies-for-global-buttons-in-page-templates/
Frank -
Create a new row in a table without using add new row button
I want to add a new row to the table without using the add new row button of the table. I'm not able to display default row in the table. Though if click on apply the record appears after saving in the database. Any thoughts how to implement this functionality.
Here is what you have to do.
1) You have to handle this in processRequest()
2) In the AM code , u need to check if there is already a row exisit or vo is blank
if (vo.getFetchedRowCount() == 0)
// first time
vo.setMaxFetchSize(0); // THIS IS REQUIRED.
Row row = vo.createRow();
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
else
//If already rows are there then you suppose to insert in the end
// i assume you would have execute your vo
YourVORowImpl row= (YourVORowImpl)vo.getRowAtRangeIndex(0);
vo2.insertRowAtRangeIndex();
It should work. -
Hello!
I'm using JDev 11.2 and I'm trying to add a new row to a table object (using create insert)
the catch is this-
and the new empty row that will appear- I want a value set instead of one of the values- so the user can choose which value to insert
do you know how can this be done?
(just to be clear- i know how to add a value set, I know how to add new row- dont know how to make the new row contain value set field)
tnx for your time
TalyaIf you use a model driven list of value on the attribute in question this should work automatically.
Have you setup a LOV on the attribute? Have you (on the attribute) checked that the ui-hint is set to selectOneChoice?
Timo -
How to add new row to adf table progrmatically
Hi,
I have a bean with a list and correspoding getter & setter methods inside it.
I created a datacontrol out of the bean and I am displaying af:table in the ui
binded to this list.
Ex:
public class StudentBean {
private List<Student> students;
// getter & setter methods.
jsp
<af:table value="#{bindings.students.collectionModel}" var="row"
rows="#{bindings.students.rangeSize}"
emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.students.rangeSize}"
rowBandingInterval="0"/>
How to add a new row programitically to this adf table.
I dragged and dropped 'Create' from operations menu on to jsp.
But on click of that.no new row is being added to the current table.
On click of a button in u.i I want to add a new row to the table.
Thanks,
PraveenHi,
The source code is as below.
<af:table value="#{bindings.students.collectionModel}" var="row"
rows="#{bindings.students.rangeSize}"
emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.students.rangeSize}"
rowBandingInterval="0"
filterModel="#{bindings.rscGroupsQuery.queryDescriptor}"
queryListener="#{bindings.rscGroupsQuery.processQuery}"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.rscGroups.collectionModel.selectedRow}"
selectionListener="#{bindings.rscGroups.collectionModel.makeCurrent}"
rowSelection="single" id="t1"/>
<af:commandButton actionListener="#{bindings.Create.execute}"
text="Create" disabled="#{!bindings.Create.enabled}"
id="cb1" partialTriggers="t1"/>
Please let me know where am I doing wrong?
On click of this button,it is not adding a row dynamically.
Thanks,
Praveen -
How do I add a new row to an AbstractTableModel?
I'm having an issue with adding new data to a table row. Every row I add contains the same data which is always the last data I grabbed from my database. I'm not sure if my issue has to do with how I set up the data to be passed or the table itself or both... Any help would be appreciated. It seems like the tablemodel is holding the memory spot ArrayList I'm passing. If I have to set up an arraylist of arraylists, to pass how do I do that?
My output is always:
1,4,Laser,10,120,100
1,4,Laser,10,120,100
1,4,Laser,10,120,100
1,4,Laser,10,120,100
Desired output:
1,1,Beam,10,99,100
1,2,Canon,10,120,100
1,3,Missile,10,66,100
1,4,Laser,10,120,100
* Extract weaponIDs by hullType from weapon database
private void setWeapons(int hullType){
// equpModel is the tableModel
equipModel.clearTable();
Weapon tempWeapon = new Weapon();
ArrayList newData = new ArrayList();
for (Iterator <Weapon> i = dataBaseManager.weaponList.iterator(); i.hasNext(); ){
tempWeapon = i.next();
if (tempWeapon.weaponClass == hullType){
newData.add(0,1);
newData.add(1,tempWeapon.weaponID);
newData.add(2,tempWeapon.weaponName);
newData.add(3,tempWeapon.weaponCps);
newData.add(4,tempWeapon.weaponMass);
newData.add(5,tempWeapon.weaponCost);
equipModel.insertRow(newData);
}Here is a snipet from the table class
public class GenTableModel extends AbstractTableModel {
private ArrayList data; // Holds the table data
private String[] columnNames; // Holds the column names.
* Constructor: Initializes the table structure, including number of columns
* and column headings. Also initializes table data with default values.
* @param columnscolumns[] array of column titles.
* @param defaultvdefaultv array of default value objects, for each column.
* @param rowsrows number of rows initially.
public GenTableModel(String[] columns, Object[] defaultv, int rows) {
// Initialize number of columns and column headings
columnNames = new String[ columns.length ];
for(int i = 0; i < columns.length; i++) {
columnNames [ i ] = new String(columns [ i ]);
// Instantiate Data ArrayList, and fill it up with default values
data = new ArrayList();
for(int i = 0; i < rows; i++) {
ArrayList cols = new ArrayList();
for(int j = 0; j < columns.length; j++) {
cols.add(defaultv [ j ]);
data.add(cols);
* Adds a new row to the table.
* @param newrowArrayList new row data
public void insertRow(ArrayList newrow) {
data.add(newrow);
super.fireTableDataChanged();
* Clears the table data.
public void clearTable() {
data = new ArrayList();
super.fireTableDataChanged();
}Hi thanks again for responding
Here is the Initialization, including the panel and scrollpane it sits on.
// Table attempt
JPanel tablePanel = new JPanel(new BorderLayout());
tablePanel.setBounds(PANEL_X+2*PANEL_DISTANCE, PANEL_Y, PANEL_WIDTH+300, PANEL_HEIGHT);
title = BorderFactory.createTitledBorder(blackLine, "Table List");
tablePanel.setBorder(title);
// This is column tile plus one dummy initilization set.
String[] columnNames = {"DB", "ID", "Name", "CPS", "Energy", "Mass", "Cost"};
Object[] data = {new Integer(0),new Integer(0), "Empty", new Integer(0),
new Integer(0),new Integer(0),new Integer(0)};
// here is the GenTableModel creation
equipModel = new GenTableModel(columnNames, data, 1);
equipmentTable = new JTable(equipModel);
equipmentTable.setRowSelectionAllowed(true);
equipmentTable.setFillsViewportHeight(true);
equipmentTable.setColumnSelectionAllowed(false);
TableColumn column = null;
column = equipmentTable.getColumnModel().getColumn(0);
column.setPreferredWidth(20);
column = equipmentTable.getColumnModel().getColumn(1);
column.setPreferredWidth(20);
JScrollPane scrollPane = new JScrollPane(equipmentTable);
tablePanel.add(scrollPane);
add(tablePanel);
Here is the full code for GenTableModel. It is as you guessed.
public class GenTableModel extends AbstractTableModel {
private ArrayList data; // Holds the table data
private String[] columnNames; // Holds the column names.
public GenTableModel(String[] columns, Object[] defaultv, int rows) {
// Initialize number of columns and column headings
columnNames = new String[ columns.length ];
for(int i = 0; i < columns.length; i++) {
columnNames [ i ] = new String(columns [ i ]);
// Instantiate Data ArrayList, and fill it up with default values
data = new ArrayList();
for(int i = 0; i < rows; i++) {
ArrayList cols = new ArrayList();
for(int j = 0; j < columns.length; j++) {
cols.add(defaultv [ j ]);
data.add(cols);
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.size();
public String getColumnName(int col) {
return columnNames [ col ];
public Object getValueAt(int row, int col) {
ArrayList colArrayList = (ArrayList) data.get(row);
return colArrayList.get(col);
public Class getColumnClass(int col) {
// If value at given cell is null, return default class-String
return getValueAt(0, col) == null ? String.class
: getValueAt(0, col).getClass();
public void setValueAt(Object obj, int row, int col) {
ArrayList colArrayList = (ArrayList) data.get(row);
colArrayList.set(col, obj);
public void insertRow(ArrayList newrow) {
data.add(newrow);
super.fireTableDataChanged();
public void deleteRow(int row) {
data.remove(row);
super.fireTableDataChanged();
public void deleteAfterSelectedRow(int row) {
int size = this.getRowCount();
int n = size - (row + 1);
for(int i = 1; i <= n; i++) {
data.remove(row + 1);
super.fireTableDataChanged();
public ArrayList getRow(int row) {
return (ArrayList) data.get(row);
public void updateRow(ArrayList updatedRow, int row) {
data.set(row, updatedRow);
super.fireTableDataChanged();
public void clearTable() {
data = new ArrayList();
super.fireTableDataChanged();
} -
Hi,
I need to add a new row to a table without using any NEW button. The first column in my table is a drop down . Whenever user selects a value in drop down a new row should be created .
Also am not able to see drop down options throughout my tableview , Only for created rows am able to see drop downs. How do i activate that ?
Plz help me....
Regards,
DivyaHI
GOOD
go through this link,hope this ll help you to solve your problem
http://help.sap.com/saphelp_nw2004s/helpdata/en/28/4bae407e69bc4ee10000000a1550b0/content.htm
thanks
mrutyun^ -
Problems with adding a new row in my table
Im an ADF beginner but I thought it would be simple to to do some basic CRUD stuff in ADF. Im now even struggling when i try to add a new row to my table.
Seems that the primary key id is not set correctly...
could someone help?Hi,
Have a look to this page CREATE SEQUENCE
Regards,
Sébastien
Creating a Sequence: Example
The following statement creates the sequence customers_seq in the sample schema oe. This sequence could be used to provide customer ID numbers when rows are added to the customers table.
CREATE SEQUENCE customers_seq START WITH 1000 INCREMENT BY 1 NOCACHE NOCYCLE; -
Problem in adding a new row in a table.. plsss hlppp
Hi Friends,
I have a table defaulted to 4 rows. I have a add button to add a new row in the table.
When i have already 4 rows in table, and when i click add its adding that 5th row correctly( and i used set_lead_selection for this new row ).
But i want to automatically make a next page once i hit the ADD button here. Each time now i m hitting next page then only able to see hte 5th row. I need once ADD is clicked, i want to see the 5th row visible..
Can someone tell me how to code or do this
thanks friends,,,
Nirajahi niraja,
Plz refer to the following code:
method onactiononadd .
node_material type ref to if_wd_context_node.
elem_material type ref to if_wd_context_element.
stru_material type sflight.
node_material = wd_context->get_child_node( name = 'ANNA' ).
elem_material = node_material->get_element( ).
if ( elem_material is initial ).
call method node_material->create_element
receiving
element = elem_material.
endif.
call method elem_material->get_static_attributes
importing
static_attributes = stru_material .
call method node_material->bind_structure
exporting
new_item = stru_material
set_initial_elements = abap_false.
endmethod.
i hope it helps
regards
arjun -
Addig a new row in a table in Ess/cats
Hello all,
I am working on Ess/cats application.
By default it is displying me 8 rows.I have to put a button to add a new row in the table.
but i could not find a way to add a new row.
Thanks and Regards.
Punit PawarHi,
In the onAction of button Add one more element in node which is bounded to the table. You can use following code.
public void onActionAddRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionAddRow(ServerEvent)
IWDNodeElement element = wdContext.node<Node_Name>().create<Node_Name>Element();" Here Node_Name is the name of node which is bounded to your table.
wdContext.node<Node_Name>().addElement(element);
//@@end
I hope it helps.
Regards,
Rohit -
Need to add a new row at the end of the table
Experts,
working jdev 11.1.1.3.0
i am adding row programetically, my requirement need to add the row at after last row.
i tried different ways.
Row newLastRow = getPWBBidLaneVO().last();
int lastRowIndex = getPWBBidLaneVO().getRangeIndexOf(newLastRow);
getPWBBidLaneVO().insertRowAtRangeIndex(lastRowIndex - 1,
laneRow);
this is giving --- java.lang.ArrayIndexOutOfBoundsException: 0
and
http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html --- its giving index out of bound because vo.getRangeSize() is 25. We set this value at vo for performance improment suggestions.
is there a way to add a new row at the end of the table?Add this to the view row impl class
public void insertRow(Row row) {
//go to the end of Rowset if it has rows
Row lastRow = this.last();
if (lastRow !=null){
//insert new row at the end and make it current
int indx = this.getRangeIndexOf(lastRow)+1;
this.insertRowAtRangeIndex(indx,row);
this.setCurrentRow(row);
}else { // empty Rowset
super.insertRow(row);
} -
Add a new row at the top of a table in GUI
Hi,
I am using JDev 11.1.1.1.0. I need to be able to let users add a new row at the top of a table and not anywhere else in the middle of table rows. I cannot seem to find a way to do it. note that it does not matter where a new row gets inserted in the db, i am only concerned about restricting the insert in the GUI to the topmost line/row.
Thanks,
AJHi
Can you try with writing your custom create method in application module and calling same from UI on command button action like
public void createNewRow()
ViewObjectImpl vo = getVO1();
Row newRow= vo.createRow()
vo.insertRowAtRangeIndex(0, newRow);
Vikram -
How can I Add and save new row in data table?
Hello All,
I want to add new row in the jsf page with data and save it.
I have data table with rows from database..
<h:form id="test">
<h:dataTable id="hh" value="#{MyBean.dataList}" var="list">
<h:column>
<h:outputText value="#{list.name}"/>
</h:column>
<h:column>
<h:outputText value="#{list.lastName}"/>
</h:column>
<h:column>
<h:outputText value="#{list.phone}"/>
</h:column>
</h:dataTable>
<h:commandButton id="sd" action="#{MyBean.addNewRow" value="Add Row" />
<h:commandButton id="save" action="#{MyBean.updateList" value="Save Data />
</h:form>
{code}
i understand action with save to database, but still I could not find right way to add new row from jsf page.....
I want add new row, add new name, lastname, and save it....
Edited by: armen on Feb 20, 2009 12:39 AMThanks, but your example consist from too many parts and I could not join all components for understatnding all proccess.
-
Trying to automatically add a new row w/o mutating table error...
I'm using Oracle 10g express. I'm trying to automatically add a new row with the same e_ID, (RDD + 6 months) as the updated row when RC is updated. I'm fairly new to Oracle, so I need some help on creating a trigger. If you need more details let me know. Thanks in advance.
create table E
e_id number(6,0) not null,
constraint e_pk primary key(e_id)
create Table ER
e_Id Number(6,0) Not Null,
SC Date,
RDD Date,
RC Date,
Constraint ER_Fk Foreign Key(E_Id) References E(E_Id)
);mookjais wrote:
I'm using Oracle 10g express. I'm trying to automatically add a new row with the same e_ID, (RDD + 6 months) as the updated row when RC is updated. I'm fairly new to Oracle, so I need some help on creating a trigger. If you need more details let me know. Thanks in advance.
create table E
e_id number(6,0) not null,
constraint e_pk primary key(e_id)
create Table ER
e_Id Number(6,0) Not Null,
SC Date,
RDD Date,
RC Date,
Constraint ER_Fk Foreign Key(E_Id) References E(E_Id)
);Do you mean following(example)?
create trigger after_insert_e
after
insert
on e /*This is table name*/
referencing new as new old as old
for each row
begin
insert into ER(e_Id,SC,rdd,rc)
values(:new.ed_id,sysdate,sysdate,sysdate);
end;
Maybe you are looking for
-
To get Document content via RFC
Hi forum, I have a small bsp-application to show documents for a material-number stored in the SAP-tresor (via ftp). The SAP-tresor is installed in the core-system, the WEB-AS is another server. I developed a remote-enabled function module called get
-
I cant up;oad a photo on facebook
hello when i try to edit my profile photo on facebook my firefox locks up and it says not responding then it shuts down cann someone help me
-
Nokia 6111, dont know how to connect, Please Help
Ive just got a Nokia 6111, and have downloaded the PC Suite, what do I need to do to get a connection between my pc and phone, Bluetooth and Infrared wont work ( i dont think Ive got the thing on my pc to use them??) My pc is 5 years old, but it runs
-
Requisition Creation -- E-Recruiting
The manager create requisition in management involvment, no. She hit "Save draft" button. Now, where she see this draft requisition. I see it in Requisition Overview, but when I click on the requisition / click details button it display details but n
-
Can icloud transfer office documents instead of iworks
Hello, I notice that iCloud only seems to transfer iWorks documents, at least that's what all the propaganda says. But I don't use iWorks, I use Microsoft Office (in Windows 7 using Parallels Desktop, but all the files are saved in the Mac Documents