How to bypass or modify  WAD initialization with javascript

Hello WAD Developers
I want to understand what happens when you load and re-load a page, because I need to invoke some logic only the first time a page is run and not each time you click someone.
I have created some javascript logic which uses a drop-down to reset a data provider - similar to the Query View Selector item except that I can take advantage of variants. Part of my solution is that I load a drop-down select box from an external list of choices. The BW data part works wonderfully. But what also happens is that my select options load EVERY TIME any event happens on the page. This means that after the data is loaded and the select box is reset, it will not show what was selected. I've tried "first-time only" logic in the function, but since the page refreshes, it's always the first time.
Any suggestions?
To show it graphically,
Here's how the dropdown boxes normally work. Let's pretend my box shows four slots:
Select a State  <== This is what you see in your box.
AL
GA
FL
If you select GA, then the next time you might see
GA           <== Now I'll see the first selected item.
FL
IN
OK
Select a State  <== Even after a selection,
AL              <== I always see this
GA
FL
What I have coded the drop-down to do is like this:
1. In the html itself, there is only one item:
Selection Goes Here.
2. After my code loads, by running a function from the <body onload>, I get:
Variant1
Variant2
Variant3  etc.
If the user selects Variant2, the next time I should see:
Variant2
But instead my code shows me:
Variant1 each time.
I have code within the function to only load the drop-down when it is in the initial state, but my debugging shows
me the initial html drop-down values are reset each time. How can I persuade bw NOT to reset this code each time?
If this is javascript DOM stuff and someone can show me that instead, I'll be greatful.
Points are awarded, and if you're in Atlanta, I'll even bring you a Coke and a candy bar.
Thanks in advance,
Doug Childs

Hi,
you could use a wrapper around your Template:
Your Template is an Iframe in a 'top'-template.
'onload' in your bw-template you could then chek the upperframe for a variable, which tells you if your function was allready executed.
Regards,
Alican

