Returning a selection from a list or table

I'm looking for a nice way to present the selcted value of a JList or a JTable to the rest of the program. So far the only thing I know to do is make the selection a static variable of the class implementing the ListSelectionListener interface. For instance, in the code below, I would make the variable rowNum a static variable, accessible from outside. But OO says to make it a method like public int getSelection(){return rowNum}i've had difficulty extracting the selection and making it available where it is really needed, in the business logic of the program. Any comments would be appreciated.class TablePanel extends JPanel
  ConnectionHandler ch;
  static TheTableModel tm;
  ListSelectionHandler selector;
  TablePanel(ConnectionHandler ch)
    this.ch = ch;
    tm = new TheTableModel();
    JTable jt = new JTable(tm);
    //selection mechanics
    jt.setPreferredScrollableViewportSize(new Dimension(900,200));
    ListSelectionModel rowSM = jt.getSelectionModel();
    selector = new ListSelectionHandler();
    rowSM.addListSelectionListener(selector);
    jt.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //set column widths
    TableColumn column = null;
    for (int i = 0; i<9;i++)
      column = jt.getColumnModel().getColumn(i);
      if(i==0) column.setPreferredWidth(40);
      column.setPreferredWidth(100);
    //display
    JScrollPane jsp = new JScrollPane(jt);
    add(jsp);
class ListSelectionHandler implements ListSelectionListener
  public void valueChanged(ListSelectionEvent e)
    ListSelectionModel lsm = (ListSelectionModel)e.getSource();
    if(lsm.isSelectionEmpty()) return;
    int rowNum = lsm.getMinSelectionIndex();
    if(!e.getValueIsAdjusting())
      System.out.println(rowNum +" =rowNum");
}

You could make it a method like
public int getSelection() {
   return table.getSelectedRow();
}That would work fine provided 'table' is kept as an instance variable. As far as I can see, there's no need for a static variable here. If you wanted to return different information, you could do it the same way (eg, returning the selected value, instead of the row, etc.)

