Gui using nested panels???
hello all i am trying to do a gui and i have been building it in pieces using panels . However once i get to the point of adding the panels to the frame they have already been nested several times. My problem is now accessing the things in the panels like the textfrields and the buttons to set and get text and eventhandlers. Is this a bad way to go about doing Swing design? Should i just layout everyting onto one panel.? what is considered good practice in gui design using swing?
Hi All,
I ve just started hacking the Swing library, and I am facing the same problem, and to make more clear, here is my scenario:
public class PaperEntry extends JFrame {
public static Paper paper;
Publisher publisher;
JLabel titleLabel, dateLabel, conference_nameLabel;
JTextField titleField, dateField, conference_nameField, authorNameField,
autherAddressField, publisherNameField, publisherAddressField;
TextArea displayArea;
JButton addAuthorButton, addPublisherButton, showPaperButton, exitButton;
public PaperEntry() {
super("Paper Information");
paper = new Paper();
Container c = getContentPane();
public void displayPaper() {
displayArea.setText(paper.toString());
public static void main(String[] args) {
PaperEntry p = new PaperEntry();
p.setSize(420, 450);
p.show();
private class ActionEventHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
if(e.getSource() == exitButton)
System.exit(0);
else if(e.getSource() == addAuthorButton) {
AuthorEntry ae = new AuthorEntry();
ae.show();
THE PROBLEM...
// Author Entry is almost of the same structure as PaperEntry and I want to stop PaperEntry from
// proceeding until I exit out from the AuthorEntry with the an object Author to be added to the Paper
// object
else if(e.getSource() == addPublisherButton) {
PublisherEntry pe = new PublisherEntry();
pe.show();
else if(e.getSource() == showPaperButton) {
paper.setTitle(titleField.getText());
paper.setConference_name(conference_nameField.getText());
paper.setDate(dateField.getText());
//System.out.println(paper.toString());
displayPaper();
public class AuthorEntry extends JFrame {
// author info entering frame
public class PublisherEntry extends JFrame {
// publisher info entering frame
I am looking for any solutions....
cu
modber
Similar Messages
-
Created GUI using Matisse, can't get text on jPanel
Hello, I am tying to build my first desktop application. I created a test GUI using Netbeans Matisse.
When the button is pressed I want that the text string stored in the variable text appears on jPanel1. The String is retrieved from a database (that's not a problem).
How to get the text onto jPanel1?
Here's the GUI code:
package prototype4;
import java.awt.Color;
import spin.Spin;
public class newGUI extends javax.swing.JFrame {
/** Creates new form newGUI */
public newGUI() {
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 ">
private void initComponents() {
rolloverProducer1 = new org.jdesktop.swingx.RolloverProducer();
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 376, Short.MAX_VALUE)
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 127, Short.MAX_VALUE)
jButton1.setText("Start");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel2Layout.createSequentialGroup()
.add(140, 140, 140)
.add(jButton1)
.addContainerGap(173, Short.MAX_VALUE))
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(39, Short.MAX_VALUE)
.add(jButton1)
.add(36, 36, 36))
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(55, Short.MAX_VALUE))
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
// spin off
DAOUser daouser = (DAOUser) Spin.off(new DAOUserImpl());
String text = daouser.getString();
System.out.println(text);
//jPanel1.
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new newGUI().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private org.jdesktop.swingx.RolloverProducer rolloverProducer1;
// End of variables declaration
}The code you posted is basically of no use to use since it uses custom Matisse classes.
Learn how to write a Swing app without a GUI builder. Learn how to use Layout Managers on your own.
If you want to display text on a panel then you would do:
panel.add( label );
panel.revalidate();
Whos know what will happen with your code because I have no idea what the Matisse Layout Managers do.
Read the Swing tutorial on [url
http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Managers. -
Help! GUI using two buttons
Hello all:
I have created a class for reading and writing to a text file on my hard drive. Also, I have created another class for a GUI to use for opening the text file with a button labeled Display. As you will see in the code below, I have created another button labeled Update. I seek to be able to edit and save the text directly in the text area with the Update button after opening the file with the Display button. Any help would be greatly appreciated. Thanks!
/** Class TextFile */
import java.io.*;
public class TextFile
public String read(String fileIn) throws IOException
FileReader fr = new FileReader(fileIn);
BufferedReader br = new BufferedReader(fr);
String line;
StringBuffer text = new StringBuffer();
while((line = br.readLine()) != null)
text.append(line+'\n');
return text.toString();
} //end read()
public void write(String fileOut, String text, boolean append)
throws IOException
File file = new File(fileOut);
FileWriter fw = new FileWriter(file, append);
PrintWriter pw = new PrintWriter(fw);
pw.println(text);
fw.close();
} // end write()
} // end class TextFile
/** Class TextFileGUI */
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TextFileGUI implements ActionListener
TextFile tf = new TextFile();
JTextField filenameField = new JTextField (30);
JTextArea fileTextArea = new JTextArea (10, 30);
JButton displayButton = new JButton ("Display");
JButton updateButton = new JButton ("Update");
JPanel panel = new JPanel();
JFrame frame = new JFrame("Text File GUI");
public TextFileGUI()
panel.add(new JLabel("Filename"));
panel.add(filenameField);
panel.add(fileTextArea);
fileTextArea.setLineWrap(true);
panel.add(displayButton);
displayButton.addActionListener(this);
panel.add(updateButton);
updateButton.addActionListener(this);
frame.setContentPane(panel);
frame.setSize(400,400);
frame.setVisible(true);
} //end TextFileGUI()
public void actionPerformed(ActionEvent e)
String t;
try
t = tf.read(filenameField.getText());
fileTextArea.setText(t);
catch(Exception ex)
fileTextArea.setText("Exception: "+ex);
} //end try-catch
} //end actionPerformed()
} //end TextFileGUISwing related questions should be posted in the Swing forum.
You are using the same ActionListener for both buttons, so you need to be able to tell which button was pressed. There are a couple of ways to do this:
a) use the getSource() method of the ActionEvent and compare the source against your two buttons to see which one was pressed and then invoke the appropriate code.
Object source = e.getSource();
if (source == displayButton)
// do display processing
else if (source == updateButton)
// do update processingb) Check the action command to determine which button was clicked. This approach is demonstrated in the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/button.html]How to Use Buttons
Another option is to create separate ActionListeners for each button so there is no confusion
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
class TextAreaLoad
public static void main(String a[])
final JTextArea edit = new JTextArea(5, 40);
JButton read = new JButton("Read some.txt");
read.addActionListener( new ActionListener()
public void actionPerformed(ActionEvent e)
try
FileReader reader = new FileReader( "some.txt" );
BufferedReader br = new BufferedReader(reader);
edit.read( br, null );
edit.requestFocus();
catch(Exception e2) { System.out.println(e2); }
JButton write = new JButton("Write some.txt");
write.addActionListener( new ActionListener()
public void actionPerformed(ActionEvent e)
try
FileWriter writer = new FileWriter( "some.txt" );
BufferedWriter bw = new BufferedWriter( writer );
edit.write( bw );
edit.setText("");
edit.requestFocus();
catch(Exception e2) {}
JFrame frame = new JFrame("TextArea Load");
frame.getContentPane().add( new JScrollPane(edit), BorderLayout.NORTH );
frame.getContentPane().add(read, BorderLayout.WEST);
frame.getContentPane().add(write, BorderLayout.EAST);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo( null );
frame.setVisible(true);
} -
ADF/Swing probles with nested panels layout.
When panel is placed in other panel, changing of nested panel layout by changing panel properties, results in adding in jbInit() metod code for setting choosen layout at the end of jbInit and not (as in top panel) at the begining of jbInit(). Many times (for instance when layout is BorderLayout) because of this nested panel is displayd empty. It is necessary of course to manually move lines setting layout before lines which adds components to nested panel. Thou it is possible to do it manually it would be nice not to have remember about it.
Remi,
how do I reproduce this? Can you give me a step-by-step instruction? Its not clear from your posting which JDeveloper release you are using (though I assume JDeveloper 10.1.3), nor if the panels are created in external Java file or within the parent panel.
Frank -
Hi ,
I wanna clarify whether using nested event structures in a vi is good Labview programming ?
I have a vi which has two event structures nested,assuming it has two buttons GO1 and GO2.
The outer event structure handles event triggered by GO1 and inner event structure handles Go2.
The outer structure does fine by handling the button click on GO1,the problem is inability of inner
event structure to handle click on GO2 button.
I'm also attaching a sample.vi for reference.It would be great if you could help me
solve this issue.Thanks in advance.
Regards,
Nalin
Attachments:
sample.vi 30 KBYou can actually make this work, but like the others, I don't recommend it.
To make your VI work. Right click on the "GO1" structure and select "Edit Events.....". At the bottom of the dialog, there is a checkbox that reads "Lock Front Panel until the event case for this event completes". With this checked, all front panel objects are locked until the GO1 event completes. This is what is causing the GO2 button not to work. Uncheck this and your application will work as you want it to.
If your intent is to have GO2 disabled until you click GO1, try the attached VI. It uses property nodes to disable the GO2 button until you click the GO1.
Another thing that you have setup that doesn't look necessary is the Timeout event, especially set to 1ms. The basic idea of the Event Structure is to not have to constantly poll for front panel events. If you just deleted the timeout event cases and removed the 1ms constant, your application would just well, but would just sit and wait for you to click a button.
Ed
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Attachments:
sample.vi 27 KB -
A bug using nested GridBagLayouts ?
Hallo,
if I am nesting JPanels using the GridBagLayout the component width are not calculated correctly. In the following example the component width is not evenly distributed:
Any hints to solve this?
best Regards,
Thomas
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
public class GridPanelTest {
public static void main(String[] args) {
GridBagConstraints gbc = new GridBagConstraints();
JPanel pane = new JPanel(new GridBagLayout());
JPanel pane1 = new JPanel(new GridBagLayout());
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
JPanel fix = new JPanel(new GridBagLayout());
fix.add(new JButton("test1"), gbc);
pane1.add(fix, gbc);
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 0.5;
gbc.fill = GridBagConstraints.HORIZONTAL;
pane.add(pane1, gbc);
JPanel pane2 = new JPanel(new GridBagLayout());
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 0.5;
gbc.fill = GridBagConstraints.HORIZONTAL;
pane2.add(new JButton("test2"), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.weightx = 0.5;
gbc.fill = GridBagConstraints.HORIZONTAL;
pane2.add(new JButton("test3"), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.weightx = 0.5;
gbc.fill = GridBagConstraints.HORIZONTAL;
pane.add(pane2, gbc);
JDialog dlg = new JDialog();
dlg.setContentPane(pane);
dlg.pack();
dlg.setVisible(true);
}java Version 1.5.0_3
The right panel should divided half the size of the left panel but the size in the example is not distributed correctly if i am using nested GridBagLayouts. Here is a tidy version of the code:
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
public class GridPanelTest {
public static void main(String[] args) {
// left panel
JPanel left = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
left.add(new JButton("left"), gbc);
// right panel
JPanel right = new JPanel(new GridBagLayout());
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0.5;
right.add(new JButton("right1"), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0.5;
right.add(new JButton("right2") , gbc);
// main panel
JPanel mainPanel = new JPanel(new GridBagLayout());
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0.5;
mainPanel.add(left, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0.5;
mainPanel.add(right, gbc);
JDialog dlg = new JDialog();
dlg.setContentPane(mainPanel);
dlg.pack();
dlg.setVisible(true);
} -
How to save report in PersonalCategory after creating it using java panel?
Hi,
Anybody knows How to save report in PersonalCategory after creating it using java panel?
I dont want to save it in public folder. I want to save report (webi) in user's personal category.
can anybody send me source code?
It will help me a lot.
Thanks in advance
Amol MaliHi teda,
i'm assuming that you have seen my post that i did successfuly save report in user's personal category.
Actually the report is created in webi java panel using RE SDK and is saved in Report Sample Folder then i'm saving it in user's personal category by following code
string query = "Select SI_PERSONAL_CATEGORIES From CI_INFOOBJECTS Where "
+ "SI_INSTANCE=0 And SI_ID=" + reportID;
InfoObjects infoObjects = infoStore.Query(query);
InfoObject infoObject = infoObjects[1];
Webi wreport = (Webi)infoObject;
ObjectRelativeIDs personalIDs = wreport.PersonalCategories;
/personalIDs.Add(Convert.ToInt32(categoryID));
infoStore.Commit(infoObjects);
But the report is presents in the Folder also and in user's personal category also.
I dont want the report to be in the folder (Report Sample) if i saved it in user's personal category.
How can i do that?
any idea.
Please help me.
Thanks in advance
Amol Mali
Edited by: amol mali on Jan 9, 2009 7:55 PM -
How to use another panels in status line
Hi Everyone:
Can anybody tell me how can i use another panels in the
Console's status line, I'm using the message line but i need to
show the user's name and Date-Tiem in another section of the
status line and not in display controls as i'm already doing it.
Thanks.Do you really need a JSF component for that? You can use h:panelGroup and some JS. But a simple div with some JS is also sufficient.
-
How to use nested tables in adobe form
Hi All,
I have to use nested tables in adobe form for table display. I have used Subforms for displaying table data. I have changed accessibility of the subforms. Currently i am able to print print the table correctly if there is single material record in table 1 and single corresponding record in table 2. But the requirement is that i will have multiple lines in table 1 for single material and only one record in table 2.
EX: form is for Sales order. in line items if the order is for 100 units then we if we have delivered material as 80, 10, 10, then table 1 will have 3 lines for this. Table 2 will always have only 1 corresponding record.
item--materialdescription-ordered qty--delivered qty--delivery date-price
xxx--xxxxxxx-xxxxxxxxx-10080xxxxxxxxxx-xxxx
10----
xxxxxxxxxx
10----
xxxxxxxxxx
yyyyyyyyyyyyyyyyyyy------yyyyyyyyyyyyyyyyyyyyy
xxxxxx is table 1 and will have multiple lines
yyyyyy is table 2 and will have only 1 entry for item xxx
and this group will be repeate as per no of items. table 1 can have any no of lines per item.
I am currently able to display 1 line for table 1 and 1 line for table 2.
But how to show multiple lines for table 1 and 1 line for table 2.HI,
Set the body page as flowed and set the tables also flowed.
go to bodypage>object->subform-->select flowed option.
I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
Thanks,
Mahdukar -
Can't scan using front panel of HP Officejet Pro 8600 Plus
I can't scan using front panel or laptop. I can't find the set up disc that came with the printer that I purchased almost 2 years ago.
Hello @Pierre1 , and welcome to the HP Forums, I hope you enjoy your experience!
I see you are having issues scanning. I'd like to help!
I'd recommend starting with a power reset. Disconnect the power cord from the printer and the power outlet, then wait 60 seconds. After 60 seconds, plug the printer back in. Ensure you plug the printer directly to a wall outlet. Make sure to bypass any sort of surge protector or power bar.
I would also recommend downloading and running the HP Print and Scan Doctor.
Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
Jamieson
I work on behalf of HP
"Remember, I'm pulling for you, we're all in this together!" - Red Green. -
I am trying to generate an application that saves a copy of its front panel on completion. This is easy to do using an invoke node with Print VI to HTML but this does not work in an .exe format. I have seen elsewhere that you have to use the Get Panel Image method, but no details are supplied in LV 5.0.1 documentation of how to use the "image" data (1-D Unsigned Byte array) that is generated. I want to save this in a format that can then be read as a bitmap in any standard graphics package. Any assistance?
Hi,
If you'd upgrade to LV5.1 or 6 you could use the 'standard' vi's for this.
You need a VI called "Write BMP File.vi". It's not shipped with LV5.0.1.
This vi only uses 3 subVI's, so perhaps someone at NI can convert it and
send it to you (sorry, I won't, it's copywrited).
If you cannot get this VI anywhere, you'll need to figure out the BMP file
format yourself. It's not too complicated, but still could take some days.
Perhaps someone figured it out before LV5.1 was released.
Regards,
Wiebe.
"RDK" wrote in message
news:[email protected]..
> I want to use Get Panel Image in Labview 5.0.1 and need details on how
> to save the BMP data generated
>
> I am trying to generate an application that saves a copy
of its front
> panel on completion. This is easy to do using an invoke node with
> Print VI to HTML but this does not work in an .exe format. I have seen
> elsewhere that you have to use the Get Panel Image method, but no
> details are supplied in LV 5.0.1 documentation of how to use the
> "image" data (1-D Unsigned Byte array) that is generated. I want to
> save this in a format that can then be read as a bitmap in any
> standard graphics package. Any assistance? -
My Illustrator does not allow me to change colors using swatches panel. Help pleas.
Few days ago I started having strange problems with my Illustrator CS5 application. I am using MacBook Pro with Intel Processor. After major update on the Mac OS few days ago I noticed I can not change colors in my drawings using swatches panel. The function on my Illustrator CS5 stopped working. When I select object and try to change its fill or stroke color using fill and stroke from the options bar above work space, none of the swatches would work. The are there how ever nothing hapends when I select them, the color remains the same.The same thing happens if I try to use the swatch panel, I select the object then I try to select new color from swatch but the fill or stroke does not change. I can only change color on my drawings using the color panel but that is not useful for me since I need to get precise colors using approved color swatches ether from pantone library or approved by client.
The other strange thing is my selection tool does not deselect when I click outside on or of the artboard, the object remains selected until I reselect another object or use the keyboard short cut to deselect it.
I have tried various options to resolve the issue from deleting and reseting preference to completely uninstalling and reinstalling Illustrator CS5. I even installed back my old CS4 version because I had to complete a project and the same issue is happens there as well. I also reset the application using Time Machine from few months ago when it was working correctly. What happens when I reset or reinstall the app, it works for about 10 min correctly as it should and and then it reverts to the same problem. I am out of options and do not know what else I could do to fix this. Right now I am working on my old Mac tower G5 and CS4 where everything works as it is suppose to, but I really need to get this fixed. Can any one help or has solution for my problem? Please.hey i m working on my illustrator and i m having many problems with my swatches
for example i use the green phosphorique i don't get this color i get another green
and many colors too it's like illustrator chooses for you the only green color
so please i kind of need help i can show you pictures of that i print screen viewed them.. so anybody who can help... pleaaaaaaaaaase contact me because i m having a project now..
my e mail is [email protected] i would be thankful
i even tried to download the illustrator on my friend's computer also i m having this problem .... -
Using nested Joins in abap prog
Hi All,
please help me out in using nested joins in abap progrmaming. I dont know about joins in abap.specially in case of outer join.
I have 5 internal tables.. mara ,marc, mvke,mbew,ampl. am using a select query with certain fields from all these tables.
I need to disply all the materials of a mara for a particular date irrespective of the values in fields of other tables.
Even if that materail is not present in other table for certain condtion ,that material should get displyed with all other fields showing null value..Hi RK,
the code am using is of the same way...but my problem was with the joins..in the select query am using nested join combining inner and outer join.. but i could not able to display all the materials of mara of a particular date..
The code looks like this..
SELECT <some fields.......>
INTO TABLE i_materials
FROM ( marc AS b
INNER JOIN mara AS a ON amatnr = bmatnr
INNER JOIN mvke AS c ON cmatnr = amatnr
INNER JOIN ampl AS g ON gbmatn = amatnr
LEFT OUTER JOIN mbew AS d ON dmatnr = bmatnr
AND dbwkey = bwerks )
WHERE a~matnr IN s_matnr AND .................
Else
SELECT <some fields.......>
INTO TABLE i_materials
FROM ( marc AS b
INNER JOIN mara AS a ON amatnr = bmatnr
INNER JOIN mvke AS c ON cmatnr = amatnr
INNER JOIN ampl AS g ON gbmatn = amatnr
LEFT OUTER JOIN mbew AS d ON dmatnr = bmatnr
AND dbwkey = bwerks )
FOR ALL ENTRIES IN i_mara
WHERE a~matnr = i_mara-matnr AND ............ -
Stored Proc to create XML (using nested cursors)?
From previous posts and from the
documentation for XSQL I have
discovered the joys of the
CURSOR operator to create
nested tables: i.e:
SELECT dname,
CURSOR (SELECT ename, sale....) as employees
FROM dept
However, I can not find any other
documentation on how to program (PL/SQL)
this functionality.
I would like to use XSQL as
it is exactly what I need, but
I can not because my client does
not want to use Java and they
require IIS, but do not want to
use JRUN, etc... (I tried this
first).
Since I only need to do an XML
dump to a variable for processing
by other parts of the program, life
is fairly easy. I have already done
this using Microsoft Data Shapes in
VB (client does not want VC++ either...)
However this was slow.
In order to speed things up I want to
create a stored procedure in Oracle to
dump out the XML hierarchy to a variable given
an SQLQuery input. If I use
nested CURSORS this should be very easy.
I would like to create a recursive PL/SQL
function to handle this, but I have the
following questions:
1) I want the function to have an
input of an open cursor,
My plan is to detect the column
type, when it is a nested cursor
I would recurse with the open cursor
to handle the nested cursor.
2) I can not find a reference on to
programatically handle "untyped collections
based on an SQL statement" in anything
other than the XSQL documentation.
I am assuming that I can detect the
column type of nested cursor somehow
and then recurse on this to handle
dump the recordset to an XML tagset.
But I wuold like to find some documentation
or examples on the calls, type statements,
etc....I think the CURSOR() thing is an invention of the XSQL Servlet; not available elsewhere.
You can accomplish nesting via user defined types and object views, using the "cast(multiset())" syntax, which is not documented particularly well either. This does require some setup, and so is not particularly dynamic. -
Advantages of using nested iViews
Hi All,
Could anybody point out what are the major advantages of using nested iViews? Under what circumstances is the usage of nested iViews desired or recommended? Thanks!
cheers
PrachiHi Prachi
The nested iviews comes handy in case where in you model expects numerable UI elements or heavy UI screen.
Nested iview is a way of achieving componentized models and also avoids re-work.
You could avoid error like these:-
"Error in compiling Flex application:
Error: Branch between 8479 and 41869 around line 0 exceeds 32K span.
If possible, please refactor this component.
Failed to compile AAD8T3.mxml"
This is the well known 32K limitation from Adobe Flex 1.x. The compiled applications are not allowed to be larger than 32K. That usually happens with larger models.
Solution:-
In order to solve this issue, you need to redesign your application and use nested iViews (basically splitting the model into multiple components)
To instantiate you,go through this thread:-
Re: Multiple input forms problem
Regards
Navneet
Maybe you are looking for
-
Connecting ORACLE 10G, SAP R/3 to Xcelsius dashboard
Dear All, I have a scenario with a customer, where in we have to develop an XCelsius dashboard over Oracle 10g source. Customer is keen on building dashboards directly on top of Oracle 10G (or) SAP R/3. Could you please let me know - which approach i
-
Connect fileserver to proxyserver... Please help..
Hello, i recently installed an antivirus on a novell 6 fileserver and now i want to update the virus definitions, but i cant connect the fileserver to the internet, i have a novell bordermanager proxyserver with the address 172.22.0.1 but i cant conn
-
Externally Processed Operation
Hi All, I want to perform end-to-end cycle for externally processed material. Please provide link or document having step-by-step guideline. I got following error: I have performed following steps: 1) In the routing control key maintained which is ex
-
HOW-TO initialize class variable
How can an annotation initialize a class variable? For example, JEE5 has an annotation called @EJB that initializes a class variable with a remote or local interface: @Stateless class Foo @EJB bar; bar.scoobyDoobyDoo(); // I can use bar seemingly bef
-
Hi, does anybody knows how to have barcodes working with the bursting engine ? I have the xdo.cfg in $XDO_TOP, the standard XMLP output has got the barcodes but the bursted PDF do not. We are launching the bursting engine from the after report trigge