Resetting values in popup

I am sharing a sample script that one can use to reset values in popup for versions that do not support resetEditable values.
resetAction=function(clientId){
    var component= AdfPage.PAGE.findComponentByAbsoluteId(clientId);
    console.log(component);
    var components=component.getDescendantComponents();
    this.resetFunction(components);
   resetFunction=function(components){
     for (var i=0;i<components.length;i++){
     if(components[i] instanceof AdfRichInputText){
     if(components.getVisible()&&!components[i].getDisabled()&&!components[i].getReadOnly()){
components[i].setValue("");
if(components[i] instanceof AdfRichSelectOneChoice){
if(components[i].getVisible()&&!components[i].getDisabled()&&!components[i].getReadOnly()){
components[i].resetValue();
* Resets the popup
* @return null
public String resetPopupAction() {
FacesContext context = FacesContext.getCurrentInstance();
ExtendedRenderKitService erks =
Service.getRenderKitService(context, ExtendedRenderKitService.class);
erks.addScript(context,"resetAction('"+formBinding.getClientId(context) +"')");
return null;
Edited by: Ramandeep Nanda on Nov 17, 2011 7:18 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Yes, but i thought i'd share it here as users often come to the forums so it will answer their query .
Edited by: Ramandeep Nanda on Nov 17, 2011 7:57 PM

Similar Messages

  • Clear Form Value in Popup using Reset Link

    Hi All,
    Jdev Version 11.1.1.6.0
    I have an upload button on page with table, which opens a popup. In popup, I createInsert table attributes using Submit Button. As per our requirement, we also need to have a Reset Form link, which should clear out details entered by user in popup. I tried to add af:resetActionListener on af:CommandLink (Reset Form) but it didn't worked out. Clicking on reset is closing the popup. But it should rather clear out data entered by user.
    Please advice.
    Thanks, Ank

    Hey Timo,
    Thanks for inputs, but in our popup, we have 3 actions - i. Save(Submit) ii. Reset iii. Cancel
    The above suggestion is best for Cancel, but for Action Reset, if user filled any information but in the end click Reset link, values of input text should be restored to blank or default in case of Edit or Create, and popup should not close.
    I am looking for resetting default value of popup, without closing the popup.
    Ankur
    Edited by: ankurmdh on Dec 30, 2012 10:06 PM

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • Error while selecting NULL value from Popup Key LOV(numeric or value error)

    Hi,
    I have a item P1_DEPTNO with following properties.
    P1_DEPTNO - Popup Key LOV (Displays description, returns key value)
    LOV - P1_DEPT_LOV
    select deptname d, deptno r from deptP1_DEPTNO item properties
    List of Values
      Named LOV - P1_DEPT_LOV
      Display Null - Yes // changed to Yes, so that it can accept NULL values.
      Null display value - NULL
      Null return value -   (blank)PL\SQL Process -
    declare
    v1 number;
    begin
    if :P1_DEPTNO is null OR :P1_DEPTNO = '' then
        v1 := 0;
    else
        v1 := :P1_DEPTNO;
    end if;
    // rest of the PL\SQL process
    end;Now, when I run the page and select NULL value from Popup LOV and submit, I get the following error.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error.When, I select any other value other than NULL, then it's working perfectly fine.
    Only in case of NULL value, I am getting this error.
    ANY idea, why this error is coming??
    Thanks,
    Deepak

    Hi Varad,
    I did the following change
    Null display value - (blank) // by default it is displaying '%' in the select this
    Null return value - -1
    but when I select % (null value) from the popup list, it displays the return value -1 in the text field.
    My question is why it is displaying the return value -1 in the text field...*It should display the display value in the text field (i.e blank in this case)*
    then, I did the following change
    Null display value - (blank) // by default it is displaying '%' in the select this
    Null return value - // a single space, so that when I select %(null value) from the list, it should display blank in the text field...
    then I did the following change in the PL\SQL process.
    PL\SQL process
    declare
    v1 number;
    begin
    if :P1_DEPTNO = ' ' then // -- checking the value of single space ' ' when we select %(null) in the popup list, BUT even I select %(null), control is not coming here.
        v1 := 0;
    else
        v1 := :P1_DEPTNO;
    end if;
    // rest of the PL\SQL process
    end;Thanks,
    Deepak

  • Bold value from popup LOV

    Hi,
    style="font-weight:bold" or class="fielddatabold" in the element's HTML Form Element Attributes work perfectly for the text field. I cannot get the same result for field with disp.value from popup LOV (display value,return key). I can change font family for example, but cannot bold. Any suggestions ?

    Thanks a lot for your answer. I got the same idea, but cannot see any place to manage returned values on this template. Description from pop-up key LOV seems to be turned "disabled", and will get the grey colour on the screen. However, if I will change to Select list, it looks fine.

  • Copa there is a option for reset value field / quantity value filed

    Hi
    As per the sap standard in copa there is a option for reset value field / quantity value filed. We
    use this function to reset a quantity or value field depending on the
    billing type (For eg L2 (Debit Memo) G2(Credit Memo). This means that
    the condition value set in the field is replaced by value 0. Due to
    this quantity value filed in copa reflects nil. My client requirement is when profit center document is generated System should display the quantity as nil.
    i have tried some enhancement but these enhancement is only used in  case of PGI . But in the case of debit and credit memo their is no PGI. first we create debit not request (va01) then billing(vf01) then document is generated .
    Can we do the same thing in profit center Accounting? When PCA document
    is generated System should display the quantity as nil.
    Please let me know some user exit or substitution or Bte  we can use ?
    Anjali

    hi Jerry,
    Very appreciated the link you sent.  In this article of this link,  it gives an example of a conversion from an external to an internal format:
    1. '1234 ' -> '00001234'
    2. 'ABCD ' -> 'ABCD '
    Just wonder why the external format '1234 '  has to be converted to '00001234', what's the purpose of doing this converstion?
    Thanks!

  • I had a problem with slowness so I used "reset". The popup ran forever so I stopped it. Now I can't remove or add the program.

    I had a problem with slowness so I used "reset". The popup ran forever so I stopped it. Now I can't use, remove, or add the program. How do I proceed?
    TIA,
    BWSwede

    You can paste that path in the command line in the Windows Explorer file manager.

  • Populating values from popup

    Hi,
    Module pool program: I have 3 fields based one drop down select in the first field the 2nd filed values will get popup screen(F4), based on any row select here, those values should get into populate in 2nd and 3rd fields (table maintenance screen).
    Till Popup I have done.
    I am getting row values into an internal table but here i am facing problem is when i select row in popup only first field only populating the next field not getting.
    Please suggest me
    Regards,
    Prabhakar

    Hi Prabhakar,
    U said ur getting one field value from the popup. U can get the values that ur gonna show in popup in one internal table.
    Get the single field value from popup which the user selects into the program and using READ statement get the remaing values from the internal table for the same and update in the required place.
    Regards,
    Sanil

  • Settings reset after shutdown + popup

    I don't usually shutdown my 2014 Macbook Air except the occasional freeze but recently decided to do so while I wiped the keyboard clean. Once I turned it back on and signed in, I found all my preferences reset including trackpad set to 'tap to click', dock icons reset to original, etc. It seems like everything was reset to factory settings.
    I tried going to Preferences to change the trackpad to 'tap to click' but discovered that it was already set do so...yet I'm unable to 'tap to click'.
    The other problem is I get this annoying popup which I've never seen before titled "OSX needs to repair your library to run applications". Even after entering the correct password, the popup reappears. Then I tried just hitting cancel repeatedly until it disappeared. That's when a different popup appeared--something titled "mail chain...enter your password"--can't remember exactly.
    This was all occurring on one of my user accounts so I tried switching back to the original Admin account and found the same issues occurring there (the account also reverted back to factory settings).
    Any ideas? Your help is much appreciated.

    Back up all data before proceeding.
    This procedure will unlock all your user files (not system files) and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    resetp
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
               ▹ Restart
    from the menu bar.

  • Eliminating the null values from popup list item

    Dear All,
    i create a popup list,at runtime it shows a null blank value among the values i specified while the combo box is not,
    i want to eleminate the blank null value from the popup list.
    Need Help.
    Thanks & Regards.

    Okay,
    i create a popup list, populate it in runtime with create_group_from_query builtin.
    now when i run the form and click the list item, it display a null value among the other values which are
    return from the create_group_from_query .
    the procedure is below
    procedure Department_proc is
    rg recordgroup;
    n number;
    begin
    remove_record_group('RG');------  this is another procedure which checks for Record group existance and remove it.
    rg=:=create_group_from_query('RG4','SELECT NAME,TO_CHAR(DEPT_ID) FROM TAB_DEPT_SECTION
    UNION
    SELECT '||'''All Departments'''||'as name,'||'''0'''||' as name from dual');
    n:=populate_group(rg4);
    populate_list('control_block.department',rg4);
    end;
    it display a null value among the other values for the first time is run the form,but when i click it and select a value from it
    and the onward click dont show the null value.i want to eleminate the null value even for the first time when the user run the
    from.
    Best Regards

  • How to pass the values from popup window to parent's window

    Hi Experts,
    in my application i need to develop one popup window in that i have created 4 dropdowns and one ok button , if i willl click on that ok  button the values should pass to parent window dropdownlistboxes
    can any body suggest how i will get the popup window values
    thanks in advance,
    ramani.

    Hi Ramani,
    I can provide few inputs on how can we control JSP 2 from JSP1.
    Here is the code. Check if you can convert this to make useful to you. I am not passing values but control.
    here it is:
    JSP 1.
    <h1>Page One</h1>
    <br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>.html#part1">part 1</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part2">part 2</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part3">part 3</a>
    JSP 2.
    <h1>Page Two</h1>
    <br>
    <a name="part1">
    <h3>Part 1</h3>
    </a>
    <a name="part2">
    <h3>Part 2</h3>
    </a>
    <a name="part3">
    <h3>Part 3</h3>
    </a>
    This way you can move from one JSP to other.
    regards
    -Kedar Kulkarni
    reward points if useful.
    Message was edited by:
            Kedar Kulkarni

  • How to populate a Value in popup based on value selected in Parent window

    Hi Gurus,
    I have done a custumization to generate a PDF report for a given DocType and Document ID.
    I have 2 fields in xxxQuoteDevPG.xml (Parent Window) called DocType and Document Number.
    Doctype is dropdown list which has 2 values i.e. Sales Quote and Manual SOW Number and Document Number is a text field with search option.
    when i select the doctype as Sales Quote and search for docnumber , i will get a popup where i have "Search By" dropdown list in this i have 2 values i.e "Quote Number" and "Customer PO".
    When i select a Sales Quote as Doctype i need to populate Quote Number as defualt in Search by dropdown list.
    and When i select Manual SOW Number from parent window i need to defualt Customer PO in popup.
    Now it is always shows Quote Number as defualt one for the doctypes.
    Actually thr is only one controller atatched to xxxQuoteDevPG.xml and popup is a OA Region.
    Can somebody help me on this issue.
    Thanks,
    MMR

    This should be a custom java class containing that method.
    Try on java or jdbc forum - Java Database Connectivity (JDBC) , Java Programming

  • How to pass field value from popup window to oninput processing of other pg

    Hi,
    I want to pass a field value from the popup window to oninput processing of main page ( from where popup window is triggered). and need to close the popup window. How to do it ?
    In the popup window's oninputprocessing, im doing some validation checks. If it passes all the validations, then only the control shd come to main page ..else it should stay in popup window only .
    Regards,
    Jothi.

    Hi Jothi,
    you can use java script to pass the value and close your popup window. use the following code.
    in your popup window:
    function passData(h1)
             window.opener.document.getElementById('var1').value = h1 ;
             window.close();
    then call this function when you finish your validations.
    in your main page layout create an input field with id as passed in the function above "var1".
    In the value attribute give it your variable as follow:
    <htmlb:inputField id      = "var1"
                              value   = "<%= var2 %>"
                              visible = "false" />
    "var2" will be assigned the value from your popup window.
    I hope this will help you..
    Regards,
    Husain

  • How to reset values in a Data Form Bean?

    I have created an ADF application that has a search facility in it. The architecture is as follows:
    DataPage (search.jsp) --> DataAction (validateSearch) -->DataAction (refreshCollection) --> DataPage (results.jsp)
    I have successfully created a data form bean to hold the data that is submitted in the search and bind it to the refresh method of the collection. I have also successfully overridden the validate method, which catches and throws and displays appropriate ActionErrors on the search.jsp page.
    I have added a link back to the search.jsp page from the results.jsp page (as a user may wish to perform another search), the ActionErrors are resetting ok but I have not managed to work out how to reset the values of the actual data form bean.
    I have tried several different ways of overriding the reset method within the data form bean but so far have been unsuccessful - I would appreciate any assistance with this matter.
    Shown here is a basic example of a form bean that I have been trying different things out with - I can not get the reset method to even be called - please help!
    package uk.dmf.eg02;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class searchForm extends ActionForm
    String search;
    public setupForm()
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
    ActionErrors errors = new ActionErrors();
    if (search.trim().length()==0)
    errors.add("search", new ActionError("error.search"));
    return errors;
    public void reset(ActionMapping mapping, HttpServletRequest request)
    System.err.println("EXECUTING RESET METHOD");
    this.search = "";
    public void setSearch(String search)
    this.search = search;
    public String getSearch()
    return search;

    If you run in request scope the reset method is called, however in session scope is't only called once (or never?). See documentation of method reset():
    public void reset(ActionMapping mapping,
    javax.servlet.http.HttpServletRequest request)
    Reset bean properties to their default state, as needed. This method is called before the properties are repopulated by the controller.
    The default implementation does nothing. In practice, the only properties that need to be reset are those which represent checkboxes on a session-scoped form. Otherwise, properties can be given initial values where the field is declared.
    If the form is stored in session-scope so that values can be collected over multiple requests (a "wizard"), you must be very careful of which properties, if any, are reset. As mentioned, session-scope checkboxes must be reset to false for any page where this property is set. This is because the client does not submit a checkbox value when it is clear (false). If a session-scoped checkbox is not proactively reset, it can never be set to false.
    This method is not the appropriate place to initialize form value for an "update" type page (this should be done in a setup Action). You mainly need to worry about setting checkbox values to false; most of the time you can leave this method unimplemented.

  • How to reset values in fileds of a selection screen?

    I have a selection screen ,can you please tell me how to reset the values of the fields in selection screen.

    Hi,
    SELECTION-SCREEN: begin of block blk,
    SELECT-OPTIONS FL_DATE FOR SBOOK_WA-FLDATE.
    SELECTION-SCREEN: End of block blk,
    INITIALIZATION.
    REFRESH  FL_DATE.
    Please Note: Always search SCN before posting.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

Maybe you are looking for

  • Network Pane causes System Preference to Crash

    An unusual problem has cropped up on my Black Macbook 2 GHz machine. Everytime I click on the Network Pane it causes the system preferences to crash. I've tried everything from rebuilding the permissions, to deleting certain pref files. I thought I h

  • 10.1.0.2.0 database download link needed for window server 2008 64bit

    Here is our plan. We are currently running oracle 10.1.0.2 database on a windowsServer 2003 32 bit. Now we would like to migrate the database to 10gR2 and run it on our new server windows server 2008 64bit. After doing research, I think I need to go

  • Browser and email issues with OS 10.9.4

    Had a problem that I thought had been solved.  See thread here: Just installed OSX 10.9.4 - have browser and email issues Now a week or so later, it's back.  Same symptoms.  I have followed the procedure posted by Linc Davis.  Anybody have further id

  • FIrefox repeatedly crashes at startup or just after opening a webpage

    Firefox repeatedly crashes on startup or just after opening a new page, I've tried downgrading my browser to FF 18 & the problem still occurs. Firefox won't even run properly in safe mode. I have included the latest crash report: bp-d8715a6c-6208-442

  • Jar file position in classpath

    I have built a jar file containing my application. I added the location (d:\tools\myjar.jar) of the jar file to the end my classpath environment variable, When I try to run the application, it finds the first class containing main just fine but throw