Similar Messages

  • Selecting from a list to a table

    need help.i have items in a list and combo box in which i want it in such away that when item is selected from the list and combo box it goes to the table i have in a panel.i want to discard the text area i used.thanks in advance
    my code:
    '\n'
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    public class BreakFast extends JFrame implements ActionListener{
         private JList ingredient;
         private JTextArea meal;
         private JTable table;
         private DefaultTableModel model;
         private JButton move;
         private String[] food;
         private JComboBox box,box1;
         private String[] units;
         private double[] price={100,150,200,250,300,350,400};
         public BreakFast(){
              Container c=getContentPane();
              c.setLayout(new FlowLayout());
              food = new String[] {"Corn Flakes","Beans","Shredded Bread","Mushroom",
              "eggs","Milks","Butter","Sugar","water","Oil"};
              ingredient = new JList(food);
              ingredient.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
              ingredient.setVisibleRowCount(4);
              JPanel p = new JPanel();
              p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
              //move = new JButton(">>>");
              //move.addActionListener(this);
              meal = new JTextArea(5,20);
              meal.setEditable(false);
              p.add(new JScrollPane(ingredient),"Wast");
              //p.add(move,"Center");
              p.add(new JScrollPane(meal),"East");
              JPanel p2 = new JPanel();
              p2.setBorder(new BevelBorder(BevelBorder.RAISED));
              units = new String[]{"2 cups","3 cups","4 cups","5 cups","1 mudu","2 mudu",
                        "3 mudu","4 mudu","5 mudu","6 mudu","7 mudu","8 mudu","9 mudu",
                        "1 bag"};
              box = new JComboBox(units);
              box.addActionListener(this);
              box1 = new JComboBox();
              //box1.setEditable(true);
              box1.addActionListener(this);
              for(int i=0;i<price.length;i++){
                   box1.addItem(price);
              model = new DefaultTableModel();
              model.addColumn("No.");
              model.addColumn("Food Items");
              model.addColumn("Units");
              model.addColumn("Price");
              String[] cell={"1","Rice","2 cups","#20"};
              model.addRow(cell);
              table = new JTable(model);
              JScrollPane pane = new JScrollPane(table);
              pane.setPreferredSize(new Dimension(200,100));
              p2.add(box,"North");
              p2.add(box1,"South");
              p2.add(pane,"East");
              c.add(p);
              c.add(p2);
              setSize(450,300);
              setVisible(true);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void actionPerformed(ActionEvent e){
                   Object[] value = ingredient.getSelectedValues();
                   if(e.getSource() instanceof JComboBox){
                        for(int i=0;i<value.length;i++){
                             String word = (String)value[i];
                             meal.append(box.getSelectedItem()+" "+"of"+" "+word+" "+box1.getSelectedItem()+"\n");
         public static void main(String[] arg){
              new BreakFast();

    So the problem is?
    All you need to do is to create the JTable first of all (which you haven't done). Secondly, you create a TableModel for it so can manage its data effectively.
    Thirdly, you replace the code in your actionPerformed method to add a new row containing the data you received from the list and combo box.
    Now is that so hard? Okay, here is some code
    DefaultTableModel model = new DefaultTableModel(0,3);
    JTable table = new JTable(model);
    public void actionPerformed(ActionEvent e){
        Object[] value = ingredient.getSelectedValues();
        if(e.getSource() instanceof JComboBox){
            for(int i=0;i < value.length;i++){
                String word = (String)value;
    Vector<Object> data = new Vector<Object>();
    data.addElement( box.getSelectedItem() );
    data.addElement( "of" + " " + word );
    data.addElement( box1.getSelectedItem());
    model.addRow( data );
    ICE

  • Select from multiple entries in table cell.

    Hi All,
    I'm having issues when trying to do a simple select from an access database:
    <CFQUERY NAME="GetAllByMonth" DATASOURCE="dsn">
    SELECT * FROM table WHERE  strMonth = '#url.strMonth#' AND strDisplay = Yes
    order by strOrder_id
    </CFQUERY>
    Table cells in rows contain coma separated values:
    January, February, March, April, May, June, October, November, December
    Unfortunately the query returns no values. I've tried changing the "=" with "like", "contains" but with no results.
    Difficult to know what to search for so any help gratefully recieved.
    Ta
    Trevor

    Here is an absolutely crazy "hack" that I once used when dealing with a database like that.  It had hundreds of thousands of rows with comma separated values that for various legacy could not be changed.
    So one day I did this ...  SELECT DISTINCT column_from_purgatory FROM table_from_hell.
    Much to my surprise, there were less than a hundred DISTINCT values in that column.  (They were, fortunately, reasonably-sized VARCHARs.)
    So I built a table of those values, then created a separate table into which I could put each of the comma-separated parts, and then wrote a small (Perl) script to populate the two.  For example, a row containing "January, March, April" would be linked to three rows containing one month-name each.
    Now, as long as I had a way to be sure that this pair of lookup-tables was always complete (which was slightly problematic), I had something that I could actually JOIN to.  It wasn't pretty ... in fact, it was butt-ugly ... but it saved a tremendous amount of processing time for this application.

  • DB Trigger: select from and into current table

    I'm running 8.0.5 and facing a table looking like MYTAB(RECID,RECLABEL,..., PARENTRECID, PARENTRECLABEL) where:
    . RECID = current record UID (say: employee number)
    . RECLABEL = current record label (say: employee name)
    . PARENTRECID = RECID of another record in table MYTAB (say: employee ID of the manager of the current employee)
    . PARENTRECLABEL = must be made to hold automatically the contents of RECLABEL in the parent record (say: the name of the manager of the current employee)
    I know an easy way to get this info would be to use a view like CREATE VIEW MYVIEW AS SELECT A.RECID, A.RECLABEL, A.PARENTRECID, B.RECLABEL "PARENTRECLABEL" FROM MYTAB A, MYTAB B WHERE A.PARENTRECID=B.RECID but for various reasons I would really love to denormalize that info into column PARENTRECLABEL using a database trigger.
    Obviously, table MYTAB itself cannot be selected from during the execution of the dB trigger: mutating table error !
    I tried:
    . to select from a view defined as "SELECT * FROM MYTAB" as suggested in another thread, but this trick didn't seem to be sufficient to lure Oracle (it still says I'm trying to select from a mutating table !)
    . to use a package within which a PL/SQL table variable is filled with the list of affected RECID on a FOR EACH ROW basis, and to issue updates in a after statement (thus: not AFTER EACH ROW) AFTER UPDATE trigger - but it's too late already and those updates are apparently not taken into account by the database.
    Any other suggestions?
    Thx - Didier

    Here's the code, if the formatting in unpreserved please do let me I'll mail the same.
    The Package
    CREATE OR REPLACE PACKAGE save_table_package
    AS
    TYPE saved_test2_type
    IS TABLE OF test2%ROWTYPE
    INDEX BY BINARY_INTEGER;
    saved_test2 saved_test2_type;
    saved_test2_num NUMBER:= 1;
    PROCEDURE save_test2_row(i_id NUMBER
    ,i_ename VARCHAR2
    ,i_mgr_id NUMBER
    ,i_mgr_ename VARCHAR2
    PROCEDURE clear_rows;
    END save_table_package;
    show err
    CREATE OR REPLACE PACKAGE BODY save_table_package AS
    PROCEDURE save_test2_row(i_id NUMBER
    ,i_ename VARCHAR2
    ,i_mgr_id NUMBER
    ,i_mgr_ename VARCHAR2
    IS
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Enter pkg.save_test2_row:'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    save_table_package.saved_test2(saved_test2_num).id := i_id;
    save_table_package.saved_test2(saved_test2_num).ename := i_ename;
    save_table_package.saved_test2(saved_test2_num).mgr_id := i_mgr_id;
    save_table_package.saved_test2(saved_test2_num).mgr_ename := i_mgr_ename;
    DBMS_OUTPUT.PUT_LINE('Saved Details Of Row ###:' &#0124; &#0124;
    TO_CHAR(save_table_package.saved_test2_num,'099999') &#0124; &#0124;'('&#0124; &#0124;
    TO_CHAR(save_table_package.saved_test2(saved_test2_num).id,'099') &#0124; &#0124;','&#0124; &#0124;
    save_table_package.saved_test2(saved_test2_num).ename &#0124; &#0124;','&#0124; &#0124;
    save_table_package.saved_test2(saved_test2_num).mgr_id &#0124; &#0124;','&#0124; &#0124;
    save_table_package.saved_test2(saved_test2_num).mgr_ename &#0124; &#0124;')'
    save_table_package.saved_test2_num := save_table_package.saved_test2_num + 1;
    DBMS_OUTPUT.PUT_LINE('Leave pkg.save_test2_row:'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    END save_test2_row;
    PROCEDURE clear_rows IS
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Enter pkg.clear_rows :'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    save_table_package.saved_test2_num := 1;
    DBMS_OUTPUT.PUT_LINE(' Leave pkg.clear_rows :'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    END clear_rows;
    END save_table_package;
    show err
    The Triggers
    CREATE OR REPLACE TRIGGER trig_bfr_iup_test2_fer
    BEFORE INSERT OR UPDATE OF mgr_id ON test2 FOR EACH ROW
    DECLARE
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Enter before insupd:'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    save_table_package.save_test2_row(:new.id
    ,:new.ename
    ,:new.mgr_id
    ,:new.mgr_ename);
    DBMS_OUTPUT.PUT_LINE('Leave before insupd:'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    END;
    show err
    CREATE OR REPLACE TRIGGER trig_aft_iup_test2_stm
    AFTER INSERT OR UPDATE OF mgr_id ON test2
    DECLARE
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Enter after insupd:'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    FOR i IN 1 .. save_table_package.saved_test2_num - 1
    LOOP
    UPDATE test2 eme
    SET mgr_ename = (SELECT mgr.ename
    FROM test2 mgr
    WHERE mgr.id = eme.mgr_id)
    WHERE eme.id = save_table_package.saved_test2(i).id
    DBMS_OUTPUT.PUT_LINE('MGR_ENAME Set Row#:'&#0124; &#0124;TO_CHAR(i,'099999'));
    END LOOP;
    save_table_package.clear_rows;
    DBMS_OUTPUT.PUT_LINE('Leave after insupd:'&#0124; &#0124;TO_CHAR(save_table_package.saved_test2_num,'099999'));
    END;
    show err
    null

  • When clicking on a lookup, firefor does not allow me to select from the list

    When I use firefox, the website I am on has lookup fields located on it, firefox does not allow me to select my preferred option from the list. also when I slect another lookup from a list it displays the message 'invalid lookup value located in field ......'
    This does not happen in IE

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Random selection from a list

    I’m setting up a multiple-choice question, and I want to re-arrange the position of the button sprites representing the correct answer and distractors.
    I can randomly select one of the sprites via gDistractorLoc = random(4). The random function fails me after that.
    Is there a means of randomly selecting one of the entries from a list, e.g. gDistractorList = [1, 2, 4] or [1, 4]?
    I realize that I am perhaps complicating the process, and I'd be grateful for a simpler approach.

    I don't know if this is simpler or not, but here is a method for grabbing a random item from a list:
    gDistractorList = [1, 2, 4]
    put gDistractorList.getAt(random(gDistractorList.count))

  • How to control the number of rows selected from a sybase database table?

    Hi, JDBC guru,
    I'm working on project using Sybase 11.9.x database.We need to process a record in a table,first select it from the table,then do some computing,finally write it to a dbf file, if the above steps succeed,remove the original row in the table.Quite evidently, all these operation should be put into one transaction. But how can I select just a number of rows from the sybase database table?
    Any hints?
    Thank you in advance.
    Regards,
    Jusitne

    Statement stmt...
    stmt.setMaxRows(20);

  • Cannot select from dropdown list

    This is very weird. I am a long-time FF user. Suddenly, I find that I cannot select from a dropdown list. Clicking on the list shows all the options but moving the mouse doesn't change the highlighted option.
    Safe Mode - Didn't help
    New profile - Didn't help
    What is going on here? Please help. Thanks

    Troubleshooting plugins
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins
    Check and tell if its working.

  • Select Count(*) from... returns zero, select * from... returns 4000 recs?

    Hi,
    I have an odd situation where "select count(*) from my_view where some_clause" returns 0, but the exact same query fetching the data (ie "select * from my_view where some_clause") works fine and fetches, correctly, 4000+ records.
    I have tried dropping and recreating the view, and collecting DB stats again, but the problem persists.
    I had a look at the explain plans and they are very different, but both the SQL statements work fine on a copy of the database taken with impdp.
    Does anyone have any suggestions on what might be going on here ?
    Any help would be appreciated, I've run out of ideas !
    Dave
    Edited by: user10281551 on 18-Sep-2008 00:43
    Edited by: user10281551 on 18-Sep-2008 00:44

    Maybe it's the bug that a function based index is present and gets incorrectly used in the select count(*) statement?
    If that's not the case, then please show us more details, like the statement and both execution plans.
    Regards,
    Rob.

  • Value of a cell dependent on a data selected from the list in another cell

    Hello Everyone,
    Could you please help to solve this puzzle.
    I need to make a value of cells in the 2nd column dependent on the selection made in the cells in the 1st column, i.e.:
    Header 1
    Header 2
    List An
    LIst Bn
    Lists A and B have 10 items each
    A1    B1
    A2    B2
    A10  B10
    If A1 is selected I need a B1 appear in the second column in the same row, if A2 selected then B2,...and so on.
    Could you please hep to resolve this, if at all this is possible?
    Many thanks,
    Andrew

    Supposing that your list is a drop down list, you could put a script like the following on the exit event of List A. (very approximate, since I don't know any of your field names)
    switch (this.rawValue)
    case "A1":
         ListB.rawValue = "B1";
         break;
    case "A2":
         ListB.rawValue = "B2";
         break;
    Obviously, you'll want to replace "ListB" with the name of your field, and possibly the references to it (ie. TableName.RowName.FieldName) and fill in more case statements all the way to A10 if that's what you need. If List B is going to be a read-only field, you may even want to make it simply a text input box and have it display the values you want it to have based on the selection from List A.

  • Polulate textfield(s) from a MS SQL Database based on selection from DropDown List

    I am new to LiveCycle Designer. I am trying to create a Master Bill of Lading form. I want the user to be able to enter a Store Number from a in a text field and, based on what they enter I want to populate the address information from a database on my SQL Server.
    When I bind the address fields from the database, I only see the first record in the database.
    I'm not sure where to go from here...
    Thanks in advance,
    Jeremy

    That seemed to fix my error and returned the value to my DDL.
    I have modified the code so it looks at the clone of my dataConnection (dcStoreData)
    CODE:
    btnClear.MainPage.sStNo::change - (JavaScript, client)
    var inStrNbr = xfa.event.newText;
    if (inStrNbr == ""){
    app.alert("You must enter a valid name - try again!") } var nIndex = 0;
    while(xfa.sourceSet.nodes.item(nIndex).name != "dcStoreData")
    nIndex++;
    tfStoreID.rawValue = inStrNbr;
    var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1);
    // the node pertaining to the data connection specified
    //app.alert(oDB.saveXML("pretty"));
    //set up sql call to DB to get specifics about employee
    oDB.nodes.item(1).query.setAttribute("text", "commandType");
    oDB.nodes.item(1).query.select.nodes.item(0).value = "Select * from tblStoreMast_LastVersion where StorNbr = '" + inStrNbr + "'";
    //app.alert(oDB.nodes.item(1).saveXML("pretty"));
    //now connect to DB and get a record
    oDB.open()
    oDB.close();
    it runs with no error and I am seeing the value it has given my DDL.rawValue
    Now I get the "error:"
    GeneralError: Operation failed.
    XFAObject.open:16:XFA:btnClear[0]:MainPage[0]:sStNo[0]:change
    ado2xfa operation failed.  Item cannot be found in the collection corresponding to the requested name or ordinal.
    My Store Number is stored as an int in the database.
    Do I have to somehow cast it as a character?
    Sorry for the headache!
    Jeremy

  • Tab pages not changed when selecting from TAB LIST

    Hi All,
    I have a form which has 15 tabs, 1st 10 Tabs are dynamic (enabled at new form instance, depending on configuration) and 11 to 15 are Static tabs visible for all.
    My problem is when i am clicking on tabs iam able to switch tabs, but when I select tab from Tab List I am not going to the selected TAB.
    Ex: when I am in TAB 1 and Select TAB15 from Tab list My form Still Stays in TAB1 and not moving to TAB 15
    Please provide me a Solution.
    My code in WHEN TAB PAGE CHANGED is
    DECLARE
    l_curr_rec NUMBER;
         BEGIN
              l_curr_rec := :SYSTEM.CURSOR_RECORD;
              --Get the Top Default Tab Page for the Form
              SHOW_VIEW('HDR_CANVAS_FIXED');
              :global.headers:=GET_CANVAS_PROPERTY('TAB_CANVAS', topmost_tab_page);
         IF(:GLOBAL.HEADERS='AS_REC_IMAGE')THEN      
    SHOW_VIEW('AS_REC_IMAGE');
    SET_VIEW_PROPERTY('AS_REC_IMAGE',VISIBLE,PROPERTY_TRUE);
    SET_TAB_PAGE_PROPERTY('AS_REC_IMAGE',ENABLED,PROPERTY_TRUE);
              GO_BLOCK('AS_REC');
                   --Hide the other canvases except the Pricing Canvas                     
         ELSIF(:GLOBAL.HEADERS='TRIM_REC_IMAGE')THEN      
    SHOW_VIEW('TRIM_REC_IMAGE');
    SET_VIEW_PROPERTY('TRIM_REC_IMAGE',VISIBLE,PROPERTY_TRUE);
    SET_TAB_PAGE_PROPERTY('TRIM_REC_IMAGE',ENABLED,PROPERTY_TRUE);
              GO_BLOCK('TRIM_REC');
                   --Hide the other canvases except the Pricing Canvas                     
         ELSIF(:GLOBAL.HEADERS='AS_SHIP_IMAGE')THEN      
    SHOW_VIEW('AS_SHIP_IMAGE');
    SET_VIEW_PROPERTY('AS_SHIP_IMAGE',VISIBLE,PROPERTY_TRUE);
    SET_TAB_PAGE_PROPERTY('AS_SHIP_IMAGE',ENABLED,PROPERTY_TRUE);
              GO_BLOCK('AS_SHIP');
                   --Hide the other canvases except the Pricing Canvas                     
         ELSIF(:GLOBAL.HEADERS='TRIM_SHIP_IMAGE')THEN      
    SHOW_VIEW('TRIM_SHIP_IMAGE');
    SET_VIEW_PROPERTY('TRIM_SHIP_IMAGE',VISIBLE,PROPERTY_TRUE);
    SET_TAB_PAGE_PROPERTY('TRIM_SHIP_IMAGE',ENABLED,PROPERTY_TRUE);
              GO_BLOCK('TRIM_SHIP');
                   --Hide the other canvases except the Pricing Canvas                     
         ELSIF(:GLOBAL.HEADERS='EXTRA')THEN      
                   ---Show the Export Canvas---------     
    SHOW_VIEW('EXTRA');
    SET_VIEW_PROPERTY('EXTRA',VISIBLE,PROPERTY_TRUE);
    SET_TAB_PAGE_PROPERTY('EXTRA',ENABLED,PROPERTY_TRUE);
              GO_BLOCK('EXTRA');
                   --Hide the other canvases except the Pricing Canvas                     
         ELSE -- DYNAMIC TABS
    --Hide all the other  static canvases
    IF (:GLOBAL.HEADERS='CT01')THEN
         GO_BLOCK('CT01');
    ELSIF (:GLOBAL.HEADERS='CT02')THEN
         GO_BLOCK('CT02');
    ELSIF (:GLOBAL.HEADERS='CT03')THEN
         GO_BLOCK('CT03');
    ELSIF (:GLOBAL.HEADERS='CT04')THEN
         GO_BLOCK('CT04');
    ELSIF (:GLOBAL.HEADERS='CT05')THEN
         GO_BLOCK('CT05');
    ELSIF (:GLOBAL.HEADERS='CT06')THEN
         GO_BLOCK('CT06');
    ELSIF (:GLOBAL.HEADERS='CT07')THEN
         GO_BLOCK('CT07');
    ELSIF (:GLOBAL.HEADERS='CT08')THEN
         GO_BLOCK('CT08');
    ELSIF (:GLOBAL.HEADERS='CT09')THEN
         GO_BLOCK('CT09');
    ELSE --ELSIF (:GLOBAL.HEADERS='CT10')THEN
         GO_BLOCK('CT10');
    END IF;
              END IF;
         END;
    Thanks,
    Durga Srinivas.
    Edited by: DurgaSrinivas_886836 on Dec 3, 2012 8:12 PM

    In your trigger, you are doing a SHOW_VIEW ('HDR_CANVAS_FIXED'); before you select the :GLOBAL.HEADERS information. I'm not sure what HDR_CANVAS_FIXED is, but I am wondering if that is what is messing you up. What happens if you either comment that out:
    DECLARE
      l_curr_rec     NUMBER;
    BEGIN
      l_curr_rec := :SYSTEM.CURSOR_RECORD;
      --Get the Top Default Tab Page for the Form
      --SHOW_VIEW ('HDR_CANVAS_FIXED'); /* <-------------------------------------------------------Comment it out */
      :global.headers := GET_CANVAS_PROPERTY ('TAB_CANVAS', topmost_tab_page);
      IF (:GLOBAL.HEADERS = 'AS_REC_IMAGE') THEN
        SHOW_VIEW ('AS_REC_IMAGE');
        .or if it is necessary move it to after the :GLOBAL.HEADERS:
    DECLARE
      l_curr_rec     NUMBER;
    BEGIN
      l_curr_rec := :SYSTEM.CURSOR_RECORD;
      --Get the Top Default Tab Page for the Form
      :global.headers := GET_CANVAS_PROPERTY ('TAB_CANVAS', topmost_tab_page);
      SHOW_VIEW ('HDR_CANVAS_FIXED'); /* <------------------------------------ Swap it with :global.headers */
      IF (:GLOBAL.HEADERS = 'AS_REC_IMAGE') THEN
        SHOW_VIEW ('AS_REC_IMAGE');
        SET_VIEW_PROPERTY ('AS_REC_IMAGE', VISIBLE, PROPERTY_TRUE);
        SET_TAB_PAGE_PROPERTY ('AS_REC_IMAGE', ENABLED, PROPERTY_TRUE);
        GO_BLOCK ('AS_REC');
      --Hide the other canvases except the Pricing Canvas
      ELSIF (:GLOBAL.HEADERS = 'TRIM_REC_IMAGE') THEN
        SHOW_VIEW ('TRIM_REC_IMAGE');
        .

  • ARQ: Manager Id manual selection from the list???

    Hi,
    I had discussed in my other thread here that, in some of the cases, a user may not have manager id for some reason either in HR or AD. For such users, the option is to select manager id manually from the list by pressing F4.
    The problem is that, as soon as a manager id is searched, this will display "all" the users available in GRC system: requester, manager, role owner, other dialog users and even background users!
    This causes the requester to select incorrect manager id and exposes all the irrelevant users from GRC system.
    May I know how I can control this? Or do we have any other way to handle this?
    As I know, there are following options:
    1. Maintain users' details properly either in AD or SAP HR systems
    2.In case of non-availability of manager id, route request to appropriate team/person who can take proper decision (which I have done currently)
    Does any also suggest/endorse an idea to modify the default search ability of ARQ?
    I would appreciate if we can have ideas/suggestions on this.
    Would be waiting for kind responses.
    Regards,
    Faisal

    Dear Alessandro,
    Thanks for your reply.
    Regarding :
    I understand your concern regarding correct/wrong mangers. But in case that manager information is wrong in LDAP/HR from which source should GRC get the correct managers?
    I would share on thing and that is, for contractors (for example) some how manager details are not maintained in LDAP (as in SAP HR only permanent employees' HR data is maintained).
    I could not get the first 3 lines of next paragraph and I think this is not the issue
    Basically you can say who ever is a manager can also be a manager from someone else. But it is possible that someone who is not yet a manager can be a new manager and has to be defined as manager in ARQ.
    The issue that, for some type of employees (contractors), manager details are not maintained neither in LDAP nor in SAP HR system. Therefore, in such cases, manager field is empty. But let me tell you there are managers for even contractors, but not maintained in LDAP due to the maintenance responsibility and gathering this information from different department is assumed to be a big and painful task.
    But these managers (for contractors) are definitely available in GRC system as approvers. Therefore, for users (contractors) whose manager is not maintained, manually it is to be selected from the search option. If we start searching for a "suitable" manager, then it displays all the users available in GRC system (because they are created in SU01).
    Also, we might face similar problem at the time of forwarding a request! Actually, a manager should only see the list of other managers, not all users!
    Similarly, a role owner will intend to forward his responsibility to another role owner only!
    Therefore, we should only see the relevant users from the search, but not all!
    Please share your valuable inputs.
    Regards,
    Faisal

  • Selecting from a view when tables are in more than one schema problem

    I give up where am I missing it. Why is the ORA-01031 error being generated on the view u1.bv1. In testing even if I give object access to u3 I still get the same errors:
    SQL>
    SQL> drop user u1 cascade;
    drop user u1 cascade
    ERROR at line 1:
    ORA-01918: user 'U1' does not exist
    SQL> drop user u2 cascade;
    drop user u2 cascade
    ERROR at line 1:
    ORA-01918: user 'U2' does not exist
    SQL> drop user u3 cascade;
    drop user u3 cascade
    ERROR at line 1:
    ORA-01918: user 'U3' does not exist
    SQL> drop role aRole;
    drop role aRole
    ERROR at line 1:
    ORA-01919: role 'AROLE' does not exist
    SQL>
    SQL>
    SQL> select user from dual;
    USER
    SYS
    1 row selected.
    SQL>
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Solaris: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    5 rows selected.
    SQL>
    SQL> create user u1 identified by u1 default tablespace users
    2 quota unlimited on users;
    User created.
    SQL>
    SQL> create user u2 identified by u2 default tablespace users
    2 quota unlimited on users;
    User created.
    SQL>
    SQL> create role aRole;
    Role created.
    SQL>
    SQL> create user u3 identified by u3 default tablespace users;
    User created.
    SQL>
    SQL> grant aRole to u3;
    Grant succeeded.
    SQL>
    SQL> alter user u3 default role all;
    User altered.
    SQL>
    SQL> grant create session to u3;
    Grant succeeded.
    SQL>
    SQL> create table u1.t1(c1 number);
    Table created.
    SQL>
    SQL> create table u2.t1(c1 number);
    Table created.
    SQL>
    SQL> grant select on u2.t1 to u1;
    Grant succeeded.
    SQL>
    SQL> create or replace view u1.bv1 as
    2 select u1.t1.c1 as c1 ,u2.t1.c1 as c2
    3 from u1.t1, u2.t1 where u1.t1.c1 = u2.t1.c1;
    View created.
    SQL>
    SQL> grant select on u1.bv1 to aRole;
    Grant succeeded.
    SQL>
    SQL> create or replace view u1.gv1 as select * from u1.t1;
    View created.
    SQL>
    SQL> grant select on u1.gv1 to aRole;
    Grant succeeded.
    SQL>
    SQL> connect u3/u3
    Connected.
    SQL>
    SQL> select * from u1.bv1;
    select * from u1.bv1
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL>
    SQL> select * from u1.gv1;
    no rows selected
    SQL>
    SQL> spool off

    User u1 cannot do a grant on a view to other user if the view uses tables from other schemas unless you do a "with grant option" grant.
    You need to do the following to make it work:
    SQL> grant select on u2.t1 to u1 with grant option;
    Grant succeeded.
    SQL>

  • Link an image field to a value selected from a list

    Hello!
    I'm newbie to Dreamweaver - PHP and I have a problem. I have
    made a list that displays the names of all the images of my
    database. Now, I want every time the user selects a value from the
    list the corresponding image appears on the same page. How can I do
    this?
    Please help me!!!

    Hi Stefan,<br /><br />Thanks for responding to my last mail. I am talking about the XFA(xml form architecture). Actuallly i am working on Picture form field in PDF which Adobe has newly introduced. In this type of form field , user can add an image. But i am not able to differentiate between the "Picture form field" and "push button". The only thing i have found that the picture form field entry exist in dataset but not the Push button.<br /><br />29 0 obj<br /><<<br />/Length 13533<br />>><br />stream<br /><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><xfa:data><form1><IMAGE href="" xfa:contentType="image/jpg"></IMAGE></form1></xfa:data></xfa:datasets><br />endstream<br />endobj<br /><br />In the above case the "Image" is a picture form field.<br /><br />Another difference i found between "push Button" and "Picture Form Field" is the MK dictionary as below.<br /><br />Pushbutton<br />-----------<br />/MK <<<br />/BG [ 0.831375 0.815689 0.784317 ]<br />/CA (Print Form)<br />/BC [ 0 0 0 ]<br />>><br /><br />Picture form Field<br />-------------------<br />/MK <<<br />/TP 1<br />/I 17 0 R<br />>><br /><br />But i want to find the exact difference. May be some bit in Form Field Flag(ff) signify the picture form field. It will be very helpful to me if you could tell me the exact difference.<br /><br />Kind Regards,<br />Shekhar Kumar Keshri

Maybe you are looking for