Settin' default value of a lov depending on the value of another lov

hi all,
here is my problem:
I got two combobox item in my form;
the first one is customer_id,
the second one is seller_id,
what i wanna do is:
when selecting one customer_id, i want to set the value of the seller_id to the one associated with this customer, and give the enduser to change this value;
i'm tryin' to do so with bind variables but it doesn't work!
any help.;
thanks in advance

Hi,
ok got your requirement clear ,see what all you have to
First of I make clear that by frame what I ment was that when you are in the design phase of the
and you are in the section of "formating " ,there you have 2 frames which are basically not visible as frames,
so just forget about that.
I have implemented the same thing in the emp table intead of your
your customer_id and the supplier_id.
I'm assuming that you will be having just one record in the second LOV corresponding to the
first LOV.
What I've done is that I have made an entry in the scott.emp table with deptno 40 so that
for deptno 40 I have just 1 entry ,to simulate your case.
Note:
Customer_id type is combobox the lov is LOV_CUSTUMER (this will be equivalent to my DEPT_NO LOV)
seller_id type is combobox too, the lov is LOV_SELLER (this will be equivalent to my EMPNO_NO LOV)
1)My driving LOV is in deptno field.
2)I have the driven LOV in empno field.
3)Now when I select Operation dept (dept no 40),I get the selected value in the LOV (empno)
and also rest of the empnos.
This is how you can achieve the functionality as said by you.
1)In your second LOV write some thing similar.
select ENAME, EMPNO from SCOTT.EMP where deptno = :deptno
union
select ENAME, EMPNO from SCOTT.EMP where deptno != :deptno
this is to ensure that you get all the values and at the same time
are able to use the binding of the second LOV.
2)In the before display section write something similar.
declare
l_empNo varchar2(3000);
l_deptNo number(4);
begin
-- This deptno shows what you selected from the first LOV.
l_deptNo := p_session.get_value_as_NUMBER(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_DEPTNO',
p_index => 1);
--just check  wheather it returned something,at the time of loading it will not return anything,so simply
--return in that case without doing anything.
if(l_deptNo is null) then
return;
else
--This query basically fetches the value for your second LOV.
select empno into l_empNo from scott.emp where deptno = l_deptNo;
--set the value for the second LOV in the session.
p_session.set_value(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_EMPNO',
p_value => to_number(l_empNo));
end if;
end;
please try to understand the relationship in my scenario and your scenario.
Hope this helps.
rahul

