Set a component visible based on a value of a LOV

Hi all,
I am using Jdeveloper 11.1.1.2 and ADFBC.
I have a panelFormLayout with some fields.
I have a LOV and I want to set the property visible of a field based on the value of the LOV.
For example: if LOV = First (value =1) field = visible, if LOV = Second (value =1) field = not visible
I have created a backing bean of the page with a method that return a boolean, but I don't know how to get the value of the LOV.
What have I to use? ADFUtils? JSFUtils?
Here there is my code:
public class InsMovimento {
private RichSelectOneChoice soc3;
public void setSoc3(RichSelectOneChoice soc3) {
this.soc3 = soc3;
public RichSelectOneChoice getSoc3() {
return soc3;
public boolean isVisiblePanelLottoEScadenza(){
boolean isVisible = false;
// ... code to retrieve the value of the LOV
return isVisible;
Any suggestions?
Thank you
Andrea

Hi,
you have 2 options. For both options you need to set autosubmit=true on the LOV field and use the PartialTriggers property on the depedent fields to point to the ID of the LOV. Alo define a value change listener on the LOV field
Option 1: Create a managed bean reference for the LOV using its binding property. Then, call getValue on it to get the component value
Option 2: If the component is bound to ADF, you can read the value fom the ADF binding layer
Option 1 is good to use if for example the "immediate" property on the LOV is set to true so you avoid required field validation problems if the dependent fields have no value though must have one. In this case using a ValueChangeListener on the LOV can be used to read the values, and set the boolean values in the managed bean
Frank

Similar Messages

  • Setting a component visible

    Hi,
    I have a JButton that is setVisible (false ) when a form is first opened. The button is added to the panel of the form though. The button becomes visible on the press of another button but a small area of the form is blanked out as soon as it becomes visible - a small section under the button in question?
    Is there a known bug here? I have 1.3.1_1 because 1.4.2 doesnt compile classes on my PII.
    Cheers
    Reave

    Hi Alex,
    I think you are just hitting a Flex limitation, 60+ charts does sound like a lot in one dashboard, what is it you are trying to do and can you not reuse existing ones?
    I can't remember where I saw it but someone blogged the other day about Flex in general crawling along with 60+ charts because charts tend to be heavy weight so when you have a lot of them it does not work very well so they were creating a new lightweight chart set instead.
    Regards
    Matt

  • Can we return a value in two field based on a value select in LOV?

    Hello expert.
    i have a lov attached to a non-bind text field. when i select a value from non bind field lov, a record group of another LOV attached to a database item field generated. both text field are in same block.
    LOV record group query of non-bind field is:
    select cli_desc,cli from ivt_cli_mst
    mapping is done for same lov field.
    as: LOV record group query of database item_field :blk_stg_mst.item_cd is
    select a.item_cd,b.short_desc
    from storg_mst a,item_mst b
    where a.item_cd = b.item_cd
    and substr(a.item_cd,3,2) = :blk_stg_mst.nb_cli_cd(non bind LOV attached field)
    and a.store_cd= :blk_store_mst.store_cd
    order by item_cd
    requirement:
    i want as i select a value from LOV in non_bind field , value display in non_bind field as well as database item_field:
    i.e in :blk_stg_mst.item_cd also.
    please help.
    thanks yash

    hi,
    assign LOV to database item.(as usual setting the lov reuturn column to it). in the when validate item of database field assign value to no db field(something like if :db column is not null then :nondb_col := :dbcolumn).

  • How to set a value into a component visibility with expression builder?

    Hello,
    I want to set true/false value into a adf component visibility according to a bean object's value. if the object value is null then visibility value will be false, else visibility is true.
    How can I do that without an extra variable definition in the backing bean?
    Thanks, Ali

    I think, "visibility = false" is a rendered element, which is not display to the user (like a HiddenField). You should find the element in your HTML-code of your browser. A "rendered = false" element should be not rendered into HTML and not to find in the HTML-code.
    Regards
    Majo

  • Setting the Link Group Name in  Deep Link based on the value of a column

    Using Jdeveloper 11g, Jheadstart 11g
    Is it possible to override the link group name in deep linking. For example can I conditionally set that field based on the value of the item.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:35 AM
    Edited by: aliegeh on Jul 25, 2010 8:43 AM

    Thanks for the suggestion.
    Here is what I am trying to do:
    I have a table with one visible column that has the following entries:
    1. Create
    2. Modify
    3. Verify
    4. Approve
    5. View
    If the user clicks on row 1 (Create) then the link group name should be "CreateEmployees" to create new employees
    If the user clicks on row 3 (Verify) then the link group name should be "MaintainEmployees" for verification and so on.
    (This is role based and each role will have access to one or more of the rows in the tabler)
    It basically mimics a work-flow type of scenario.
    I tried to modify the template and looked at the line:
    action="$JHS.facesConfigGenerator.addItemGroupLinkTaskFlowCall((${JHS.Current.item})}" but got stuck there.
    Is there a way to change "JSH.current.item" in the template to read the group link name from another column say by using #if statements.
    One way I also tried was to introduce a column for each action such as CreateAction, VerifyAction etc which kind of agrees with your suggestion but the drawback is the need to modify the table if another task is required.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:36 AM
    Edited by: aliegeh on Jul 25, 2010 8:42 AM

  • Custom itemRenderer component based on cell value: error 1009

    I'm working on an item renderer for a dataGrid that has different states depending on the cell and row values.
    The cell value is a toggle (true or null), and sets whether content should be shown in the cell or not
    The row properties determine what is shown when the cell value is true.
    The dataGrid dataProvider is populated based on user id input.
    I created the itemRenderer as a custom actionscript component, closely following this example:
    360Flex Sample: Implementing IDropInListItemRenderer to create a reusable itemRenderer
    However, my component results in Error #1009 (Cannot access a property or method of a null object reference) when a user id is submitted.
    package components
         import mx.containers.VBox;
         import mx.controls.*;     import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
              {super();}
              private var _listData:BaseListData;   
                   private var cellState:String;
                   private var cellIcon:Image;
                   private var imagePath:String;
                   private var imageHeight:int;
                   private var qty:String = data.qtyPerTime;
                   private var typ:String = data.type;
              public function get listData():BaseListData
                   {return _listData;}
              public function set listData(value:BaseListData):void
                   {_listData = value;}
              override public function set data(value:Object):void {
                   super.data = value;
                   if (value != null)
                   //errors on next line: Error #1009: Cannot access a property or method of a null object reference.
                   {cellState = value[DataGridListData(_listData).dataField]}
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState=='true'){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    There are no errors if I don't use an itemRenderer--the cells correctly toggle between "true" and empty when clicked.
    I also tried a simple itemRenderer component that disregards the cell value and shows in image based off row data--this works fine without errors or crashing. But I need to tie it to the cell value!
    I have very limited experience programming, in Flex or any other language. Any help would be appreciated.

    Your assumption that the xml file either loads with "true" or nothing  is right.
    After modifying the code to the following, I don't get the error, but it's still not reading the cell value correctly.
    package components
         import mx.containers.VBox;
         import mx.controls.*;   
         import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
               super();
              private var _listData:BaseListData;   
              private var cellState:Boolean;
              private var cellIcon:Image;
              private var imagePath:String;
              private var imageHeight:int;
              private var qty:String;
              private var typ:String;
               public function get listData():BaseListData
                 return _listData;
              override public function set data(value:Object):void {
                   cellState = false;
                   if (listData && listData is DataGridListData && DataGridListData(listData).dataField != null){
                       super.data = value;
                       if (value[DataGridListData(this.listData).dataField] == "true"){
                           cellState = true;
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState==true){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    - didn't set the value of qty or typ in the variable declarations (error 1009 by this too--I removed this before but wanted to point out in case its useful)
    - added back in the get listData() function so I could use the listData
    - changed the null check
    All cells are still returning cellState = false when some are set to true, even if I comment out [if (value[DataGridListData(this.listData).dataField] == "true")] and just have it look for non-null data. That shouldn't make a difference anyway, but it confirms that all cells are returning null value.
    Swapping out the first if statement in set data with different variables results in the following:
    [if (listData != null)]  all cells return null (cellState=false for all)
    both [if (value != null)] and  [if (DataGridListData != null)]  results in error 1009 on a line following the if, so I assume they return non-null values.
    All rows have data, just not all fields in all rows, so shouldn't listData be non-null?  Could it be that the xml file hasn't fully loaded before the itemRenderer kicks in?
    I also realized  I had removed the item renderer from many of the columns for testing, and since some columns are hidden by default only one column in the view was using the itemRenderer--hence the single alert per row I was worried about earlier.
    Thanks for your help so far.

  • How to Visible/Hide an Item based on the value of another Item

    Hi
    I need to visible and hide a textitem based on the value of another item.This form has 3 blocks, and the both item is in the first Master Block.
    My code is:
    if :RECORDTYPE=7 then
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_TRUE);
         Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_TRUE);
    ELSE
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_FALSE);
    Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_FALSE);
    :BLOCK.ITEM:=NULL;
    end if;     
    I wrote the code in the Validate Trigger, but not working when moving Next Record & Previous Record
    Thanks in advance
    Rizly

    Read the 'Propagation of Property Changes' section towards the end of the page for Set_Item_Property in the online help. I'm not sure what you mean by locking automatically but perhaps it's because of this.
    You should also ensure the item you're setting to invisible is not the current item (check :system.cursor_item and go to a different item if necessary).

  • Is column visibility based on the first page of the result set or the entire result set?

    I have tried, in vain, to play with the column visibility expression in my report. So where my Business Unit is "MC" or "FM", then I want to display column "HCFA Number"...otherwise hide it. If I run strictly for "MC"
    it works! If I run simply for "CO" it works! And doesn't show! But if I combine "CO" and "MC", it is hidden and I would expect it to be visible since "MC" is part of my entire report.
    Here's the expression I came up with for Column Visibility...
    =IIf((Fields!BUSINESS_UNIT.Value = "MC") OR
    (Fields!BUSINESS_UNIT.Value = "FM"),FALSE,TRUE)
    Am I missing something here or just being dense late on a Friday???
    Thanks for your review and am hopeful for a reply.

    Hi ITBobbyP,
    It seems you have add parameter based on the "Business Unit" which is multiple values and when you select the "CO,MC" the entire column "HCFA Number" is hide, but what you want is to hide the CO related "HCFA Number"
    and show the MC related "HCFA Number", right?
    The expression you are using to show/hide the column visibility will based on the current filtered entire result set. That is mean the entire column "HCFA Number" will be show when the result set contains "MC" or "FM"
    or both, otherwise, it will always hide.
    In your scenario, you can set the row visibility using the expression and you will get the result like below:
    You can set the visibility of the textbox "[HCFANumber]", but the CO related "HCFANumber" will be blank:
    If I have some misunderstanding, please try to provide more details information about the expect result you want.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • DataGridCellStyle: Set Background of DataGridCell based on value in a Different DataGrid / DataTable

    Hi everyone
    I am trying to set the background of a cell in a datagrid based on a value in a different datagrid. Is it possible to specify this in the XAML through binding? I'm using the MVVM pattern and would like to minimise code in the code behind. Please note that
    the datagrids are the same dimension, but the dimension is unknown until runtime.
    I've copied an image of the two datagrids. Essentially, the second datagrid will contain values of 0 or 1. I would then like to color the cells in the first datagrid a different color based on these values. 
    CODE:
    <DataGrid Style="{StaticResource Style1}" ItemsSource="{Binding Table1, StringFormat=n}" AutoGenerateColumns="True" >
    <DataGrid.InputBindings>
    <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding CommandWithParameter}" CommandParameter="{Binding .}"/>
    </DataGrid.InputBindings>
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="Background" Value="{Binding Table2, Converter={StaticResource WeightConverter} }"/>
    </Style>
    </DataGrid.CellStyle>
    </DataGrid>
    Thanks!

    You could use a DataTrigger that binds to a column of a row of the other DataGrid like this:
    <DataGrid x:Name="datagrid"></DataGrid>
    <DataGrid x:Name="datagrid2">
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Style.Triggers>
    <DataTrigger Binding="{Binding Path=Items[0].num, ElementName=dataGrid}" Value="abc">
    <Setter Property="Foreground" Value="Red"/>
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </DataGrid.CellStyle>
    </DataGrid>
    DataTable dt = new DataTable();
    dt.Columns.Add(new DataColumn("num") { DataType = typeof(string) });
    dt.Rows.Add("abc");
    datagrid.ItemsSource = dt.DefaultView;
    datagrid2.ItemsSource = new List<string> {"a", "b", "c" };
    Hope that helps.
    Please also remember to mark all helpful posts as answer to close your threads and please start a new thread if you have a new question.

  • How to select a different value based on $FLEX$ Value set

    Hi friends,
    am getting a column like position from positions_table....
    now based on this value set am selecting another column from the same table like for ex amount...using $FLEX$.vlaueset_name
    now if the value in the table is 0 or null I should make the field available for the user to enter something
    as of now it is not letting me enter any data as this value is based on the first value set we defined..
    is there a way to do that..
    hope am clear in specifying my requirement
    thanks

    Hi Balraj
    I want to select one list item value from yyy based on the xxx item value..Pls use the following andreas's link ( it's about it)
    http://andreas.weiden.orcl.over-blog.de/article-28957008.html
    pls study it carefully and develop.
    Hope it helps...
    Regards,
    Abdetu...

  • Change an Object property based on a value coming from the Excel sheet

    hi all
    i've been able to bind a value from the excel sheet to my my component
    but i want to change a property of an object in my component based on this value at the run time.
    during the design time, it works fine
    for example, if my value called "_xvisible"
    and i use to it to hide some object.
    if i set _xvisible during the design time in excel, it works fine in the run mode.
    but during the run mode, if the value got changed, there is no affect.
    thank you
    Amr

    Hi
    See the xcelsius samples present inside xcelsius SDK. there are examples describing how to bind data which will work at runtime also.
    Hope this helps
    Rush-me

  • How can I force an "invisible" object to become "visible" when a numeric value is entered?

    So I’m trying to force an “invisible” subform to switch to “visible” when a numeric value greater than or equal to 22 is input into a numeric field.
    I can’t get the following javascript code to work properly with any event. I’ve tried the change, calculate, validate, events and a few more to no avail. The only event that kind of works with the javascript code I’m using is the validate event. When I input the code into the validateevent, the invisible subform becomes visible when an amount equal to or greater than 22 is entered, but when ANY amount is input into this field, an error message pops up that says “NumericField4 validation failed” and the user has to click “Ok” to get rid of the pop up box.
    if (this.rawValue <= 22) {
            Approval23.presence = "hidden";
    if (this.rawValue >= 23) {
                Approval23.presence ="visible";
     Here’s a link to my .pdf: http://www.filedropper.com/salgovform
    The object field that the javascript code is contained in is called: NumericField4 (a.k.a. New Job Grade)
    The subform that I want to become visible when a number greater than 22 is input into NumericField4, is called Approval23.
    I’ve based the javascript code I used on information I gathered from the following thread and associated .pdf . . .
    Thread:
    http://forums.adobe.com/message/1982919
    PDF in thread with the javascript code:
    http://forums.adobe.com/servlet/JiveServlet/download/1981437-8059/Sample_SW.pdf
    I’m pretty sure I’m just missing one little thing that’s throwing everything off!
    Any help would be GREATLY appreciated.

    Hi,
    The following works in the exit event of the numeric field, where the language is set to JavaScript:
    if (this.rawValue <= 22) {
         Approval23.presence = "hidden";
    else {
         Approval23.presence = "visible";
    Here is your form: https://acrobat.com/#d=3gRNt6WBY2bE0K7en4CnSA
    Hope that helps,
    Niall

  • Costing component allocation to CO-PA value field via SD invoicing

    Hi experts,
    Somewhere a setting must be made that allocates costing component amount to CO-PA value fields.
    I.e. this takes place when the CO-PA document is created belonging to the order/invoice created in SD.
    Will appreciate to learn a transaction code where this setting is made.
    BR,
    Niclas

    Hi,
    costing-based CO-PA:
    all values from billing documents flow to CO-PA based on KE4I T-code, quantities based on KE4M. If its necessary to reset some of the transferred values this can be done depending on the billing type using KE4W.
    All other values that are posted with a PAOBJNR as cost object (=direct postings) are processed by mapping the cost element number to a value field in T-code KEI2.
    Other values are settled to CO-PA by different settlement transactions (KEU5, KO88,...)
    Best regards, Christian

  • Yield of portfolio based on accounting values?

    Hello,
    I want to ask if there exists any possibility to measure yield of portfolio from accounting values. Actually I am trying to find information about functionality of Accounting Analyzer in available sources but I am not sure, if it includes yield based on accounting values.
    Thank you for your response.
    Regards,
    Maria

    Hi,
    Specify a  variable(say Flag) in the GlobalData and then in the Code Initialization section Check whether your table is having data or not and accordingly set the variable (here Flag to "X" if table is having data).
    In the Layout use this variable(check if flag == "X" )  to decide the visibility of the Subforms S1 to S4 .
    Thanks.
    UmaS.

  • How do I access a value of a variable in SSIS and control the flow accordingly based on its value?

    So I have a Foreach Loop Container that Enumerates a read Excel spreadsheet and this Foreach Loop get its User::SheetName. Can I change my flow accordingly based on the value of the User Variable User:SheetName that is dynamically valued by the Foreach Loop
    Container? So if the User::SheetName is "Enrolled", I want to load that worksheet to a certain SQL Server Table using an Excel Source and OLE DB Destination and if the User::SheetName is "Engaged", I want to load its worksheet contents
    to a different SQL Server Staging Table. What Task can I use to determine the value of User::SheetName or am I going to have to write a C# script to do this?
    Any help and/or suggestions are GREATLY appreciated.
    Thanks!

    Hi ITBobbyP,
    According to your description, you want to read data from excel by using the Foreach Loop container with the appropriate enumerator. If that is the case, please refer to the following steps:
    Inside the ADO NET enumerator, add a data flow task.
    Inside the data flow task, add an Excel source.
    Open the Excel source, and point to the Excel data source set up in the file enumerator.
    Select one of the sheets that shows in the drop down.
    Close the Excel source.
    Select the Excel source.
    In the properties window, copy the name of the sheet you selected. It's in the 'OpenRowset' property.
    Set this as the initial string in your sheet name variable created to gather the sheet name from the ADO NET enumerator.
    Select the Excel source.
    In the properties window, change the 'AccessMode' to OpenRowset from Variable. This will change the property 'OpenRowset' to 'OpenRowsetVariable'.
    Change the 'OpenRowsetVariable' to the variable created to hold the sheet name via the dropdown.
    Open the Excel source. You should see your variable as the sheet name.
    Click the 'Columns' tab to verify you can connect and mess with columns.
    For detail information, please refer to the following document:
    https://technet.microsoft.com/en-us/library/ms345182.aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

Maybe you are looking for