How to set value from one view to other view's context node attr b4 save

HI all,
My requirement is as below:
There are two views in component BP_CONT.
BP_CONT/ContactDetails    IMPL class
BP_CONT/SalesEmployee   SALESEMPLOYEE    STRUCT.SALESEMPLOYEE
I want to set value from first view to second view's context node's attribute.
i get Sales Employee BP number in ContactDetails view, from here i want to set that value in to STRUCT.SALESEMPLOYEE
of second view in the same component.
please send me code snippet for doing the same.
Thanks in advance.
seema

Hi Seema
You can access the fields from different views by either using custom controllers or by using component controllers, in your case you can access the Sales employee BP number from the Component controller.
first access the component controller  as below in BP_CONT/SalesEmployee  (in do_prepare_output method) or in (specific setter method)
lv_compcontroller type ref to CL_BP_CONT_BSPWDCOMPONENT_IMPL,
lv_partner type ref to cl_crm_bol_entity,
lv_role type string,
lv_partner_no type string.
lv_employee TYPE REF TO if_bol_bo_property_access,
lv_compcontroller  = me->COMP_CONTROLLER.
lv_partner ?= lv_compcontroller  ->typed_context->-partner->collection_wrapper->get_current( ).
lv_role = lv_partner->get_property( iv_attr_name = 'BP_ROLE' )
IF LV_ROLE = 'SALESEMPLOYEE'
  lv_partner_no ?= lv_current->get_property( iv_attr_name = 'BP_NUMBER' ).
endif.
now set the value
lv_employee ?= me->typed_context->salesemployee->collection_wrapper->get_current( )
CHECK lv_employee IS BOUND.
    lv_employee->set_property( iv_attr_name = 'SALESEMPLOYEE' iv_value =  lv_partner_no  )
Thanks & Regards
Raj

