Disable input on page load depending on page level item

Hi All,
I am trying to set the disabled property of a HTML input button when an APEX page is loaded. This can be achieved easily by using getElementById and setting the *"disabled"* property in the onLoad event of the body.
However, I need to keep the state of the button as disabled if the page is refreshed by the user or through a submit. I've stored this state in a page item, however using +$x(PAGE_ITEM_NAME)+ in the onLoad body event does not return me the value stored in the page item. Calling the same code using an onClick of a dummy button returns me the value.
1. What is the appropriate way of getting the value of page_item during a page load?
2. If doing it on a page load is not feasible, is there a way of setting the state of a html input button to disabled using a page process for e.g?
Thanks heaps,
Raihaan

Hi Raihaan,
Let's do this a little bit different, as this approach gets you into trouble.
Create an application process called "GETLOCK" (Shared Components > Application Processes > Create), make sure the "point" is set to "onDemand". Paste in the following source:
DECLARE
  result NUMBER;
BEGIN
  FOR c IN (select count(flag) lock_status from c_locking where rownum = 1) LOOP
    result := c.lock_status;
  END LOOP;
  HTP.P(result);
END;Next go back to your page, and go to the page definition, paste the following code in the HTML Header:
<script type="text/javascript">
function checkButtons(){
  ajaxRequest = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=GETLOCK', 0);
  ajaxResponse = ajaxRequest.get();
  if (ajaxResponse == 1){
    $x('Button_1').disabled = true;
    $x('Button_2').disabled = false;
  }else{
    $x('Button_2').disabled = true;
    $x('Button_1').disabled = false;
</script>Change the Button_1 and Button_2 to the button names accordingly (make sure it is the "id" attribute).
Next paste the following javascript in the Page "Footer Text":
<script type="text/javascript">
  disableButtons();
</script>What you just did, is create an Application Process, that is called upon by an AJAX call in the javascript header, that is fired by the javascript in the page footer.
I think you allready have your DML taken care of, with the submit of your buttons. Now every times the page loads, it checks which button to disable.
Hope it helps,
Greetings,
Rutger

Similar Messages

  • Quotes in a page level item not showing up as " when used in a hyper link

    Hi all,
    In my app, I need to hyper link to a crystal report application with parameters from my page. I have a page level item that puts my parameter in quotes, but when the item is utilized in the hyperlink, the quotes come across as & q u o t ; (spaces were put in to the post to avoid html conversion) how can my string be used to appear the way I want?

    I don't use Crystal Reports, but, in general, you should encode your URL. When you create your link, run the URL through utl_url.escape() first. Put it in your select statement.
    E.G.,
    select utl_url.escape('http://oracle.com/foo"bar') from dual;
    will escape/encode the quotation mark and give you:
    http://oracle.com/foo%22bar
    This translates the " into a URL-safe escape code, %22, that should (I hope) be understood properly by your Crystal Reports server.
    Good luck.

  • Aplication Vs. Page level items for application process

    Hi,
    I have many application processes in my applications, many of them take parameters.
    Right now I am passing parameters using page level temporary items. This is causing each page to have many items that are only used for calling the application process.
    Is it better to use application level items for this purpose?
    any pros and cons for each of these?
    ~Ketan

    Arie,
    Are you saying that the condition only apply to rendering the item, but the APEX engine will still consider such an item a valid “internal” variable?
    Yes. The absence of a condition on a page item or a condition that evaluates to true simply allows it to be rendered on the page. The existence of the item in the page definition allows it to hold session state.
    We're planning to introduce a non-displaying page item type just for this purpose, sort of a scratchpad variable with no display properties, like an applicaition item but defined on a page.
    Scott

  • Drill Down in Pivot Table with item on page level

    Hi,
    I've got a pivot table with Chart next to it. The chart is a separate view, I did not use the 'Chart pivoted results' option.
    My pivot table has one Page Level item being the Month Name.
    I now have the strange behavior that drilling down on the Pivot table elements gives me No Results as my filter would be too restrictive. The problem is with the 'Month Name'. Removing this item from the filter shows the correct data. When I use the chart next to my data to do the drilling I encounter no problems. This is because this way the restriction on the month name is not added when drilling.
    Has anybody encountered this behavior before and knows of a way to solve this.
    Thanks for your advice,
    Kris

    My query looks like this :
    SELECT TO_NUMBER (TO_CHAR (t1601.datum_prestatie, 'MM'), '99') AS c3,
    t1584.description AS c4, t1497.project_group AS c5,
    t1497.project_desc AS c6, t1497.project_code AS c7,
    CONCAT (CONCAT (t2241.firstname, ' '), t2241.lastname) AS c8,
    t2254.employee_number AS c9, t1601.duur AS c11,
    t1601.datum_prestatie AS c12
    FROM t_projects t1497 /* Dim_PROJECTS */,
    t_organization t1579 /* DimX_ORGANIZATION_Project */,
    t_organization t1584 /* DimX_ORGANIZATION_Project_Parent */,
    t_employees t2241 /* DimA_EMPLOYEE_Prestatie */,
    t_prestaties t2254 /* DimA_PRESTATIE_Project */,
    t_prestaties t1601 /* Fact_PRESTATIES */
    WHERE ( t1497.business_domain_code = t1579.department_code
    AND t1497.project_code = t1601.project_code
    AND t1497.project_code = t2254.project_code
    AND t1579.parent_department = t1584.department_code
    AND t2241.employee_number = t2254.employee_number
    AND t1584.description = 'Specialized Technologies'
    AND t1497.project_group = 'SUPP AP TM'
    AND TO_NUMBER (TO_CHAR (t1601.datum_prestatie, 'MM'), '99') = 3
    The last row being a check on the month number.
    At the same time in OBIEE I get this :
    No Results
         The specified criteria didn't result in any data. This is often caused by applying filters that are too restrictive or that contain incorrect values. Please check your Request Filters and try again. The filters currently being applied are shown below.
         Divisie is equal to Specialized Technologies
    and      Month is equal to 3
    and      Project Group is equal to SUPP AP TM
    and      Month Name is equal to Mar
    The physical query doesn't even show the restriction on Month Name which makes it even more spooky...

  • Disabling components when page is loaded

    Hi all,
    I have a web page where I want to disable some components (a selectmany_menu) depending on the data that other components on the page are displaying (a selectone_menu).
    I have got a value changed listener working fine that disables my selectmany_menu depending on what is selected in the selectone_menu. The event listener checks the data and then uses the setAttribute method to disable the selectmany_menu if necessary.
    However, what do I do when the page is first loaded. I there a way that I can invoke the event listener (or something else) when the page is loaded so that the correct components will be enabled and disabled.
    Thanks
    Patrick

    Maybe I can state my question above in another way...
    I using a standard command_button to navigate from one page to another page.
    <h:command_button actionRef="xyzBean.goToPage" label="Go" commandName="submit" />
    public Action getGoToPage() {
    return new Action() {
    public String invoke() {
    //MANIPULATE COMPONENTS ON NEW PAGE
    return "success";
    The question is, how do I access the components for the page that I am going to rather than the page that I am coming from. I tried this:
    FacesContext context = FacesContext.getCurrentInstance();
    UISelectMany myMenuComponent= (UISelectMany) context.getTree().getRoot().findComponent("myMenuComponent");
    myMenuComponent.setAttribute("disabled", "true");
    However, this fails because the tree that I get access to is the tree I am coming from, raher than the one I am going to.
    Is there a way to access the new tree?
    Patrick

  • After installing Firefox6 many sites will not finish loading. I click on "stop loading this page" and then click on "reload this page" and the page loads. Also if I disable javascript the page will load.

    After installing Firefox 6 MANY web site will not finish loading. I disabled all add-ons and still have the problem. If I disable javascript, the pages will load. When the page is trying to load, if I hit "stop loading this page" and then hit "reload this page", the page will load; but sometimes I have to do this 2-3 times for the page to finish loading. No problem with these pages using IE8.

    I see that you ave changed some network.http prefs.<br />
    Doing that can cause all kinds of problems because not all servers like such changes, so you can try to reset those prefs on the about:config page.<br />
    network.http.max-connections 48<br />
    network.http.max-connections-per-server 16<br />
    network.http.max-persistent-connections-per-proxy 16<br />
    network.http.max-persistent-connections-per-server 8<br />
    network.http.pipelining true<br />
    network.http.pipelining.firstrequest true<br />
    network.http.pipelining.maxrequests 8<br />
    network.http.proxy.pipelining true<br />
    network.http.request.max-start-delay 0<br />
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Change value of a control in a list item new or edit form depending on the page level view Add New Item being clicked.

    I have a list which has a underlying infopath form for insert and edit a record.
    The list has various views spread across different pages .
    Now depending on different pages "New Item", a value for the form will have a corresponding value.
    If there is a single line of text control in the list, and depending ona page name, the value for the single line text should be autofilled when Add new item is clicked.
    How do i achieve that?
    Thanks...

    Hi,
    According to your description, there are several list views in your list, there is a textbox control which holds the “Single Line of Text” type of data in your custom
    form. When users click the “Add new item” button in one of the existing list views, you want the textbox control in the custom form to be populated automatically.
    By default, when user clicks the “Add new item” button in a list view, the URL of the custom form page will contain the name of that list view page, thus, a workaround
    which requires custom code can be like this:
    After the form page loaded, we can extract the name of the list view page from the URL, then populate it into the textbox control immediately. This can be achieved
    using jQuery.
    About how to
    get URL parameters of current page using jQuery:
    http://www.jquerybyexample.net/2012/06/get-url-parameters-using-jquery.html
    About
    adding jQuery into InfoPath form:
    http://riteshudupak.blogspot.com/2010/09/add-jquery-to-browser-enabled-infopath.html
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Disable Default WebVPN Page

    I am setting up a few different WebVPN profiles I am wondering if there is any way to disable the default page. I am going to give all users specific URLs (https://mywebvpn.mydomain.com/myprofile) but I would like to completely disable the page if they try browsing to https://mywebvpn.mydomain.com. I havent been able to find a setting yet that will disable the main page but still allow access to all group-urls. I have tried adding in the https://mywebvpn.mydomain.com to the default WebVPN group and checking disable, but it still loads the webpage when going to that URL.

    To specify a URL for the web page that displays when this WebVPN user logs in, enter the homepage command in username webvpn configuration mode. To remove a configured home page, including a null value created by issuing the homepage none command, enter the no form of this command. The no option allows inheritance of a value from the group policy. To prevent inheriting a home page, enter the homepage none command.
    The none keyword indicates that there is no WebVPN home page. It sets a null value, thereby disallowing a home page and prevents inheriting a home page.
    The url-string variable following the keyword value provides a URL for the home page. The string must begin with either http:// or https://.
    There is no default home page.
    http://www.cisco.com/en/US/docs/security/asa/asa71/configuration/guide/vpngrp.html#wp1122812

  • Struts can't display the input jsp page

    Hello,
    I'm using Struts 1.3.8 to construct a simple user registration system, in which the user could input his info (such as uuname and gpin, both are strings) in a jsp page, and after the submit, the system should go to a success page. However, somehow, when I access the url, it goes directly to the success page, but not stay at the input page.
    Here is my {color:#ff0000}struts-xml.config{color}
    bq. <?xml version="1.0" encoding="UTF-8"?> \\ <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> \\ <struts-config> \\ <form-beans> \\ <form-bean name="{color:#ff0000}anotherUserForm{color}" type="com.visualbuilder.struts.beans.AnotherUser" /> \\ </form-beans> \\ <!-- Global Exceptions --> \\ <global-exceptions></global-exceptions> \\ <!-- Global Forwards --> \\ <global-forwards> \\ <forward name="success" path="success.jsp"/>     </global-forwards> \\ <!-- Action Mappings --> \\ <action-mappings> \\ <action path="/{color:#ff0000}addanotheruser{color}" type="com.visualbuilder.struts.action.AddAnotherUserAction" name="{color:#ff0000}anotherUserForm{color}" attribute="user" input="{color:#ff0000}/addanotheruser.jsp{color}" cancellable="true"> \\ </action> \\ </action-mappings> \\ <!-- Message Resources --> \\ <message-resources \\ parameter="registration.resources.ApplicationResources" /> \\ </struts-config>
    My action class is:
    package com.visualbuilder.struts.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.visualbuilder.struts.beans.AnotherUser;
    public class AddAnotherUserAction extends Action {
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (isCancelled(request)) {
    return mapping.findForward("welcome");
    {color:#ff0000}AnotherUser anotherUser = (AnotherUser) form;{color}
    System.out.println("UUName: " + anotherUser.getUuname() + "\tGPIN: " + anotherUser.getGpin());
    {color:#ff0000}return mapping.findForward("success");{color}
    My ActionForm class is:
    package com.visualbuilder.struts.beans;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class AnotherUser extends ActionForm {
    private static final long serialVersionUID = 1058901817587421984L;
    private String uuname;
    private String gpin;
    public String getGpin() {
    return gpin;
    public void setGpin(String gpin) {
    this.gpin = gpin;
    public String getUuname() {
    return uuname;
    public void setUuname(String uuname) {
    this.uuname = uuname;
    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    uuname = null;
    gpin = null;
    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    return errors;
    The input jsp page is addanotheruser.jsp:
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Another User Registration</title>
    </head>
    <body>
    <h1>Another User Registration</h1>
    <html:errors />
    <table>
    {color:#ff0000}<html:form action="addanotheruser">{color}
    <tr>
    <td>UUName</td>
    <td>{color:#ff0000}<html:text property="uuname"></html:text>{color}*</td>
    </tr>
    <tr>
    <td>GPIN</td>
    <td>{color:#ff0000}<html:text property="gpin"></html:text>{color}*</td>
    </tr>
    <tr>
    <td><html:submit/></td>
    <td><html:cancel/></td>
    </tr>
    </html:form>
    </table>
    </body>
    </html>
    Everytime I access http://localhost:9080/addanotheruser.do, it jumps to the success.jsp, but not stay at addanotheruser.jsp to wait for the user input, and in the server's console, I could see the output "UUName: null GPIN: null"
    I've been stuck at this simple program for three days, could anybody help to find the errors? Thanks a lot.

    sorry, the post looks ugly. Does anybody know how to make the indent not disappear?

  • Forms personalisation - Vendor Form - How to Disable a Tab Page

    Hi,
    I am not a Forms 6i/9i programmer, although I have an appreciation of the concepts and can look at forms in Form builder. I have been looking at forms personalisation and have used it to execute plsql via the built in 'execute a procedure'. I can also see how to disable blocks, or items, but I haven;t managed to disable a form tab page i.e. On the vendor form there are tabs for GENERAL, CLASSIFICATION etc.
    I have tried using the object type Tab Page, but the poplist doesn;t list any tab pages. Also if you choose Canvas, the list of Canvases appears but generates errors when you try and use the form (complaining of tab page ids).
    I understand that to disable a tab page programatically, you would use SET_TAB_PAGE_PROPERTY i.e. in a forms trigger or in CUSTOM.pll
    I would have thought Forms personalisation could do this.
    Any ideas would be appreciated
    mark
    I under

    What you can do is hiding the tabs (see pic below) and force the active tab programmaticily
    Hope this helps
    Message Edité par TiTou le 09-20-2006 10:35 AM
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    Clipboard01.png ‏151 KB

  • Can you disable 'Go to' page feature

    Can you disable 'Go to' page feature in Acrobat as it getting in the way of other navigation I have added.

    I can't tell you how to use it, but I do know that the iPhone Conficuration Utility can be used for this purpose.
    http://support.apple.com/kb/DL1465
    Matt

  • How to disable a JSP page caching?

              Hello there,
              How do I can disable a JSP page caching? This is becoz when the first time i ran
              a EJB calling from a JSP, it works, but after the second time, it unable to call
              the same EJB again, I double check the console and the database, the same records
              does not appears after the second calling, i suspect is caching problem.
              TQ
              Neo
              KL
              

    Neo, wls does not cache jsp page by default. We do have a custom tag for
              it as you can see here
              http://e-docs.bea.com/wls/docs61/jsp/customtags.html#overview.
              Regards,
              Joseph Nguyen
              BEA Support
              "Neo" <[email protected]> wrote in message
              news:3d4a428d$[email protected]..
              >
              > Hello there,
              >
              > How do I can disable a JSP page caching? This is becoz when the first time
              i ran
              > a EJB calling from a JSP, it works, but after the second time, it unable
              to call
              > the same EJB again, I double check the console and the database, the same
              records
              > does not appears after the second calling, i suspect is caching problem.
              >
              > TQ
              >
              > Neo
              > KL
              

  • How do I disable editing of pages in author mode? User should not be able to edit content . Can this

    How do I disable editing of pages in author mode? User should not be able to edit content . Can this be customized on component basis?

    You have to remove modify rights for those users on that page. Component basis is possible but will create ACL complications. Please check http://dev.day.com/docs/en/cq/current/developing/components/boilerplates.html for that.
    Yogesh
    www.wemblog.com

  • Disable a button under certain circumstances and disable input fields

    Scenario: My user receives a PDF (dymanic XML) where they fill in fields and click a Submit button to send the data to the server. They receive a confirmation copy of the form back. In our older version of Livecycle, the confirmation form was locked down - no fields were editable, the Submit button was disabled. We still need the ability to not input/change any data on the confirmation copy and not be able to click the Submit button. Under ES4, everything started out editable.
    On the confirmation copy, there are messages that I check. When those messages are present I would like to hide the buttons (optimal solution) or at the very least, disable them so the user cannot resubmit the form again.
    I've managed to put Javascript in place to lock down all input fields, I just can't get the script to work to hide the buttons. I'm beginning to wonder if the script to lock down all input fields is causing the scripts to hide the buttons to not work.
    Sample code to disable editing of input fields:
    - had to provide this code at the table level so that when a table flows to a second page, the fields are locked. When I put it at the page level or top level of the hierarchy, it only worked on the one page when I need it to cover fields that have flowed on to a second page. Even at the table level, there are still some tables that remain open until a change is made, then the fields on the second page become locked.
    - when this is entered at the subform level, second page of the subform is modifiable
    rfqHeader.rfqHeader.IssuerInfo::ready:layout - (JavaScript, client)
    if (rfqHeader.rfqMessages.Message.rawValue != null)
    // Get the field containers from each page.
    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
    var oFields = xfa.layout.pageContent(nPageCount, "field");
    var nNodesLength = oFields.length;
    // Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
    oFields.item(nNodeCount).access = "readOnly";
    Sample code to make the button hidden:
    rfqHeader.rfqFooter.button.SubmitButton::initialize - (JavaScript, client)
    if (rfqMessages.Message.rawValue != null)
    this.presence = "hidden" ;
    Any help and suggestions would be welcome!
    Thanks, Josie.

    Hi Josie,
    I think, for what you are trying to do, you must be in the doc:ready to be able to do this.
    All because the doc:ready is the last event to be fired when a form is reopen...
    rfqHeader.rfqFooter.button.SubmitButton::docReady - (JavaScript, client)
    if (rfqMessages.Message.rawValue ! = null)
    this.presence = "hidden" ;

  • How check page level permission on SharePoint pages library using JSOM

    Hi,
    Can anyone tell me how check page level permission on SharePoint pages library using JSOM.
    Tanks in advance .
    Regards,
    Hari
    Regards, Hari

    Hi,
    According to your post, my understanding is that you want to check the page level permission on SharePoint Pages library via JSOM.
    I have made a simple code demo to check whether current user has edit permission for the pages in Pages library, it works like a charm.
    You can re-write it to fit your environment.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    var web;
    var list;
    $(function(){
    $("#Button1").click(function()
    console.log(1);
    getListItems('Pages',success_Items,error_Items);
    console.log(2);
    function getListItems(listTitle,success,error)
    var context = SP.ClientContext.get_current();
    this.web = context.get_web();
    this.list = context.get_web().get_lists().getByTitle(listTitle);
    this.items = list.getItems(SP.CamlQuery.createAllItemsQuery());
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.load(web,'EffectiveBasePermissions');
    context.load(items);
    context.executeQueryAsync(
    function() {
    success(items);
    error
    function success_Items(items){
    var e = items.getEnumerator();
    while (e.moveNext()) {
    this.item = e.get_current();
    console.log(this.item.get_item('FileLeafRef')); //print File or Folder Name
    console.log(this.item.get_item('FileRef')); //print File or Folder Url
    if (this.web.get_effectiveBasePermissions().has(SP.PermissionKind.editListItems)) {
    console.log('Nice, edit list item permissions!');
    else {
    console.log('Boo, no edit list item permissions!');
    function error_Items(sender,args){
    console.log(args.get_message());
    </script>
    <input id="Button1" type="button" value="Check Permissions"/>
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for

  • Where can I get detailed maps of Japan/Kyoto

    I am traveling to Japan/Kyoto/Osaka next week.  I downloaded the Japan map but the file is only a few MB in size and there is almost no detail.  In contrast the maps for China are huge and very detailed. Is there an alternative site that I can get a

  • Which widows server 2008 release and edition supports Oracle 11g R1 64 Bit

    Hi Trying to install the Oracle 11g R1 64bit on Windows server 2008 . Hence requesting you all , which Windows server 2008 Release and Edition support Oracle database 11g R1 64bit . Thank You Edited by: user8709943 on Nov 12, 2010 10:34 AM

  • Deprecated value for migration

    Hi All, I have to migrate a database of version Oracle 8.1.7.4.0 to Oracle 10gR2. Can anyone is able to help me out for figuring out the Deprecated value which shoud be taken care from application prospective.For examplae if i will compile the proced

  • Item details with Last Transaction Date ?

    Hi, Please help someone to fine tune this query :- Select ILLITM,ILDOC, ILDCT, ILTRDJ FROM CRPDTA.F4111 where ILTRDJ in (Select max(ILTRDJ) FROM CRPDTA.F4111); The above query is returning the latest transaction date with Item details. But expected o

  • How do I sync and switch between multiple camera angles?

    I shot a concert with 3 HD cameras. I though it would be relatively simple to sync and cut between them but it's turning out to be much harder than I expected. I'm sure I'm not the first person to do this. Anybody have any tips and tricks on how best