Using javascript to set non database values

I finally figured out how to set the values of a non database form field using Javascript. The only problem is, I want this
field to be a display only field, and the value does not get set if I make the field non updateable on the form. Can
somebody please help me!! This is urgent.

Stan,
One way to do this is to call the doSubmit() function and create a page branch to handle your request. This way you can use apex validations and other goodies if your requirements change. Also this will save the state of your items on the page you are leaving.
Edit
I forgot to mention that you can pass a string parameter to the doSubmit function. The parameter will be the request sent to apex. For instance you could use doSubmit('DO_SOMETHING') and you can have a page branch which will fire if the request is equal to DO_SOMETHING.
Cheers,
Tyson Jouglet
Edited by: Tyson Jouglet on Dec 1, 2009 10:11 AM

Similar Messages

  • Using JavaScript to set value of Spry validated text field

    Why can't the value of a text field be set using JavaScript
    when it's validated using the Spry validation widget.
    Example (this works):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <input type="text" name="birthdate" id="birthdate"
    value="">
    Example (this doesnt work):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <span id="birthdate">
    <input type="text" name="birthdate" id="birthdate"
    value="">
    <span class="textfieldRequiredMsg">please enter your
    birthday</span>
    </span>
    <script type="text/javascript">
    <!--
    var birthdate = new
    Spry.Widget.ValidationTextField("birthdate", "none");
    //-->
    </script>
    Is there a way to change the value of a Spry validated text
    field using JavaScript?
    Thanks.

    Why can't the value of a text field be set using JavaScript
    when it's validated using the Spry validation widget.
    Example (this works):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <input type="text" name="birthdate" id="birthdate"
    value="">
    Example (this doesnt work):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <span id="birthdate">
    <input type="text" name="birthdate" id="birthdate"
    value="">
    <span class="textfieldRequiredMsg">please enter your
    birthday</span>
    </span>
    <script type="text/javascript">
    <!--
    var birthdate = new
    Spry.Widget.ValidationTextField("birthdate", "none");
    //-->
    </script>
    Is there a way to change the value of a Spry validated text
    field using JavaScript?
    Thanks.

  • Problem using javascript to submit jsf form, values not submitted

    Greetings!
    I have a t:selectOneMenu where I want the page to be submitted when they change the selected value. At this point, I am able to get the form to submit and reload the page, which is all fine. The problem is that none of the values from the page are not set in the backing bean. I have break points on the setter methods that are not being hit.
    I have tried a number of things from searching multiple forums, but here are snippets from my latest version...
    <h:form>
    <t:commandLink id="hiddenLink" forceId="true" value="test link"
    action="#{pc_PageX.doBtnHiddenLinkAction}"></t:commandLink>
    <t:selectOneMenu id="pageList_top" forceId="true" value="#{pc_PageX.ValueX}"
         onchange="jspellSync(); submitPageX();">
         <f:selectItems value="#{pc_PageX.ListX}" />
    </t:selectOneMenu>
    </h:form>
    function submitPageX(){
         var hiddenLink = document.getElementById("hiddenLink");
         hiddenLink.click();
    }Note that the <t:commandLink> is not hidden, though it will be in the final version if I can get this to work.
    If I click the commandLink myself, the page is submitted with all the page values as expected. If I change the list value, thus using javascript to fire the commandLink's click event, the page is submitted with NO values.
    Can anyone come up with an explanation for this behavior? Or better yet, a solution?
    A couple other things I've tried...
    - Not using a commandLink and using jsf's submit function -> onchange="jspellSync(); submit();"
    - Clicking the link using other ways -> hiddenLink.fireEvent('onclick');
    If all else fails, I'll just add a button that they have to click to submit the form.

    snotmare wrote:
    BalusC wrote:
    I recall this problem in one of the ancient JSF versions. Which JSF version do you use? Do you have any room to upgrade to latest? We're using an IBM implementation of JSF, which is at version 7.0. The IBM implementation appears to be built on the JSF base 1.1.That's not an IBM JSF implementation, they do not have any one, they just have some component libraries which runs on top of some JSF implementation. RAD/WSAD ships by default with Sun JSF RI. Try upgrading to at least 1.1_02 which you can download from the aforementioned link. There's a gap of 2 years (and inherently a lot of bugfixes) compared to 1.1. If the application server used supports Servlet 2.5, you could even upgrade to the latest 1.2.
    We've had other issues with the IBM implementation, which could be the cause in this case too. We've been talking about switching to MyFaces, but there is one feature of the IBM version that we like. It's basically a script collector (hx:scriptCollector) that allows us to do pre-processing on the page.As said before, IBM does not have a JSF implementation. So replacing RI by MyFaces wouldn't make any difference.

  • Using Javascript function to change the value of a request variable

    Have a javascript function that activates onchange within a form variable. Would like the javascript function to change the value of a request variable.
    The javascript function is able to obtain the current value of the request variable ( which is 0 ) however I am unsuccessful in changing the value to 1.
    I have been trying to use the following:
         var vchange = 'request.changes_made = 1 ;' ;
         eval(vchange);
    Any ideas?

    If the user makes a change to the content of the form, and then attempts to leave the form, a javascript alert pops up giving the user the option of cancelling the submit, returning to the form and saving it.
    If there have been no changes, then the user is free to migrate to another page.
    This process is to protect users from losing valuable information but not to annoy them with "R U Sure" messages.
    Knowing the status of the form content is important to the functionality of the application.
    G

  • Using javascript to set relative position of popup

    I currently use the code below to pop up a window. BUt based on different screen resolutions it might not appear where it should be on all monitors. I always want it to the top right. If there a way to do this with javascript. Setting the top/right pixels wont always work, i dont think so anyhow.
    Thanks in advance.
    <script>
    function MDM_openWindow(theURL,winName,features)
    var _W=window.open(theURL,winName,features);
         _W.focus();
    _W.moveTo(750,25);
    </script>
    Click here

    hi....use this to get screen res...then you can use a percantage instead of pixels to place the pop-up...it shows method and height methods to get user resolution...
    <script language="JavaScript">
    var browserheight;
    var iMyHeight;
              var iMyWidth;
    //Gets user's resolution
    iMyHeight = (window.screen.height);
              iMyWidth = (window.screen.width);
    </script>
    hope this helps / steve

  • Use javascript to Update To Database

    Hi All,
    First of all I'm not a javascript user but I have to use javascript for this thing.
    Ok I have developed an online application using asp vbscript.
    All i want is when a user click on the checkbox i want to do a database update. Obviously I can't do that using client side script and without submitting the page..My friends say the only way is to use Java applet and I never do Java applet before! :)
    But i do want to learn..Do anybody have any related websites on this or examples for Java applet dummies..?? I'll appreciate it a lot..
    Thks..

    asp vbscript.AHHHGGGG! (j/k)
    >
    All i want is when a user click on the checkbox i want
    to do a database update. Obviously I can't do that
    using client side script and without submitting the
    page..What do you mean? You have no access to the server?
    A db update from an HTML page, IMHO, can't be done without some server side work...

  • ALV WebDynpro Hierarchy -Setting non-numeric values in the header level row

    Hi Experts,
    When setting up an ALV table as a table hierarchy the standard ALV settings only seem to allow for numeric values to be displayed in the higher hierarchy levels. Is there a way to also set the values for some non-numeric columns into these higher-level rows - programmatically or through the ALV Settings?
    Example: I have delivery item level data in my context and the delivery number as a hierarchy column. Some columns in my context however actually come from the delivery header e.g. delivery block, delivery priority, ship-to etc and I would like to display these in the collapsed header rows of the delivery number.
    It seems obvious to me that this should be doable otherwise if you are looking at at a list of hundreds of deliveries and all you see besides the delivery number is numeric data such as sums & totals, it's kind of hard to know which delivery you might want to expand the sub-level for.
    Please help,
    Peter

    Hi,
    Even we have faced the same issue.
    In ALV hierarchy, we cannot display data at header items/levels. this is a constraint in ALV. You can achieve the same usign TABLE UI element.

  • Non-Database Item Sort Using Multiple Block Values

    I need to sort the result set of a block based on a calculated item. I found several messages addressing this, however they all speak to using the columns from within the same block as input variables to the function used to calculate the non-database column value.
    My problem is that I need to use values from a different block as input variables. I have not found a way to use them since I need to use the full block.column syntax. Forms does not like this and always thows an error right at the period(.). I need to do this because the column names are the same in each block. the function compares the column values and changes the record instance background a different color based based on how many of the column pairs match. Each block is mutually exclusive from each other and doing a accurate join is not really possible.
    I tried renaming the block column name to something unique, however I get a variable not bound error when I try to use it in the order by function even though their values are in the top most block.
    For Example:
    First Block. Contains a list of cases that need to be worked because the automated process could not find a valid provider based on the values received. This list is created by a background process.
    Table: CASE_MAIN
    TIN
    CASE_ID
    FCLTY_CM
    MEDICARE_CM
    Unrelated Second Block (i.e., no join). It uses the TIN value in the first block to get a list of all of the providers for the TIN associated with the Case so that a person can assign the correct Provider to the case (A TIN has a provider and address associated with it). As a result there is no link to the results of this table and the CASE_ID. That's what the users needs to do manually
    Table: PROVIDER_MAIN
    FCLTY
    MEDICARE
    I need to take the values in the first block and compare them in the second block so that I can recolor the background based on matching logic in the function below.
    order by clause = get_vals( ''||:FCLTY_CM||''
    ,''||:MEDICARE_CM||''
    ,fclty
    ,medicare) desc
    I am able to do the coloring within the form easily, however I need to order them by how many values match exactly so the ones that match to most value pairs show at the top. Hence ordering by the result of the function. I return a 0,1, or 2 based on the matches. 0 for none and 2 for both.
    I cannot create a view because the sources of the information I need to compare are NOT related to each other, yet. that is what the application is designed to do. I have a case without a
    provider assigned, but I have a tax id number that possible identifies the provider. I use this TIN to query the provider table for all of the possible providers under that TIN. As a result there is no link between the case information and provider information. The goal is to get this list compare the values from the target information and put the most likely matches on top, with
    the ones with the most matches first. I can create a function many ways that takes in various parameters. For example Case ID and Provider Id and query the records in subselects
    individually like so;
    select count(*)
    from (select fclty, medicare from case_main where case_id p_case_id) cm
    ,(select fclty, medicare from provider_main where prv_id = p_prv_id) pm
    where cm.fclty = pm.fclty
    and cm.medicare = pm.medicare
    If the number is greater than zero I know I have a match with that provider and I can sort accoringly. I can also pass in the target information from case_main and the provider inforation from provider_main and then do an if/then statement for comparing. Then I can use this function to create a column value for each record and then use the same reference to the function in the order by clause to order by that value.
    The problem comes in trying to reference the case_id or target information from a different block than where the fucntion needs to be used. I get a variable bound not error message. What am I missing here. Why can I not reference a uniquely named block item as a input variable to a function in a different block? Does Forms first figure out what it needs to retrieve and then executes the SQL for each block in isolation, or does the first block's result set get retrieved, then the second, third, etc. Based on the message i am getting I would suspect the former since it appears their is no value in subsequent blocks. If so is there anyway around this? thanks.

    Don't quite understand your problem completely. But this might help. I sure hope your Provider_Main is a single-record block ...otherwise, how would you supply a list of values of FCLTY and MEDICARE to the function that does the sorting? Be awere, too, that the order-by is processed by the server, and NOT by Forms.
    Assuming it is a single-record block, you can put the values into parameters:
    :Parameter.Fclty := :Provider_Main.Fclty;
    :Parameter.Medicare := :Provider.Medicare;
    Execute_Query;
    And your order-by clause would be
    get_vals( ''||:FCLTY_CM||'',''||:MEDICARE_CM||'',
    :Parameter.Fclty,
    :Parameter.Medicare) desc
    By the way, the first line of your order-by looks strange. Shouldn't it be:
    get_vals( FCLTY_CM || ',' || MEDICARE_CM,
    or even better, get_vals should take in 4 parameters:
    get_vals(Fclty_cm, Medicare_cm, :parameter.Fclty, :parameter.Medicare)

  • Set property values using  javascript

    How can I recreate this while using javascript?
    <PARAM NAME="AllowSelection" VALUE="false">
    I tried this...
    document.Grid.setPropertyValue(AllowSelection,false);
    but it did not work.  Where is the documentation that would describe this in its entirety.  Thank you in advance.

    Chip,
    here is the Javascript for you.
    document.iGrid.getGridObject().setAllowSelection(NEWVALUE);
    Documentation you can find under the help Link in MII. You can also use the SAP MII Script Assistant
    to see all supported methods .
    Regards
    Pedro

  • Non sequential values for knobs

    Is it possible to set non-sequential values for the control knobs on the front panel? For example, I'd like to set values of 1, 2, 5, 10, 20, 25, 50, 100, etc...

    Use the log mapping and text labels.  See example.
    Attachments:
    Non_Seq_Knob.ctl ‏5 KB

  • Searching in non-database items

    Hi,
    I have a block of which the source is a table.
    There are some non-database item in the block.
    Actually these fields are from another table.
    In the post-query, I populate the non-database items with the table.
    My question is : normally I can use 'Enter Query' to seach the records in
    the database column. How can I perform seaching with non-database items ?
    Thanks
    Ivan

    In a pre-query trigger alter the where clause of the main block to query the main table based on non-database values...
    Use the set_block_property procedure and the 'DEFAULT_WHERE' clause or the 'ONETIME_WHERE' property...
    example...
    set_block_property('MYBLOCK', ONETIME_WHERE,
    'where main_table.id in (
    select id from my_non_db_block_table where mycol = :my_non_db_field)');
    To accept wild cards you will probably have to change the = to a "like" above..
    You will have to build your where clause by adding a "and" condition for each non-db field.
    Message was edited by:
    Mark Reichman

  • Setting Negative Forecast Values to Zero

    In 7.0 we used a option - Setting Negative Forecast Values to Zero.
    But after upgrade to 7.3 this option is missing and I can find any information about this.
    Can we open the option in 7.3?
    Anatoly

    Hi,
    thanks for your reply.
    mls qos
    interface GigabitEthernet3/34
    description *** DATA VLAN 35 - VOICE VLAN 34 ***
    switchport
    switchport trunk native vlan 36
    switchport trunk allowed vlan 34,36
    switchport mode trunk
    mls qos trust dscp
    no cdp enable
    spanning-tree portfast trunk
    If i don't include the global 'mls qos' command then the voice packets keep the dscp 46 value.  If I add the mls qos command this causes the switch to set the dscp values to zero.
    Thanks again 
    ps.  there are some other mls commands on the switch... i don't know if these could interfere but they were already on there so i'm reluctant to remove them..

  • Set the value of a non database field in forms

    hai friends ,
    Have been struggling a lot with the problem now . Could anyone suggest me how to go about it.
    I want to set the value of a field in a form . I know the function set_value and set_value_as_(data type ) does the work . But then is there any constraint on the position where it is called.
    My requirement is on querying a form the data from the tables mut be populated( which the portal handles) and I want to populate the non database bound fields with certain values.
    Could any one help me out with this ..
    null

    I need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
    Or have the servlet that created that request attribute take care of that requirement.

  • How do I set an Apex mulri-row reports form value for the specifc current row using Javascript?

    I have a multi-row region based on a table in which I have two particular columns of interest.  The first has an LOV defined for which I have set up a pick-list of codes associated with the item's status as "OK" or having some problem, for which there are a small number of set codes associated.  Most rows will be OK, but when there is a problem, the pick-list will be used.
    When that pick list has been used, there is an optional "comments" column that can be filled in.  I want my screen to dynamically enable/disable a pushbutton that links to the comment based on the code.  This being row-based, the push-button needs enabling or disabling by row, not as a whole "conditional column".  That bit is ok, I think, but I don't know and can't find the syntax for how within the javascript onchange function I set the current row value for a different column to the one that triggered it.
    My header function (that doesn't work) is going to be something like this (where the status column LOV having a value = 6 means "OK").  Note I'm using alert for a debug mechamism.  The $s line is my failed attempt to set he column value, here with a hard-coded string "Changed COMMENTS":
    <script type="text/javascript">
    function doActivateButton(object)
      if(parseInt(object.value)!='6')
        alert('It is not 6!');
        $s('#COMMENTS','Changed COMMENTS','Changed COMMENTS',TRUE);
      else
        alert('It is 6, you know!');
    </script>
    Ideally, I want any existing comments blanked if the user picks "OK" (6) as the new status, whereas for debug above I'm setting the hardcoded debug string.  You will probably also note I realise I haven't properly understood the purpose of the third parameter in the $s API.
    (This is a reports region, by the way.  A detail block, in forms-speak, with a header block above it.)
    Thanks for any assistance.
    Mark

    Sorry, versions are: Apex 4.1 on Oracle RDBMS 11.2.

  • How to upload a document with values related to document properties in to document set at same time using Javascript object model

    Hi,
          Problem Description: Need to upload a document with values related to document properties using custom form in to document set using JavaScript Object Model.
        Kindly let me know any solutions.
    Thanks
    Razvi444

    The following code shows how to use REST/Ajax to upload a document to a document set.
    function uploadToDocumentSet(filename, content) {
    appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
    hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    var restSource = appweburl +
    "/_api/SP.AppContextSite(@target)/web/GetFolderByServerRelativeUrl('/restdocuments/testds')/files/add(url='" + filename + "',overwrite=true)?@target='" + hostweburl + "'";
    var dfd = $.Deferred();
    $.ajax(
    'url': restSource,
    'method': 'POST',
    'data': content,
    processData: false,
    timeout:1000000,
    'headers': {
    'accept': 'application/json;odata=verbose',
    'X-RequestDigest': $('#__REQUESTDIGEST').val(),
    "content-length": content.byteLength
    'success': function (data) {
    var d = data;
    dfd.resolve(d);
    'error': function (err,textStatus,errorThrown) {
    dfd.reject(err);
    return dfd;
    Then when this code returns you can use the following to update the metadata of the new document.
    function updateMetadataNoVersion(fileUrl) {
    appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
    hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    var restSource = appweburl +
    "/_api/SP.AppContextSite(@target)/web/GetFolderByServerRelativeUrl('/restdocuments/testds')/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem?@target='" + hostweburl + "'";
    var dfd = $.Deferred();
    $.ajax(
    'url': restSource,
    'method': 'POST',
    'data': JSON.stringify({
    'formValues': [
    '__metadata': { 'type': 'SP.ListItemFormUpdateValue' },
    'FieldName': 'Title',
    'FieldValue': 'My Title2'
    'bNewDocumentUpdate': true,
    'checkInComment': ''
    'headers': {
    'accept': 'application/json;odata=verbose',
    'content-type': 'application/json;odata=verbose',
    'X-RequestDigest': $('#__REQUESTDIGEST').val()
    'success': function (data) {
    var d = data;
    dfd.resolve(d);
    'error': function (err) {
    dfd.reject(err);
    return dfd;
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

Maybe you are looking for

  • Connected to internet - IE and Firefox wont work

    I am connected to the internet, Safari and MSN work.  When I try to get on FireFox or IE it says my connection is being interrupted.  I had just downloaded Microsoft Office, and the problems started after that. I checked my firewall to see if that wa

  • How do you convert a negative digital image to a positive?

    When I scanned some of my slides they turned into negatives.  How can I get them back to positive images?

  • Does the entire query always have to execute?

    We have a large (100 line) query that is used for detecting bad data. The query looks like select * from table where clause1 is true -- for example, start_date is null OR clause2 is true -- end_date is null OR clause3 is true -- start_year < 1970 . 1

  • 802.1x ISE, LDAP, and OSX 10.8.2

    We are in the slow process of setting up ISE for 802.1x for all our users. Our Windows guys are working great so far with AD, but or Mac guys use their own LDAP server. I have sucessfully configured the LDAP server into ISE and I am able to authentic

  • Aperture wont launch since 10.6.5 update

    Aperture 3 wont launch. I get a message saying opening Aperture library for a few seconds then the spinning wheel shows up, then nothing.... until i click the software update button in the top left drop down, then as if by magic Aperture opens up on