Reset value by default for drop doown list inside a  valueChangeListener

Dear all,
I have two drop down list.
A valueChangeListener for the dropdown1.
Inside the valueChangeListerner i set the value to null for the dropdown2.
But after that the setter of the dropdown2 is call with the previous value selected by the user.
Why?
My bean are in request scope.
But I create a reset button and in that case it works but it 's not what i want.      
I look at now the JSF cycle, and I notice that the process events is called before the Update Model Values
I try to call FacesContext.getCurrentInstance().renderResponse() .
It doesn't work in fact.
Any idea?

It doesn't work.
But I find finally a way.
for each component I want to reset ,I specify a binding attribute.
and in my actionListener method ( I have attribute immediate at true, I don't know if it linked)
I call folowing code:
component.setSubmittedValue(null);
component.setValue(null);
component.setLocalValueSet(false);
but apparently i can use also the method: resetValue()
but it works well

Similar Messages

  • How can I add a blank value in a standard drop down list

    Hello,
    I have a requirement to add a blank value into the standard drop down list of for i.e. the search criteria
    "created on" -> (values are: yesterday/today/last week etc).
    The problem is, that this field has always the default value "yesterday" but our customer wants to have a blank field as default.
    Can anybody provide me steps how can I add this blank value ?
    Many thanks in advance

    Hi Bernard,
    thanks for your reply.
    Its for quotation.
    Could you give me still some further detail steps, please ?
    Many thanks
    Andreas

  • Conditional validation for drop down list

    Hi all,
    I have been working on getting the conditional validation for drop down list to work but no luck. Here is my situation. I have a page with 'time' and 'source' drop down which contains a list of values along with null value. I have two buttons 'save' and 'close'. when a User clicks on 'Save' button, no checking should occur and the values filled in the form should be stored into the database. When a user clicks on 'Close' button, validation should occur and messages should be displayed saying 'values should be filled' . After the user fills each drop down list and hits close button, changes should be saved to the database. I used the technique posted by Jayashri and wrote the validation code in 'Close button action method'
    Here is my code
    public String btnClose_action() {
    // TODO: Replace with your code
    try {
    if (ddlTime.getSelected() == null || ddlTime.getSelected().equals("")) {
    FacesMessage message3 = new FacesMessage("Please select a value");
    message3.setSeverity(FacesMessage.SEVERITY_ERROR);
    getFacesContext().addMessage(ddlTime.getClientId(getFacesContext()), message3);
    return null;
    if (ddlSourceReq.getSelected() == null || ddlSourceReq.getSelected().equals("")) {
    FacesMessage message4 = new FacesMessage("Please select a value");
    message4.setSeverity(FacesMessage.SEVERITY_ERROR);
    getFacesContext().addMessage(ddlSourceReq.getClientId(getFacesContext()), message4);
    return null;
    sendMail("close");
    } catch (Exception ex) {
    return null;
    public String btnSave_action() {
    // TODO: Process the button click action. Return value is a navigation
    // case name where null will return to the same page.
    sendMail("save");
    return null;
    I did not set the 'required' property of both the drop downs and I dont have any message components in the page. How do I get this to work. Please help.
    Thanks,
    S

    Hi,
    Try this
    HTP.p('
    function validate_form_fields()
    var validation = true;
    if (document.forms[0].fld_1.options[document.forms[0].fld_1.selectedIndex] == null )
    validation = false;
    alert("Selection of FLD1 is mandatory.");
    if (document.forms[0].fld_2.options[document.forms[0].fld_2.selectedIndex] == null )
    validation = false;
    alert("Selection of FLD 2 is mandatory.");
    return validation;
    ');If the above does not work, it could be the definition of the your fld_1 select - options. Looks like they allow null values, and if null is not the first option then selectIndex = 0 will be a not null option by default.
    Moreover, the below has redundant condition as ==0 and < 1 amount to the same thing. selectIndex cannot be negative.
    if ((document.forms[0].fld_1.selectedIndex == 0 ) || (document.forms[0].fld_1.selectedIndex < 1 ))Regards,

  • How to reset the factory defaults for Adobe Photoshop CS4? [was:need assistance]

    How to reset the factory defaults for Adobe Photoshop, CS4.  My 'image size' box is not quite right. Thank you.

    How to delete/reset Photoshop preferences
    Preference file functions, names, locations | Photoshop CS4
    To reset within the Image Size dialog press Alt (Option on Mac) and click Reset.

  • How to get ALL values as default for  a drop down box in JSF

    Hi,
    I have a drop down box in JSF page which retrieves values from LOVCache.java. I have values like Company, Client, User, ALL in the drop down box.
    By default blank value is selected for the drop down box. I want to make ALL(which retrieves data for all the values) as default value for the drop down box.
    Could any body help me? Any help must be appreciated.
    Thanks,
    Aseet

    Thanks Nikhil. But I am fetching the values from the LOVCache.java.
    I am using <af:selectManyChoice>. Is there any way I can use LOVCache.java value for selecting default values instead of hard coding?
    I mean to say can I write
    unselectedLabel="#{LOVCache.entityTypeSelectionList.anyValue}"
    where LOVCache.entityTypeSelectionList is used to populate the drop down box.
    Regards,
    Aseet

  • How to get the selected value/key of a drop down list box in webdynpro Java

    Dear SDN Members,
    I have added some static data into a drop down list box by key UI element using the procedure specified in value help tutorial.
    Now i want to display the value selected in a dropdown list box on view whenever i select an item in a dropdown list box.
    Can any one put here the code part relating to this.
    Your help will be awarded.
    Thanks in advance,
    Regards,
    Sireesha.B

    Hi Sireesha,
        You want to display value based on the key selected in dropdown list. If you want to do like that
    1) Create a context attribute for ex: key_value
    2)In the properties of the attribute select the calculated as true.
    3)It will create getter and setter methods for your attribute.
    4)Go to implementation add the following code in getter method of your attribute
    String attributeName = IPrivateCreate.IContextElement.KEY;
    //KEY is your dropdown key attribute not the value attribute.
    IWDAttributeInfo attributeInfo = element.node().getNodeInfo().getAttribute(attributeName);
    ISimpleTypeModifiable simpleType = attributeInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet valueset = simpleType.getSVServices().getModifiableSimpleValueSet();
    Object key = element.getAttributeAsText(attributeName);
    return valueset.getText(key);
    Regards
    Suresh

  • Swap textbox for drop-down list in "search" section of work list panel

    Hi everybody
    I am using albpm 6.0, when I do searches for instances in the work list panel I can add conditions to the search, for example if I select the "Priority" condition I can select my condition from a drop-down list but if I select the "Description" condition there isn't drop-down list instead a textbox appear so my question is: Can I control or change that behavior? I would like to do that when someone select the "Description" condition a drop-down list containing the values appear so he doesn't have to type anything.
    Thank you

    Hi,
    can you share the solution,even i was trying to archive the same.Thanks in advance.

  • JS Validation for Drop down List is not working in Oracle PL/SQL Package

    Hi All,
    I am facing an issue with JavaScript validation done in Oracle PL SQL package.
    System Requirement:
    There is one screen which contains two fields viz. FLD 1 & FLD 2 and one 'Submit' button.
    FLD 1 and FLD 2 fields are drop down list boxes.These are mandatory fields.
    The screen is developed in Oracle Mod PL SQL package.
    The html coding and java scripting are embedded in the respective Oracle PL SQL Package procedure which generates this screen,takes the input values provided by user,does the
    field validations and submits the form.
    Issue:
    The javascript validation for FLD 2 dropdown is working successfully.
    When the user leaves this field as blank,the embedded javascript pops up an error message 'Selection of FLD 2 is manadatory before submitting the form!'.
    As FLD 1 is also a mandatory field,the javascripting validation should pop up the similar error message 'Selection of FLD 1 is manadatory before submitting the form!'.
    But,this first field validation is not at all working.
    The system allows to submit the form even if the 'FLD 1' is left blank.
    The javascript code sysntax for validation of FLD 1 & FLD 2 drop down list boxes as follows:
    function validate_form_fields()
    if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
    [0].p_fld_1.selectedIndex < 1 )
    alert("Selection of FLD 1 is manadatory before submitting the form!!!");
    return false;
    else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
    [0].p_fld_2.selectedIndex < 1 )
    alert("Selection of FLD 2 is manadatory before submitting the form!!!");
    return false;
    return true;
    I am viewing the screen from the web browser IE version 8.0.
    Your timely help will really be appreciated.
    Regards & Thanking in advance,
    Alka

    Hi,
    1. Your problem is actually related to JavaScript, not SQL and PL/SQL. So, this is the wrong forum to post. The closest to JS is the Application Express forum {forum:id=137}. Clearly state that it is not an Apex issue and that you are looking for JS help.
    2. Your JS code, the way you has posted it, is syntactically incorrect, so if you post on Apex forum put the correct code and in tags as described in the FAQ
    {quote}
    function validate_form_fields()
    if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
    [0].p_fld_1.selectedIndex < 1 )
    alert("Selection of FLD 1 is manadatory before submitting the form!!!");
    return false;
    else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
    [0].p_fld_2.selectedIndex < 1 )
    alert("Selection of FLD 2 is manadatory before submitting the form!!!");
    return false;
    return true;
    {quote}
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Setting a particular value as default for the Grouping Range at BP Creation

    Hi,
    I am trying to set certain default for the Grouping Range when I create a new Bp using Tcode BP. For this i have changed the PBC fucntion for the view BUP020 ( TCode : BUS3). The Z function module attached is Z_FBSBP_SET_DEFAULT_GROUPING
    FUNCTION z_fbsbp_set_default_grouping.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(IV_ACTION) LIKE  BUS000FLDS-CHAR1
    *"     REFERENCE(IV_SICHT) TYPE  BU_SICHT
      DATA: lv_bu_group TYPE bu_group VALUE 'GR01'.
    Set the Grouping Range with a default value for all roles, each time
    when transaction BP is called
      SET PARAMETER ID 'BPP' FIELD lv_bu_group.
    Call the standard PBC fucntion module for BP Creation
      CALL FUNCTION 'BUP_BUPA_PBC_MISC'
        EXPORTING
          i_action = iv_action
          i_sicht  = iv_sicht.
    ENDFUNCTION.
    As per my notion this fucntion module should get triggered once I open the transaction BP and try to create a new BP, but such a thing is not happening.
    Can someone help me in this?
    Regards
    Priyanka

    Yes we did,
    But its not a very good solution though it serves the purpose.
    See what I did was:
    1. Read the authorization object's values for the logged on user using SUSR_USER_AUTH_FOR_OBJ_GET. From here I retrieve the Grouping Range required for the user.
    2. Keep this value in a variable say gv_grouping_range.
    3. SET PARAMETER ID 'BPP' FIELD gv_grouping_range.
    4. CALL TRANSACTION 'BP'.
    The four steps above have been enclosed in a report which has been attached to a new transaction code. We from now on allow user an access to this new transaction and not the standard BP transaction(which of course calls for a major change in roles).
    Secondly, the first three steps which have been enclosed in a subroutine set_default_grouping are also called from the BDT view BUP050, where the PBO has been changed to ZBUP_BUPA_PBO_MISC
    FUNCTION zbup_bupa_pbo_misc .
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(I_SICHT) TYPE  BU_SICHT
    PERFORM get_set_def_grouping IN PROGRAM zrpbsbp_create_businesspartner.
      CALL FUNCTION 'BUP_BUPA_PBO_MISC'
        EXPORTING
          i_sicht = i_sicht.
    ENDFUNCTION.
    Hope this helps.
    Regards
    Priyanka

  • SAP Design Studio 1.2 sp01 Filters logic is required for drop down list component

    Hi all,
                   I am working with sap ds 1.2 sp01,In dropdown list, assume it has X,Y,Z. So defaulty it shows first  "X' value in Dropdown list , but in Croos tab from DS_1, it is not related to "x" value, it shows overall Values In formation,but i want "x" value Information.. How can i get in DS?, PLEASE HELP ME OUT.
    .below logics i applied in drop down list component.
                 DS_1.setFilter("Dimension Name", DROPDOWN_1.getSelectedValue());
    and below logic in Application on Startup event:
    DROPDOWN_1.setItems(DS_1.getMemberList("dimension name", MemberPresentation.INTERNAL_KEY, MemberDisplay.KEY, 10));
    Thanks
    Thiru.G

    Hi,
    Try adding "DS_1.setFilter("Dimension Name", DROPDOWN_1.getSelectedValue()); " after
    "DROPDOWN_1.setItems(DS_1.getMemberList("dimension name", MemberPresentation.INTERNAL_KEY, MemberDisplay.KEY, 10));"
    on startup event too.  You should tell the application that you need to filter the data, even if you don't select it manually from the dropbox, in other words ; on startup. 
    Regards,
    Onur

  • How to grab the value from a drop down list inside a table cell

    Hello,
    My situation is I have a few columns displayed in a table format using repeater tag. Some cells is a dropdown list(<netui:select /> tag). My question is how can I grab the value when user made a selection.
    I believe I can get the row index but I can't use the datasource attribute to get the user selection since it is in a repeater. All the cell use the same datasource and workshop will give "NULL" value when there are more than one tag bind to the same form valiable.
    Any suggestion are very much appreciated! Thanks a lot in advance.
    My snippet code are:
    <netui-data:repeater dataSource="{pageFlow.ownedTask}"><netui-data:repeaterHeader></netui-data:repeaterHeader>
    <tr valign="top">
    <td><netui:select dataSource="{actionForm.userName}" optionsDataSource="{pageFlow.nameList}" onChange="getUser()" ></netui:select>
    </td>
    <td><netui:select dataSource="{actionForm.empDept}" optionsDataSource="{pageFlow.deptList}" onChange="getSelectedDept()" ></netui:select>
    </td>
    <td><netui:label value="{container.item.status}" />
    </td>
    </tr>
    </netui-data:repeaterItem>
    <netui-data:repeaterFooter></netui-data:repeaterFooter>
    </netui-data:repeater>

    1) let drop down box be g_dd.
      if g_dd is initial.
      g_dd = option2.
      endif.
    2)
    by default same pf-status is used by all the screens in the same program
    if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come
    set pf-status 'abc' excluding 'fcode_of_button'
    endif.
    or
    data: git_fcode type sy-ucomm with header line.
    git_fcode = 'fcode_of_button'.
    append git_fcode.
    if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come
    set pf-status excluding git_fcode
    endif.
    Edited by: Amit Gupta on Oct 11, 2008 11:36 AM

  • HOW TO SELECT MIN VALUE UNDER DEFAULT TAG OF SELECT LIST

    GREETINGS,
    I M USING APEX 4.1 AND CREATED SELECT LIST ON PAGE, I WANT TO SHOW MIN VALUE OF THE SELECT LIST FOR THAT I WROTE IN THAT SELECT LIST PROPERTIEC UNDER DEFAULT TAG MIN; AND CHOOSE PL/SQL EXPRESSION BUT ITS GIVING ERROR "Error computing item default value for page item P1_PRODUCT."
    BUT IF I HARCORE THE VALUE CONTANING IN MY DATA LIKE PRODUCT ID = 1, I HARDCODED IN DEFAULT VALUE 1 AND SELECT PL/SQL EXPRESSION IT WORKS.
    BUT ITS NOT DONE LIKE THIS I WANT TO SELECT BY DEFAULT MIN VALUE OF THE SELECT LIST, SO THAT THE DATA SHOULD BE DISPLAYED ACCORDING TO THAT.
    THE EXACT REQUIREMNT IS TO ENTER THE SELECT LIST DEFULAT VALUE IN SESSION SO THAT DATA IS TO BE DISPLAYED

    Hi,
    you have some options:
    1) you can try setting default value of P1_SELECT_PRODUCT item, I was do it
    2) or you can try send the value of P1_SELECT_PRODUCT value in URL, like this:
    http://apex.oracle.com/pls/apex/f?p=45296:1:0::::P1_SELECT_PRODUCT:4
    3) or you can set the session state of P1_SELECT_PRODUCT item on page 101 (login page) by seting this value in Login process on page 101
    HELLO kIAS !
    SETTING DEAFULT VALUE VALUE OF P1_SELECT_PRODUCT_ITEM IS NOT A SOLUTION ON THIS MATTER, BECASUE P1_SELECT_PRODUCT IS CALLED DYNAMICALY AFTER THE LOGIN DEPEND UPON THE RIGHTS OF THE USER THE SELECT IS POPULATED ID USER IS E.G ABC AND IT DOESBNOT CONTAIN SELECT LIST VALUE 4 THEN IT DISPLAY NOTHING.
    AND THIRD POINT MAY BE HELP ME BUT I DONT KNOW HOW TO SET SESION STATE BECASUE WHEN I GO TO LOGIN PAGE AND CREATE SESSION STATE PROCESS FOLLOWING RADIO BUTTOPN APPEARS
    Clear Cache For Applications (removes all session state for listed applications)
    Clear Cache For Current Application (removes all session state for current application)
    Clear Cache For Current Session (removes all state for current session)
    Clear Cache for Items (ITEM,ITEM,ITEM)
    Clear Cache for all Items on Pages (PageID,PageID,PageID)
    Reset Preferences (remove all preferences for current user)
    Set Preference to value of Item (PreferenceName:ITEM)
    Set Preference to value of Item if item is not null (PreferenceName:ITEM)
    WHICH ONE I HAVE TO SELECT ?

  • I need to calculate based on a value chosen in a drop down list!!

    Ok, here's the deal.
    I'm writing an order form for custom guitars.
    There will be a dropdown list for many things.
    Example:
    Body Shape : (Shape A, Shape B, Shape C)  <-(dropdown list)
    Body Color : (Color A, Color B, Color C)  <-(dropdown list)
    all three shapes and colors have different costs.
    So for example, if the base cost is $450
    and chosing
    Shape A = +$0
    Shape B = +$50
    Shape C = +$65
    Color A = +$0
    Color B = +$15
    Color C = +$35
    So after the customer chooses the shape and Color, I want the final price to display in the "Price" box.
    So if I chose Shape B & Color C in my dropdown list, the price would read $535.
    Is this possible?
    If so, do I need to write a seperate calcuation for it?? How do I do it?

    If all of your items in a given drop down box have a unique price you can set the export value for each option.
    The custom calculation for the total price field could be, with the field names of "Body Shape" and "Body Color":
    var nBase = 450;
    var nShape = Number(this.getField("Body Shape").value);
    var nColor = Number(this.getField("Body Color").value);
    event.value = nBase + nShape + nColor;
    If you created a hidden field for the base price you could use the "Field is the sum of the following fields:" and select the field names.
    You could also use the Simplified Field Calculation:
    450 + Body\ Shape + Body\ Color

  • #TAB_LINK# value not set for tabbed navigation list

    I'm a big supporter of searching the threads for an answer before posting. My apologies if I've overlooked this in the threads.
    Like many others, I'm leveraging lists to mimic third level tab functionality. I'm trying to use the tabbed navigation list template. My targets for the list entries are pages within the application. When clicking the links however, #TAB_LINK# is not being interpreted within the link URL. #TAB_LINK# is simply appended to the end of the URL instead of being replaced with the actual link value, for example I would expect to see a typical htmldb page link with the target page value.
    As a result, no navigation occurs to the target page. If I change the list template to horitzontal link list, the links function as expected, however I prefer the look of the tabbed navigation template.
    Any suggestions?
    David

    I took a hint from my own post and checked the template that was working for me and noticed that the horizontal list template uses #LINK# instead of #TAB_LINK#.
    I altered the tabbed navigation list template, replacing #TAB_LINK# with #LINK#, and now the tab links function as expected. I'm not sure if this fix will bite me later, or if this is a known issue. If there is a "proper" solution out there, I would still like to hear it. For now I'll assume my fix is a hack.
    Thanks,
    David

  • Multiple values as default for input parameter

    Hi,
    As per one requirement, I have to create a input parameter with default values (having multiple default values).
    Any suggestions are much appreciated.
    Regards,
    Saurabh

    create or replace procedure emp_proc ( p_test_input in varchar2,
                                                        p_emp_id in number,
                                                        p_emp_name in varchar2 default null,
                                                       p_manager_id in number default null )

Maybe you are looking for