Similar Messages

  • How to draw and modify double lines with Adobe Illustrator?

    I need tot draw roadmaps. This should be easy using the pen tool, but my problem is that I cannot find a way to draw double lines with this tool. I have seen many fancy border styles and patterns. Some do have double or even quadruple lines, but the problem is than that they have an offset from the vector line and the space in between the two lines (the edges of the road) cannot be filled. Somewere I also found some pens called 'Double line 1.1' to 'Double line 1.6' but they also had an offset from the vector and I could not chance the size of the lines and the interval in between them independently.
    What I am looking for is a way to draw two lines in parallel and have the option tot fill the space in between with a color or even a pattern.
    The color and size of the lines should be changeable to make a distinction between several types of road.
    Is there an existing set of pencils for this purpose? It would be nice to be able to draw not only roads, but also railways and rivers!
    I am surely not the first person who needs to do this?
    I use AI version 6

    Jacob,
    Thanks for the answer. I have been searching for a solutions for a long
    time, but today I found the solution on a forum (not on this one). That
    solution is exactly as you described below, i.e. using a coloured line and a
    narrower white line on top of the first one. My problem was that I did not
    know how to create a custom brush based on the two lines. Now I know how to
    do that. However, I still have the problem. I can now draw double lines and
    I can change the color of the background line (the coloured one) but I
    cannot change the white colour of the narrower line. I assume that I have to
    completely redefine a new brush when I need to change that colour too.
    Regards,
    Rob Kole
    Van: Jacob Bugge [email protected]
    Verzonden: donderdag 28 maart 2013 17:04
    Aan: RKOLE
    Onderwerp: How to draw and modify double lines with Adobe
    Illustrator?
    Re: How to draw and modify double lines with Adobe Illustrator?
    created by Jacob Bugge <http://forums.adobe.com/people/Jacob+Bugge>  in
    Illustrator - View the full discussion
    <http://forums.adobe.com/message/5186535#5186535

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How do I redirect to a URL with JavaScript on submit in Adobe LiveCycle

    How do I redirect to a specific URL with JavaScript upon submit in Adobe LiveCycle?
    I already have the code in place where the submit event is handled, and just need the specific code to do the redirect.
    Standard asp.net-style redirects such as
    windows.location.replace(http://myURL.com);
    do not work.
    Any help would be appreciated.

    To be able to redirect a website with a submit button, you must have a custom submit button and insert the following line:
    app.launchURL("www.url.com");

  • Modify hbj:tableView with JavaScript

    Hi forum-team,
    does anyone know if it is possible to modify the contents of a hbj:tableView-Cell with JavaScript (e.g. modify the text within a cell)?
    I only found some getClickedRow methods within the JavaScript API.
    Regards,
    Frank

    Hi,
      I can't get a code for this but can guide you.
    There is onClientCellClick event for tableview which can be used for this. You will have to implement separate methods for each cell click, I hope. Also this is a classlib and not taglib. Check the documentation for more info on this.
    http://help.sap.com/saphelp_nw70/helpdata/en/fd/01f34026d70b06e10000000a155106/frameset.htm
    Also check these.
    onClientRowSelection for tableView's
    onClientCellClick in htmlb tableview
    Regards,
    Harini S

  • When I initialize Firefox Bing comes up as he Search Engine in the Search box. How can I change this to initialize with a different search engine? Thank you.

    When I initialize Firefox Bing comes up as the Search Engine in the Search box. I know I can pull down to get others. Is there someway for me to specify Google as the one displayed when Firefox initializes? Thank you.

    Remove Install Mac / Genieo/ Bing from Safari search
    http://www.thesafemac.com/arg-genieo/
    Best.

  • How to use elements in .css file with javascript in the jsp

    I have a jsp in which i need to show some links with the background colour.The links depends on certain conditions which is known.But the requirement is that the background color should be grey and white alternatively. I could have hardcoded the background color with the link. But the problem is that all the links are not visible to all users. The background color is defined in the .css file. I need to check the background color for the previous link. I am declaring a boolean within a jsp and then verifying the value of that boolean( in the javascript within the same jsp) so that i could know the bckground color for previous link.but i am not able to use the element in the .css element in that javascript which is having if-else loop.It's showing an error when i tried doing this. So can some one help me out how can this be done.

    Hi Shweta,
    Refer this [wiki|https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-TableDisplayinSAPScript]
    Regards,
    Sravanthi

  • How do you update an .SWF file with Javascript

    Hello - I have this Flash map that I've created. It uses
    javascript calls from within Flash to swap out hidden DIVS when a
    user clicks on a county. When the user clicks on the zip code
    region of that map, a javascript triggers the check box.
    What I need to do now is to have a way that when a user
    unclicks the check box, the zip code region in the map will be
    unhighlighted. Essentially, I need to have javascript tell a movie
    clip within the .SWF file to goto a certain frame and stop.
    I've never done this before, so I'm seeking someone's wisdom
    on how to proceed with this.
    For a visual on what I'm describing, the file can be viewed
    here:
    http://pixegen.com/sandbox/map.html

    use the flash'es externalinterface class for two way
    communication between js and actionscript.

  • Problem on WAD Broadcasting with Javascript

    Hi Experts,
    I have some javascript code on WAD. I put the javascript code in the Script item. It works when I click "execute" icon on WAD.
    But when I broadcast this WAD report to portal. The javascript doesn't work. I check the html source, right-click  and view source on the browser, there is no any javascript code which I added could be found.
    Does anyone know what's wrong on it or any steps I miss?
    Thanks,

    This issue is solved.
    Thanks

  • Enhancing WAD template with Javascript

    hi,
    I have a requirement to draw vector lines on a scatter web item. Those lines are used as delimiters between different areas in the chart results.
    I need to draw the lines on top of the existing scatter web item.
    My question is what event i need to use when calling the JS function that draws the lines, so they will be drawn only after the web item was entirelly rendered in WAD (and not before)?
    Can someone explain?
    Many thanks,
    Xibi

    Write your script after <\Body> and <\HTML> and I think this gets executed after all the controls are drawn in your web page.
    Regs
    Gopi

  • Synchronizing Applet Initialization with JavaScript

    In reference to the thread Getting the input values in xacute query
    I want to:
    1.  pass a parameter value from an HTML form to my xacute query
    2.  not have the applet running the query run until after the HTML form's Submit button has been pressed

    David,
    I hope my response in that thread was helpful.
    Regards,
    Michael Teti

  • Replacing comma with Javascript

    Hi,
    How to replace commas in an array with Javascript???
    For eg, i have an array that contain the values 1,2,3,4.
    Here i want to remove the comma. So the solution i am looking for is
    1234.
    How to do this. Can we the Java functions like replace() in javascript?
    How to import the Java classes in Javascript???
    Please do provide a solution for this.
    Regards,
    M.Ananthu

    I'm not aware of any mechanism in Javascript that can help with this. In our fully-internationalized web applicaiton we choose to perform all locale-dependent validation server-side. This includes dates, numbers, currency values etc. About the only thing we check in Javscript is that required fields are filled in.
    I'd be interested in knowing if anyone has solved this in Javscript. Its possible that you could dynamically generate a Javscript validation routine based on the locale-specific formatting symbols, but we decided it wasn't worth it.
    T

  • Getting hidden value with javascript problem

    <html>
    <body>
    <form>
    <input type="hidden" id="code" value="123">
    </form>
    </html>
    when open the html file and type "javascript:alert(document.getElementById("code").value)" in the address bar, I get a message box with "123".
    but when i do in the jsp with
    <input type="hidden" id="code" value="<%=request.getParameter("code")%>">
    and type the javascript in the address bar, i get "object not supported".
    Can anyone tell me how to get hidden value in jsp with javascript?
    thank you.

    There is no difference between a JSP or plain html, since javascript executes on the client side after the JSP is done processing. There is obviously something wrong with the HTML content after you input the request value, so check the generated HTML in your browser to see if there are any unwanted quotes in there or something.

  • How do I unlock an iPhone 4 with iOS 7 and bypass the activation lock?

    How do I unlock an iPhone 4 with iOS 7 and bypass the activation lock? I can't find the previous owner and I really want to use my new iPhone, I did purchase it Second-Handed.and now I'm stuck. Ive tried recovery mode and nothing still restores and asks me the same thing. Been working on this forever- Please Help!

    If you want to risk your money, fine. 
    To answer your questions
    Is this just an iOS 7 feature?
    Yes, Activation Lock is an iOS 7 feature.
      Could you not restore the device to an earlier version?
    No, you cannot downgrade your iOS device.
    That may mean jailbreaking, I'm not sure.
    Jailbreaking is not supported by Apple or this forum.
    Or what about replacing the motherboard?
    There are no user serviceable parts on an iPhone.

Maybe you are looking for