Similar Messages

  • Shading part of a JTable Cell dependent upon the value of the cell

    Hi
    Was hoping some one woudl be able to provide some help with this. I'm trying to create a renderer that will "shade" part of a JTable cell's background depending upon the value in the cell as a percentage (E.g. if the cell contains 0.25 then a quarter of the cell background will be shaded)
    What I've got so far is a renderer which will draw a rectangle whose width is the relevant percentage of the cell's width. (i.e. the width of the column) based on something similar I found in the forum but the part I'm struggling with is getting it to draw this rectangle in any cell other than the first cell. I've tried using .getCellRect(...) to get the x and y position of the cell to draw the rectangle but I still can't make it work.
    The code for my renderer as it stands is:
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.table.TableCellRenderer;
    public class PercentageRepresentationRenderer extends JLabel implements TableCellRenderer{
         double percentageValue;
         double rectWidth;
         double rectHeight;
         JTable table;
         int row;
         int column;
         int x;
         int y;
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              if (value instanceof Number)
                   this.table = table;
                   this.row = row;
                   this.column = column;
                   Number numValue = (Number)value;
                   percentageValue = numValue.doubleValue();
                   rectHeight = table.getRowHeight(row);
                   rectWidth = percentageValue * table.getColumnModel().getColumn(column).getWidth();
              return this;
         public void paintComponent(Graphics g) {
            x = table.getCellRect(row, column, false).x;
            y = table.getCellRect(row, column, false).y;
              setOpaque(false);
            Graphics2D g2d = (Graphics2D)g;
            g2d.fillRect(x,y, new Double(rectWidth).intValue(), new Double(rectHeight).intValue());
            super.paintComponent(g);
    }and the following code produces a runnable example:
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    public class PercentageTestTable extends JFrame {
         public PercentageTestTable()
              Object[] columnNames = new Object[]{"A","B"};
              Object[][] tableData = new Object[][]{{0.25,0.5},{0.75,1.0}};
              DefaultTableModel testModel = new DefaultTableModel(tableData,columnNames);
              JTable test = new JTable(testModel);
              test.setDefaultRenderer(Object.class, new PercentageRepresentationRenderer());
              JScrollPane scroll = new JScrollPane();
              scroll.getViewport().add(test);
              add(scroll);
         public static void main(String[] args)
              PercentageTestTable testTable = new PercentageTestTable();
              testTable.pack();
              testTable.setVisible(true);
              testTable.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }If anyone could help or point me in the right direction, I'd appreciate it.
    Ruanae

    This is an example I published some while ago -
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Fred120 extends JPanel
        static final Object[][] tableData =
            {1, new Double(10.0)},
            {2, new Double(20.0)},
            {3, new Double(50.0)},
            {4, new Double(10.0)},
            {5, new Double(95.0)},
            {6, new Double(60.0)},
        static final Object[] headers =
            "One",
            "Two",
        public Fred120() throws Exception
            super(new BorderLayout());
            final DefaultTableModel model = new DefaultTableModel(tableData, headers);
            final JTable table = new JTable(model);
            table.getColumnModel().getColumn(1).setCellRenderer( new LocalCellRenderer(120.0));
            add(table);
            add(table.getTableHeader(), BorderLayout.NORTH);
        public class LocalCellRenderer extends DefaultTableCellRenderer
            private double v = 0.0;
            private double maxV;
            private final JPanel renderer = new JPanel(new GridLayout(1,0))
                public void paintComponent(Graphics g)
                    super.paintComponent(g);
                    g.setColor(Color.CYAN);
                    int w = (int)(getWidth() * v / maxV + 0.5);
                    int h = getHeight();
                    g.fillRect(0, 0, w, h);
                    g.drawRect(0, 0, w, h);
            private LocalCellRenderer(double maxV)
                this.maxV = maxV;
                renderer.add(this);
                renderer.setOpaque(true);
                renderer.setBackground(Color.YELLOW);
                renderer.setBorder(null);
                setOpaque(false);
                setHorizontalAlignment(JLabel.CENTER);
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
                final JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
                if (value instanceof Double)
                    v = ((Double)value).doubleValue();
                return renderer;
        public static void main(String[] args) throws Exception
            final JFrame frame = new JFrame("Fred120");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setContentPane(new Fred120());
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }

  • Calculate a measure depending on the value of other dimension

    HI,
    I would like to know if it’s possible to calculate a measure depending on the value of other dimension. I want to calculate this measure in the Business Model and Mapping. I show you how I am trying to do it:
    http://img338.imageshack.us/img338/2496/imagenjp.png
    But when I try to make an aggregation of this measure then I get an error of consistency.
    I think a good example to make you to understand me is the function TODATE which calculates an aggregation depending on one time dimension. I would like to do the same thing but regarding to the value of other dimension.
    Can someone help me? Thanks a lot.

    Hi,
    Do you have that dimension table as a "Sources" in that BMM folder? if yes, then you can use the "Data Type" option and click on "show all logical sources". Then click on your fact table using which you want to do the calculation and then use this formula. After that you can have the aggregation.
    It should work.
    Thanks,
    Rohit

  • How do i prepopulate a listbox depending on the value of a textfield

    I am getting an custmerid value in a textfield depending on the selected customer name after getting this value i need to pass this customer id to a rowset query for populating the customer address listbox with that customers addresses only (he has multiple address ) iam doing so by doing setobject(1,custid) on that particular rowset.
    How ever on deploying iam getting invalid parameter binding exception.
    what do i do ? how do i get that customers addresses ?when does the creator look for the parameter bindings in the rowset.or trather when does it execute that particular rowset.?

    Hi,
    Check the following tutorial:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/listbox_components.html

  • Hide Advance table Depending upon the value of dropDown

    Hi,
    I have 2 advance tables. 1st one has a DropDown. Depending upon the value of the dropdown in 1st advance table, the second advanced table should get rendered.
    I tried by getting the value of the dropdown by addingg a PPF and iterating trough the table and I got the value. But when I redirect to the same page, all the selection and other values in 1st advanced table vanish out.
    Can someone help me getting the 2nd table hidden and at the same time retaining the values for the 1st advanced table.
    Thanks in Advance,
    Kaushik Rambhiya

    Kaushik
    Implement PPR for this requirement and dont redirect the page
    Displaying image based selected value of choice bean
    http://oracleanil.blogspot.com/2009/05/ppr.html
    Thanks
    AJ

  • Column displaying as an icon instead of/depending on the value

    Hello,
    I use interactive reports and I've a column (IND_CAMP) that can take 2 values : 0 or 1 (the type of the column is "Number").
    I would like this column displays as an icon, depending on the value (a check box, checked or not).
    Must I change my table or can I do this directly in Apex, for example with the conditional display ?
    Or can I add a column, with a different type, connected to IND_CAMP in my query ?
    thanks for your ideas,
    Fanny

    Hi MDK, thanks for your help,
    I'm sorry but I'm new with Apex and PL/SQL...
    My "checkbox" is in fact only a picture, so I've 2 icons, for example icon1.gif and icon2.gif
    And the value I'm interested in is the value of IND_CAMP (0 or 1).
    Should my query look like this...? :
    SELECT MYTABLE.CDE_CAMP,
    MYTABLE.IND_CAMP
    FROM MYTABLE
    CASE
    IND_CAMP.value WHEN 0
    THEN
    '<img src="#WORKSPACE_IMAGES#icon1.gif" />'
    ELSE
    '<img src="#WORKSPACE_IMAGES#icon2.gif" />'
    ENDI can add a column with the icon and hide the IND_CAMP or I can replace it.
    thanks again,
    Fanny

  • Formula to populate one Person or Group column depending on the value of another Person Group column

    I am looking for a way to popluate the Account information of a Person based on another column where there name in another column.  I have Two Columns   "Name" which is a Person or Group information type and User Account which
    is also a Person or Group Information type.  When an Invidividuals name is entered into the Name column, I what the User Account column to prepolulate.

    Hi,
    For your issue, you can automatically populate User Information depending on the value of another Person or Group column by connectting with User Information List or  connectting with User Profile Web Service:
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=172
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Disabling button depending on the Value of a field in a standard page

    Hi,
    How can I disable a button depending on the value selected in a particular field of the same page? Is it possible to do so in a Oracle standard page? Please guide me in resolving this requirement.
    Thanks,
    Swagatika

    Swagatika,
    You can attach PPR event to the textinput field and use method
    pageContext.ForwardImmediatelyToCurrentPage().As process request method will be called again,here you can use method setDisabled(boolean) in OAsubmitButtonBean, to enable or disable your button!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ColumnChart color depending on the value of the column

    Hi,
    I'va been trying for 2 days to change the colors of columnseries in a columnchart and it is actually awful. I've tried to do it inline without custom itemRenderer but I quickly understood that it is impossible. I then looked on the internet, and found that it was maybe possible by creating a custom itemRenderer class, extending ProgrammticSkin and implementing IdataRenderer.
    I have tried but am not at all able to retrieve the value of the column inside the itemRenderer. Even more, the so called _chartItem is always null and never never carries anything from anyparent.
    I'm a bit exhausted of trying and getting this value, so if you have some idea, i'll be very grateful.
    Here is the code for my itemRenderer class:
    import flash.display.Graphics;
        import flash.geom.Rectangle;
        import mx.charts.ChartItem;
        import mx.charts.chartClasses.GraphicsUtilities;
        import mx.charts.series.items.ColumnSeriesItem;
        import mx.controls.Alert;
        import mx.core.IDataRenderer;
        import mx.graphics.IFill;
        import mx.graphics.IStroke;
        import mx.skins.ProgrammaticSkin;
        public class ColorRenderer extends ProgrammaticSkin implements IDataRenderer
            public function ColorRenderer():void
                super();
            private var _chartItem:ChartItem;
            public function get data():Object
                return _chartItem;
            public function set data(value:Object):void {
                _chartItem = value as ColumnSeriesItem;
                invalidateDisplayList();
            private static const fills:Array = [0xFF0000,0x00FF00,0x0000FF,
                0x00FFFF,0xFF00FF,0xFFFF00,
                0xAAFFAA,0xFFAAAA,0xAAAAFF];
            override protected function
                updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                var g:Graphics = graphics;
                g.clear(); 
                g.beginFill(fills[(_chartItem == null)? 0:_chartItem.element.y]);
                Alert.show(_chartItem.index.toString());
                g.drawRect(0, 0, unscaledWidth, unscaledHeight);
                g.endFill();
        } // Close class.
    } // Close package.
    Thank you

    It worked, thanks
    Date: Wed, 21 Apr 2010 09:03:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: Flex ColumnChart color depending on the value of the column
    Have you looked at doing per-item fills?
    http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf69084-7c3f.ht ml
    This feature lets you define a function that customizes chart item fills based on their values.
    >

  • Variant network depending on the value of the characteristics.

    Hi,
    I want to create a project from a sales order for a configurable material. The problem is that the network should be slightly different depending on the value of the characteristics used in the configurable material. For example, it could happen that one operation should not be executed, or that this operation should take longer because of the characteristics.
    How should I proceed?
    Thanks in advance.
    Regards,
    Luis.

    Thanks for your answers, but I needed a more specific answer. Anyway, in the end I found the solution:
    - I had to create a configuration profile for the standard network (CU41), and then I had to assign the same class as the one assigned to the configuration profile of the configurable material.
    - Then, I run t-code CN02, and I had to select one operation and then I clicked "Extras --> Object Dependencies --> Editor". And finally, I just chose the dependency type and filled it with its corresponding code.
    Still, I have a problem:
    - Is it possible to set the value of the Normal Duration (or any other parameter of the operation) depending on the value of one characteristic?
    For example: The value of my characteristic A is 2, so I want to set Normal Duration = 10*(Value_of_A) = 20 for the first operation of the standard network. Is it possible in standard SAP???
    Thanks!

  • The drop down list values want to vary based on the contents of another drop down field

    hi,
    hi in search page i have two drop down list. i have two tables and one mapping tables. service line and subservice line are tables and i have one mapping table. using rapid application i create one component using mapping table. now in search page i have two drop list. one is servline and another is sub serviceline. in service line i have values like 1,2 k  for subservice 3,4.5,6 for one service line ex. for 1 i have two subservice 3,4 and for 2 i have 5,6. now my requirment in if i choose service line 1 in first drop down list, automatically in second drop down list want to contain values 3, 4. before both the drop down list have values.if i chose one value the correponding mapping value want to come in drop down list in same context node.

    Hi,
    This requirement involves defining p-getter for the service type, and the v-getter of you sub type.
    Since this involves to populate the values of subtype attribute depending on value of service type, u need a round trip.
    This is done in the p-getter of the 1st attribute(service type in your case).
    In the v-getter of the 2nd attribute, 1st fetch the current value of attribute 1, then filter the value in the dropdown table according to ur logic.
    Ref :Drop down values in table view
    Regrads
    Anish

  • Filter an LOV depending on a value selected in another LOV

    Hi,
    I have two LOVs.
    1. Job
    query:
    select
    distinct
    pj.job_id,
    pjd.segment1 job_code,
    pjd.segment2 job_title
    from
    per_jobs pj,
    per_job_definitions pjd,
    per_valid_grades pvg
    where pj.job_definition_id = pjd.job_definition_id
    and pj.job_id = pvg.job_id(+)
    2. Grade
    Query:
    select
    distinct
    pg.name grade_name,
    pg.grade_id,
    'Yes' valid_for_job
    from
    per_valid_grades pvg,
    per_grades pg
    where pvg.grade_id = pg.grade_id
    and pvg.job_id = NVL(:1,pvg.job_id)
    union all
    select
    distinct
    pg.name grade_name,
    pg.grade_id,
    'No' valid_for_grade
    from
    per_grades pg
    where not exists (select pvg.job_id
    from
    per_valid_grades pvg
    where pg.grade_id = pvg.grade_id
    and pvg.job_id = NVL(:2,pvg.job_id))
    When ever i select different value from JOB LOV, corrosponding JobID have to be passed to Grade LOV.
    I though of passing jobid as lovmap criteria for Grade but if select jobid in my Grade LOV Query it don't give me the required records.
    Can some one please help me fixing this.
    Thanks a lot
    Pavan

    Thanks Ratheesh for your response. I got the solution now.
    I have given the Query which i used for my second LOV at the beginning of this ticket.
    What i did was, i used putSessionValue() and getSessionValue() methods to pass the jobid from base page where the values from first LOV is returned and passed it to a new controller created for second LOV. I used the below code both in my PR and PFR.
    String jId = (String)pageContext.getSessionValue("paramJobId");
    System.out.println("job Id in PR: "+jId);
    EmployeeLovAMImpl am = (EmployeeLovAMImpl)pageContext.getApplicationModule(webBean);
    GradeLovVOImpl vo = (GradeLovVOImpl)am.getGradeLovVO1();
    vo.setWhereClause(null);
    vo.setWhereClauseParams(null);
    vo.setWhereClauseParam(0,new oracle.jbo.domain.Number(Integer.parseInt(jId)));
    vo.setWhereClauseParam(1,new oracle.jbo.domain.Number(Integer.parseInt(jId)));
    System.out.println("query after in PR: "+vo.getQuery());
    vo.executeQuery();
    Thanks you once again for your response.
    Pavan

  • Change the colour of a cell text depending on the value Web Reports (NW04s)

    Hi all,
    does anyone know how to change the color of the text of a cell depending on its value on Web Reports? For example red text for values smaller than zero and blue for values bigger than zero?
    I know you can create exceptions, but that changes the background color of the cell and not the text color
    I have tried modifying the theme but the property "negative text" doesn't related to cell values.
    Thanks
    C
    PD: Point will be awarded!
    Message was edited by:
            Carles Prunera

    This function changes all numeric fields to blue if no css style is set.
    [code]
    function turnblue(){
      var cells =document.getElementsByTagName('a');
      for ( i=0; i<cells.length; i++){
        if ( cells<i>.className == '' ){
          var changeColor = checknumber(cells<i>.innerHTML);
    // additional condition on value
          if (changeColor) {
            cells<i>.style.color = '#0000FF'
    function checknumber(cNumber){
      var x= cNumber
      var anum=/(\d+$)|(\d\.\d$)/
      if (anum.test(x))
        testresult=true
      else{
        testresult=false
    return (testresult)
    [/code]
    hope it helps

  • Setting default value for a jcombobox based on the value not the index

    I am trying to set the default value for my combobox to the current year. One way I thought of doing it was to get the index of the value representing the current year and then use setSelectedInex to make it the default. Any ideas?
    The relevent section of code is below.
    GregorianCalendar gregorianCalendar = new GregorianCalendar();
    int year = gregorianCalendar.get(Calendar.YEAR);
    String currentyear = year + "";
    int startyears = 2000;
    int numyears = 25;
    JComboBox endyearcombobox = new JComboBox();
    endyearcombobox.setBorder( BorderFactory.createLineBorder(Color.DARK_GRAY));
    endyearcombobox.setFont(standardfont);
    endyearcombobox.addActionListener( new ActionListener() {
    public void actionPerformed( ActionEvent event ) {
    endyearcombobox = ( JComboBox )event.getSource();
    endyear = endyearcombobox.getSelectedItem();
    boolean same = endyear.equals(oldItem);
    oldItem = endyear;
    String[] endyearlist = new String[numyears];
    for(int i = startyears; i < startyears+numyears; i++){
    String item = new Integer(i).toString();
    endyearcombobox.addItem(item);
    Thanks
    Ged

    Thanks mate,
    That was what I was looking for. I still had a little more manipulation to do, but sent me on the right track and have got it working now. I don't know why I didn't think of it in the first place.
    Ged

  • How to bind value to lov based on the output from other lov

    HI all, i have 2 message choice Lov, i am selected a value from the 1st lov based on this value i am a executing a query, i want to display one of the attribute value from the query result in the second LOV. i am getting the attribute value correctly but i dont know how to bind that(display) in the 2nd LOV(at runtime).

    Read the dev guide LOV section, it should give you details about this implementation.

Maybe you are looking for

  • No funcionan los parlantes de mi notebook con microsoft uaa+conexant audio

    MI PREGUNTA hola. hace dias que estoy renegando con esto, he seguido los pasos que indica hp y utilizado todo tipo de metodos y no logro hacer qeu salga audio por los parlantes de mi HP Pavilion DV6045NR. La compre con un sistema operativo vindows SP

  • Dreamweaver template Spry Accordion displays error on Firefox

    Hi, I downloaded and try to use the template 02 with Dreamweaver CS5 from http://www.adobe.com/devnet/dreamweaver/articles/dreamweaver_custom_templates.html However, when I try to browse the theme_02_design.html in firebox, the spry accordion is corr

  • Meaning of field  upgrade in table smodilog

    Hi all , Do you know what is the meaning of field UPGRADE in table smodilog ? the thing is that after upgrade of our test system , by using spau cr (that was imported during the upgrade in phase adjust_prp) when I  goto SPAU I see that the objects th

  • Flash CS5.5 appcrash(aflamingo.dll)

    So I am working on a project for few days now. Today when I tried to open the file I get an appcrash only for that project. The weird thing is that I even worked earlier, but now that I tried to open it I get this crash. Any ideas? Hopefully the file

  • Querry regarding the event fire

    Hi All, I am coming across the problem that my code is able to fire lost focus event only once. Next time when I try to do the same thing then the lost focus event does not work. For this I have to run the program again and again. Why it is so? Pl ex