Similar Messages

  • How to pass values from one stage to other

    I have two stage (say primary and secondary).The primary stage creates the secondary stage. When the secondary is opened i can access all the members(say bitNo) of 1st stage and try to set some value. But in the 1st stage i find the value not being set. I think it's because 1st is executed before the 2nd. I used showAndWait() in 1st then show() on 2nd then it is throwing exception.
    So i want to use the values set by the 2nd stage in the 1st stage.
    How do i synchronize them ?
    Thanks .
    package test;
    import javafx.application.Application;
    import javafx.event.*;
    import javafx.scene.*;
    import javafx.scene.control.*;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.*;
    import javafx.stage.*;
    public class Test extends Application {
        private int bitNo;
        Stage primaryStage,secondaryStage;   
        TextField textField;   
        double x,y;
        public static void main(String[] args) { launch(args); }
        @Override
        public void start(final Stage primaryStage) {
            this.primaryStage=primaryStage;
            Group rt=new Group();
            Scene sc= new Scene(rt,300,300);
            Button button =new Button("Click Me");
            button.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    secondaryStage=new Stage(StageStyle.TRANSPARENT);
                    secondaryStage.initModality(Modality.WINDOW_MODAL);
                    secondaryStage.initOwner(primaryStage);    
                    showSecondaryWindow();
            rt.getChildren().add(button);          
            primaryStage.setScene(sc);
            primaryStage.show();
            //primaryStage.showAndWait();
            System.out.println("Bit no set= "+bitNo);      
    }//start
    public void showSecondaryWindow(){
         Pane root=new Pane();
         root.setStyle("-fx-background-color: rgb(0,50,70);");
         //root.setPrefSize(200,200);
         Scene scene=new Scene(root,200,300);
         Label label=new Label("Data");
         textField=new TextField();
         textField.setUserData("one");
         Button ok=new Button("Ok");
         ok.setDefaultButton(true);
         ok.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                System.out.println("New Stage Mouse Clicked");
                bitNo=Integer.parseInt(textField.getText());
                System.out.println("Bit no set by Secondary= "+bitNo);
                primaryStage.getScene().getRoot().setEffect(null);
                secondaryStage.close();
         Button cancel=ButtonBuilder.create().cancelButton(true).text("Cancel").build();
         cancel.setOnMouseClicked(new EventHandler<MouseEvent>() { 
             @Override
             public void handle(MouseEvent event) {
                 System.out.println("New Stage Mouse Clicked");
                 primaryStage.getScene().getRoot().setEffect(null);
                 secondaryStage.close();
         //VBox vBox =new VBox();
         //vBox.getChildren().addAll(label,textField,ok);
         HBox dataFileds=new HBox(10);
         dataFileds.getChildren().addAll(label,textField);
         HBox buttons=new HBox(10);
         buttons.getChildren().addAll(cancel,ok);
         root.getChildren().add(VBoxBuilder.create().children(dataFileds,buttons).spacing(10).build());
         //scene.getStylesheets().add(Test.class.getResource("Modal.css").toExternalForm());
         secondaryStage.setScene(scene);
         //final Node root = secondaryStage.getScene().getRoot();
         root.setOnMousePressed(new EventHandler<MouseEvent>() {
             @Override public void handle(MouseEvent mouseEvent) {
                 // record distance for the drag and drop operation.
                 x = secondaryStage.getX() - mouseEvent.getScreenX();
                 y = secondaryStage.getY() - mouseEvent.getScreenY();
         root.setOnMouseDragged(new EventHandler<MouseEvent>() {
             @Override public void handle(MouseEvent mouseEvent) {
                 secondaryStage.setX(mouseEvent.getScreenX() +x);
                 secondaryStage.setY(mouseEvent.getScreenY() +y);
         //primaryStage.getScene().getRoot().setEffect(new BoxBlur());
         secondaryStage.show();
    }//showSecondaryWindow
    }//class

    You can use showAndWait() on your secondary stage. Then execution is blocked and you'll see the change to your variable:
    package test ;
    import javafx.application.Application;
    import javafx.event.*;
    import javafx.scene.*;
    import javafx.scene.control.*;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.*;
    import javafx.stage.*;
    public class Test extends Application {
      private int bitNo;
      Stage primaryStage, secondaryStage;
      TextField textField;
      double x, y;
      public static void main(String[] args) {
        launch(args);
      @Override
      public void start(final Stage primaryStage) {
        this.primaryStage = primaryStage;
        Group rt = new Group();
        Scene sc = new Scene(rt, 300, 300);
        Button button = new Button("Click Me");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            secondaryStage = new Stage(StageStyle.TRANSPARENT);
            secondaryStage.initModality(Modality.WINDOW_MODAL);
            secondaryStage.initOwner(primaryStage);
            // This calls showAndWait(), so execution blocks until the window is closed
            showSecondaryWindow();
            // secondary window is now closed, value should be updated:
            System.out.println("Bit no now: " + bitNo);
        rt.getChildren().add(button);
        primaryStage.setScene(sc);
        primaryStage.show();
        // primaryStage.showAndWait();
        System.out.println("Bit no set= " + bitNo);
      }// start
      public void showSecondaryWindow() {
        Pane root = new Pane();
        root.setStyle("-fx-background-color: rgb(0,50,70);");
        // root.setPrefSize(200,200);
        Scene scene = new Scene(root, 200, 300);
        Label label = new Label("Data");
        textField = new TextField();
        textField.setUserData("one");
        Button ok = new Button("Ok");
        ok.setDefaultButton(true);
        ok.setOnMouseClicked(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            System.out.println("New Stage Mouse Clicked");
            bitNo = Integer.parseInt(textField.getText());
            System.out.println("Bit no set by Secondary= " + bitNo);
            primaryStage.getScene().getRoot().setEffect(null);
            secondaryStage.close();
        Button cancel = ButtonBuilder.create().cancelButton(true).text("Cancel")
            .build();
        cancel.setOnMouseClicked(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            System.out.println("New Stage Mouse Clicked");
            primaryStage.getScene().getRoot().setEffect(null);
            secondaryStage.close();
        // VBox vBox =new VBox();
        // vBox.getChildren().addAll(label,textField,ok);
        HBox dataFileds = new HBox(10);
        dataFileds.getChildren().addAll(label, textField);
        HBox buttons = new HBox(10);
        buttons.getChildren().addAll(cancel, ok);
        root.getChildren().add(
            VBoxBuilder.create().children(dataFileds, buttons).spacing(10).build());
        // scene.getStylesheets().add(Test.class.getResource("Modal.css").toExternalForm());
        secondaryStage.setScene(scene);
        // final Node root = secondaryStage.getScene().getRoot();
        root.setOnMousePressed(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent mouseEvent) {
            // record distance for the drag and drop operation.
            x = secondaryStage.getX() - mouseEvent.getScreenX();
            y = secondaryStage.getY() - mouseEvent.getScreenY();
        root.setOnMouseDragged(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent mouseEvent) {
            secondaryStage.setX(mouseEvent.getScreenX() + x);
            secondaryStage.setY(mouseEvent.getScreenY() + y);
        // primaryStage.getScene().getRoot().setEffect(new BoxBlur());
        secondaryStage.showAndWait();
      }// showSecondaryWindow
    }// classYou can also use an IntegerProperty to hold the variable, and listen for changes on it:
    package test ;
    import javafx.application.Application;
    import javafx.beans.property.IntegerProperty;
    import javafx.beans.property.SimpleIntegerProperty;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.*;
    import javafx.scene.*;
    import javafx.scene.control.*;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.*;
    import javafx.stage.*;
    public class Test extends Application {
      private IntegerProperty bitNo;
      Stage primaryStage, secondaryStage;
      TextField textField;
      double x, y;
      public static void main(String[] args) {
        launch(args);
      @Override
      public void start(final Stage primaryStage) {
        this.bitNo = new SimpleIntegerProperty();
        bitNo.addListener(new ChangeListener<Number>() {
          @Override
          public void changed(ObservableValue<? extends Number> observable,
              Number oldValue, Number newValue) {
            System.out.printf("bit no changed from %d to %d%n", oldValue, newValue);
        this.primaryStage = primaryStage;
        Group rt = new Group();
        Scene sc = new Scene(rt, 300, 300);
        Button button = new Button("Click Me");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            secondaryStage = new Stage(StageStyle.TRANSPARENT);
            secondaryStage.initModality(Modality.WINDOW_MODAL);
            secondaryStage.initOwner(primaryStage);
            showSecondaryWindow();
        rt.getChildren().add(button);
        primaryStage.setScene(sc);
        primaryStage.show();
        // primaryStage.showAndWait();
        System.out.println("Bit no set= " + bitNo.get());
      }// start
      public void showSecondaryWindow() {
        Pane root = new Pane();
        root.setStyle("-fx-background-color: rgb(0,50,70);");
        // root.setPrefSize(200,200);
        Scene scene = new Scene(root, 200, 300);
        Label label = new Label("Data");
        textField = new TextField();
        textField.setUserData("one");
        Button ok = new Button("Ok");
        ok.setDefaultButton(true);
        ok.setOnMouseClicked(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            System.out.println("New Stage Mouse Clicked");
            bitNo.set(Integer.parseInt(textField.getText()));
            System.out.println("Bit no set by Secondary= " + bitNo);
            primaryStage.getScene().getRoot().setEffect(null);
            secondaryStage.close();
        Button cancel = ButtonBuilder.create().cancelButton(true).text("Cancel")
            .build();
        cancel.setOnMouseClicked(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            System.out.println("New Stage Mouse Clicked");
            primaryStage.getScene().getRoot().setEffect(null);
            secondaryStage.close();
        // VBox vBox =new VBox();
        // vBox.getChildren().addAll(label,textField,ok);
        HBox dataFileds = new HBox(10);
        dataFileds.getChildren().addAll(label, textField);
        HBox buttons = new HBox(10);
        buttons.getChildren().addAll(cancel, ok);
        root.getChildren().add(
            VBoxBuilder.create().children(dataFileds, buttons).spacing(10).build());
        // scene.getStylesheets().add(Test.class.getResource("Modal.css").toExternalForm());
        secondaryStage.setScene(scene);
        // final Node root = secondaryStage.getScene().getRoot();
        root.setOnMousePressed(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent mouseEvent) {
            // record distance for the drag and drop operation.
            x = secondaryStage.getX() - mouseEvent.getScreenX();
            y = secondaryStage.getY() - mouseEvent.getScreenY();
        root.setOnMouseDragged(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent mouseEvent) {
            secondaryStage.setX(mouseEvent.getScreenX() + x);
            secondaryStage.setY(mouseEvent.getScreenY() + y);
        // primaryStage.getScene().getRoot().setEffect(new BoxBlur());
        secondaryStage.show();
      }// showSecondaryWindow
    }// class

  • How to move value from one tlist to another tlist in same form?

    how to move value from one tlist to another tlist in same form on button press?
    Same like in data block wizard when we select value from 1st list it will go to 2nd list and can be move back. Please help i am new to forms .
    Regards

    just call the following proc in your add & add all buttons. Reverse the code for REMOVEs
    this proc will move one item at a time from list_item1 to list_item2.
    PROCEDURE add_an_item
    IS
      v_list_count    NUMBER;
      v_item1_label  VARCHAR2(60);
    BEGIN
      IF :list_item1 IS NOT NULL THEN v_list_count := nvl(Get_List_Element_Count('list_item1'),0);
          IF v_list_count >= 1 THEN FOR i IN 1..v_list_count
          LOOP
             IF   :list_item1    = Get_List_Element_Value('list_item1', i)
             THEN
                  v_item1_label := Get_List_Element_label('list_item1', i);                 
                  Add_List_Element('list_item2',1,v_item_label,:list_item1);         
               Delete_List_Element('list_item1',i);
               Exit;
             END IF;
          END LOOP;
           END IF;
       END IF;
    END;
    *********************************************************************************this proc will move all items from list_item1 to list_item2.
    PROCEDURE add_all_items
    IS
      v_list_count NUMBER;
      v_item_label VARCHAR2(60);
      v_item_value VARCHAR2(60);
    BEGIN
    v_list_count := nvl(Get_List_Element_Count('list_item1'),0);
    IF    v_list_count = 1 AND Get_List_Element_Value('list_item1', 1) IS NULL THEN NULL;
    ELSIF v_list_count >= 1 THEN
           FOR i IN 1..v_list_count
           LOOP
            v_item_value  := Get_List_Element_Value('list_item1', i);
            v_item_label  := Get_List_Element_label('list_item1', i);       
            Add_List_Element('list_item2',i,v_item_label,v_item_value);
           END LOOP;
           clear_list('list_item1');
    END IF;
    END;I added [ code ] tags to make this easier to read.
    Message was edited by:
    Jan Carlin

  • How to move table from one tablespace to other tablespace?

    how to move table from one tablespace to other tablespace?

    887274 wrote:
    how to move table from one tablespace to other tablespace?
    alter table <table_name> move  tablespace <new_tablespace_name>;
    Rebuild the indexes; alter index <index_name> rebuild <new_tablespace_name> online;Example;:
    SQL> create table ttt( ID NUMBER PRimary key);
    Table created.
    SQL> insert into ttt values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL> alter table ttt move tablespace users;
    Table altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 UNUSABLE
    SQL> alter index SYS_C0010863 rebuild tablespace users online;
    Index altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL>

  • How to get value from one context node to otehr contect conde in diff views

    Hello Guru's
    We have a rek which is of getting the value from one context node to other context node,
    for example there is Total value in BT111H_OPPT/ITEMLIST (One context node) we need to have the same Total value in the in BT111H_OPPT/DETAILS (other context node) automatically
    Inputs are highly appricated.......

    Hello,
    Thanks for your Reply
    But my rek is i want to get value from different views
    eg BT111H_oppt/itemslist(contex node - BTADMINI) field net value to BT111h_opp/Details(Context node - BTopporth)
    for this which method should i use to chive this.
    Thanks..

  • ESB  : How to Pass value from one RS to another RS

    Hi Gurus,
    I want to pass a value from one First Routing service to another to set the value for the last XSL transformation.
    How can I do this without creating specific XSDs??
    Rgs
    JO

    Data flowing through the ESB is XML-based (or opaque), so if the value you want to pass is in the XML result of RS1, you can use it in RS2. If you have a good reason why not too or this doesn't work for you, you could store data somewhere along the ESB process (database, stateful bean, etc.). Otherwise, you would need to let the ESB generate (or create you own) XSD describing the XML.
    Regards,
    Ronald

  • How to copy value from one field to another in a Apex Form

    Hello guys,
    There are 2 addresses one is shipping and other is billing. I do not want the customer to re-enter all the details if it is the same address. So based upon an action, it should take the live values from one address field and populate the other address field. I know in JS you can do it, but how to implement that in Apex?
    I guess using Dynamic Actions to achieve this in Version 4 but do not know how. Read quite some info but no luck.
    Thanks in advance!

    Hi,
    I have assumed that you have your shipping address at the top of the page, and then further down the page you have your billing address that you want to enable the users to copy (if this is in reverese, you will need to switch the js variables in the code following).
    I would create a Select List item above the 'Billing Address' details, called PX_SAME_ADDRESSThis select list would be static, with the options Null.
    I also assume you would have pairs of address page items such as:
    PX_SHIPPING_ADDRESS_L1
    PX_BILLING_ADDRESS_L1
    PX_SHIPPING_ADDRESS_L2
    PX_BILLING_ADDRESS_L2
    PX_SHIPPING_POST_CODE
    PX_BILLING_POST_CODEThen copy the following code into the HTML Header of the page definition:
    <script language="JavaScript" type="text/javascript">
    function copyAddress()
       if( $x('PX_SAME_ADDRESS').value == 'YES')
         $x('PX_BILLING_ADDRESS_L1').value = $x('PX_SHIPPING_ADDRESS_L1').value;
         $x('PX_BILLING_ADDRESS_L2').value = $x('PX_SHIPPING_ADDRESS_L2').value;
         $x('PX_BILLING_POST_CODE').value = $x('PX_SHIPPING_POST_CODE').value;
       else //Clear Address Fields
         $x('PX_BILLING_ADDRESS_L1').value = " ";
         $x('PX_BILLING_ADDRESS_L2').value = " ";
         $x('PX_BILLING_POST_CODE').value = " ";
    </script>Then, in your PX_SAME_ADDRESS item, copy the code below into the Element > HTML Form Element Attributes field.
    onChange="copyAddress();"Hopefully this works for you too, and should give you some basis to play around with.
    Amanda.

  • How to concatenate values from one form to another form using calculated columns in sharepoint?

    Im new to Sharepoint.
     I need to know , how to fetch the x1 , x2 values from one form to another form x1, x2 fields, this wants to happen when 2 forms ID fields(Drop down field) are same.
    ex:
    first module I have 3 fields like, "Marketing ID" , "Company name" , "Vendor name".
    second module I have the same related fields like "Marketing ID" , "Company name" , "Vendor name" and some more fields.
    now i need to fetch the information from 1st module to 2nd module ( "Company name" , "Vendor name" ) when I select the Marketing Id(Drop down - field) 
    it should be want to show in Calculated columns.
    Can someone make a suggestion on how I can do this.
    Thank you so much for any help you may be able to provide.
    Sincerely
    Ahalya Babu

    Calculated Columns can only generate a value from fields of the current item. And only some types of fields (for example, it can't use a lookup column).
    Consider using a workflow to accomplish your goal.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • How to pass value from one method to another method

    Hi all,
    I have created a funtion module and i am calling this function module inside a method and it is exporting some value in a table, now i have to pass table value to another method where i have do some thing based upon this values.
    I think there a marco available to move the values from one method to another method.
    Please help me in this issue.
    Regards
    Balaji E.

    Hi,
    Let me make certain assumptions!
    Method 1 - You export the table values
    Method 2 - The method where you need the table values
    Once you create a method from a function module which has tables as one of the export parameters then the code automatically puts in the macro code which looks like : SWC_SET_TABLE CONTAINER 'Table' TABLE.
    The 'Table' in the above code is the container element which is created by the workflow once you use this method and the TABLE (The table that gets filled in the function module) is the variable to code automatically created.
    Now you can use the other function module in the workflow as a background step and pass the values from the 'Table' container to this method using the binding. When you use this then the method automatically has the macro SWC_GET_TABLE CONTAINER 'Table' ITABLE. Here the 'Table' is the same container table you used in the binding and the ITABLE would be the variable you can use in the other function module.
    Hope this helps,
    Sudhi

  • How to pass control from one component to other component

    Hi,
    I have a requirement to pass control from one component to other component.
    Here is my requirement.. l have two portal components, one is search component and other is result component. I have this search component as quick navigation iView where we can enter a value and results will display in results iView, it's a main iView.
    When search view gets the results, I will display the count in search view and result in results view. .i.e.. both the iviews are viewed at any time.
    Can any one advise me how to acheive this.
    Thanks,
    Chinna.

    Hi Sandeep,
    Thanks for the reply. I have gone through the EPCF API, and tried with doNavigate('iViewName').
    when I click on the button in search view (quikc navigation frame), instead of page getting refreshed in result iView, whole page is replaced by results iview. I want only search view and results view gets refreshed.
    can you please tell me which even should I use for this scenario...
    Thanks,
    Chinna

  • How to retrieve value of one column to other in Apex using Javascript

    Hi all,
    Can any one help me in solving this problem.
    How to send a value from one column to another column using javascript in Apex. I heard that we can use onChange().
    My requirement is,
    I have a column(Varchar2) in form where i need to enter a value and the data need to be sent to another column(Number) when i press apply changes.
    ex: if i enter a value say 1/3 or 1/4 or 1/3*1/6
    the result should be entered in the other column.
    Message was edited by:
    Raman

    Try something like
    html_GetElement('P1_ITEM2').value = eval(html_GetElement('P1_ITEM1').value);

  • How to  move items from one JList to other

    Can u pls help me out to implement this(I m using Netbeans 5.5):
    I want to move items from one JList to other thru a ADD button placed between JLists, I am able to add element on Right side JList but as soon as compiler encounter removeElementAt() it throws Array Index Out of Bound Exception
    and if I use
    removeElement() it removes all items from left side JList and returns value false.
    Pls have a look at this code:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
    Object selItem = jList1.getSelectedValue();
    int selIndex = jList1.getSelectedIndex();
    DefaultListModel model = new DefaultListModel();
    jList2.setModel(model);
    model.addElement(selItem);
    DefaultListModel modelr = new DefaultListModel();
    jList1.setModel(modelr);
    flag = modelr.removeElement(selItem);
    //modelr.removeElementAt(selIndex);
    System.out.println(flag);
    }

    hi Rodney_McKay,
    Thanks for valuable time but my problem is as it is, pls have a look what I have done and what more can b done in this direction.
    Here is the code:
    import javax.swing.DefaultListModel;
    import javax.swing.JList;
    public class twoList extends javax.swing.JFrame {
    /** Creates new form twoList */
    public twoList() {
    initComponents();
    //The code shown below is automatically generated and we can�t edit this code
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jList1 = new javax.swing.JList();
    jButton1 = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    jList2 = new javax.swing.JList();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jList1.setModel(new javax.swing.AbstractListModel() {
    String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
    public int getSize() { return strings.length; }
    public Object getElementAt(int i) { return strings[i]; }
    jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
    public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
    jList1ValueChanged(evt);
    jScrollPane1.setViewportView(jList1);
    jButton1.setText("ADD>>");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jScrollPane2.setViewportView(jList2);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(31, 31, 31)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jButton1)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(78, Short.MAX_VALUE))
    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jScrollPane1, jScrollPane2});
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(62, 62, 62)
    .addComponent(jButton1))
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
    .addContainerGap(159, Short.MAX_VALUE))
    layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jScrollPane1, jScrollPane2});
    pack();
    }// </editor-fold>
    //automatic code ends here
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
            jList1 = new JList(new DefaultListModel());
            jList2 = new JList(new DefaultListModel());
             Object selItem = jList1.getSelectedValue();
             System.out.println(selItem);
            ((DefaultListModel) jList1.getModel()).removeElement(selItem);
            ((DefaultListModel) jList2.getModel()).addElement(selItem);
    //Now trying with this code it is neither adding or removing and the value �null� is coming in �selItem� .It may be bcoz JList and Jlist are already instantiated in automatic code. So, I tried this:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
             Object selItem = jList1.getSelectedValue();
             System.out.println(selItem);
            ((DefaultListModel) jList1.getModel()).removeElement(selItem);
            ((DefaultListModel) jList2.getModel()).addElement(selItem);
    //Now with this as soon as I click on �jButton1�, it is throwing this error:
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: twoList$1 cannot be cast to javax.swing.DefaultListModel
            at twoList.jButton1ActionPerformed(twoList.java:105)
            at twoList.access$100(twoList.java:13)
            at twoList$3.actionPerformed(twoList.java:50)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6038)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

  • How to copy data from one column to other column

    hi,
    can any one tell me how to copy data of  one column to other column for some specific data
    example
    productno  ocalyear        actualsales  prevplansales   currentplansales
    p001       2007                  100              120                   
    p002       2007                   90               100
    p003       2007                  120              130
    p004       2007                  140              120
    p005       2007                  150              150
    i want to copy data of p001 and p002 from prevplansales to current plansales
    productno  ocalyear        actualsales  prevplansales   currentplansales
    p001       2007                  100              120              120     
    p002       2007                   90               100              100
    p003       2007                  120              130
    p004       2007                  140              120
    p005       2007                  150              150
    is it possible to do?
    please suggest me.
    i will assign points

    Hi,
    I think the needed techniques are already described in the documentation, e.g. in
    http://help.sap.com/saphelp_nw70/helpdata/en/45/e641e4c61256dee10000000a114a6b/frameset.htm
    or
    http://help.sap.com/saphelp_nw70/helpdata/en/45/e641e4c61256dee10000000a114a6b/frameset.htm
    The main techiques used in the above example to bind the filter of the planning function to selected (marked) objects in the analysis item or to drop down boxes (or both). These techniques are used in the above examples.
    Regards,
    Gregor

  • How to move items from one list to other

    hi all,
    in jsp page i have twolist boxes. i want to move item from one list to other list on click of add or move button. can u plz suggest me an answer for the above. thank u
    Regards sangeet

    This link should help. Remove from one list and add to the other using Javascript.
    http://www.mredkj.com/tutorials/tutorial006.html

  • How to do forward from one XML to other?

    Hello!
    I would to do forward from one XML to other like in HTML use tag <meta>:
    <meta http-equiv="REFRESH" content="0;url=http://...">
    Could XML to control HTTP query?

    I apologize, but your scenario still does not make sense to me.
    The user requests a URL, an XML page is returned to their browser, then immediately another XML page is returned to their browser?
    Maybe try to explain in functional terms what you're trying to achieve rather than assuming that "forwarding" or refreshing is the solution. Stated this way, I still don't have an idea of what kind of application you're trying to build.

Maybe you are looking for

  • Questions on few quality management topics

    Hi Sapiens, I am SD consultant and new to QM, I have been task to record mulitple assay results in system. So, I am implementing the QM module here. I have got few questions, so kindly take sometime and send your valuable answers. 1) Can we have many

  • Pixel Bender for Photoshop CS4 -- in August 2010 ?????

    How could I have missed it! Just found out about Pixel Bender today via an email from Wacom. Can only find the CS5 version available for download on the Adobe Labs site. Will the CS5 version work with PSCS4? If not, is there someway for me to downloa

  • I get a "connection error" when trying to update/install Flash Player

    I have a previous version of Flash player so I was trying to update it. The installation doesn't make it past 5% before saying "connection error". I have tried all the troubleshooting steps and even tried to uninstall it. When I try to download the u

  • MacMini HDTV through DVI

    Hey guys, I just bought my first mac to hook up to my HDTV... and the only resolution I can get is 680 by 400 or so. It looks terrible. I have the MacMini hooked up to the HDTV through DVI direct... no adapters or anything. The TV is an RCA... I cann

  • HP BC-555OH Rom driver firmware needed for HP6154EA for brand new windows install.

    I was installing a fresh copy of windows 7 ultimate onto my HP 6154EA then it asked me for the drivers for the cd/dvd drive before installation could continue. Searching the HP website & using google/yahoo to find 3rd party sites, I have unable to lo