Hiding a caption and field based on context condition

Hi,
I have what should be a simple problem, but I'm not sure if what I'm doing is the correct way to solve it.
I have a telephone number of a user master being output, and if there is an extension number I want to output that as well, separated by ext
In the context node I have put a condition on the Extension field (GS_HEADER-FSABE-TEL_EXTENS1 not equals INITIAL), and debugging the code of the function module shows that %OUTPUT is not being called for the Extension field in the layout as expected.
The Extension field in the layout is bound to the Extension field in the context, and the caption is set as "Ext"
Therefore I either want to output
Telephone: 01234 567890 ext 1234
or
Telephone: 01234 567890
It's not working though, as I still get ext printing even when there is no Extension - have I done something wrong or is this not the correct way to go about this?
Thanks,
Vindaloo

Thanks very much, this has solved the problem
In the layout:ready event for the extension field I have put the following Javascript:
// Hide the Telephone Extension caption & value if it is not populated
if (this.rawValue == null) {
  this.presence = "hidden";
I was under the misapprehension that simply putting a condition onto the field in the context would stop it being passed to the form and rendered.
The layout:ready event seems to be the best place to put this code.  However, the adobe help for this event is confusing as it contains the following:
Initiates after the form design and data are merged, the form exists, and the form's layout is applied. At this time, the finished form has not been rendered; therefore, a calculation or script set to run on this event could modify the layout before the form is rendered.
This is fine and fits in with what I have.  It then goes on to say:
Note: Scripts that fire on layout:ready should not do anything that would cause the layout of the form to change. For example, this would include anything involving subforms or tables that grow or shrink, adding fragments dynamically at run time, adding or removing subform instances, and toggling the presence setting of an object between hidden and visible.
This seems to be in direct conflict with the previous statement, regarding modifying the layout.
Vindaloo

Similar Messages

  • Caption and field alignment

    Is it possible to have the caption aligned one way and the field aligned another?
    I have a text field, and I want the caption to be aligned flush right and the text to be aligned flush left.

    Yes that is controlled in the Paragraph palette. It is probably off so you can activate it under the Window menu. You can toggle between the caption and the value by clicking on this button
    Paul

  • Joins on different fields based on a condition

    Hi,
    I have 2 tables, each consists of 5 fields, based on Field3's data, I want to join either F1 & F2 or F4 & F5.
    I have given below the field creation and sample data for your reference. When I run the SQL with "case when .."
    statement, it gives "ORA-00905: missing keyword" error.
    I can do this by splitting into 2 separate SQL statements one for F1 & F2 and the other for F4 and F5.
    Is there any other better way of doing it in a single SELECT statement?
    Please share your views, thank you.
    create table tmp_a
    (f1 varchar2(50),
    f2 varchar2(50),
    f3 char(1),
    f4 varchar2(50),
    f5 varchar2(50))
    create table tmp_b
    (f1 varchar2(50),
    f2 varchar2(50),
    f3 char(1),
    f4 varchar2(50),
    f5 varchar2(50))
    begin
         insert into tmp_a
         values('R1', 'abc', 'L', 'A1', 'B1');
         insert into tmp_a
         values('R2', 'lkj', 'L', 'A2', 'B2');
         insert into tmp_a
         values('R3', 'qwe', 'M', 'A3', 'B3');
         insert into tmp_a
         values('R4', '123', 'M', 'A4', 'B4');
         insert into tmp_b
         values('R3', 'qwe', 'L', 'A1', 'B1');
         insert into tmp_b
         values('R2', 'lkj', 'L', 'A2', 'B2');
         insert into tmp_b
         values('R4', '123', 'M', 'A3', 'B3');
         insert into tmp_b
         values('R1', 'abc', 'M', 'A3', 'B3');
         commit;
    end;
    select * from tmp_a;
    select * from tmp_b;
    select a.*, b.*
    from tmp_a a, tmp_b b
    where a.f1 = b.f1 and a.f2 = b.f2;
    select a.*, b.*
    from tmp_a a, tmp_b b
    where a.f4 = b.f4 and a.f5 = b.f5;
    select a.*, b.*
    from tmp_a a, tmp_b b
    where case when a.f3 = 'L' then
              a.f4 = b.f4 and a.f5 = b.f5
         else
              a.f1 = b.f1 and a.f2 = b.f2
    end;

    Maybe something like:
    SQL> SELECT a.*, b.*
      2    FROM tmp_a a, tmp_b b
      3   WHERE CASE
      4            WHEN a.f3 = 'L'
      5               THEN a.f4
      6            ELSE a.f1
      7         END = CASE
      8                 WHEN a.f3 = 'L'
      9                    THEN b.f4
    10                 ELSE b.f1
    11              END
    12     AND CASE
    13            WHEN a.f3 = 'L'
    14               THEN a.f5
    15            ELSE a.f2
    16         END = CASE
    17                 WHEN a.f3 = 'L'
    18                    THEN b.f5
    19                 ELSE b.f2
    20              END
    21  /
    F1         F2         F F4         F5         F1         F2         F F4         F5
    R1         abc        L A1         B1         R3         qwe        L A1         B1
    R2         lkj        L A2         B2         R2         lkj        L A2         B2
    R3         qwe        M A3         B3         R3         qwe        L A1         B1
    R4         123        M A4         B4         R4         123        M A3         B3
    4 rows selected.Regards,
    Jo
    Edited by: Joice John on Jul 17, 2009 4:30 AM
    Sigh!!! Sean you are too fast for me.... ;)

  • Unable to filter a formula field based on two conditions

    hi,
    I have a report with 3 subreports in it. When i drill down onto first subreport i am getting correct records in details based on selection criteria but when i am unable to populate the same record count in summary.
    For example
    On summary i see : 60 when i drill down i see 20 records which is correct but not reflecting onto summary report
    the details selection criteria is based on two  fields where field1>=1 and field2= "Text"It is coming out good (20 records) but in summary i am unable to populate this based on same selection criteria
    The main issue i am facing was if i apply a filter on summary selection criteria all the subreport counts are getting affected. Is there a way i can apply filters only one one field
    Please suggest
    Thanks!
    Lucky

    Thanks! for the prompt response Abhilash
    I got part of what you told me. Yes i am calculating the counts in the summary report.
    Basically here is the selection criteria: i need to filter the records based on two conditions. One is x.field1= "Admin" and x.field2=act_pct>=1
    For example:
    Admin Returns         50  but when i dig into details it showing as 20 records ( based on selection criteira above)
    when coming back to summary . 50 what ever is returing here is based on a formula ( if x.field1="admin" then 1 else 0) ..in addition to this i need to filter that by x.field2>=1 which is not taking it     
    Is there any syntax to do this
    If i apply a filter on this particular 50 record its bee applying for whole summary report ...
    And from what you said :
    Why don't you create the summary in the Subreport and maybe use shared variables to bring it back to the Main Report?
    i did not get this
    Please suggest
    Lucky

  • To make a field hide and show based on a condition.........

    hi all.
    i have a requirement where i need to make a set of regions alter based on which field we select....
    i have a LOV input and based on that the input the respective region has to be displayed..
    suppose i have 5 regions.....
    if i give 1 then the 1st region has to displyed.....similarly 2nd and 3rd......
    any help..........????????
    DEV

    Hi,
    Check the code snippet from Dev Guide:
    if (pageContext.isLovEvent())
    // Form was submitted because the user selected
    // a value from the LOV modal window,
    // or because the user tabbed out of the LOV input.
    // Find out which LOV input triggered the event.
    String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
    // Find out the result values of the LOV.
    Hashtable lovResults =
    pageContext.getLovResultsFromSession(lovInputSourceId);
    if (lovResults != null)
    // Update the page depending on the value chosen by the user.
    It explains what you need.
    niranj

  • ASA in multi context mode and AAA based on context

    Hello, running ASA5520 in multicontext mode, and would like to apply AAA in separate contexts; eg. context A and B should have AAA authentication and context C not.
    I am familliar how to setup AAA in single firewall mode but not sure about correct procedure when setting up AAA in multicontext mode.
    Is it possibe to configure individual contexts for AAA?
    Thanks

    Hi,
    Yes, it is possible to setup AAA in individual contexts. The procedure is going to be exaclty the same as when the firewall is in single context mode.
    Just be careful while configuring command authorization on a firewall in multiple context.
    http://www.cisco.com/en/US/docs/security/asa/asa80/configuration/guide/mgaccess.html#wp1060011
    Hope it helps.
    Thanks,
    Amitashwa

  • Dynamic Action - How to enable  text field based on a condition

    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number- Text field
    Order number should be disabled and only on selection of order type ,order number should be enabled.
    Can someone please help me on this?

    Hi Gayathri,
    Gayathri Venugopal wrote:
    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number- Text field
    Order number should be disabled and only on selection of order type ,order number should be enabled.
    Can someone please help me on this?
    Create two dynamic action
    1. Make it order number item disable on page load.
       Event : Page Load
       Action : Disable
       Fire When event result is : True
       Selection Type : Item
       Item : Your order number item
    2 . enable and disable order number on selection of order type(assuming when order type is null it is disable otherwise it is enable)
        Event : Change
        Selection type : item
        Item : your order type item
        condition : is not null
    True Action
        Action : Enable
        Fire When event result is : True
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    False Action
        Action : Disable
        Fire When event result is : False
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    Hope this helps you,
    Regards,
    Jitendra

  • WriteBack: Update a field based on two conditions.

    Hi Experts,
    I am facing a serious problem in write back to database.
    Let me explain the writeback i am trying to do.
    I have a table as Below
    Col1----- Col2---------Col3----------Col4
    100--------1-------------2----------100/(1+2)
    Col1,col2,col3 are editable.
    Once the values are entered in these columns Col4 is calculated by the formula (Col1/(Col2+Co3))
    If the user enters 0 in col2 and col3 then it will be a division by zero which i have handled by the DECODE function
    But the user requires a standard value to be shown there that is Col1/0.57895 whenever he enters 0 in col2 and col3.
    I initiially put a column formula for Col4 in answers saying if col2 or col3 = 0 then (Col1/0.57895)
    But as this formula is only at the prsentation level...teh values were not getting saved in the database.
    My requirement is i need to put this condition in the writeback xml itself and see to it that this standard value be updated in the table itself.
    like
    update table set col4=Col1/0.57895 where col2=0 and col3=0
    Update table set col4=(Col1/(Col2+Co3)) where col2 <>0 or col3<>0
    I am unable to use two update queries in teh xml template.
    Please let me know how can i implement this in the xml template.
    Appreciate your immediate response.
    -Best Regards!

    You can't do it in the xml but you can do it in the database with a before trigger update
    http://www.techonthenet.com/oracle/triggers/before_update.php

  • How to count number  of records for a field based on condition?

    Hi guys,
    I want to know how to find count of records coming from the database for a particular field based on some condition.
    I need to use this count to suppress some headers. Because of this i am not able to use running totals. Is there any other way?
    Ex scenario:
    I have account number and currency fields, those are coming from database. And i need to count the number of accounts whose currency is not Euro.
    Thanks in advance,
    Vijay.

    A simple formula can do that:
    //Formula begin
    if {your account field}<>"Euro" then 1
    //Formula end
    This formula can be summarized. (by group or report)
    Bryan Tsou@Taiwan

  • Setting a field as Mandatory dynamically based on certain condition

    Hi All -
    I am working on ADOBE Interactive forms. I am not able to find out, How to set a particular field as a 'Mandatory field' based on some condition. I am using FormCalc as scripting language.
    i.e: I have a field "RATING". I want to make the next field "COMMENT" as mandatory when "RATING" is less than 3.

    Hi Vishal,
       You need to set the mandatory attribute of the specific field according to your condition. In FormCalc this will be similar to this,
    if (Rating < 3) then
              $.mandatory = "error"
              $.mandatoryMessage = "The corresponding Comment field is mandatory. Please fill"
    else
              $.mandatory = "disabled"
    endif
    The mandatory property can be set as:
    "error" : Makes the field compulsory to be filled before submission
    "disabled" : Makes the field optional
    "warning" : Gives a warning to the user that the field should be filled, but doesn't cause an error on submission
    The property "mandatoryMessage" specifies the message to be displayed to the user when the mandatory field isn't filled before submission.
    Regards,
    Rose

  • Dropdown editable in a table based on a condition

    Hi,
    I would like to know how to solve these problems.
    1. I have a cell (of the type dropdown by key) in a table, which is editable or not, depending on a condition ? Is this is possible? Please let me know if there is a sample code
    2. So basically I have a  table that has 2 entries in it, user details and one of the fields in FLAG showing the values Yand N for the user. I want the table in the webdynpro application to show the 2 user entries and then in the Flag column have a DROPDOWNBYKEY that DEFAULTS to showing what flag the user has, but also allows the user to CHANGE the entry.
    Thanks in advance
    I appreciate for the help.

    is possible
    In your Context node which is binded to the table as DataSource, add an attribute WDY_BOOLEAN type
    In layout bind the newly created attribute to the dropdown UI element Enable property
    while filling your context node, fill the attribute with abap_true and abap_false based on your condition
    Abhi

  • How to add a new metadata field to iPhoto where new field is calculated as age in years and month based on a specific date and the date photo was taken ? I want to calculate and display the age of my two kids on every photo.

    Hi
    How can I add 2 new metadata-fields to every photo in iPhoto ?
    The new fields should state the age of my kids in years and months based on the date that they were born and the date that photo is taken.
    Exampel:
    My son is born 01.01.2010
    My daughter is born 01.01.2012
    Photo taken by data
    Aage of son
    Aage of daughter
    01.07.2011
    1 year 6 month
    not born yet
    01.01.2014
    4 year 0 month
    2 year 0 month
    I would like to be able to search by kids age and get the info displayed when doing slideshows.
    How to do this in iPhoto ?
    Any alternatives to accomplish the same ?
    Kind regards

    It can't be done with iPhoto.  There are some DAM (digital asset management) applications that can write to other IPTC fields that iPhoto can't read. One such app is Media Pro 1.
    However you would have to calculate the age for each date and add it to one of the fields. There are online age calculators that can do that for you: Age Calculators
    If you go thru that much trouble then use iPhoto, make the calculations and add the age to the Description field.  Then you can use Smart Albums to search for 1year 6 month text.
    OT

  • Showing/Hiding certain fields based on Radioset selection

    Hello all,
    I'm like to know whether it is possible to Show/Hide certain fields using a RadioSet selection as it is done in Forms in ADF UIX. Kindly go through this post.
    Showing/Hiding certain fields based on Radio Group selection
    kindly help me out on this.
    Thanks & Regards,
    Arun.V

    Hi Arun,
    Here is what I do with my checkboxes, but I think that the radiobutton will do the same:
    <af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
                          label="Label 1"
                          binding="#{backing_page1.selectBooleanCheckbox1}"
                          id="selectBooleanCheckbox1"
                          autoSubmit="true"
                          immediate="true"/>
    <af:inputText label="Label 1" binding="#{backing_page1.inputText1}"
                          id="inputText1"
                          disabled="#{!backing_page1.selectBooleanCheckbox1.selected}"
                          partialTriggers="selectBooleanCheckbox1"
                          value="#{backing_page1.selectBooleanCheckbox1.selected}"/>

  • Dynamic Page Rendering (based on the difinition for labels and field setup)

    We have a requirement to display pages dynamically based on the setup or configuration for labels and fields.
    1. For example (the display page will look like):
    Company Name: -------------------------
    DB No:
    2. Setup for this will be in a UI (saved to the database):
    Page Seq Label Field type size
    1 1 Company Name comp_nm text char(50)
    1 2 DB No db_no number
    The pages will be rendered through the database procedure for the above.
    Thanks in advance for help.

    Hi Timo
    JDEV Version: Studio Edition Version 11.1.2.2.0
    I mean the definitions for the page like labels, text fields will be setup as this page will change as per the business requirements.
    We are open to sql or xml if the db procedure will not work.
    The objective is to give the business user to add anything to the page (for example, we have a lot of questions which changes in time due to specific business needs), so that the user can add a question or disable one based on the need.
    Hope if clarifies.
    Thanks
    Bibs

  • Changing field text color and fill based on input value.

    I am trying to create a field that can be red, yellow or green.  In the end, what I need is a box that can be made red, yellow or green by the form user.  My strategy is to use a validation script to change the field and text color based on the field input.  So if you type "red", the text and field turn red, essentially making a red box.  The field is named "GoalColor".
    Am I headed in the right direction to get make this dynamic colored box?
    This script works but you must type "red" into the field(including quotation marks).  Any ideas on why the word red alone isn't triggering it? 
    var vcolor = this.getField("GoalColor").value;
    if (vcolor == "red") {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    I have also tried - works if you type 'red'
    var vcolor = this.getField("GoalColor").value;
    if (vcolor == 'red') {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    and  - does not work
    var vcolor = this.getField("GoalColor").value;
    if ( vcolor == red ) {
        this.getField('GoalColor').fillColor = color.red;
    } else {
        this.getField('GoalColor').fillColor = color.white;
    Thanks!

    And you don't need to add the quotation marks in the text field. In fact, doing it will cause the script not to identify the word.

Maybe you are looking for

  • Setting the Font of Selected Tab in JTabbed Pane

    Hi, i have A JTabbedPane , I want to set the font of the selected tab to be bold. Can anyone please tell me how can i do that... waiting for reply , Bye Sanjeev

  • Question for an audiophile...what exactly IS normalization?

    Maybe someone here can end my years of ignorance on this topic. Audio normalization is often described as the process of applying constant gain to a recording to bring the highest peak to a target level. (This is often defined in opposition to compre

  • "Start Deletion of Data in Receiver System" does not start

    I faced the problem tha data deletion in Receiver system is not started in TDTIM synario. I started the activity "Start Deletion of Data in Receiver System" , the job "CNV_TDMS_09_RESTART_JOBS" is aborted till the job "CNV_MBT_CNV_TDMS_09_START_JOBS"

  • Doesn't find nearby missing files

    I have always been able to "find missing files" when moving them from one drive to another selecting find nearby files. Yesterday I could see all the files in the window when I selected one, but LR won't connect to the nearby files, only the one sele

  • Quick Camera - how is this possible?

    I noticed a new app in photography category called "Easy Camera". It takes pictures super fast in low resolution (320x480). I tried out the app, and it can take 2-3 pictures per second. The app requires OS 2.2.1. Does anybody know how this is possibl