Pass current row data from table and pass it to a method in AM
Hi All,
I have a table with row selection enabled. Also for each row I have a select image which on selection should pass the data from one of the columns of the current row selected to a method in AM.
Can anybody let me know on "How on selection of the image in any row, can I pass the column data to the method in AM?".
Thanks,
Vijay
Hi,
the most easiest and straight forward approach is
- Ckick the "Binding" tab at the bottom of the Visual Editor
- In the Bindings section click teh green plus icon and choose Generic Bindings | Attribute Value
- point the iterator selection to the iterator used by the table
- choose the column's attribute name from the list of attributes
- Create a method on the ApplicatioNModule IMPL class (should take single argument)
- expose it as a client interfaces so it shows in the Data Controls panel
- In the "Binding" tab, create a method binding for this exposed method
- point the method binding argument to #{bindings.column-attribute-name.inptValue}
So whenever you need to pass the value on to the AM, you just call the method binding
OperationBinding oper = (OperationBinding) bindings.get("name of method");
oper.execute();
Frank
Similar Messages
-
How to retrieve multiple data from table and represent it in jsp page
Hi
The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
<html> function addRow()
i++;
var newRow = document.all("tblGrid").insertRow();
var oCell = newRow.insertCell();
oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
// oCell = newRow.insertCell();
// oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
}<html> Then this data are send to the next Servlet for adding into two table.
My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
Rows added into jsp page.
Here is an code for that logic.
<html>
ArrayList<String> mucode = new ArrayList<String>();
ArrayList<Integer> serials = new ArrayList<Integer>();
ArrayList<Integer> apxrate = new ArrayList<Integer>();
ArrayList<Integer> srname = new ArrayList<Integer>();
ArrayList<String> itcode = new ArrayList<String>();
ArrayList<String> itname = new ArrayList<String>();
ArrayList<Integer> iqnty = new ArrayList<Integer>();
ArrayList<String> iuom = new ArrayList<String>();
ArrayList<Integer> pqnty = new ArrayList<Integer>();
ArrayList<String> puom1 = new ArrayList<String>();
ArrayList<Integer> arate = new ArrayList<Integer>();
ArrayList<String> rdate = new ArrayList<String>();
ArrayList<String> bcs = new ArrayList<String>();
ArrayList<String> ccs = new ArrayList<String>();
ArrayList<String> remarkss = new ArrayList<String>();
//ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
//ArrayList<String> dors = new ArrayList<String>();
//ArrayList<String> remarks = new ArrayList<String>();
String entryn = request.getParameter("entryno");
String rows = request.getParameter("rows");
out.println(rows);
//String Entryno = request.getParameter("entryno");
// out.println(Entryno);
int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
if(!Entryno.equals("")){
entryno = Integer.valueOf(Entryno);
if(!rows.equals("")){
rowcount = Integer.valueOf(rows);
for(int i=1;i<=rowcount;i++){
if(request.getParameter("srno"+i)!=null){
serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
out.println(serials.size());
for(int i=1;i<=rowcount;i++){
if(request.getParameter("srno"+i)!=null){
srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
out.println(srname.get(0));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("itmcd"+i)!=null){
itcode.add(request.getParameter("itmcd"+i).trim());
} //out.println(itcode.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("itmnm"+i)!=null){
itname.add(request.getParameter("itmnm"+i).trim());
}//out.println(itname.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("indentqty"+i)!=null){
iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("uom"+i)!=null){
iuom.add(request.getParameter("uom"+i).trim());
}//out.println(iuom.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("mcode"+i)!=null){
mucode.add(request.getParameter("mcode"+i).trim());
for(int i=1;i<=rowcount;i++){
if(request.getParameter("packqty"+i).equals("")){
pqnty.add(0);
}else
pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("pack"+i)!=null){
puom1.add(request.getParameter("pack"+i).trim());
}else
puom1.add("");
for(int i=1;i<=rowcount;i++){
if(request.getParameter("rate"+i).equals("")){
arate.add(0);
}else
arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
/* for(int i=1;i<=rowcount;i++){
if(request.getParameter("rate"+i)!=null){
arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("dor"+i)!=null){
try{
rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
}catch(ParseException p){p.printStackTrace();}
}else
{ rdate.add("");}
for(int i=1;i<=rowcount;i++){
if(request.getParameter("bcc"+i)!=null){
bcs.add(request.getParameter("bcc"+i).trim());
}out.println(bcs.get(0));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("ccc"+i)!=null){
ccs.add(request.getParameter("ccc"+i).trim());
}out.println(ccs.get(0));
for(int i=1;i<=rowcount;i++){
out.println("remark2");
if(request.getParameter("remark2"+i)!=null){
remarkss.add(request.getParameter("remark2"+i).trim());
}out.println(remarkss.get(0));
ArrayList<String> Idate = new ArrayList<String>();
for(int i=1;i<=rowcount;i++){
if(request.getParameter("dateindent"+i)!=null){
try{
Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
}catch(ParseException p){p.printStackTrace();}
String Rdate = dashdate.format(new java.util.Date());
String tdate = dashdate.format(new java.util.Date());
// String Indentdate = dashdate.format(new java.util.Date());
// String ApprovedT1 = dashdate.format(new java.util.Date());
// String ApprovedT2 = dashdate.format(new java.util.Date());
// String ApprovedT1=" ";
//String ApprovedT2="";*/
String ApprovedT1= dashdate.format(new java.util.Date());
out.println (ApprovedT1);
String ApprovedT2=dashdate.format(new java.util.Date());
out.println(ApprovedT2);
String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
out.println(Indentdate);
String Cocode ="BML001";
out.println(Cocode);
String Deptcode = request.getParameter("dept1");
out.println(Deptcode);
String Empcode = request.getParameter("emp");
out.println(Empcode);
String Refno =request.getParameter("rtype");
out.println(Refno);
String Divcode = request.getParameter("todiv1");
out.println(Divcode);
String Usercode = "CIRIUS";
String Whcode = request.getParameter("stor");
out.println(Whcode);
// String Itemgroupcode = request.getParameter("");
String Itemgroupcode ="120000";
out.println(Itemgroupcode);
String Supplytypecode = request.getParameter("stype");
out.println(Supplytypecode);
String Delcode = request.getParameter("deliverycode");
out.println(Delcode);
String Itemclass="WS";
out.println(Itemclass);
// String Itemclass = request.getParameter("iclass");
// out.println(Itemclass);
String unitcode = request.getParameter("uni");
out.println(unitcode);
String Todivcode = request.getParameter("todiv1");
out.println(Todivcode);
String Appxrate = request.getParameter("rate");
out.println(Appxrate);
String Srno = request.getParameter("srno");
out.println(Srno);
/* String Indqty = request.getParameter("indentqty");
out.println(Indqty);*/
String Itemcode = request.getParameter("itmcd");
out.println(Itemcode);
String Othersp = request.getParameter("remark1");
out.println(Othersp);
String Reqdt = request.getParameter("dor");
out.println(Reqdt);
String Munitcode = request.getParameter("mcode");
out.println(Munitcode);
String Packqty = request.getParameter("packqty");
out.println(Packqty);
String Packuom = request.getParameter("pack");
out.println(Packuom);
String Remark2 = request.getParameter("remark2");
out.println(Remark2);
String BC = request.getParameter("bcc");
out.println(BC);
String CC = request.getParameter("ccc");
out.println(CC);
try{
st=connection.createStatement();
connection.setAutoCommit(false);
String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
out.println(sql);
st.addBatch(sql);
for(int i=0;i<serials.size();i++){
out.println("Inside the Statement");
String query3="test query for u";
out.println(query3);
String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
out.println(queryx);
st.addBatch(queryx);
int[] result=st.executeBatch();
connection.commit();
for(int k=0;k<result.length;k++)
out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
catch(BatchUpdateException bue)
out.println("error1;"+bue+"");
catch(SQLException sql)
out.println("error2;"+sql+"");
catch(Exception l)
out.println("error3;"+l+"");
</html>
Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
I have able to show the data in Header portions of page in this ways
here i am adding the part of code which shows the data from header part of table i.e from Header table
<html>
<h2 align="center"><b>Indent Preparation</b></h2>
<div align="left">
<table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
<tr>
<td ><div align="left"><b>Indent No.</b></div></td>
<td ><label>
<input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
</label></td>
<td ><div align="center"><strong>Indent Date</strong></div></td>
<td ><label>
<div align="center">
<input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
</div>
</label></td>
<td> </td>
<td><div align="right"><strong>Entry No.</strong></div></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
<%}else{%>
<td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
<%}%>
<div align="right"></div>
</tr>
<tr>
<td><b>Division</b></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
<td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
<%}else{%>
<td><input type="text" name="div" id="div" /></td>
<td><input type="hidden" name="div1" id="div1" /> </td>
<%}%>
<td> </td>
<td> </td>
<td><div align="right"><strong>Unit</strong></div></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
<td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
<%}else{%>
<td><input type="text" name="unit" id="unit" /></td>
<td><input type="hidden" name="uni" id="uni" /> </td>
<%}%>
</tr>
<tr>
</html>
Any suggestion on any above works is highly appreciated.
Thanks and regards
harshalToo much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
I will only answer the question in the thread's subject:
How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
To display, make use of JSTL's c:forEach. -
Fetch data from table and generate attachment than mail it.
Hello Experts,
From couple of day I am searching on Google for a better database procedure that will help me to get data from tables and generate attachment and mail it but i fail.
My Scenario is:
I have a query that will fetch almost 5000 records from database tables. Each record has almost 75 characters
select a.location_code,
a.item_code,
b.description item_desc,
to_char(a.manufact_date,'ddMonyy')mfg,
to_char((a.manufact_date + nvl(b.expiry_period,0)),'ddMonyy')expr,
to_char((a.manufact_date + nvl(b.qurantine_period,0)),'ddMonyy')qrtn,
round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) days_elapsed,
a.closing_balance_posted quantity
from wms_stock_current_balance_v a, wms_item_setup_mast b
where a.closing_balance > 0
and a.item_code = b.item_code
and a.loc_type in ('RACKING','PICKING','QUICKA','BUNDLED')
and nvl(b.qurantine_period,0) > 0
and round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) <= 0
order by a.item_code, a.location_code;
Sample data of above query is
LOCATION_CODE
ITEM_CODE
ITEM_DESC
MFG
Expiry
Quarantine
Days Elapse
Quantity
13DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
14DL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
134
14DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
14DR2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
20
14LL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17ER2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17GL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17SL0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
64
18QL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
19AR5
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
160
19DL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
19JR0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
60
19TL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
20GR2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
40
36FL3
000000000000000F0487
CLEAR COOL BLACK 05ML
18-Feb-10
29-Mar-14
2-Jun-13
-124
65
19UR0
000000000000000F0591
COMFORT WHITE 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
1
12SL1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
12SR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
14OR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
8
36EL4
000000000000000F0594
CLEAR HF DECRASE 5M*360
14-Feb-10
14-Feb-11
12-Oct-10
-1088
14
13VL1
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
160
14ER0
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
105
Database Info
Oracle 10g
Version 10.2.0.1.0Look at the sample code for generating a CSV file that I've just posted in response to a similar question:
Re: How to execute a proc and spool files in a database job
And the use the search button in this forum to find sample code for sending a CLOB as a plain/text e-mail attachment using UTL_SMTP. -
How to get current row data in table control
Hi , expert ,
I am professional in oracle , but now I am a new guy in SAP ABAP .
I have a question in UI
How to get current row data and click pushbutton in table control to open next screen ?
I want to get the current data and open next screen to carry out detail detail .
Thansk for all your suggestion .GET CURSOR LINE SY-CUROW .
READ TABLE internal_table index SY-CUROW. -
How to get data from table to pass into alvgrid function module
i want to get some data from below table to pass into function module of alvgrid
how can i get data please help.
thanks in advanced.
form get_data.
select * into corresponding fields of table itab
from J_1IEXCHDR
inner join J_1IEXCDTL
on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
where J_1IEXCHDr~status = 'P'.
append itab.
endform.Pass your final table(internal table which you want to display) along with fieldcatalog to FM reuse_alv_grid_display.:\
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
IT_SORT = gt_sort
it_fieldcat = lt_fieldcat[]
TABLES
t_outtab = lt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. -
Capturing data from JTable and passing it to a class
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.table.AbstractTableModel;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import javax.swing.SwingUtilities;
public class ProjectTable2 extends JFrame implements ActionListener
JButton Up;
// String lecturer_data[][];
public ProjectTable2()
super("Lecturer Table");
setSize(300, 200);
// addWindowListener(new BasicWindowMonitor());
//JButton Up = new JButton("Update");
//Up.addActionListener(this);
//getContentPane().add(Up, BorderLayout.SOUTH);
TableModel tm = new AbstractTableModel()
//JTable jt = new JTable(tm);
//JScrollPane jsp = new JScrollPane(jt);
//getContentPane().add(jsp, BorderLayout.CENTER);
Object[][] data = {
{"Sandip", "Vekaria", "ee99c9", "A"},
{"Manesh", "Mistry", "ee99b4", "A"},
{"Barry", "Kwok", "ee99b6", "A"},
{"Nikhil", "Nag", "ee99b3", "A"},
{"Kevin", "Jervis", "ee99b1", "A"}};
/* lecturer_data[][] = new String[data.length][4];
for(int row = 0; row < data.length; row++)
for(int col = 0; col <= 3; col++)
lecturer_data[row][col] = data[row][col];
String[] headers = {"First Name", "Second Name", "UserName", "Grades"};
public int getRowCount() { return data.length; }
public int getColumnCount() {return headers.length; }
public String getColumnName(int c) {return headers[c]; }
public Object getValueAt(int r, int c) {return data[r][c]; }
public boolean isCellEditable(int r, int c)
if (c < 3)
return false;
else
return true;
/* Returns cell information of a record at location row,column
public synchronized Object getValueAt(int r, int c)
try
ProjectTable2 p = (ProjectTable2)data.elementAt(r;
switch (c)
case 0:
return (String)p.val1;
case 1:
return (String)p.val2;
case 2:
return new Integer(p.val3);
catch (Exception e)
return "";
public void setValueAt(Object value, int r, int c)
if (c >=3)
System.out.println("Setting value at " + r +", " + c + " to " + value);
else {data[r][c] = value;}
data[r][c] = value;
fireTableCellUpdated(r, c);
JTable jt = new JTable(tm);
JScrollPane jsp = new JScrollPane(jt);
getContentPane().add(jsp, BorderLayout.CENTER);
Up = new JButton("Update");
Up.addActionListener(this);
getContentPane().add(Up, BorderLayout.SOUTH);
public void actionPerformed(ActionEvent bc)
// fireTableCellUpdated(r, c);
if(bc.getSource()==Up)
Lecturer nameGrades = new Lecturer("Raul Mondragon", "ele_956", true);
// nameGrades.setTableDataUpdate(lecturer_data);
//no_of_rows = tm.
System.out.println("Update");
// nameGrades.printDetails3();
// nameGrades.printDetails4();
//JTable jt = new JTable(tm);
//JScrollPane jsp = new JScrollPane(jt);
// getContentPane().add(jsp, BorderLayout.CENTER);
public static void main(String args[])
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
ProjectTable2 pt = new ProjectTable2();
pt.setVisible(true);
Somebody please help!!import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.table.AbstractTableModel;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import javax.swing.SwingUtilities;
public class ProjectTable2 extends JFrame implements ActionListener
JButton Up;
// String lecturer_data[][];
public ProjectTable2()
super("Lecturer Table");
setSize(300, 200);
// addWindowListener(new BasicWindowMonitor());
//JButton Up = new JButton("Update");
//Up.addActionListener(this);
//getContentPane().add(Up, BorderLayout.SOUTH);
TableModel tm = new AbstractTableModel()
//JTable jt = new JTable(tm);
//JScrollPane jsp = new JScrollPane(jt);
//getContentPane().add(jsp, BorderLayout.CENTER);
Object[][] data = {
{"Sandip", "Vekaria", "ee99c9", "A"},
{"Manesh", "Mistry", "ee99b4", "A"},
{"Barry", "Kwok", "ee99b6", "A"},
{"Nikhil", "Nag", "ee99b3", "A"},
{"Kevin", "Jervis", "ee99b1", "A"}};
/* lecturer_data[][] = new String[data.length][4];
for(int row = 0; row < data.length; row++)
for(int col = 0; col <= 3; col++)
lecturer_data[row][col] = data[row][col];
String[] headers = {"First Name", "Second Name", "UserName", "Grades"};
public int getRowCount() { return data.length; }
public int getColumnCount() {return headers.length; }
public String getColumnName(int c) {return headers[c]; }
public Object getValueAt(int r, int c) {return data[r][c]; }
public boolean isCellEditable(int r, int c)
if (c < 3)
return false;
else
return true;
/* Returns cell information of a record at location row,column
public synchronized Object getValueAt(int r, int c)
try
ProjectTable2 p = (ProjectTable2)data.elementAt(r;
switch (c)
case 0:
return (String)p.val1;
case 1:
return (String)p.val2;
case 2:
return new Integer(p.val3);
catch (Exception e)
return "";
public void setValueAt(Object value, int r, int c)
if (c >=3)
System.out.println("Setting value at " + r +", " + c + " to " + value);
else {data[r][c] = value;}
data[r][c] = value;
fireTableCellUpdated(r, c);
JTable jt = new JTable(tm);
JScrollPane jsp = new JScrollPane(jt);
getContentPane().add(jsp, BorderLayout.CENTER);
Up = new JButton("Update");
Up.addActionListener(this);
getContentPane().add(Up, BorderLayout.SOUTH);
public void actionPerformed(ActionEvent bc)
// fireTableCellUpdated(r, c);
if(bc.getSource()==Up)
Lecturer nameGrades = new Lecturer("Raul Mondragon", "ele_956", true);
// nameGrades.setTableDataUpdate(lecturer_data);
//no_of_rows = tm.
System.out.println("Update");
// nameGrades.printDetails3();
// nameGrades.printDetails4();
//JTable jt = new JTable(tm);
//JScrollPane jsp = new JScrollPane(jt);
// getContentPane().add(jsp, BorderLayout.CENTER);
public static void main(String args[])
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
ProjectTable2 pt = new ProjectTable2();
pt.setVisible(true);
Somebody please help!! -
How to get current row value from table when press the submit button
Hi,
I want to get the current row value of SuccessionPlanId which is one of the column in a advanced table.
I created one button (created using personalization, action fired thru CO)in the table as column, so each row having one button, if i press the first row's button means then i want to fetch the first row's SuccessionPlanId and if it is 3rd means then i want to get the value of third row's value.
How to do it in controller extension?
Please reply soon, its urgent.
Thanks in advance,
SANPratap,
Yes, I tried with 'delete' button which is seeded one.
For this, our code using row reference is working too fine. it throws exact SuccessionPlanId value of corresponding row.
I created MessageStyledText, but here i need to give text value right, then only it 'll appear in the page.
Instead i created one image and fired explicitly from the controller processRequest method.
But the same problem remains..
here my code:
public void processRequest(OAPageContext pageContext, OAWebBean webBean){
super.processRequest(pageContext, webBean);
OAButtonBean oabb = (OAButtonBean)webBean.findChildRecursive("XXSubmit");
FireAction action = new FireAction("XXSubmit");
oabb.setAttributeValue(UIConstants.PRIMARY_CLIENT_ACTION_ATTR, action);
OAImageBean oaib=(OAImageBean)webBean.findChildRecursive("XXSubmitImage");
oaib.setFireActionForSubmit("XXSubmitImage", null, null, true);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
if("XXSubmitImage".equals(pageContext.getParameter("event"))){
String succIdI="";
String rowRefI = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
if(rowRefI != null && !("".equalsIgnoreCase(rowRefI ))){
PerSuccPlanSearchVORowImpl rowI = (PerSuccPlanSearchVORowImpl)oaam.findRowByRef(rowRefI);
if(rowI != null)
succIdI=rowI.getAttribute("SuccessionPlanId").toString();
}else{
throw new OAException("Row is null");
throw new OAException(succIdI, OAException.INFORMATION);
}else{
super.processFormRequest(pageContext, webBean);
If i run the page using this controller, it throws exception without any value, because for 'succIdI' i initialized without any string.
Can you please suggest me how to solve? -
How create report with data from table and some columns results function ?
Hi,
How can i create on apex report region with some columns (of the report) as returned from a table and the other columns as results of plsql functions ?
for example , I want to create a report like that:
device last_date error_msg stop/start
kodak1 06/04/08 null >>
kodak2 08/03/08 good msg --^--
kodak3 08/04/08 err msg >>
3 rows returned
where the 3 first columns are data returned from the table and the forth column is the result of plsql function (returned for example false) and on that i want to display a button of start ( >> in this example ) or stop ( --^-- in this example)Thomas,
There is no problem here -- this is fully suported scenario.
1. Bind Table dataSource to Customers node.
2. Bind individual cell editors to any attribute of customer or any nested node like Address, say create column with InputField as editor, then for "value" property select Customer.Address.Street.
Your nested nodes (like Address) must be non-singleton, set singleton=false on context designer tab.
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com -
Passing vectors into JSP from Servlet and passing data back to Servlet
I have been building an MVC application.
It has a controller which instantiates classes and evokes methods to
populate vectors. These vectors are then passed into a JSP. This part of the application works fine.
What I am having trouble with is a new JSP I have designed; this will
display the data that is actioned by the FORM action. This is actioned
based on the Search criteria entered by the user. Based on this a further vector is populated and brought back to the JSP as a vector
and this is rendered via the TABLE tag. Again this works fine.
Against each of the rows displayed, I have a print checkbox which can be checked by the user. On checking the records they want to print, they should then hint a Print button which should go back to the Servlet and print the data. THIS IS WHERE I HAVE THE PROBLEM. On going
back to the servlet the checkbox values are not displayed, rather
the values that initially populate the JSP. How do I get these new values back into the vector and hence accessible from the Servlet.
Any help with be very much appreciated.
ChrisThanks for this.
Just to clarify I am not using Struts.
What I am having difficulties with is the fact that:
I can't get the checked values back to the Servlet - they keep the values they have in the bean - so as part of instantiating the bean class I set the value of the item to 'off'. The user will then check
the checkbox which should presumbably set the value to 'on'. This isn't happening because the setter method of the bean is not evoked again
because I don't come into this JSP again - the Servlet has finished here
and now needs to print the records. It can't do this because as
far as it is concerned nothing has changed since it last passed through
the vector to the JSP.
Even when I do the following:
Enumeration paramNames = request.getParameterNames();
String param = null;
while (paramNames.hasMoreElements())
param=(String)paramNames.nextElement();
System.out.println("parameter " + param + " is " +
request.getParameter(param));
what comes back is the valus of 'off' as opposed to 'on'.
The other thing is that 'request.getParameterNames()' only works
with the first record in the vector, i.e. it doesn't fetch any other
records that are rendered in the <TABLE> tag.
In desperation is there anybody out there who can help me.
Thanks
Chris
I am going to assume you are using a MVC framework
like Struts or very similar (I am assuming that from
the language you are using).
When the servlet passes the vector back to the JSP
page and you render the HTML that is passed back the
client your Vector is gone. The Vector is not
available at the HTML level that is being viewed at
the browser.
When the user selects the checkboxes and submits the
page (by clicking the print button) the controller
servlet (called ActionServlet in Struts, yours maybe
called something else) forwards the request to the
appropriate JavaBean and Servlet to process the
request. Either the JavaBean has to recreate the
Vector (not recommended) or the processing Servlet can
(better). You can do this by recreating the Vector
from scratch for the HttpRequest parameters or, at the
time of the initial request, saving Vector to a
session and then updating with the data you get back
from the client (again from the HttpRequest
parameters).
Either way you have to work with
HttpRequest.getParameter(). -
Reading data from table and print the value based condition
hi
my table like this
slno | value1 | value2 |
1 0 5
2 5 10
3 10 15
assume n= 8 ( where n is user define)
i want output like
number 8 between value 5 and 10
plz helpHi,
Try:
Select 'Number '+ U_Value3 + ' Between '+ U_Value1'and 'U_Value2
From [dbo\].[@UDT T0\]
Where T0.U_Value3=[%0\] and T0.U_Value3 BETWEEN U_Value1 AND U_Value2
Thanks,
Gordon -
How to delete a single data from table using control file
I want delete a single row data from table using sql loder control file
Edited by: 977940 on Dec 19, 2012 9:00 PM977940 wrote:
I want delete a single row data from table using sql loder control file
Edited by: 977940 on Dec 19, 2012 9:00 PMWhy?
And how do you imagine this happening with sqlloader?
The entire purpose of sqlloader is to load data (hence, the name sql*loader*) into a table from an external source. If you want to delete rows from a table, you use the sql DELETE statement.
What is the business problem you are trying to solve? -
Hi Experts,
Currently in my program previous period data can be pulled from MBEW using MBEW_EXTEND putting XVPER = X . How can I pull the current period data from MBEW and which stock field should I need to consider for it?
call function 'MBEW_EXTEND'
exporting
xvper = 'X'
tables
mbew_tab = tab_temp.
Thanks in advance.hi,
table MBEW is for material valuation table, irrespective of the period. here there is no bifurcation of this current period and previou period.
MBEWH- is material valuation history table.
here current period running active period in which the posting is beeing done.
previous period is one month before the current period.
here in MBEWH, an option is given to fill the last current month as required for fetching the data.
Edited by: manipal on Jan 10, 2008 4:56 AM -
How to pass the selected table row data from popup to source view
Hi ,
I have requirement of passing the data from popup view to source. , searching some data in popup view and displaying in table,
Like i am passing some input and click search button will display the data in table, when select any of the row in the table and click on the another button , i should be able to pass the select row to the source view and also should close the popup.
When i implement , In the popup windiw, when i enter the customer no, and click on search button, it is closing the popup itslef. not able to see the data in popup.
Can u tell me what is that soultion.
Regards
VijayHi Harsimran
Thanks for the reply,
1) Source view
In "Source View" i have input field called Customer_no. But, the end user will not have any idea , what customer no to enter. so i am searching the customer no in the popup view.
1) Customer_no( This is an inputfiled , to get the customer no from the popup view)
2) Get Customer NO( This is a button to call the popup view)
"Get Customer NO" This button action will open the popup view.
In this popup, i have
1) Input field (To enter the search term)
2) Search (To seach the customer no based on the search term)
3) Table ( To display the search data)
4) Button in Table tool bar called "Select" .( To close the popup view after selected the required data in the table to pass it back to the source view).
so in the popup view what happening is, when i click on the search button itself , it is closing the popupview by transfering the first row of the tbale ,with out select the required row in the table.
i need to close the window after click on the "Select" button in the toolbar , after selected the required row data to trasfer in the table.
Can u pelase tell me what are the modifcations i need to do it.
Regards
Vijay -
Multi row checking in advance table and passing this to other OAF page...
Hello,
I have an advance table on my OAF custom page, this table have checkbox column. I need to implement the solution when user selects some rows in this table and then press submit button on the page. So new OAF page is opened and on that page i need to show those lines which user selected in previous step.
The problem is that right now i have this selection checkbox tight to VO attribute which updates table and then on submit do commit and on another page i'm just selecting rows which have this flag set. But what i'm looking for is - do not make commit and changes on database data, but pass the selected rows as kind of parameter to other page or something like this.
Could you please give me any suggestions of how is the better way to implement this solution?
thanks in advance...Make a transient VO, and insert all the lines the user has checked.Share the same AM in other page and while redirecting retain AM. On this page show the lines from the transient VO.Another option could be utilizing session.
--Mukul -
How to export internal table and pass the internal table to another screen?
Hi,
I have a sql SELECT statement that select data from table into internal table. I would like to export out the internal table and pass to another screen and display the data in ALV list. How to export it out? I try but the error given was " The type of "OUT_SELECT_ITAB" cannot be converted to the type of "itab_result".
Another question is, how to pass the internal table that i export out from the function module to another screen?
Here is the code
==============================================================
FUNCTION ZNEW_SELECT_ZSTUD00.
""Local Interface:
*" IMPORTING
*" REFERENCE(IN_SELECT_YEAR) TYPE ZSTUD00-EYEAR
*" EXPORTING
*" REFERENCE(OUT_RESULT) TYPE CHAR9
*" REFERENCE(OUT_SELECT_ITAB) TYPE ZSTUD00
*& Global Declarations
DATA: itab TYPE ZSTUD00,
itab_result TYPE TABLE OF ZSTUD00.
*& Processing Blocks called by the Runtime Environment
itab-eyear = IN_SELECT_YEAR.
SELECT *
FROM ZSTUD00
INTO TABLE itab_result
WHERE eyear = IN_SELECT_YEAR.
IF sy-subrc = 0.
out_result = 'Success'.
OUT_SELECT_ITAB = itab_result.
ELSE.
out_result = 'Fail'.
ENDIF.
ENDFUNCTION.
===============================================================
Please advise. Thanks
Regards,
RaydenHi Nagaraj,
I try to change it in Tables tab page but it state that TABLES parameters are obsolete. when i "Enter". I try to "Enter" again. it seem to be ok but it stil give me the same error.
================================================================
FUNCTION ZNEW_SELECT_ZSTUD00.
""Local Interface:
*" IMPORTING
*" REFERENCE(IN_SELECT_YEAR) TYPE ZSTUD00-EYEAR
*" EXPORTING
*" REFERENCE(OUT_RESULT) TYPE CHAR9
*" TABLES
*" OUT_SELECT_ITAB STRUCTURE ZSTUD00
*& Global Declarations
DATA: itab TYPE ZSTUD00,
itab_result TYPE TABLE OF ZSTUD00.
*& Processing Blocks called by the Runtime Environment
itab-eyear = IN_SELECT_YEAR.
SELECT *
FROM ZSTUD00
INTO TABLE itab_result
WHERE eyear = IN_SELECT_YEAR.
IF sy-subrc = 0.
out_result = 'Success'.
OUT_SELECT_ITAB = itab_result.
ELSE.
out_result = 'Fail'.
ENDIF.
ENDFUNCTION.
===============================================================
regards,
Rayden
Maybe you are looking for
-
How to delete material from meraterial mast
Hi Guru Some wrong material are created on Pre - Production Client, we need to delete those material. i done following step. Use Tcode - MM06 for Deletion Flag for material. after this use MM71 Transaction for archive material while MM71 Transaction
-
Updated phone, WiFi got disabled
I updated my phone to 1.1.1 and now neither WiFi nor bluetooth will work. In settings the phone just says "no Wi-Fi" but doesn't give me the option to click and look for WiFi networks (its grayed out)... And next to Bluetooth setting it says"Unavaila
-
Contacts sync with iPhone, iPad & MacBook Pro but not calendar won't
OK, so on my iPhone and iPad I have software V 6.1.3, my MacBook Pro 10.8.3. I can get contacts to sync with all 3 but the calendar nothing wants to sync.
-
List manager (based on Popup LOV)
Hi ! I have a problem with my list manager. I'll explain the situation. I have users into my db and does users are associate to many groups. I have a user table, an association table and a group table. I have that LOV query : begin :VALEUR_ACTIVE :=
-
Can I use the BAPI_PO_CREATE1 to create a PO with reference to a PR?
Hi experts. I have a big question. I have been spend many hours in this site to find an answer about if I can use the BAPI_PO_CREATE1, to create a Purchase Order with reference to a Purchase Requisition. I could n ot find nothing about this. Can some