Difficulty in setting value of a field at runtime

I have a form with input text fields. One of the fields is disabled and automatically filled by the system. I am having problem filling this field at runtime.
What I did was that I tried to set the value of the field during the save operation (that is when I clicked on the save button). The system sets the value of the field but it did not commit the value into the table. This is is the code that I used
    public String SaveParameterRecord() {
       this.codeTypeId.setValue("GB011");
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Commit");
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
            return null;
        return null;
Again I tried with with method call, but it gave me java.lang.NullPointerException at the point (this.codeTypeId.setValue("GB011"))
    public String CheckParameterMethod() {
         BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
            return null;
         this.codeTypeId.setValue("GB011");  
        return null;

hi Frank,
The issue I see is that by putting this.codeTypeId.setValue("GB011"); wont be updating the model, and that is why after your commit, the value comes null. Is that variable depending on any other value? If you really want to update the model at that stage you will need to do something like;
  public static void setExpressionValue(String expression, Object newValue) {
      FacesContext facesContext = getFacesContext();
      Application app = facesContext.getApplication();
      ExpressionFactory elFactory = app.getExpressionFactory();
      ELContext elContext = facesContext.getELContext();
      ValueExpression valueExp =
          elFactory.createValueExpression(elContext, expression,
                                          Object.class);
      //Check that the input newValue can be cast to the property type
      //expected by the managed bean.
      //If the managed Bean expects a primitive we rely on Auto-Unboxing
      Class bindClass = valueExp.getType(elContext);
      if (bindClass.isPrimitive() || bindClass.isInstance(newValue)) {
          valueExp.setValue(elContext, newValue);
And then instead using this.codeTypeId.setValue("GB011"); you will call setExpressionValue("#{bindings.yourVariable.inputValue}","GB011"). But then again I dont recommend you doing this.
If this variable depends on another variable, you can use a setPropertyListener and autoSubmit=true.
Regards

Similar Messages

  • How to set values of formula fields during runtime in crystal reports

    Hello All,
    Could any one help in letting me know how to set the values of a formula in the runtime.
    I tried using the below systax in the formula field
    Assume that I have 2 formula fields
    1. format_count
    2. format_display
    my formula is like below:
    in the formula field format_count i have
    format_display=pagenumber
    when checking for errors its throwing error stating "stamement is expected"
    Could any one help in resolving this
    Thanks

    Hi Ranjeet,
    Whenever you assign values to a variable, you need to use :=
    Like this:
    numbervar x := pagenumber
    And what exactly are you trying to do anyway?
    -Abhilash

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Setting value in 'FROM' field while replying the mail

    Hi,
    I am working on one issue, In component CRMCMP_CCS_EML, while replying the email, i need to read the 'TO' field and on the basis of that i need to set the value in 'From' field. How can I recognize that this is a reply and not a new email. Also, could anyone please describe me in detail as i never work on email component before.
    Regards,
    Kamesh Bathla

    This issue has been resolved.
    I got the message mode by using
    message_mode = typed_context->mail->messagemode.
    got all the options for from address using
    lt_from_addresses[] = typed_context->mail->GT_DEFAULT_FROM_ADDRESSES[].
    got the original email address using
    lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( ).
    CALL METHOD lr_gdc->get_entity
    EXPORTING
    name = c_currinboxitem
    RECEIVING
    value = lr_inbox_item.
    CALL METHOD lr_inbox_item->get_property_as_value
      EXPORTING
        iv_attr_name = 'SOF_RCP_ADDR'
      IMPORTING
        ev_result    = lv_original_mail

  • I need to set values of 2 fields to 0 if the join condition is false

    I'll try to explain what I need to do as clearly as possible . I have three sub queries in my data model . My layout is group left .
    My first query :
    SELECT ALL BOEPAY_HD.BPH_RECP_NO_,
    BOE_PAY_HD.BPH_RECP_DATE, BOE_PAY_MODE.BPM_PAY_MODE, BOE_PAY_HD.BPH_ID,
    BOE_PAY_HD.BPH_DEC_CODE, BOE_PAY_HD.BPH_NAME1, BOE_PAY_HD.BPH_IMP_EXP_CODE,
    BOE_PAY_HD.BPH_SITE, BOE_PAY_HD.BPH_TOTAL, BOE_PAY_MODE.BPM_NUMBER
    FROM BOE_PAY_HD, BOE_PAY_MODE
    WHERE (BOE_PAY_HD.BPH_RECP_DATE BETWEEN TO_DATE(:st_date||' 00:00:00', 'dd/mm/yyyy hh24:mi:ss') AND TO_DATE(:en_date||' 23:59:59', 'dd/mm/yyyy hh24:mi:ss')
    AND (BOE_PAY_HD.BPH_RECP_NO = BOE_PAY_MODE.BPM_RECP_NO)
    Second query :
    It is linked to the first query with the primary key BPO_RECP_NO
    SELECT ALL BOE_PAY_OTH.BPO_AMT, BOE_PAY_OTH.BPO_DTX_CODE,
    BOE_PAY_OTH.BPO_RECP_NO
    FROM BOE_PAY_OTH
    On my report I display fields BOE_PAY_OTH.BPO_AMT, BOE_PAY_OTH.BPO_DTX_CODE in a repeating frame .
    The problem is when there is no data in table BOE_PAY_OTH for a particular BPO_RECP_NO , the second sub query is not executed.
    Columns(Values) in my layout overlap with values from the third query .
    I need to find a way to set values BOE_PAY_OTH.BPO_AMT, BOE_PAY_OTH.BPO_DTX_CODE to zero and display them so that there is no overlapping .
    Is there a way for me to achieve this .
    Please help . Thanks.

    This overlapping is usually dealt with in the layout by putting a frame in the appropriate place rather than in the queries. The frame stops items from
    moving up the page.
    Dave

  • Set value for textarea field in tabular report

    Hi all,
    I need some help setting textarea values in a tabular report. The tabular report is for users to be able to build their own ad hoc report, by specifying which columns should be included and filtered. Here are the example tables:
    -- Table that holds all of the data for the report.
    create table vehicle (
      make varchar2(50),
      model varchar2(50),
      type varchar2(50),
      year number);
    insert into vehicle values ('Toyota','Camry','Sedan','2008');
    insert into vehicle values ('Toyota','4Runner','SUV','2008');
    insert into vehicle values ('Honda','Civic','Compact','2011');
    insert into vehicle values ('Honda','Accord','Sedan','2010');
    insert into vehicle values ('Ford','F150','Truck','2011');
    -- Table that holds the columns that are available to be filtered in report.
    create table vehicle_cols (
      col_id varchar2(50),
      col_label varchar2(50));
    insert into vehicle_cols values ('make','Vehicle Make');
    insert into vehicle_cols values ('model','Vehicle Model');
    insert into vehicle_cols values ('type','Vehicle Type');
    insert into vehicle_cols values ('year','Vehicle Year');
    -- Table that holds filters saved by user.
    create table vehicle_user_saved (
      saved_rpt_name varchar2(50),
      col_id varchar2(50),
      col_value varchar2(50));
    insert into vehicle_user_saved values ('Saved Report One','make','Toyota');
    insert into vehicle_user_saved values ('Saved Report One','make','Honda');
    insert into vehicle_user_saved values ('Saved Report One','model','Sedan');
    insert into vehicle_user_saved values ('Saved Report Two','make','Honda');
    insert into vehicle_user_saved values ('Saved Report Two','year',2010);And below is the source query for the region. The textarea value is initially set to null.
    -- Region Source for specifying query parameters.
    select
      col_label,
      apex_item.checkbox(1,'#ROWNUM#','CHECKED') as include_cols,
      apex_item.hidden(2,col_id)
      || apex_item.textarea(3,null,2,100) as filter_cols
    from
      vehicle_cols;When a user clicks the button to load the parameters for a report they have previously saved, I'd like to change the values in the textarea field from null to the saved values from the vehicle_user_saved table so the user can see the parameters and run the report, or modify the parameters if necessary.
    I thought I could run a PL/SQL process (After Footer) when the button is clicked to populate these textarea fields, but the test below doesn't do anything:
    begin
      apex_application.g_f03(1) := 'Hello';
    end;For example, when a user selects to load "Saved Report One," the following parameters should be loaded into the textarea fields:
    Column >> Filtered Columns
    Vehicle Make >> Honda, Toyota
    Vehicle Model >> Sedan
    Vehicle Year >> Null
    Vehicle Type >> NullCan someone help me out? I wouldn't think I need Ajax for this since it's ok to be processed after the button click. But if I do need to use Ajax, I definitely could use some help with it, as I've never used Ajax before. I've setup this example in my hosted account to help.
    Site: http://apex.oracle.com
    Workspace: MYHOSTACCT
    Username: DEVUSER1
    Password: MYDEVACCT
    Application: report parameters
    Thanks in advance!
    Mark
    APEX 4.1, Oracle 11g

    Hi, thanks for your response.
    I'm not adding any new rows, I'm just trying to change the values of the textarea fields in the tabular report when the user chooses to load his/her saved parameters. The default for the textarea field in all rows is null, because I assume users will want to start building the report from scratch. However, when the user clicks the button to load his/her saved values, I want to overwrite the null values with new values. How can I do that?
    Thanks,
    Mark

  • Set value in text field when checking checkbox

    Hi,
    I have a manual tabular form and when I check cb1 I want to set ben2 to Oracle.
    Is there anyway I can do that?
    Here you can see my very simple example:
    http://apex.oracle.com/pls/otn/f?p=22968:3:4142231640027285:::::
    My tabular form query:
    select
    to_char(dag,'day dd mon yyyy')||apex_ITEM.HIDDEN(1,pk) dag
    , apex_item.text(2, ben1) ben1
    , apex_item.text(3, ben2) ben2
    , apex_item.text(4, ben3, null,null,null,'f04_'||rownum) ben3
    , apex_item.text(5, ben4)||apex_item.hidden(6, cb1) ben4
    , apex_item.checkbox(7, ROWNUM, 'onclick="test(this)"',DECODE (cb1, 'Y', ROWNUM)) cb1
    from dummy
    Regards Daniel

    Hi Anirban,
    The sql-query for the report:
    select
    to_char(dag,'day dd mon yyyy')||apex_ITEM.HIDDEN(1,pk) dag
    , apex_item.text(2, ben1) ben1
    , apex_item.text(3, ben2) ben2
    , apex_item.text(4, ben3, null,null,null,'f04_'||rownum) ben3
    , apex_item.text(5, ben4)||apex_item.hidden(6, cb1) ben4
    , apex_item.checkbox(7, ROWNUM, 'onclick="test(this)"',DECODE (cb1, 'Y', ROWNUM)) cb1
    from dummy
    On the region, Header and Footer -> Region Header
    <script type="text/javascript">
    function test(pThis)
    if(pThis.checked)
    {document.getElementById('f04_'+pThis.value).value = 'Checked';}
    else
    {document.getElementById('f04_'+pThis.value).value = 'Not Checked';}
    </script>
    That's all.....
    /Daniel

  • Is it required to enter Attribute sets values?

    I am doing tutorials and it mentions to enter attribute set values for the fields. Is this required? Will the tutorial work If I do not enter this?

    Its not necessary to set Attribute sets values.
    Attribute set value is a set of properties for an item or regioni.
    Hence when we set attribute value for some item, it sets other properties of that item like colour, promt and such other properties.
    In short, if you dont want to manually set all properties, just specify the attribute set value, you may see that all other properties are also set.
    Abdul Wahid

  • How to Insert more than one record at a time- with fixed set of values in one field

    Can someone guide as to how to insert multiple records at a time using ASP VBScript in Dreamweaver CS4 or ADDT.
    If someone can guide then the exact problem is given below.
    I have a MS access database with one table. The table has three fields. The first field is an autonumber field for ID number.
    The second field contains string values- One out of 7 predefined values. One set of records consists of 7 records containing all the seven types of predefined values in fields no 1.
    The third field is a numeric field and can contain integers.
    I want that the user can enter data for the table using an ASP form in such a way that he enters one set of records at a time in one single screen. This way he will not have to remember that he has /has not entered all the seven set of values for the field no 1.
    I am not creating fields with the 7 types of field1value as their names as it will increase the number of fields drastically.
    Please help for dreamweaver ASP VBScript.

    I have successfully inserted seven records in one form submit operation by looping through the command object execute method.
    However, the data that is being inserted by the command object is repetition of the first record and the command object is not taking any data from the text boxes for the second record onwards. In this I had used the isert record behavious generated by DW CS4 and modified it to suit my requirement. However, the data inserted in the first row is getting repeated in all the seven rows.
    Please help.
    Also advise if there are any free dreamweaver server side validation extensions available.

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • How to set default value to input field dynamically

    Hello Experts,
    I am using adobe forms inside Webdynpro Java.
    Adobe form is having few input fields where at run time i want to assign default value to those fields.
    How can i do it ?
    Thanks in advance,
    Vinay
    Edited by: VINAY on Feb 24, 2011 6:39 AM

    Hi Mate,
    Just set the value to the webdynpro context fields on view init.
    if its like that will override the values entered by use on the form.
    just check if the default value is equall to the field value if yes leave it, if not dont touch that field.
    does this make sense...?
    Cheers,
    Sai

  • Help to set value of an attribute based on value selected in another field

    Hi all,
    I want to set the value of an attribute STRUCT.ITM_TYPE to a default value whenever i select one of the value from dropdown list in LC_STATUS.
    I tried to add an event in the get_p method of the lc_status but there i cant able to access the context of the ITM_TYPE as the fields are in different views.
    Please Help,
    Rewards will be awarded.
    Naveenn

    Hi Vineet,
    Thanks for the suggestion.
    Please chech my code and suggest me for any corrections.
    In the Get_P_LCSTATUS method of Context Node BTADMINH in View1.
    METHOD GET_P_LCSTATUS.
      CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
        WHEN if_bsp_wd_model_setter_getter=>fp_server_event.
          rv_value = 'ACT_STATUS_SELECTED'.
      ENDCASE.
    ENDMETHOD.
    In event handler method in Context Node BTADMINI in View2
    method EH_ONACT_STATUS_SELECTED.
    * Added by wizard: Handler for event 'ACT_STATUS_SELECTED'
    data: lr_ent1 type ref to cl_crm_bol_entity,
             lr_ent2 type ref to cl_crm_bol_entity.
    lr_ent1 = me->typed_context->BTADMINH->collection_wrapper->get_current( ).
    check lr_ent1 is bound.
    * To Get Value of First Attribute
    lv_attr1 = lr_ent1->get_property_as_string( 'LC_STATUS' ).
    * To Set Value of 2nd Input Field now based upon this value
    lr_ent2 = me->typed_context->BTADMINI->collection_wrapper->get_current( ).
    *lr_ent2->lock( ).
    lr_ent2->set_property_as_string( iv_attr_name = 'ITM.TYPE'  iv_value = 'RREQ' ).
    endif.
    endmethod.
    but during syntax check its showing error messge as BTADMINH is unknown.
    2) How and where to bind the context node in custom controller.
    Please help.

  • Setting default value for form field assoc with a table column

    On a "Create Record" situation I was trying to set the default values of some form fields using a page level "Process". These form fields have Source Type = Database Column. It wasn't working, I could only set non-db assoc form field values no matter when the "Process" was set to exec. From some other posts it seems that this is by design, ie. not being able to programatically set the initial values of form fields that are sourced to db columns. I was hoping to have just one "Process" that would exec to set these initial values in one place rather than scattered about for each field that needed a default value. These particular default values come from ref tables and may be different for each user.
    So, it looks like I have to use a "Default Value" plsql chunk for each field on the form itself or else set their value on the calling form's Redirect in the "Set these Items" area.
    Is this correct?

    You could define a database function which accepts the name of the item and the user ID of the user running the application. Based on the item name and the user ID have the function return the appropriate initial value. Invoke this function in a "Default Value" PL/SQL block.
    Does that help in centralizing your initial values? You could have one function per page or one function per application. I would do one function per application.

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • How do I add a set value to a form field calculation?

    I'm creating a form where I need a set value added to the sum of other editable fields - e.g. Field A + Field B +$125 = Sum
    For the addition of Field A and B I've been using the pre-set functions in Adobe X, but I'm clueless as to how to add the $125 to the sum calculation. I'm absolutely new to Java, so I'd need something I can cut and paste.
    Thanks!

    One last question:
    I have existing code for a Submit by Email form that has a subject line and message content. I'm trying to add a second email to it but can't seem to figure out how.
    this.mailDoc({
    bUI: false,
    cTo: "[email protected]",
    cSubject: "Here is my Renovation Draw Request",
    cMsg: "You will find my completed Renovation Draw Request attached. I’m excited to move forward, so please contact me as soon as possible."

Maybe you are looking for

  • Everytime my phone vibrates it makes this loud noise from inside that sounds like a weird cracking noise or something help!!

    Okay so I noticed a week or two ago that there was something lose on the inside of my iPhone 5s and ever since then when my phone vibrates sometimes there is this weird noise. It sounds almost like a cracking noise from the inside or a weird electric

  • Coffe on my msi gt60

    HI i just spilled coffe on my laptop,  everything still works as it did before. no keys are sticky or non-functional(using it right now spilled coffe 50 mins ago). But right when it happend i took  out the power source cable and put it on the side to

  • Picture and text for anonymous user: picture is asking user id and password

    Hi all, I created one html page in KM. In that one picture and some text is there. Given anonymous user & group permission for picture and html.. created one KM document Iview given the path. Iview is assigned to Page,  Page to role(Given anonymous a

  • Macbook advice/help

    Ok. Right now im using a Sony Vaio. Its a nice computer but it has very short battery life and has a few problems that I just cant stand. I am able to but a new computer and need to know from current macbook users if the macbook is the right option f

  • POS - Port Operaton System

    Working on Port operation system of one of the PSU. The processes have been mapped in std PM/SD functionalities. lots of developments requried to satisfy the requirement. Can functionalities be used from Bulk transportation for mining - Marine Schedu