Logic to get the view in MM02
Hi,
I would just like to ask if there is an easier way to get the selection views in MM02. There are different views per material and I need to insert the logic in getting the view to a custom program. The custom program will be used for performing a BDC transaction that's why I need to get the logic for the views.
Hi
Try using the function module SELECTION_VIEWS_FIND
* Material views ....................................................
data: l_vpsta like t130m-pstat.
select single vpsta
into l_vpsta
from mara
where matnr = p_matnr.
* Get View sequence .................................................
data: l_bild like t133a-bilds,
lt_bild like mbildtab occurs 0 with header line.
* Screen Sequence for Standard Industry tab pages in material master
l_bild = '21'.
* Get screen sequence
call function 'SELECTION_VIEWS_FIND'
exporting
bildsequenz = l_bild
pflegestatus = l_vpsta
tables
bildtab = lt_bild
exceptions
call_wrong = 1
empty_selection = 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.
Shiva
Similar Messages
-
How to get the view link definition from the view link accessor
Hi,
I am using Jdev 10.1.3 and ADF BC. I am trying to do deep copy in a master/details view, after the new child record is created, I want to update the foreign key attribute. I know I can get the list of attribute definitions from the row in the view object, which include the view link accessors, I am wondering if I can get the view link definition from the view link accessors, so that I can get the source and destination attribute names.
Thanks!Hi,
you should get this through
ViewObject vo = this.findViewObject("LocationsView1");
int indx = vo.getAttributeIndexOf("DepartmentsView");
ViewAttributeDefImpl vAttrDefImpl = (ViewAttributeDefImpl) vo.getAttributeDef(indx);
ViewLinkDefImpl vdefImpl = (ViewLinkDefImpl) vAttrDefImpl.findViewLinkDefImpl();
Note that this code starts from the ApplicationModuleImpl class, which is why I used this.findViewObject().
Frank -
How to get the view Object in UserDefined Action
Hi All,
Any body tell me how to get the view object , like the view object avilable in the wdDoModifyView() method as parameter.
I have requirement like, i want to change the , no of rows displaying in the table should be changed at the runtime based onthe no of rows selected in the dropdown box.
The action which i created will be assigned to that dropdown box, on select of the available option, i will get the view object and change the properties of the "maxrows" of the table .
so for getting the view object in the the Action methods tell me what is the procedure for getting the current view object.Hello Vishal,
Simply create a value attribute (say rowCount) of type 'integer' and bind it to the 'visibleRowCount' property of your table. Then, in the actionHandler get the value from the UI element (in your case, I guess it is drop down) and set it to the attribute 'rowCount' like this.
wdContext.currentContextElement.setRowCount(
wdContext.current<nodeElement>.set<AttributeBound toDropDown>);
Bala -
How to get the view tree from a jsp page
Hi,
I would like to get the view tree of a jsp page. The idea is to dynamically include the content of one or more jsf pages into a UIPanel during a "value changed" event.
So, i could get from an arbitrary page like ...
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<h:panelGrid columns="3" width="100%" rowClasses="gridTop">
<h:outputText value="#{someBean.someValue}"/>
</h:panelGrid>... the corresponding List of components...
Any idea?Thanks for your answer Jayashri,
The view tree can be retrieved by this way during the page is parsed, for example with scriptlets <%%>, or once the page has been parsed (the view has been builded and attached to the FacesContext).
My problem is to get the view tree of a page from another Context.
The idea is to build a dynamic layout of some pages that represents "views". I can imagine this like the concept of perspectives and views of Eclipse IDE.
Because of the difficulty to build it with pure JSP (cannot use dynamic ID nor JSTL ForEach), I try to build it into my backing bean and to bind it with a <h:panelGrid/>. By this way, I'm not able to use the <jsp:include/> tag as I usually did to include some content into the view tree.
Sorry for my english ;)
- Renaud. -
Can't get the view function to work properly...
For some reason, I no longer can get the VIEW function to do what I want. Specifically, everytime I try to get ARTIST to show, it shows ALBUM BY ARTIST instead. This does NOT happen in my downloaded file, only in the entire library. Anyone else have this happen to them? Please advise.
In the Masked Artwork folder go to a photo with the keyword "food". Does it have a check mark at food?
I have had situations where the photo had the keyword printed under the title, but the check mark is not present. A search with that combination for the keyword yields "no image found".
Go to bottom of your keywords panel and look under Other Keywords. Is Food there and checked? If so you can right click on this keyword and Find will work. If you have the type of situration where keyword has no check mark in your tree, except for at Other, I found you have to delete them and then re-enter them. It will then work.
Let me know what you find discover. -
How to get the View for a particular Document position?
Hi there,
Does anyone know how to get the "deepest" View that is responsible for rendering a particular Document offset?
I tried looking at modelToView() and some other methods, but I am lost.
Can anyone please help me?
Thanks,
SwatiBart--
To find the table cell of the insertion point, you could use something like:
InterfacePtr<ITextStoryThread> storythreadp(txtModel->QueryStoryThread(startPos + 1));
InterfacePtr<ICellContent> cellcontentp(storythreadp, UseDefaultIID());
if (! cellcontentp) {
// Not a table cell, so see if it's the primary thread (kTextStoryBoss/ITextModel).
InterfacePtr<ITextModel> threadmodelp(storythreadp, UseDefaultIID());
if (threadmodelp) {
// It's the primary thread...
else {
// It's something else with an ITextStoryThread (note, footnote, etc.).
else {
// The insertion point's in a table cell (kTextCellContentBoss).
InterfacePtr<ITableModel> tableModel(cellcontentp->GetTableModel(), UseDefaultIID());
GridID gridID(cellcontentp->GetGridID());
GridAddress gridLoc(cellcontentp->GetGridAddress());
// ...and so on.
Hope this helps get you where you want to go.
Chris Roueche / Freelance Developer -
How can I get the View Tab name on the Crystal Report Viewer at runtime?
When a report is displayed in the Windows Forms Crystal Report Viewer and the user drills into the report, the drill down view is displayed in a seperate view and is identified via a View tab at the top of the report. I can determine the index of the view tab that is currently selected, but I need to access the text that is on the View tab. The only properties that I've found that pertain to the "view" on the Crystal Report viewer are the ActiveViewIndex and the ViewCount. Unfortunately, neither of these items help me because they are not specific to a certain section of the report. Has anyone had any luck accessing the View Tab properties ? Thanks.
The tabs at the top of the page are nested within some of the viewers controls. Through trial and error you just have to find the right one. In this case the main part of the report is in the first control. This happens to be a TabControl. From there you can loop through the TabPages on the TabControl to grab the names of the tabs.
Here is a quick example of what I did to get the tab text. All this code was in a button click event.
Control oControl = crystalReportViewer1.Controls[0];
TabControl oTabControl = (TabControl)oControl.Controls[0];
foreach (TabPage oTabPage in oTabControl.TabPages)
MessageBox.Show(oTabPage.Text); -
How to get the view in editable mode with OCA button.
Dear Experties,
I am new to CRM WEB UI ,I have got the requirement to develope a view with OCA button on it and when i click on the button it should direct to the second view and it should open with edit mode.
The Source view is table type and target view is form type.
I am able to achieve this but unable to get it in editable mode.
I have added the below code in do_prep_output method but getting dump at the line
lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_first( ).
The error message is
Long text During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The source type '\CLASS=CL_BSP_WD_MIXED_NODE' is not compatible for assigning with the target type '\CLASS=CL_CRM_BOL_ENTITY'.
Please somebody help me on this
lv_display = me->view_group_context->is_view_in_display_mode( me ).
IF lv_display EQ abap_false.
ELSE.
me->view_group_context->set_view_editable( me ).
ENDIF.
DATA: lr_tx TYPE REF TO if_bol_transaction_context,
lr_entity TYPE REF TO cl_crm_bol_entity,
lr_comp type REF TO ZL_BT131QI__BSPWDCOMPONEN_IMPL.
lr_comp ?= me->comp_controller.
Check lr_comp is BOUND.
lr_entity ?= lr_comp->typed_context->BTADMINI->collection_wrapper->get_current( ).
CHECK lr_entity IS BOUND.
IF lr_entity->lock( ) = abap_true.
me->view_group_context->set_view_editable( me ).
ENDIF.
lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_first( ).
WHILE lr_entity IS BOUND.
lr_entity->lock( ).
lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_next( ).
ENDWHILE.
The following error text was processed in the system:
Source type \CLASS=CL_BSP_WD_MIXED_NODE is not compatible, for the purposes of assignment, with target type \CLASS=CL_CRM_BOL_ENTITY
Exception Class CX_SY_MOVE_CAST_ERROR
Error Name MOVE_CAST_ERROR
Program ZL_ZBT131QI_EMAINLEG_IMPL=====CP
Include ZL_ZBT131QI_EMAINLEG_IMPL=====CM00C
ABAP Class ZL_ZBT131QI_EMAINLEG_IMPL
Method EH_ON_EDIT
Line 33
Long text During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The source type '\CLASS=CL_BSP_WD_MIXED_NODE' is not compatible for assigning with the target type '\CLASS=CL_CRM_BOL_ENTITY'.
Thanks in advance!!!Hi,
in CRM a context can consist of model nodes, value nodes and, unfortunately, mixed nodes. While mixed nodes implement the same interface as model nodes they can't be casted into a CL_CRM_BOL_ENTITY directly. Instead you need to perform the following conversion in order to get the model node from the mixed node:
DATA: mixed_node TYPE REF TO cl_bsp_wd_mixed_node,
entity TYPE REF TO cl_crm_bol_entity.
mixed_node = me->typed_context->EMAINLEG->collection_wrapper->get_first( ).
entity = ?= mixed_node->if_bsp_wd_ext_property_access~get_model_node( ).
Best,
Christian -
How to get the view name by passing the window name from table
Hi All,
would like to knew about the standard table from which we want to "retrieve the VIEW name by passing WINDOW name"
as we have standard tables like WDY_WINDOW, WDY_VIEW,WDY_APPLICATION but our ZComponent details
are not updated in this WDY_WINDOW table.
Is there any other table exists on the above condition
Regards
Jaipal.EHello friend,
There are many structure names started with WDY_WB_VC*where the details of the windows and views are stored just search those structures and see where its getting the tables in run time so that you can get the source tables.
I think this will be useful for you.
Thanks,
Sri Hari -
RowSetInfo; bc4j; how to get the View Object
So I'm trying to get/update/insert/delete records in a database that contain an interMedia image in a blob.
I've figured out that I can't simply set the ImmediateAccess attribute. It doesn't like that...
So I'm trying to go after the view object, since the interMedia white paper uses a VO row setAttribute to accomplish the write.
RowSetInfo extends ResultSetInfo which has a method getViewObject(). Cool.
So I try it... and get an error that getViewObject() has protected access.
Anyone know what I am doing wrong? Or should I be even taking this approach?!?!?!
If I go exclusively with the VO layer... how do I preserve the navigationBar functionality? Or do I need to roll my own?
( NOTE: This hilights another example of the perception of 'friction' between rowsetinfos and the view objects/entity objects. An approach that makes "sense" to me as a naive novice didn't pan out. And oddly, most of the bc4j examples go against VOs when, if you are an application programmer, you may never see or use the VO methods ( although it looks like we should be)... we're working at the ResultSetInfo layer. )
Is the the observation of other folk who are building Java Applications/Applets? Or do you all work directly with VOs instead of going through the ResultSetInfo "layer"?Here is some sample code that I am currently working on and will post on OTN when complete. The code shows how to access a BC4J Domain based on an Oracle type. Working with interMedia is similar since interMedia utilizes Oracle Object types. Please note that I have not tested this yet against interMedia, but I'm hoping that you may find the general process useful.
// Copyright (c) 2000 Oracle Corporation
package ObjectSampleDAC;
import oracle.dacf.control.swing.*;
import javax.swing.*;
import oracle.dacf.dataset.*;
import oracle.dacf.dataset.connections.*;
import java.awt.*;
import oracle.jdeveloper.layout.*;
import java.awt.event.*;
import javax.infobus.*;
import oracle.jbo.domain.DomainInterface;
import ObjectSampleBC4J.common.TAddress;
import java.sql.SQLException;
* A Frame class.
* <P>
* @author Scott Tiger
public class Frame1 extends InfoFrame {
* Constructs a new instance.
public Frame1() {
super();
try {
jbInit();
sessionInfo1.publishSession();
// call my initialization method
bfInit();
catch (Exception e) {
e.printStackTrace();
* Initializes the state of this instance.
private void jbInit() throws Exception {
/* All of the following code in this method was added by the designer except where noted below
EmailrowSetInfo1.setName("Email");
jPanel3.setLayout(gridBagLayout1);
StatusrowSetInfo1.setName("Status");
AddressrowSetInfo1.setName("Address");
PasswordrowSetInfo1.setName("Password");
UsernamerowSetInfo1.setName("Username");
LastnamerowSetInfo1.setName("Lastname");
FirstnamerowSetInfo1.setName("Firstname");
IdrowSetInfo1.setName("Id");
rowSetInfo1.setAttributeInfo( new AttributeInfo[] {
IdrowSetInfo1,
FirstnamerowSetInfo1,
LastnamerowSetInfo1,
UsernamerowSetInfo1,
PasswordrowSetInfo1,
AddressrowSetInfo1,
StatusrowSetInfo1,
EmailrowSetInfo1} );
this.setDataItemName("infobus:/oracle/sessionInfo1");
this.setTitle("Customer Information");
this.getContentPane().setLayout(borderLayout1);
this.setSize(new Dimension(536, 473));
jPanel1.setLayout(borderLayout2);
sessionInfo1.setAppModuleInfo(new ModuleInfo("ObjectSampleBC4J", "ObjectSampleBC4JModule"));
sessionInfo1.setConnectionInfo(new LocalConnection("MyJdbcConn"));
sessionInfo1.setName("sessionInfo1");
rowSetInfo1.setQueryInfo(new QueryViewInfo(
"CustomerView",
rowSetInfo1.setSession(sessionInfo1);
rowSetInfo1.setName("rowSetInfo1");
/* The following listener was added using the event tab in the property inspector in design
mode. The rowsetPopulated method is called when the rowset is queried/requeried.
rowSetInfo1.addChangeListener(new oracle.dacf.dataset.ChangeAdapter() {
public void rowsetPopulated(RowSetChangeEvent e) {
rowSetInfo1_rowsetPopulated(e);
textFieldControl1.setText("textFieldControl1");
textFieldControl2.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Firstname");
textFieldControl2.setText("textFieldControl2");
textFieldControl3.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Lastname");
textFieldControl3.setText("textFieldControl3");
textFieldControl4.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Username");
textFieldControl4.setText("textFieldControl4");
textFieldControl5.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Password");
textFieldControl5.setText("textFieldControl5");
textFieldControl6.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Status");
textFieldControl6.setText("textFieldControl6");
textFieldControl7.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Email");
textFieldControl7.setText("textFieldControl7");
navigationBar1.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1");
jLabel1.setText("ID:");
jLabel2.setText("First Name:");
jLabel3.setText("Last Name:");
jLabel4.setText("User Name:");
jLabel5.setText("Password:");
jLabel6.setText("Status:");
jLabel7.setText("Email:");
jLabel8.setText("Address:");
jPanel4.setLayout( gridBagLayout2);
textFieldStreet.setColumns(20);
textFieldStreet.setText("textFieldStreet");
/* The following listener (as well as the listeners on textFieldCity, textFieldState, and
textFieldZipcode were added by the designer, but the focusGained and focusLost methods
were modified in each case to call a common textField_focusGained method
textFieldStreet.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(FocusEvent e) {
textField_focusGained(e);
public void focusLost(FocusEvent e) {
textField_focusLost(e);
textFieldCity.setColumns(20);
textFieldCity.setText("textFieldCity");
textFieldCity.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(FocusEvent e) {
textField_focusGained(e);
public void focusLost(FocusEvent e) {
textField_focusLost(e);
textFieldState.setColumns(20);
textFieldState.setText("textFieldState");
textFieldState.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(FocusEvent e) {
textField_focusGained(e);
public void focusLost(FocusEvent e) {
textField_focusLost(e);
textFieldZipcode.setColumns(20);
textFieldZipcode.setText("textFieldZipcode");
textFieldZipcode.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(FocusEvent e) {
textField_focusGained(e);
public void focusLost(FocusEvent e) {
textField_focusLost(e);
jLabel9.setText("Street:");
jLabel10.setText("City:");
jLabel11.setText("State:");
jLabel12.setText("Zip Code:");
textFieldControl1.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Id");
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jPanel2, BorderLayout.NORTH);
jPanel2.add(navigationBar1, null);
jPanel1.add(jPanel3, BorderLayout.CENTER);
jPanel3.add(textFieldControl1, new GridBagConstraints2(1, 0, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(37, 11, 0, 0), 0, 0));
jPanel3.add(textFieldControl2, new GridBagConstraints2(1, 1, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(7, 11, 0, 0), 0, 0));
jPanel3.add(textFieldControl3, new GridBagConstraints2(1, 2, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(7, 11, 0, 0), 0, 0));
jPanel3.add(textFieldControl4, new GridBagConstraints2(1, 3, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6, 11, 0, 0), 0, 0));
jPanel3.add(textFieldControl5, new GridBagConstraints2(1, 4, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6, 11, 0, 0), 0, 0));
jPanel3.add(textFieldControl6, new GridBagConstraints2(1, 5, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(7, 11, 0, 0), 0, 0));
jPanel3.add(textFieldControl7, new GridBagConstraints2(1, 6, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6, 11, 0, 0), 0, 0));
jPanel3.add(jLabel1, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(37, 106, 0, 0), 0, 0));
jPanel3.add(jLabel2, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 54, 0, 0), 0, 0));
jPanel3.add(jLabel3, new GridBagConstraints2(0, 2, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 54, 0, 0), 0, 0));
jPanel3.add(jLabel4, new GridBagConstraints2(0, 3, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 54, 0, 0), 0, 0));
jPanel3.add(jLabel5, new GridBagConstraints2(0, 4, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 62, 0, 0), 0, 0));
jPanel3.add(jLabel6, new GridBagConstraints2(0, 5, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(9, 83, 0, 0), 0, 0));
jPanel3.add(jLabel7, new GridBagConstraints2(0, 6, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(9, 86, 0, 0), 0, 0));
jPanel3.add(jLabel8, new GridBagConstraints2(0, 7, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(7, 72, 94, 0), 0, 0));
jPanel3.add(jPanel4, new GridBagConstraints2(1, 7, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
jPanel4.add(textFieldZipcode, new GridBagConstraints2(1, 3, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
jPanel4.add(textFieldState, new GridBagConstraints2(1, 2, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
jPanel4.add(jLabel9, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
jPanel4.add(textFieldStreet, new GridBagConstraints2(1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
jPanel4.add(jLabel10, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
jPanel4.add(jLabel11, new GridBagConstraints2(0, 2, 1, 1, 0.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
jPanel4.add(jLabel12, new GridBagConstraints2(0, 3, 1, 1, 0.0, 0.0,
GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
jPanel4.add(textFieldCity, new GridBagConstraints2(1, 1, 1, 1, 0.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
/* The following vaiable declarations were made by the designer
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
SessionInfo sessionInfo1 = new SessionInfo();
RowSetInfo rowSetInfo1 = new RowSetInfo();
AttributeInfo IdrowSetInfo1 = new AttributeInfo(java.sql.Types.NUMERIC);
AttributeInfo FirstnamerowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
AttributeInfo LastnamerowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
AttributeInfo UsernamerowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
AttributeInfo PasswordrowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
AttributeInfo AddressrowSetInfo1 = new AttributeInfo();
AttributeInfo StatusrowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
AttributeInfo EmailrowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
TextFieldControl textFieldControl1 = new TextFieldControl();
TextFieldControl textFieldControl2 = new TextFieldControl();
TextFieldControl textFieldControl3 = new TextFieldControl();
TextFieldControl textFieldControl4 = new TextFieldControl();
TextFieldControl textFieldControl5 = new TextFieldControl();
TextFieldControl textFieldControl6 = new TextFieldControl();
TextFieldControl textFieldControl7 = new TextFieldControl();
BorderLayout borderLayout2 = new BorderLayout();
NavigationBar navigationBar1 = new NavigationBar();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
GridBagLayout gridBagLayout1 = new GridBagLayout();
JPanel jPanel4 = new JPanel();
JTextField textFieldStreet = new JTextField();
JTextField textFieldCity = new JTextField();
JTextField textFieldState = new JTextField();
JTextField textFieldZipcode = new JTextField();
JLabel jLabel9 = new JLabel();
JLabel jLabel10 = new JLabel();
JLabel jLabel11 = new JLabel();
JLabel jLabel12 = new JLabel();
GridBagLayout gridBagLayout2 = new GridBagLayout();
/* The following declarations were made manually
/* DomainAccess provides a means for getting and setting values of a column object as domain
DomainAccess da = null;
/* TAddress is the domain class
TAddress addr = null;
/* Declare variables for determining if JTextField values have been changed by user
String oldVal = null;
String newVal = null;
/* The following method is generated by the wizard when the frame was created
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSED) {
System.exit(0);
public void bfInit () throws Exception {
/* To add code to be invoked when the user moves from one row to another, get the
DataItemChangeManager from the RowSetInfo (via RowsetAccess) and add a
DataItemChangeListener. The specific method we want to use here is rowsetCursorMoved
which is invoked when the user moves from one row to another; the other methods are
defined simply because the interface requires them.
RowsetAccess ra = rowSetInfo1.getRowsetAccess();
DataItemChangeManager dcm = (DataItemChangeManager)ra;
dcm.addDataItemChangeListener(new DataItemChangeListener() {
public void rowsetCursorMoved(RowsetCursorMovedEvent e) {
rowSetInfo1_rowsetCursorMoved(e);
public void dataItemAdded(DataItemAddedEvent e) {
public void dataItemDeleted(DataItemDeletedEvent e) {
public void dataItemRevoked(DataItemRevokedEvent e) {
public void dataItemValueChanged(DataItemValueChangedEvent e) {
/* This method was generated by the designer. See rowSetInfo1.addChangeListener(...) in jbInit
above.
void rowSetInfo1_rowsetPopulated(RowSetChangeEvent e) {
try {
/* When the rowset is populated, set the JTextField values based on the domain. See
updateFields() below.
updateFields();
catch (Exception ex) {
System.out.println("Error occurred while retrieving values");
ex.printStackTrace();
/* This method was added manually to track row navigation. See dcm.addDataItemChangeListener(...)
in jbInit above.
void rowSetInfo1_rowsetCursorMoved(RowsetCursorMovedEvent e) {
try {
/* When the user moves from one row to another, set the JTextField values based on the
domain. See updateFields() below.
updateFields();
catch (Exception ex) {
System.out.println("Error occured while assigning values");
ex.printStackTrace();
/* This method finds the values from each field of the column object by using the domain, then
sets the values of the JTextFields respectively. It is invoked when the rowset is initially
populated, and each time the user moves from one row to another.
public void updateFields () throws Exception {
/* Get DataItem for the Address column object and cast to DomainAccess for to prepare for
getting and setting column value as domain.
da = (DomainAccess)AddressrowSetInfo1.getImmediateAccess();
/* Get the value of the attribute as a Domain and cast to DomainInterface.
DomainInterface di = da.getValueAsDomain();
/* null out addr. Otherwise, if the address column is null for a particular record, when
the user navigates to the record with the null values, addr will retain the previous record's
values. This ensures a clean slate.
addr = null;
/* Using DomainInterface allows us to cast the domain object to the specific Domain class for
that type. So, cast the address attribute's value to TAddress, the class that
represents the T_ADDRESS type created in the database. This provides getters and setters
for each of the fields of the Object Type.
if ( di instanceof TAddress ) {
addr = (TAddress) di;
/* If the above statement resulted in some non-null object assigned to addr, it is because
one or more of the fields of the domain contained non-null values. Therefore, if addr is
not null, get the values from each field of the domain and assign them to their
respective JTextFields. Otherwise, set each JTextField to an empty string.
if (addr != null) {
textFieldStreet.setText(addr.getStreet());
textFieldCity.setText(addr.getCity());
textFieldState.setText(addr.getState());
textFieldZipcode.setText(addr.getZipcode());
else {
textFieldStreet.setText("");
textFieldCity.setText("");
textFieldState.setText("");
textFieldZipcode.setText("");
/* If addr is null, after making sure the JTextFields are cleared, create a new TAddress
object so that we have something to assign values to if the user edits the JTextFields.
try {
addr = new TAddress();
catch (SQLException ex) {
System.out.println("Error creating domain TAddress");
ex.printStackTrace();
/* The method below is invoked when the user navigates to textFieldStreet, textFieldCity,
textFieldState, or textFieldZipcode. It's used just to find the value of the field when
the user enters the field (the "before" value).
void textField_focusGained(FocusEvent e) {
Object obj = e.getSource();
if (obj instanceof JTextField) {
JTextField field = (JTextField)obj;
oldVal = field.getText();
/* The method below is invoked when the user navigates away from textFieldStreet, textFieldCity,
textFieldState, or textFieldZipcode. It checks to see if the user changes the value of the
field, and if so, updates the value of the address attribute.
void textField_focusLost(FocusEvent e) {
/* Find out the value of the JTextField now that the user is attempting to leave the field.
Object obj = e.getSource();
if (obj instanceof JTextField) {
JTextField field = (JTextField)obj;
newVal = field.getText();
/* Compare the new value of the field ("after" value) to the "before" value captured
in textField_focusGained above. If they are equal, we do nothing. If they are not equal,
then the user must have changes the value in the field, and we have some work to do.
if (!oldVal.equals(newVal)) {
/* Since this same method is called regardless of which JTextField has been left, we find
out which text field the user is leaving, and then set the value of the appropriate
element of the addr domain.
if (obj.equals(textFieldStreet)) {
addr.setStreet(newVal);
if (obj.equals(textFieldCity)) {
addr.setCity(newVal);
if (obj.equals(textFieldState)) {
addr.setState(newVal);
if (obj.equals(textFieldZipcode)) {
addr.setZipcode(newVal);
/* So, we've set the value of the appropriate element of the addr domain, but we have not
"posted" those changes to the BC4J (middle-tier), so if we were to commit at this point
our changes would not get saved to the database (because BC4J is not aware of these
changes). The next step is to notify BC4J of the changes.
try {
da.setValueAsDomain(addr);
catch (InvalidDataException ex) {
System.out.println("Invalid Data assigned to TAddress");
ex.printStackTrace();
/* Clear out the oldVal and newVal variable so we are ready to track more changes.
oldVal = null;
newVal = null;
}-- Brian -
Logic to get the highest number
Hi,
I have a report request where i have Supplier, spend type and spend.
Spend type can be Direct or Indirect. Each supplier can have Direct and Indirect Spend, in that case i need to get the highest spend to show up on the report.
i need to write a logic to get this data ...
Any help is appreciated.
Thank You.use max() function
-
TableSorter :: getting the viewed rownumber
Hi, ive been looking through this forum for over an hour without resolving this issue (which i bet have been answered already a dozen or more times)
im using a search method that later should either select or change the color of the cell matching the search criteria..
and as u might guess, it works nicely until its sorted, then for obvious reasons, since i dont know how to retrieve the viewed row number i end up selecting the same cell/row over and over and over..
so my question is following,
how do i retrieve what rownumber TableModel views the real rownumber on..
and secondly if u feel like it, can u explain how i would change the background of a cell that i know the chords of..
Thanks in advance!
http://java.sun.com/docs/books/tutorial/uiswing/components/examples/TableSorter.java - the TableSorter class im using, no changes made.public int[] searchTable(String[][] p, int[] mPos, String match) {
boolean found = false;
if ((mPos[0] != 0) || (mPos[1] != 0)) { mPos[1]++; }
if (mPos[1] < p[0].length) {
//run through column once
for (int j = mPos[1]; j < p[0].length; j++) {
System.out.println("for 2 : "+mPos[0]+":"+j );
if (p[mPos[0]][j] != null) {
if (p[mPos[0]][j].equalsIgnoreCase(match)) {
mPos[1] = j;
return mPos;
mPos[0]++;
mPos[1] = 0;
if (mPos[0] < p.length) {
for (int i = mPos[0]; i < p.length; i++) {
System.out.println("for 1: "+i);
for (int j = mPos[1]; j < p.length; j++) {
System.out.println("for 2 : "+i+":"+j );
if (p[i][j] != null) {
if ((p[i][j].equalsIgnoreCase(match)) && (p[i][j] != null)) {
System.out.println("pos: "+ i+ ":" +j);
if (j+1 < p[i].length)
mPos[0] = i;
mPos[1] = j;
System.out.println("match@" + i + ":" + j);
found = true;
return mPos;
Arrays.fill(mPos, 0);
return mPos;
its a bit messy, but it returns the position mPos[0] - rows and mPos[1] -column, that matched.. the additional code is to make it researchable from last position +1..
anyways, it gets sent the data from MyTableModel mtm as String[][].. -
Java3D - how to get the viewing frustum coordinates
Hi all!
I am so desperate to find out how to retrieve the viewing frustum (truncated pyramid) coordinates (xyz) in Java3D.
Please let me know. I checked the API docs but no luck.
I am sure there must be some way (or method) of extracting these (xyz) coodrinates from this frustum.
Thanks!firstly I humbly admit I am not that familiar with openGL so I dont know what those functions are doing ..but still I might be missing what is it you are looking for...u saying "to get xyz" coordinates of truncated pyramid ... u need 8 points (depending on the way you wanna calculate it)to create viewing frustum so which one u looking for? ....btw there is a viewing frustum method to get points but unfortunately due to j3d setup by the time u get them using that method 2 frames will go by .... so
View view = viewer.getView();
double point1 = view.getBackClipDistance() * SOME_CONSTANT;
double point2 = view.getFrontClipDistance();
double point3 = view.getFieldOfView();
double point4 = (double) view.getCanvas3D(0).getWidth() /
(double) view.getCanvas3D(0).getHeight();
double point5 = Math.tan(point3 / SOME_CONSTANT) * point2;
double point6 = point5 / point4;
double point7 = (point5 / point1) * point1;
double point8 = point7 / point4;
now just just normals and u can setup up your 6 planes of the view frustum ... -
How do I get the viewer in imovie to reflect the correct orientation of the video?
I have a video that I've taken with my iphone 4s which plays with the correct orientation in quicktime. When I import it into imovie '08, the event thumbnails reflect the correct orientation as well but for some reason the preview shown in the viewer is upside and if I export it, the output is upside down. I've attached a screenshot so everyone can see exactly what I'm talking about. Now if I rotate the clip so that the thumbnails appear upside down, the viewer shows the correct orientation, but that isn't really a solution. Also, I should mention that this is a fresh install of imovie. Any help would be much appreciated!
I definitely appreciate the response. I'm aware of how to rotate the clip as a workaround, but simply rotating the clip so that the clip itself appears upside down and the viewer output looks right side up doesn't really fix the underlying problem. In the past whenever I've used imovie, the viewer reflects the orientation of the event/project thumbnails instead of being the opposite orientation. Any thoughts on why the viewer wouldn't be reflecting the same orientation as the clip?
-
I can't find an option to open or view the document first instead of automatically downloading it to my computer
See:
* https://support.mozilla.com/kb/Managing+file+types
Reset the action fo PDF to "Always ask": Firefox > Preferences > Applications
Maybe you are looking for
-
IPhone 5C - Turned itself off and won't come back on.
I have owned this phone since the day it came out (20th September) and it was fine up until a few weeks ago. It decided - frequently - to reboot itself, lines would appear on my screen and the brightness would decrease until the phone turned itself o
-
Developing an online web application
Hi, I'm currently doing my final year project at uni as part of a computer science degree and am designing an interactive breast cancer diagnosis system. At the moment I'm just programming the basic structure including, registration, login,feedback a
-
Setting Up a New Mac From Two Different Time Machine Back-ups?
Greetings Apple People, I am planning on getting a new iMac. Right now my wife I are still using our separate MacBooks from college. Both of them have Time Machine back-ups. We would like to setup our new iMac to have two different users. Is it possi
-
SELECT DISTINCT does not work. Why?
Dear All, I wrote the Query below in SAP B1 8.8 and it works fine. But, for some strange reason, certain records are duplicated. Could anybody explain why? I tried to eliminate the duplicates by changing the 1st line of the Query from SELECT to SELEC
-
WRT160NL - Connection drops, Reboots, USB performance
WRT160NL - Connection drops, Reboots, USB performance After reading many posts dating back several months regarding internittent connectivty drops, usb performance issues and users having to reboot there routers frequently with the WRT160NL, I was f