How update or modified an Object within an jComboBox.setEditable(true)
Hello,
I would like to modified the name of an object which is displayed within a jComboBox which is setEditable(true). As we can do within a jTable with the setValueAt method.
Here is a sample of my code:
public class MyFrame extends JFrame {
Object[] listeVoiture = new Object[2];
listeVoiture [0] = new Voiture("Clio", "458 AVB 38");
listeVoiture [1] = new Voiture("Megane", "4567 ZE 69");
MyComboBoxModel voitureComboBoxModel = new MyComboBoxModel(listeVoiture);
JComboBox jComboBoxListeVoiture = new JComboBox(voitureComboBoxModel);
jComboBoxListeVoiture.setEditable(true);
public class Voiture {
Private String modele;
Private String numPlaque;
public Voiture(String mod, String plaq){
modele= mod;
numplaq=plaq;
public String toString(){
return modele;
public void setModele(String mod){
modele=mod;
public class MyComboBoxModel extends DefaultComboBoxModel {
public MyComboBoxModel(Object[] items) {
super(items);
public void setSelectedItem(Object anObject) {
Voiture voit = (Voiture)this.getSelectedItem();
voit .setModele(anObject.toString());
super.setSelectedItem(app);
Thank you for your advises, Romain.
You can do a remove/insert... (why doesn't DefaultComboBoxModel have a set method?)
Kind regards,
Levi
Similar Messages
-
How do you set new items within a JComboBox that is within a JTable
I have searched and searched for the answer to this and do not thing there is one. I have a JTable that has 5 columns. 2 of the columns use DefaultCellRenderers where a JComboBox is used. One of the columns has a value of different football positions. The other has a value of the different players. When a user enters a particular position such as Kickers I want all the Kickers to be showin within the Players JComboBox within the table.
The problem is that I ONLY want the cell to be modified within that row and column that the position was changed. I have found ways to modify the component but it modifies it for the whole Column. I only want it to be modified for the player cell within the row that the Position was modified. Bottom line is that I just want to modify the JComboBox's components.
If anyone has had this challenge before please advise.I'm not sure I fully understood what you wanted. Does the following little program help you?import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;
import java.awt.*;
* User: weebib
* Date: 29 janv. 2005
* Time: 23:37:57
public class FootballTable extends JPanel {
private static final String[] COLUMN_NAMES = {"Position", "Name"};
private static final String[] POSITIONS = {"goal", "arriere", "milieu", "avant"};
private static final String[] GOALS = {"goal1", "goal2", "goal3"};
private static final String[] ARRIERES = {"arriere1", "arriere2", "arriere3"};
private static final String[] MILIEUX = {"milieu1", "milieu2", "milieu3"};
private static final String[] AVANTS = {"avant1", "avant2", "avant3"};
public FootballTable() {
super(new BorderLayout());
DefaultTableModel model = new DefaultTableModel(COLUMN_NAMES, 10);
final JTable table = new JTable(model);
TableColumnModel columnModel = table.getColumnModel();
columnModel.getColumn(0).setCellEditor(new DefaultCellEditor(new JComboBox(POSITIONS)));
columnModel.getColumn(1).setCellEditor(new DefaultCellEditor(new JComboBox()) {
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
JComboBox nameComboBox = (JComboBox)super.getTableCellEditorComponent(table, value, isSelected, row, column);
Object position = table.getValueAt(row, 0);
if (position == null) {
nameComboBox.setModel(new DefaultComboBoxModel());
} else if (position.equals("goal")) {
nameComboBox.setModel(new DefaultComboBoxModel(GOALS));
} else if (position.equals("arriere")) {
nameComboBox.setModel(new DefaultComboBoxModel(ARRIERES));
} else if (position.equals("milieu")) {
nameComboBox.setModel(new DefaultComboBoxModel(MILIEUX));
} else if (position.equals("avant")) {
nameComboBox.setModel(new DefaultComboBoxModel(AVANTS));
} else {
nameComboBox.setModel(new DefaultComboBoxModel());
return nameComboBox;
add(new JScrollPane(table), BorderLayout.CENTER);
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
final JFrame frame = new JFrame(FootballTable.class.getName());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(new FootballTable());
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frame.setSize(400, 300);
frame.show();
}Sorry for the French words, I have no idea how they are called in english (and too lazy to search).
There is another solution. You also can override the table's prepareEditor method and add the relevant code before returning the Component. -
How to create multiple objects within a class
I have a item.lvclass which has an item.ctl (contains a cluster of class private data). I need to add another object (item2.ctl) within that same class so that I can reuse the code for that class.
So how do you create additional objects within the same class?Well... right now... I've cornered myself going down this path: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/LVOOP-Interfaces/idc-p/1314637#M8918
Seems like the solution in the idea was not implemented yet....
Okay. I will try to describe the situation differently...
Let's say I have a Car.lvclass
I want to have two objects: sedan & roadster
both have similar properties, but also have different properties:
4 doors vs 2 doors
hardtop vs convertible
silver vs white (color)
I want the two objects to be of the same class so that they can share the same private and public VI's. As a matter of fact, I want to have both objects in the VI's within the Car.lvclass. -
How can I modify / update T002C's only one field
Hi everyone ;
I would like to write dialog programing code. After I am writing call screen screennumber, I would like to generate a design in screen painter.But screen painter doesn't open. There is an error.
Error says ' EU_SCRP_WN32 : timeout during allocate / CPIC-CALL: 'ThSAPCMRCV'#' and I search about this error. I solve the problem. Solution is T002C table's secondary language field must be writing , not empty.
When I would like to update the field's of T002C tables sap is giving an error. Error is 'Table maintenance not allowed for table T002C'.
How can I modify the field's of table T002C?dont know about the stock taking object but may be the grpo object would help
HTH
Message was edited by:
Manu Ashok -
How can i reference a MIME object within a correspondence format through...
how can i reference a MIME object within a correspondence format through TX oofo or se71?
Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?
Regards HectorFrank,
I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
Can you clarify the following ?
1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
What should I replace that EL expression with?
2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
public void initBusinessDataDashboardView() {
OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
Map params = operation.getParamsMap();
Key panelKey = getPanelInfoView().getKey();
params.put("panelKey", panelKey);
params.put("maximizedView", false);
panelView = (ViewObject)operation.execute();
// Heck code to create CollectionModel
RowSet rowSet = panelView.getRowSet();
ArrayList rowList = new ArrayList();
while (rowSet.hasNext()) {
rowList.add(rowSet.next());
model = new ChildPropertyTreeModel(rowList, null);
// To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
public CollectionModel getModel() {
return model;
Am I on the right track?
Edited by: Pricilla on May 4, 2010 2:20 PM -
How to get list of modified repository objects in SPAU
Hi,
While applying Support pack for HR (SAP ERP 6.0) I get SPAU prompt with message:
"The system detected that 10 of the repository objects in the Support Packages have been modified in
your system . Check whether you want to retain or restore these changes you have made. Fore more
info about performing modification adjustment see modification adjustment help..."
Now as I call SPAU i get the screen with following options:
Correction in SAP Note
With modification Assistant
Without modification Assistant
etc..
Can someone guide me How to get list of modified repository objects in SPAU.
Thanks & Regards
VishalHi,
In SPAU you will get with modification assistence. just expand the subtree, and follw standard process .
This is to retain the enhancement. If there are any data dictionary related correction go to SPDD.
Regards
Rahul -
JAVA&SOAP:how to return a complex object( the object has an object within)
Lets say my Complex object is :
public class PersonWithAddress {
private String name;
private int ssn ;
private Address add;
PersonWithAddress() {
name="Gagan Tandon" ;
ssn =1111;
add = new Address("1113","WestPlum Street");
public String getName() {
return name;
public int getSSN() {
return ssn;
public Address getAddress() {
return add;
This complex object has Address object embedded in it.
public class Address {
private String house;
private String street;
public Address (String myHouse,String myStreet) {
house = myHouse;
street = myStreet;
public String getHouse() {
return house;
public String getStreet() {
return street;
My deployment Descriptor is as following: check the mappings part.
<isd:service xmlns:isd=
"http://xml.apache.org/xml-soap/deployment"
id="urn:xml-soap-person-demo">
<isd:provider type="java"
scope="Application"
methods="getPersonWithAddress">
<isd:java class="PersonServer"/>
</isd:provider>
<isd:faultListener>
org.apache.soap.server.DOMFaultListener
</isd:faultListener>
<isd:mappings>
<isd:map
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="urn:xml-soap-person-demo" qname="x:PersonWithAddress"
javaType="PersonWithAddress"
java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
<isd:map
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="urn:xml-soap-person-demo" qname="x:Address"
javaType="Address"
java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
</isd:mappings>
</isd:service>
And in my SOAPRPC code at client end calls the following: check the mappingregistry code...
String serverHost = "http://localhost:8082/soap/servlet/rpcrouter";
SOAPMappingRegistry smr = new SOAPMappingRegistry();
Parameter p= null;
try {
System.out.println("here 0");
Response r=null;
Call c=new Call();
Vector parameters = new Vector();
System.out.println("here 1");
c.setTargetObjectURI ("urn:xml-soap-person-demo");
c.setMethodName ("getPersonWithAddress");
System.out.println("here 3");
c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
// parameters.addElement (new Parameter("name", String.class, "Web Services Client", null));
// c.setParams (parameters);
c.setSOAPMappingRegistry(smr);
BeanSerializer beanSer = new BeanSerializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("urn:xml-soap-person-demo","Address"),Address.class,beanSer,beanSer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("urn:xml-soap-person-demo","PersonWithAddress"),PersonWithAddress.class,beanSer,beanSer);
try
System.out.println("here 4");
r = c.invoke ( new URL(serverHost), "" );
// org.apache.soap.SOAPException can be thrown
catch ( Exception e )
e.printStackTrace();
// Check the response.
if (r.generatedFault ()) {
Fault f = r.getFault();
System.out.println ("Error Occurred: ");
System.out.println (" Fault Code = " + f.getFaultCode());
System.out.println (" Fault String = " + f.getFaultString());
// return f.getFaultString();
// return new String("gagan");
return null;
else {
System.out.println("here 5");
p = r.getReturnValue();
System.out.println("here 6");
// System.out.println( (String)greeting.getValue() );
System.out.println("SSN: " + ((PersonWithAddress)p.getValue()).getSSN());
return (PersonWithAddress) p.getValue();
catch( Exception e ){
e.printStackTrace();
// finally {
// return null;// String("not OK");
if (p==null)
return null;
else
return (PersonWithAddress) p.getValue();
When running this code..
The following error is thrown.
System.out.println("here 4") is printed.
[SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'PersonWithAddress': Class org.apache.soap.encoding.soapenc.BeanSerializer can not access a member of class PersonWithAddress with modifiers ""; targetException=java.lang.IllegalArgumentException: Unable to instantiate 'PersonWithAddress': Class org.apache.soap.encoding.soapenc.BeanSerializer can not access a member of class PersonWithAddress with modifiers ""]
at org.apache.soap.rpc.Call.invoke(Call.java:294)
at PersonClient.getPersonWithAddress(PersonClient.java:92)
at PersonClient.<init>(PersonClient.java:11)
at PersonClient.main(PersonClient.java:20)
java.lang.NullPointerException
at PersonClient.getPersonWithAddress(PersonClient.java:96)
at PersonClient.<init>(PersonClient.java:11)
at PersonClient.main(PersonClient.java:20)
I am here 1
Exception in thread "main" java.lang.NullPointerException
at PersonClient.<init>(PersonClient.java:13)
at PersonClient.main(PersonClient.java:20)
What could be the problem..? Is there any info on net how could i pass complex objects of this type in Java through SOAP RPC.
GAGANHave you managed to sole the problem ? I have got similar one...
[SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'auction.common.Property': auction/common/Property]
at proxy.soap.AuctionHistoryProxy.addAuctionProperty(AuctionHistoryProxy.java:515)
at java.lang.reflect.Method.invoke(Native Method)
(...) -
Hi all,
in scott Schema by ADF B.C 10.1.3, I created an entity object like emp
and created view object EmpView from emp and dept entities
and Application Module
and when draging EmpView and dropping it in jspx
while running I got an error :
JB0-25003 your EmpView View Object has no Type
How to determine a View Object Type (read only or updatable) in B.C ?
ThanksHi,
this should not require any manual confiuration. Can you select the ApplicationModule in the model, right click on it and run the ADf BC tester ? Check if he ViewObject runs if not added to JSF
Frank -
Can someone please help me? How do I modify my system so I can upgrade to iTunes 11?
The installation stops before iTunes could be configured.
It tells me to run the installer again but I get the same message that my system has not been modified.
I am using Windows 8 64bit on a laptop.This may help:
http://support.apple.com/kb/ts2446 -
How to hide one object within a group
Is it possible to show/hide one object within group using the Timeline? I don't need to hide it in output, just need to show/hide it in the Timeline for convenience while working on a slide.
It's funny that they will let you expand/collapse the group in the timeline window, but not edit visibility. At any rate, I suggest you enter a feature request and/or bug report here: http://www.adobe.com/go/wish
The more people that bother them about it, the more likely they are to fix it. -
How to get result of HTTPService within a function?
Hello all,
I'm trying to call an HTTPService's send() and get the
resulting data from within a function, and assigning it locally.
Specifically, this is what I want:
private function getData():void {
myRPC.send();
//How do I set the result of myRPC.send to a variable here?
// Neither myRPC.send().result, nor myRPC.lastResult works! I
get null both times!
// But if I set myRPC.result to a separate function that
handles an event, I get the correct data...but not what I want.
var myObject:Object = ???? myRPC.???
<mx:HTTPService result="???" fault="???" id="myRPC"
method="GET" resultFormat="e4x" url="someurl" useProxy="false">
<mx:request xmlns="">
<somedata>hi</somedata>
</mx:request>
</mx:HTTPService>
I am also not sure what to put in 'result' and 'fault' since
I don't want the result/fault to be passed to another
function...could anyone explain this please? Thanks!"Hamshmam" <[email protected]> wrote in
message
news:g70olu$jcd$[email protected]..
> Hi Greg,
>
> While this is not what I am looking for, thanks for your
response.
>
> I am familiar with traditional HTTPService requests and
passing the
> resulting
> event to a function handle directly and then modifying
the object from
> there.
> However, as I described in my earlier post, I'm looking
for a way to get
> the
> resulting event of the HTTPService.send() within a
different function.
>
> I am doing this because if I have another function
dependent on the
> HTTPService.send()'s data, I cannot simply call the
HTTPService.send()
> from
> within that function and update a class private var with
the data, which I
> access from the wrapping function. This is because the
HTTPService is by
> nature
> asynchronous, so it is possible that the class private
var will remain
> null
> while further lines of code are executed, all the while
the HTTPService is
> interacting with the server concurrently.
>
> I hope it is clear now why I need to assign the result
of a HTTPService
> result
> directly within a function, if you or anyone else could
shed some light on
> that, I would appreciate it! Thanks for your response.
http://www.johnwilger.com/2007/03/future-value-pattern-in-actionscript-3.html -
How to manipulate a javascript object in java?
Hi, I am fiddling with the java scripting interface. As I understand the rhino engine is packaged with the jdk but what I don't understand is how does one reconcile the objects one gets from their engine (e.g. sun.org.mozilla.javascript.internal.ScriptableObject) versus the ones in the rhino api (e.g. org.mozilla.javascript.ScriptableObject)?
Is the one in the jdk heavily modified or wrappered up to suit their javax.scripting interface?
More specifically, how do I manipulate javascript objects from java?
e.g. suppose I have this java code:
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine js = mgr.getEngineByName("js");
jsEngine.eval("var foo = { x : 1, y : 'hello', z : false };");
Object o = jsEngine.get("foo");Now o is instanceof sun.org.mozilla.javascript.internal.NativeObject, which is a subclass of a bunch of other classes in the s.o.m.j.i namespace. Being internal I can't use these directly.
Looking at the Rhino API obviously you normally get a org.mozilla.javascript.ScriptableObject and can call the .get() .getIds() methods. But I don't know how to translate the objects I am getting in my actual java code which uses the jdk engine into org.mozilla.javascript objects.
Is this even possible? Am I misunderstanding something completely? Should I just be using the rhino js jar and not the javax.scripting interface? If so, for what reason is the javax.scripting interface implemented?Assuming that you DO want a deep copy, begin with a constructor that takes another hand.
public Hand( Hand h ) { ...Then for each instance variable, within that constructor:
this.instVar0 = h.instVar0;
this.instVar1 = h.instVar1;
. . .And last, for every reference, make sure there is a constructor (or copy method for arrays) that itself makes a deep copy:
this.ref0 = new Ref0Type( h.ref0 ); -
How to Populate the JTable Object programatically with SQL Results
I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried.
Thanks in advance and God bless! (",)
* frmMain.java
* Created on October 4, 2006, 6:15 AM
package tds;
import java.io.*;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.imageio.*;
import javax.swing.JFrame;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
* @author Dexter.Carlit
public class frmMain extends javax.swing.JFrame {
private Connection connection = null;
private DefaultTableModel model;
/** Creates new form frmMain */
public frmMain() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jSplitPane = new javax.swing.JSplitPane();
jScrollPane1 = new javax.swing.JScrollPane();
jPanel3 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jPanel5 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
jGrid = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jProgressBar1 = new javax.swing.JProgressBar();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
getAccessibleContext().setAccessibleName("frmMain");
jSplitPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jSplitPane.setDividerLocation(200);
jSplitPane.setDividerSize(10);
jScrollPane2.setViewportView(jTree1);
org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel3Layout.createSequentialGroup()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 916, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
jScrollPane1.setViewportView(jPanel3);
jSplitPane.setLeftComponent(jScrollPane1);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jLabel1.setText("First Name:");
jLabel2.setText("Last Name:");
jLabel3.setText("Position :");
jLabel4.setText("Department:");
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Search Results"));
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
jGrid.setColumnSelectionAllowed(true);
jGrid.setName("");
jGrid.setTableHeader(jGrid.getTableHeader());
jScrollPane3.setViewportView(jGrid);
jScrollPane3.getAccessibleContext().setAccessibleName("rset");
org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
jButton1.setText("Find");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
jButton2.setText("Clear");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.add(1, 1, 1))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel4)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
.add(jPanel4Layout.createSequentialGroup()
.add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
jPanel4Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(jTextField1))
.add(18, 18, 18)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(jTextField2))
.add(16, 16, 16)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField3)
.add(jLabel4)
.add(jTextField4))
.add(14, 14, 14)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jProgressBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
.addContainerGap())
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
jTabbedPane1.addTab("Search", jPanel1);
org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 458, Short.MAX_VALUE)
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 401, Short.MAX_VALUE)
jTabbedPane1.addTab("Directory", jPanel2);
jSplitPane.setRightComponent(jTabbedPane1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane)
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null}
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.updateUI();
}//GEN-LAST:event_jButton2MouseClicked
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
try {
//Load and register SQL Server driver
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//Establish a connection
Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://X.X.X.X:1433","MyAccount","MyPassword");
//Create a Statement object
Statement sql_stmt = connection.createStatement();
//Create a ResultSet object, execute the query and return a
// resultset
ResultSet rset = sql_stmt.executeQuery("SELECT * FROM EpxDirectory..Directory Order By LName");
// Populates a JTABLE Object
int i=0;
while (rset.next()){
String LName = rset.getString(1);
String FName = rset.getString(2);
String Position = rset.getString(3);
String Dept_Code = rset.getString(4);
String OffPhoneNo = rset.getString(5);
String LocalNo = rset.getString(6);
String OffMobileNo = rset.getString(7);
String HomePhoneNo = rset.getString(8);
String MobileNo = rset.getString(9);
String Email = rset.getString(10);
jGrid.updateUI();
jGrid.setValueAt(rset.getString(1).trim(),i,0);
jGrid.setValueAt(rset.getString(2).trim(),i,1);
jGrid.setValueAt(rset.getString(3).trim(),i,2);
jGrid.setValueAt(rset.getString(4).trim(),i,3);
jGrid.setValueAt(rset.getString(5).trim(),i,4);
jGrid.setValueAt(rset.getString(6).trim(),i,5);
jGrid.setValueAt(rset.getString(7).trim(),i,6);
jGrid.setValueAt(rset.getString(8).trim(),i,7);
jGrid.setValueAt(rset.getString(9).trim(),i,8);
jGrid.setValueAt(rset.getString(10).trim(),i,9);
i++;
//Close the ResultSet and Statement
rset.close();
sql_stmt.close();
//Close the database connection
connection.close();
System.out.println(Integer.toString(i) + " rows found");
} catch(Exception e) {
System.out.println("Failed to connect; Please view Stack Trace");
e.printStackTrace();
}//GEN-LAST:event_jButton1MouseClicked
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
}//GEN-LAST:event_formWindowOpened
public static void run(){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
frmMain frmMain = new frmMain();
frmMain.setLocationRelativeTo(null); // Center the JFrame on the
frmMain.setVisible(true);
private void exitApplication() {
// try {
// //gui.putStatus("Closing the connection....please wait.....");
// if(connection != null) {
// // connection.close(); //Closing the connection object.
// } catch(SQLException ex) { //Trap SQLException
// //gui.putStatus(ex.toString());
System.exit(0); //Exit the aplication
* @param args the command line arguments
public static void main(String args[]) {
run();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JTable jGrid;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JSplitPane jSplitPane;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTree jTree1;
// End of variables declaration//GEN-END:variables
}Use code tags.
Don't mix GUI and JDBC together. Split them out into separate classes.
You have a good start, but you will need to loop through your resultset and also pull the ResultSet metaData for you column headings -
I'm using Flash CS3, running code in ActionScript 3.
I use the Loader class to load a child SWF file, which then
takes over the entire area on my website that is reserved for
Flash. If the user decides to stop watching the SWF file before it
is completed, he hits the "close" button within the child SWF,
ultimately causing the Loader.unload() method to be executed. So
far, so good, only the sound from the remaining portion of the SWF
file keeps playing. According to the Flash Docs for the
Loader.unload() method:
"As a best practice, before you unload a child SWF file, you
should explicitly close any streams in the child SWF file's
objects, such as LocalConnection, NetConnection, NetStream, and
Sound objects. Otherwise, audio in the child SWF file might
continue to play, even though the child SWF file was unloaded."
It then gives an example that assumes you already have access
to the Sound object, so closing the Sound object is done by:
mySound.close();
The only problem is that I have no idea how to access the
Sound object when I use the Loader.load() method. Where is this
beast? I can't seem to find anything in the documentation that
tells me how to find the Sound object after calling Loader.load().
As a temporary fix, I modified the target SWF file so that when the
"close" button is hit, it calls the "stop()" function; however,
this only stops the sound, it does not close the associated Sound
object, and I presume it continues to lurk around in memory with
nothing useful to do. (When the user hits the "close" button in the
child SWF file, it creates a "bubbling" event so that the Loader
class can call the Loader.unload() method on it.)
I've attached code for your reference.
Any help is deeply appreciated!
-DanAck! Looks like I hijacked this thread, sorry.
I'm doing almost exactly the same thing the OP is doing...
Loader class to load an external SWF (which is a video file FLV).
If the user hits the "close" button on the video, the video goes
away as it should but the audio continues.
I understand that I need to close any NetConnection and
NetStream objects in addition to unloading the movie. What I don't
understand is how to do that. I'm sure that it's a syntax thing I'm
just not getting right. I would just really like a more detailed
explanation of stopping NetConnections and NetStreams (but an
explanation for the not-so-actionscript-experienced LOL).
Thanks. -
How can we modify alv output list
Hi
this is fazil.
Please tell me any body How can we modify alv output list.
Thanks & Regards
Fazil
[email protected]Fazil,
check the program,
You can find the code in this program 'BCALV_FIELDCAT_TEST'
*& Report BCALV_FIELDCAT_TEST *
This report allows to modify the fieldcatalog of a corresponding
output table and to view the effects of your changes directly.
Note that for some changes you need to newly display the whole
ALV Grid Control, e.g., DDIC-Fields are read only the first time
you call SET_READY_FOR_FIRST_DISPLAY.
Note also that not all scenarios can be tested since the output
table does not comprise all fields to test available features
of the fieldcatalog. Copy this program and extend the output
table accordingly if you want to test such a special feature.
(The field CARRNAME in 'gt_sflight' was added to test field REF_FIELD
and TXT_FIELD of the fieldcatalog - see what happens if you
calculate subtotals by carrier-id).
report bcalvt_fieldcatalog .
data: ok_code type sy-ucomm,
save_ok_code type sy-ucomm,
fieldcatalog for output table
gt_fieldcat type lvc_t_fcat,
fieldcatalog for fieldcatalog itself:
gt_fcatfcat type lvc_t_fcat,
gs_fcatlayo type lvc_s_layo.
Output table
data: begin of gt_sflight occurs 0.
data: carrname type s_carrname.
include structure sflight.
data: end of gt_sflight.
data: g_max type i value 100.
data: g_all type c value SPACE.
Controls to display gt_sflight and corresponding fieldcatalog
data: g_docking type ref to cl_gui_docking_container,
g_alv type ref to cl_gui_alv_grid.
data: g_custom_container type ref to cl_gui_custom_container,
g_editable_alv type ref to cl_gui_alv_grid.
LOCAL CLASS Definition
class lcl_event_receiver definition.
public section.
methods handle_data_changed
for event data_changed of cl_gui_alv_grid
importing er_data_changed.
endclass.
class lcl_event_receiver implementation.
method handle_data_changed.
at the time being, no checks are made...
endmethod.
endclass.
data: event_receiver type ref to lcl_event_receiver.
end-of-selection.
set screen 100.
*& Module STATUS_0100 OUTPUT
text
module status_0100 output.
set pf-status 'BASIC'.
set titlebar 'BASICTITLE'.
create ALV Grid Control in the first run
if g_docking is initial.
perform create_and_init_controls.
endif.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module user_command_0100 input.
save_ok_code = ok_code.
clear ok_code.
case save_ok_code.
when 'SUBMIT'.
set the frontend fieldcatalog
ATTENTION: DDIC-Fields are not updated using this method!
(see 'RESTART')
call method g_alv->set_frontend_fieldcatalog
exporting
it_fieldcatalog = gt_fieldcat.
call method g_alv->refresh_table_display.
call method cl_gui_cfw=>flush.
when 'RESTART'.
Destroy the control currently visible and display it again
using the changed fieldcatalog.
perform restart_sflight.
when '&ALL'.
perform switch_visibility.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Form CREATE_AND_INIT_CONTROLS
text
--> p1 text
<-- p2 text
form create_and_init_controls.
create object g_docking
exporting
dynnr = '100'
extension = 150
side = cl_gui_docking_container=>dock_at_bottom.
create object g_alv
exporting
i_parent = g_docking.
create object g_custom_container
exporting
container_name = 'CC_0100_FIELDCAT'.
create object g_editable_alv
exporting
i_parent = g_custom_container.
register events
create object event_receiver.
set handler event_receiver->handle_data_changed for g_editable_alv.
call method g_editable_alv->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
perform build_fieldcatalogs changing gt_fieldcat gt_fcatfcat.
perform modify_fieldcatalog changing gt_fcatfcat.
perform select_data. "CHANGING gt_sflight
call method g_alv->set_table_for_first_display
changing
it_outtab = gt_sflight[]
it_fieldcatalog = gt_fieldcat[].
optimize column width of grid displaying fieldcatalog
gs_fcatlayo-cwidth_opt = 'X'.
Get fieldcatalog of table sflight - alv might have
modified it after passing.
call method g_alv->get_frontend_fieldcatalog
importing et_fieldcatalog = gt_fieldcat[].
call method cl_gui_cfw=>flush.
Display fieldcatalog of table sflight:
call method g_editable_alv->set_table_for_first_display
exporting
is_layout = gs_fcatlayo
changing
it_outtab = gt_fieldcat[]
it_fieldcatalog = gt_fcatfcat[].
register events
create object event_receiver.
set handler event_receiver->handle_data_changed for g_editable_alv.
endform. " CREATE_AND_INIT_CONTROLS
*& Form restart_sflight
text
--> p1 text
<-- p2 text
form restart_sflight.
data: ls_fieldcat type lvc_s_fcat.
free g_docking and thus g_alv
call method g_docking->free.
clear g_docking.
clear g_alv.
create new instances
create object g_docking
exporting
dynnr = '100'
extension = 150
side = cl_gui_docking_container=>dock_at_bottom.
create object g_alv
exporting
i_parent = g_docking.
This is an internal method to invalidate all fields in the fieldcat
loop at gt_fieldcat into ls_fieldcat.
clear ls_fieldcat-tech_comp.
modify gt_fieldcat from ls_fieldcat.
endloop.
Newly display the list with current fieldcatalog.
call method g_alv->set_table_for_first_display
changing
it_outtab = gt_sflight[]
it_fieldcatalog = gt_fieldcat.
Get fieldcatalog - it might be changed by ALV in the last call
call method g_alv->get_frontend_fieldcatalog
importing
et_fieldcatalog = gt_fieldcat[].
call method g_editable_alv->refresh_table_display.
call method cl_gui_cfw=>flush.
endform. " restart_sflight
*& Form select_data
text
--> p1 text
<-- p2 text
form select_data.
data: lt_sflight type table of sflight with header line,
ls_scarr type scarr.
select data of sflight
select * from sflight into table lt_sflight up to g_max rows.
copy data to gt_sflight and update CARRNAME
loop at lt_sflight.
move-corresponding lt_sflight to gt_sflight.
select single * from scarr into ls_scarr
where carrid = gt_sflight-carrid.
gt_sflight-carrname = ls_scarr-carrname.
append gt_sflight.
endloop.
endform. " select_data
*& Form BUILD_FIELDCATALOGS
text
<--P_GT_FIELDCAT text
<--P_GT_FCATFCAT text
form build_fieldcatalogs changing p_fieldcat type lvc_t_fcat
p_fcatfcat type lvc_t_fcat.
data: ls_fcat type lvc_s_fcat.
Fieldcatalog for table SFLIGHT: p_fieldcat
generate fieldcatalog automatically
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
changing
ct_fieldcat = p_fieldcat[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
shift all column positions to the right except for MANDT
loop at p_fieldcat into ls_fcat.
if ls_fcat-fieldname ne 'MANDT'.
add 1 to ls_fcat-col_pos.
if ls_fcat-fieldname = 'CARRID'.
ls_fcat-txt_field = 'CARRNAME'."link CARRNAME to CARRID
endif.
modify p_fieldcat from ls_fcat.
endif.
endloop.
create a new line for CARRNAME in p_fieldcat
clear ls_fcat.
ls_fcat-fieldname = 'CARRNAME'.
ls_fcat-ref_table = 'SCARR'.
ls_fcat-col_pos = 1.
insert new line before CARRID (do not forget MANDT!).
insert ls_fcat into p_fieldcat index 1.
Fieldcatalog for table LVC_T_FCAT:p_fcatfcat
Generate fieldcatalog of fieldcatalog structure.
This fieldcatalog is used to display fieldcatalog 'p_fieldcat'
on the top of the screen.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'LVC_S_FCAT'
I_CLIENT_NEVER_DISPLAY = 'X'
changing
ct_fieldcat = p_fcatfcat[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Hide all fields that are not documented (valid for release 4.6A)
perform hide_fields changing p_fcatfcat.
endform. " BUILD_FIELDCATALOGS
*& Module EXIT_PROGRAM INPUT
text
module exit_program input.
leave program.
endmodule. " EXIT_PROGRAM INPUT
*& Form MODIFY_FIELDCATALOG
text
<--P_GT_FCATFCAT text
form modify_fieldcatalog changing p_fcatfcat type lvc_t_fcat.
data ls_fcat type lvc_s_fcat.
loop at p_fcatfcat into ls_fcat.
ls_fcat-coltext = ls_fcat-fieldname.
ls_fcat-edit = 'X'.
if ls_fcat-fieldname = 'COL_POS' or ls_fcat-fieldname = 'FIELDNAME'.
ls_fcat-key = 'X'.
endif.
modify p_fcatfcat from ls_fcat.
endloop.
endform. " MODIFY_FIELDCATALOG
form hide_fields changing p_fieldcat type lvc_t_fcat.
data: ls_fcat type lvc_s_fcat.
Only show documented fields of fieldcatalog.
For a documentation choose "Help->Application Help" in the menu.
loop at p_fieldcat into ls_fcat.
if not (
ls_fcat-fieldname eq 'CFIELDNAME'
or ls_fcat-fieldname eq 'COL_POS'
or ls_fcat-fieldname eq 'COLDDICTXT'
or ls_fcat-fieldname eq 'COLTEXT'
or ls_fcat-fieldname eq 'CURRENCY'
or ls_fcat-fieldname eq 'DD_OUTLEN'
or ls_fcat-fieldname eq 'DECIMALS_O'
or ls_fcat-fieldname eq 'DECMLFIELD'
or ls_fcat-fieldname eq 'DO_SUM'
or ls_fcat-fieldname eq 'DRAGDROPID'
or ls_fcat-fieldname eq 'EDIT_MASK'
or ls_fcat-fieldname eq 'EMPHASIZE'
or ls_fcat-fieldname eq 'EXPONENT'
or ls_fcat-fieldname eq 'FIELDNAME'
or ls_fcat-fieldname eq 'HOTSPOT'
or ls_fcat-fieldname eq 'ICON'
or ls_fcat-fieldname eq 'INTLEN'
or ls_fcat-fieldname eq 'INTTYPE'
or ls_fcat-fieldname eq 'JUST'
or ls_fcat-fieldname eq 'KEY'
or ls_fcat-fieldname eq 'LOWERCASE'
or ls_fcat-fieldname eq 'LZERO'
or ls_fcat-fieldname eq 'NO_OUT'
or ls_fcat-fieldname eq 'NO_SIGN'
or ls_fcat-fieldname eq 'NO_SUM'
or ls_fcat-fieldname eq 'NO_ZERO'
or ls_fcat-fieldname eq 'OUTPUTLEN'
or ls_fcat-fieldname eq 'QFIELDNAME'
or ls_fcat-fieldname eq 'QUANTITY'
or ls_fcat-fieldname eq 'REF_FIELD'
or ls_fcat-fieldname eq 'REF_TABLE'
or ls_fcat-fieldname eq 'REPREP'
or ls_fcat-fieldname eq 'REPTEXT'
or ls_fcat-fieldname eq 'ROLLNAME'
or ls_fcat-fieldname eq 'ROUND'
or ls_fcat-fieldname eq 'ROUNDFIELD'
or ls_fcat-fieldname eq 'SCRTEXT_L'
or ls_fcat-fieldname eq 'SCRTEXT_M'
or ls_fcat-fieldname eq 'SCRTEXT_S'
or ls_fcat-fieldname eq 'SELDDICTXT'
or ls_fcat-fieldname eq 'SELTEXT'
or ls_fcat-fieldname eq 'SP_GROUP'
or ls_fcat-fieldname eq 'SYMBOL'
or ls_fcat-fieldname eq 'TECH'
or ls_fcat-fieldname eq 'TIPDDICTXT'
or ls_fcat-fieldname eq 'TOOLTIP'
or ls_fcat-fieldname eq 'TXT_FIELD' ).
ls_fcat-tech = 'X'.
endif.
modify p_fieldcat from ls_fcat.
endloop.
endform.
form switch_visibility.
data: lt_fcatfcat type lvc_t_fcat,
ls_fcat type lvc_s_fcat.
call method g_editable_alv->get_frontend_fieldcatalog
importing ET_FIELDCATALOG = lt_fcatfcat.
if not g_all is initial.
perform hide_fields changing lt_fcatfcat.
g_all = SPACE.
else.
loop at lt_fcatfcat into ls_fcat.
if ls_fcat-tech eq 'X'.
ls_fcat-tech = SPACE.
ls_fcat-no_out = 'X'.
modify lt_fcatfcat from ls_fcat.
endif.
endloop.
g_all = 'X'.
endif.
call method g_editable_alv->set_frontend_fieldcatalog
exporting it_fieldcatalog = lt_fcatfcat.
call method g_editable_alv->refresh_table_display.
endform.
Don't forget to rewaard if useful..
Maybe you are looking for
-
Free limit (overall limit vs free limit)
Hello, I would have a question regarding item category D (service) in Purchase Order. For such items, a tab "Limits" is displayed, In this tab, there is a field "Overall limit" but also a nested tab called "Other limit" with a field "Limit" (correspo
-
[Solved] Unable to boot after install
Forgive me for the lack of code tags, having to write this on my phone. I am unable to boot after installation. I receive an error wich has the incorrect UDID string. It doesn't even exist. I will update with error after posting so I can give grub co
-
How to transfer currency rates to R/3 after dynamic modelling in BPS
Hi all, I need your advice. I have, for example, a several sales plans, which were composed by using BPS. Each of sales plans depends on currency rates. After comparision these plans, I selected and approved one of them. After plan approval I transfe
-
How much storage units can be added in the single bin.
Hi all, Can anybody tell me how much storage units can be added in the single bin. Dev
-
Introduction to java class program assignment help
We are susposed to be writing a program that calculates the best angle for firing a cannon ball to get the best distance through different substances. My teacher and i could not see why the program was not working and i was wondering if anyone could