Adding items to a selectOneListbox from Javascript

In my JSF page I have...
<h:form id="alternateDeviceSelectForm">
    <h:selectOneListbox id="selectBox"/>
    <h:commandButton id="okButton" value="#{i18n.ok}" action="#{aBean.anActionMethod}"/>
</h:form>I also have this Javascript...
for (var i=0; i < devices.length; i++) {
    var device = devices;
// a String
var id = device.getId();
// another String
var displayName = device.getDisplayName();
this.selectBox.options[i] = new Option(displayName,id);
This creates the listbox and when the Javascript method fires, the appropriate items are listed in as list items.  However, when I hit the OK button, I get a JSF message about a validation error.  I'm not using any custom validation at all.
Here's the error message I get... "alternateDeviceSelectForm:selectBox: Validation Error: Value is not valid"
Any ideas on how I can get this working?  (I have to get the listbox item values from Javascript because that is the interface to a browser plugin that is involved in this process.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

dalearyous wrote:
the only thing is there is no data to begin with. after you choose the data structure there is a text field to type in something like apple and then you click add. then you can type in something like pear and click add.If you do it right, the part that controls the data structures won't need to directly interact with the part that adds/removes the elements in the data structures -- they'll be independent units. That's what we call "orthogonal", and it helps make programs much easier to develop and maintain. To do that, you have a common set of add/remove operations across all data structures -- just like in the Collections framework, which you should use unless your teacher is telling you that you must make your own. (And even if you do, ask your teacher if you can use the interfaces from the Collections framework, if not the implementations.)
The example I showed you supports that, in that it doesn't assume that the data structures initially contain any data. (Though it might be better to create empty Collections in your constructor, rather than ever letting existingCollection go null.

Similar Messages

  • Control the query of Content By Search web part or a Catalog-Item Reuse web part from JavaScript

    Is it possible/supported to intercept and change the query before it gets issued by a Content By Search or Catalog-Item Reuse webpart?
    I am writing a multilingual site utilizing cross-site publishing mechanism, and the out-of-box (OOB) web parts would perfectly work if not for the following requirement that I've got: I need to serve location-specific content to the end user. I have several
    versions of each content page for each geographical location, and I have tagged the pages accordingly with managed metadata keywords. I also can deduce the user's location from her browser's IP address and store it in a JavaScript variable. It is here
    where I am getting stuck: I am trying to change on the fly the queries the web parts issue in order to attach the information about the user's geographical location, unsuccessfully so far.
    I cannot rely on server-side code unless it is a cloud-hosted app code. I am about to give up and consider a custom solution alternative instead, which would be relying on Search REST API and custom client-side scripted widgets in place
    of the OOB search web parts. This seems like an expensive alternative as the entire site could have been built using the OOB web parts, if not for the location requirement.
    I would appreciate any suggestions.
    Thanks in advance,
    Ivan.

    hi
    I would check several directions:
    - in query transformation you may add keyword filter "Value of a field on the page". Documentation doesn't clearly says what "field" means here: is it only for site columns, or also may work for UI controls on the page. In second case it would solve your
    problem (it would be possible to add hidden field on the page and set value via javascript). But chances that it works like this are not high;
    - in the query settings of the Content by search web part there is setting "Loading behavior": Choose whether this query is issued on the server while the page is loading, which is better for your main content, or from the browser after the page appears.
    I.e. if you will choose 2nd option there will be a chance to intercept the query on the client side in theory. All of this requires experimenting of course;
    - by default Content by search web part sends query to /_vti_bin/client.svc/ProcessQuery with http post from client side (you may check it in fiddler). You may try to find the exact javascript function which performs the call and override it by adding additional
    conditions to the query (fortunately it is not complicated in javascript).
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Sharepoint throw a javascript error while adding items to sharepoint list

    sharepoint throw javascript error when adding item to list
    error called:  this._registeredValidators[validatorIdx].Validate is not a function
    any help please

    Hi,
    If you want to validatelist column, there is out of the box way to accomplish this with SharePoint
    There's a great blog that covers how to validate Strict Text Formats:
    http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/
    In addition, we can use JavaScript to validate column. Please make sure you use the code correctly.
    More information:
    http://chrisstahl.wordpress.com/2011/02/06/validate-a-sharepoint-list-column-with-regular-expression/
    http://blog.tallan.com/2013/09/16/how-to-add-custom-validation-logic-to-validate-a-phone-field-in-sharepoint/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Set application item from javascript?

    Hi!
    Is it possible to set an APPLICATION ITEM from javascript? If so can some one please point me to the thread, or a FAQ or an example, etc?
    Thanks!
    Dave Venus

    dvenus1,
    Sure. In the script below I check variables and populate based on what I find...
    <script language="JavaScript" type="text/javascript">
    function Populate_fld()
    var formVehicle = document.getElementById('P9_HIDE_VEHICLE').value;
    var formState = document.getElementById('P9_HIDE_STATE').value;
    var formTag = document.getElementById('P9_HIDE_TAG').value;
    var formName = document.getElementById('P9_HIDE_NAME').value;
    document.getElementById("P9_VEHICLE").value = formVehicle;
    document.getElementById("P9_TAG").value = formTag;
    document.getElementById("P9_STATE").value = formState;
    document.getElementById("P9_VISITOR_NAME").value = formName;
    if (formState = " ")
    document.getElementById("P9_STATE").value = "FL";
    </script>
    Keep Smiling,
    Bob R

  • Access page item from Javascript

    I have searched the forum, and based on my findings this is what I've done so far:
    I have a page item where the Google Map key is stored. I want to access it from Javascript so that I can call the Google map with the key. (Note: The key can't be hardcoded as it will be pulled from DB according to the environment/url the app is running on. e.g. - dev, test, production.)
    Here's a javascript code block:
    <script>
       var google_key = $x('P1_GOOGLE_KEY').value;
       var l_url = "http://maps.google.com/maps?file=api&amp;v=2&amp;key=" +
                   google_key +
                   "&sensor=false";
    </script>I have tried, $v('P1_GOOGLE_KEY') , $x('P1_GOOGLE_KEY') , &P1_GOOGLE_KEY. and none of them work.
    How do I access a page item from Javascript?
    Thx!
    Marc

    Marc,
    I am going to take a shot in the dark, but are you referencing this item outside of a function in your head tag? So basically it tries to reference the item on load? If so this is not going to work because the item does not exist yet. If you are using jQuery change your code to look like:
    $(document).ready(function(){
       var google_key = $x('P1_GOOGLE_KEY').value;
       var l_url = "http://maps.google.com/maps?file=api&amp;v=2&amp;key=" +
                   google_key +
                   "&sensor=false";
    });This will tell the javascript to fire after everything has fully loaded. If you are not using jQuery then you can use a little javascript snippet from here to add a ready event to your page. or you can copy paste this into a script tag.
    (function () {
      var ie = !!(window.attachEvent && !window.opera);
      var wk = /webkit\/(\d+)/i.test(navigator.userAgent) && (RegExp.$1 < 525);
      var fn = [];
      var run = function () { for (var i = 0; i < fn.length; i++) fn(); };
    var d = document;
    d.ready = function (f) {
    if (!ie && !wk && d.addEventListener)
    return d.addEventListener('DOMContentLoaded', f, false);
    if (fn.push(f) > 1) return;
    if (ie)
    (function () {
    try { d.documentElement.doScroll('left'); run(); }
    catch (err) { setTimeout(arguments.callee, 0); }
    else if (wk)
    var t = setInterval(function () {
    if (/^(loaded|complete)$/.test(d.readyState))
    clearInterval(t), run();
    }, 0);
    document.ready(function (){
    var google_key = $x('P1_GOOGLE_KEY').value;
    var l_url = "http://maps.google.com/maps?file=api&amp;v=2&amp;key=" +
    google_key +
    "&sensor=false";
    Good Luck,
    Tyson Jouglet

  • Pre-populating a date/time column with the value entered in the last added item

    I have a list with a column called "expected finish date". Whenever the user adds the very first item in a list, he/she should have to enter a value for this column.
    I want to make all new item entries to pre-poplate this field with the value entered in the previously added item. This way, he/she wont have to re-enter the date every time (which rarely changes). How can this be done?

    could create a second list ("state") with column ("default finish date")...
    create a workflow on main list... if column is blank/empty, pull from second list... otherwise, update second list with the value that was entered.
    Or, customize the form (InfoPath or JavaScript)
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • ADD ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO

    I WANT TO ADD ITEMS  THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
    AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
    SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
    PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
    INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORM

    Hi Praveen,
    Your form is not shared so I have not been able to access it.  But I have updated mine.  There are now two approaches, one that follows on from the above method and updates each drop down list in each row.  The second updates a separate dataset that the drop down list is bound to.  This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain.  The add button click code is;
    var particulars = xfa.datasets.resolveNode("particulars");
    if (particulars === null)
        particulars = xfa.datasets.createNode("dataGroup","particulars");
        xfa.datasets.nodes.append(particulars);    
    var particular = xfa.datasets.createNode("dataValue","particular");
    particular.value = ItemName.rawValue;
    var boundValue = xfa.datasets.createNode("dataValue","id");
    boundValue.value = BoundValue.rawValue;
    particular.nodes.append(boundValue);
    boundValue.contains = "metaData";
    // find sorted position to insert
    for (var i = 0; i < particulars.nodes.length; i++)
        p = particulars.nodes.item(i);
        if (p.value > particular.value)
          particulars.nodes.insert(particular, p);       
                 break;
    // add to end if greater than all existing items
    if (particular.parent === null)
        particulars.nodes.append(particular);
    // clear source fields
    ItemName.rawValue = null;
    BoundValue.rawValue = null;
    // remerge form data to pick up new item
    xfa.form.remerge();
    And the binding looks like;
    I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
    Regards
    Bruce

  • How to get latest flash player version from javascript code

    Hello,
    I want to know the latest flash player version number programmatically to compare with currently installed flash player version.
    I have requirement in which i need to show message to user when installed flash player version < latest flash player version.
    there is no API offlash player available which we can call to get the latest flash player version.
    We tried to do webscrapping of adobe site which prints version number but we need to do this from javascript.
    Is there any way through which we can come to know wether our installed flash player version is older than latest flash player released version?
    Please help..
    Thanks
    Dhwani

    It's in the Global Settings Manager in the Control Panel (Windows) or System Preferences (Mac), but I'm unaware of a javascript you can create to do this independent of a Flash container.
    The best you can do would be to create a web page with the expressInstall.swf and swfobject_modified.js added to a Flash container in the page. While that won't give a detailed (installed vs new) indication, it WILL prompt for an update if the current version is higher than the installed version.
    You'd then have to add the webpage to startup items, so the end user would see it on login.

  • Set Stroke Alignment from JavaScript

    Hi,
    I'm trying to set the stroke style for a path item I've drawn through JavaScript, however I can't find a way to set the stroke alignment for my path item.
    I've checked the Illustrator JavaScript reference but I can't seem to find that option in there.
    I would expect something like:
    pathItem.strokeAlignment = StrokeAlignment.OUTSIDE; // This doesn't work, what is the correct way to set the stroke alignment from JavaScript?
    If I change the option in the Actions Panel it comes up as 'Set Stroke/Alignment: Outside', so there must be an equivalent way of setting it from JavaScript.
    Is there a way of converting Actions to JavaScript so you can see which properties and attributes are being set on the object?
    Does anyone know the correct way to set the strok alignment from JavaScript?
    Thanks!

    You can only call an action from JavaScript in CS6… (I don't have this). Up until then it was AppleScript and Visual Basic only…
    Document raster effects you do have access to…
    Class
    RasterEffectOptions
    The document raster effects settings.
    Class
    Property
    Type
    Access
    Description
    antiAliasing
    bool
    r/w
    Should the resulting image be antialiased. (default: false)
    clippingMask
    bool
    r/w
    Should a clipping mask be created for the resulting image. (default: false)
    colorModel
    RasterizationColorModel:
    RasterizationColorModel.DEFAULTCOLORMODEL
    RasterizationColorModel.GRAYSCALE
    RasterizationColorModel.BITMAP
    r/w
    The color model for the rasterization. (default: RasterizationColorModel.DEFAULTCOLORMODEL)
    convertSpotColors
    bool
    r/w
    Whether to convert all spot colors to process colors in the resulting image. (default: false)
    padding
    number
    r/w
    The amount of white space (in points) to be added around the object during rasterization. (default: 0)
    resolution
    number (range: 72.0 - 2400.0)
    r/w
    The rasterization resolution in dots-per-inch (dpi) (default: 300)
    transparency
    bool
    r/w
    Should the resulting image use transparency. (default: false)

  • SSRS 2008 Work order Report , when added item descriotion , somehow costgroup id is not working , donot know why, ( need help)

    SSRS 2008 Production orders created report, when I added item description some how cost group id is not working ,
    my costgroup id did not break into labor , only Mat Cost showed in the total,
    my query is as below,  did I link the wrong field,   I want to show Labor total also
    can some one suggest what I did wrong .
    any advise will be great
    SELECT        PRODTABLE.PRODID, PRODCALCTRANS.COSTGROUPID, PRODTABLE.QTYCALC, PRODTABLE.PRODSTATUS, PRODCALCTRANS.COSTAMOUNT,
                             PRODCALCTRANS.COSTMARKUP, PRODCALCTRANS.REALCOSTAMOUNT, PRODCALCTRANS.CALCTYPE, PRODTABLE.DATAAREAID, PRODCALCTRANS.KEY3,
                             PRODCALCTRANS.CONSUMPVARIABLE, PRODCALCTRANS.REALCONSUMP, PRODTABLE.ITEMID, PRODTABLE.SCHEDDATE, PRODTABLE.FINISHEDDATE,
                             PRODCALCTRANS.KEY1, PRODCALCTRANS.TRANSDATE, PRODCALCTRANS.QTY, PRODCALCTRANS.KEY2, PRODCALCTRANS.COLLECTREFLEVEL,
                             PRODCALCTRANS.LINENUM, INVENTTABLE.ITEMNAME, INVENTTABLE.ITEMID AS Expr1, PRODTABLE.INVENTTRANSID
    FROM            PRODTABLE INNER JOIN
                             PRODCALCTRANS ON PRODTABLE.PRODID = PRODCALCTRANS.PRODID AND PRODTABLE.DATAAREAID = PRODCALCTRANS.DATAAREAID INNER
    JOIN
                             INVENTTABLE ON PRODCALCTRANS.DATAAREAID = INVENTTABLE.DATAAREAID AND PRODCALCTRANS.KEY1 = INVENTTABLE.ITEMID
    WHERE        (PRODTABLE.PRODSTATUS = 7) AND (PRODTABLE.DATAAREAID = N'AR1') AND (PRODTABLE.ITEMID = @itemid) AND
                             (PRODTABLE.FINISHEDDATE >= @Paramfromdate) AND (PRODTABLE.FINISHEDDATE <= @Paramtodate) AND (PRODCALCTRANS.COLLECTREFLEVEL
    = 1) AND
                             (PRODCALCTRANS.CALCTYPE >= 0)

    Hi Bitia,
    As per my understanding, after you add Item field to the report, it does not calculate total of matl group, right? If that is the case, please refer to the following steps to troubleshoot the problem:
    Modify the dataset used to retrieve data, delete the fields will not be used in the report.
    Run the query in SQL Server Management Studio (SSMS) to make sure that there is data for matl cost group.
    Make sure that row group and totals are correctly added.
    In addition, do you want to add Finished date to page header? If that is the case, we can use ReportItem to achieve the goal. Please refer to the following steps:
    In design surface, right-click the report and click Insert, then click Page Header.
    Drag Text Box from Toolbox to page header.
    Right-click inside of Text Box, then click Expression.
    In the expression text box, type the code like below:
    =ReportItems!FinishedDate.Value
    If the problem remain unresolved, please provide the screenshot of the report in design view, the following screenshot is for your reference:
    Reference:
    ReportItems Collection References
    Adding Grouping and Totals
    Thanks,
    Wendy Fu

  • How to get FindAgain & FindPrevious from javascript OR other options

    Hi All, I'm trying to use the 'SearchResults -> Next Hit [Old]     'SearchSubmenu -> FindAgain' [New]
    Out of all these: Find | FindSearch | SearchSubmenu | FindAgain | FindPrevious
    Only 'Find' and 'FindSearch' works from javascript - None of others worked on Adobe 9 Pro:
    For example: app.execMenuItem("FindAgain") did not work and no errors on debugger,
    Please let me know, how I will be able to get to the next search item and previous search item from app.execMenuItem
    I even tried these two to include with priv restrictions: app.beginPriv(); app.execMenuItem("FindAgain"); app.endPriv();
    ========================================================================================
    I'm attaching the zip file that contains the two required files to view a pdf in a browser through html.
    History: I'm working on this to help a old aged home where they have touch screens and it is very difficult for some to identify a pdf tool bar buttons or use their pdf's efficiently.
    So, I was thinking about it for over six months and started two weeks back to really help them. Though I did not expect that it is going to make me purchase pdf 9 pro. I did. But, even after that with all these hours working on this, I could not get this working.
    I got few samples from Jeff's:    http://www.adobe.com/devnet/air/ajax/quickstart/scripting_pdf.html
    I did use these files and trying to get that only feature which is 'Find Next' and 'Find Previous'. In fact tried almost all 'AcroSrch.....  es
    In the html, I have hard coded a search string 'lorem' with #search=lorem..., I plan to get a new search string from other html page. I will do it later.
    As per Jeff, I had that 'Edit java Script' inlcuded in the pdf file.
    If you get a chance please check the attachment. (Open test.html in the browser)
    IS THERE ANY OTHER WAY IN THIS WHOLE WORLD TO GET THIS 'FIND NEXT' and 'FIND PREVIOUS' to work? OR ANY OTHER IDEAS THAT WOULD GET THIS WORKING. THANKS A LOT. OR ATLEAST IN OLDER VERSIONS, IF POSSIBLE, ANY IDEAS THAT WOULD BE MOST WELCOME
    ========================================================================================
    if you can think of any ideas which can make this happen, it can be any even to buy some additional software or option to add some buttons in pdf itself that can do the job or sending the keyboard shortcuts commands like 'Ctrl+G' and 'Shift+Ctrl+G' [which does the same like 'FindNext' 'FindPrevious'] to the pdf object from the html button action would help,

    Both app.execMenuItem("FindAgain") and app.execMenuItem("FindPrevious") work just fine in Acrobat 8 Pro (from the console), but only after manually running the Find version once.
    Think about it, all that JS does is call these functions. So calling Find from JS will basically not do anything because you can't specify to it what to search for. Even typing the string you want to search for in the "find" field doesn't work.
    If you want to find words in a file using a script you will need to use getPageNthWord.

  • Error Message while adding Item in Item Master Data- [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting the nvarchar value 's008 01' to data type int. (CINF)

    Dear Experts
    I am getting the following error message while adding item in Item Master data. I have modified the following SBO_SP_transactionNotification in SQL server after that could not able to add the item
    ALTER proc [dbo].[SBO_SP_TransactionNotification]
    @object_type nvarchar(20),                      -- SBO Object Type
    @transaction_type nchar(1),               -- [A]dd, [U]pdate, [D]elete, [C]ancel, C[L]ose
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255),
    @list_of_cols_val_tab_del nvarchar(255)
    AS
    begin
    -- Return values
    declare @error  int                       -- Result (0 for no error)
    declare @error_message nvarchar (200)           -- Error string to be displayed
    select @error = 0
    select @error_message = N'Ok'
    --    IF @OBJECT_TYPE = '59' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
      BEGIN
       IF EXISTS(
        SELECT T0.Price FROM IGN1 T0
        where  IsNull(T0.Price, '0') = '0' and T0.DocEntry = @list_of_cols_val_tab_del)
       BEGIN
        SELECT @ERROR=1,@ERROR_MESSAGE='Please insert the price !'
      END
    end
    -- Select the return values
    select @error, @error_message
    end

    Hi Rathna,
    Just put the SP like this, without the -- before the IF. A -- marks the line as a command therefore you need to uncomment and it will work.
    IF @OBJECT_TYPE = '59' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
      BEGIN
       IF EXISTS(
        SELECT T0.Price FROM IGN1 T0
        where  IsNull(T0.Price, '0') = '0' and T0.DocEntry = @list_of_cols_val_tab_del)
       BEGIN
        SELECT @ERROR=1,@ERROR_MESSAGE='Please insert the price !'
      END
    end
    Hope it helps

  • Calling1.4.1 signed applet from Javascript causes keyboard/focus problems

    Pretty sure there's a JRE bug here, but I'm posting to forums before I open one in case I'm missing something obvious :-)
    This issue may be specific to IE, I haven't tested elsewhere yet. Our web application is centered around a signed applet that is initialized with XML data via Javascript. We first noticed the problem when our users started upgrading from the 1.3.x plug-in to the 1.4.x plug-in. The major symptom was that shortcut keys stopped working. I debugged the problem off and on for about a month before I boiled it down to a very simple program that demonstrates the issue (included below). Basically, the program has a function that adds a JButton to a JPanel and registers a keyboard listener (using the new DefaultKeyboardFocusManager class) that prints a message to the console. This function is called by the applet's init() method, as well as by a public method that can be called from Javascript (called callMeFromJavascript()). I also included a very simple HTML file that provides a button that calls the callMeFromJavascript() method. You can test this out yourself: To recreate, compile the class below, JAR it up, sign the JAR, and put in the same dir with the HTML file. Load the HTML file in IE 5.0 or greater, and bring the console up in a window right next to it. Now click the button that says init--you should see the small box appear inside the button that indicates it has the focus. Now press some keys on your keyboard. You should see "KEY PRESSED!!!" appearing in the console. This is proper behavior. Now click the Init Applet from Javascript button. It has removed the button called init, and added one called "javascript". Press this button. Notice there is no focus occurring. Now press your keyboard. No keyboard events are registered.
    Where is gets interesting is that if you go back and make this an unsigned applet, and try it again, everything works fine. This bug only occurs if the applet is signed.
    Furthermore, if you try it in 1.3, signed or unsigned, it also works. So this is almost certainly a 1.4 bug.
    Anyone disagree? Better yet, anyone have a workaround? I've tried everything I could think of, including launching a thread from the init() method that sets up the components, and then just waits for the data to be set by Javascript. But it seems that ANY communication between the method called by Javascript and the code originating in init() corrupts something and we don't get keyboard events. This bug is killing my users who are very reliant on their shortcut keys for productivity, and we have a somewhat unique user interface that relies on Javascript for initialization. Any help or suggestions are appreciated.
    ================================================================
    Java Applet (Put it in a signed JAR called mainapplet.jar)
    ================================================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainApplet extends JApplet implements KeyEventDispatcher
        JPanel test;
        public void init()
            System.out.println("init called");
            setUp("init");
        public void callMeFromJavascript()
            System.out.println("callMeFromJavascript called");
            setUp("javascript");
        private void setUp(String label)
            getContentPane().removeAll();
            test = new JPanel();
            getContentPane().add( test );
            JButton button = new JButton(label);
            test.add( button );
            test.updateUI();
            DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
        public boolean dispatchKeyEvent(KeyEvent e)
            System.out.println("== KEY PRESSED!!! ==");
            return false;
    }================================================================
    HTML
    ================================================================
    <form>
    <APPLET code="MainApplet" archive="mainapplet.jar" align="baseline" id="blah"
         width="200" height="400">
         No Java 2 SDK, Standard Edition v 1.4.1 support for APPLET!!
    </APPLET>
    <p>
    <input type="button" onClick="document.blah.callMeFromJavascript();" value="Init Applet via Javascript">
    </form>

    I tried adding the requestFocus() line you suggested... Same behavior.
    A good thought, but as I mention in my description, the applet has no trouble gaining the focus initially (when init() is called). From what I have seen, it is only when the call stack has been touched by Javascript that I see problems. This is strange though: Your post gave me the idea of popping the whole panel into a JFrame... I tried it, and the keyboard/focus problem went away! It seems to happen only when the component hierarchy is descended from the JApplet's content pane. So that adds yet another variable: JRE 1.4 + Signed + Javascript + components descended from JApplet content pane.
    And yes, signed or unsigned DOES seem to make a difference. Don't ask me to explain why, but I have run this little applet through quite a few single variable tests (change one variable and see what happens). The same JAR that can't receive keyboard events when signed, works just fine unsigned. Trust me, I'm just as baffled as you are.

  • What is the best way to call a pageflow action from JavaScript?

    What is the best way to call a pageflow action from JavaScript?
    Thanks,
    John

    John,
    How would I do this from a grid??? Unfortunately there are no JavaScript attributes
    on any of the grid tags that I can see.
    Thanks,
    John
    "John H" <[email protected]> wrote:
    >
    Thanks John!
    "John Rohrlich" <[email protected]> wrote:
    John,
    If you want to put up a confirm dialog before calling an action from
    an
    anchor it is done as follows.
    Here is an example from code of mine that deletes a customer order,if
    the
    user confirms the delete. I pass the order id as a parameter.
    - john
    Here is the JavaScript -
    function confirmDelete() {
    if(confirm('Continue with order delete?'))
    return true;
    else
    return false;
    Here is a sample anchor tag -
    <netui:anchor action="requestToDeleteOrder" onClick="return
    confirmDelete(); return false;">
    Delete
    <netui:parameter name="orderId" value="{container.item.orderId}"/>
    </netui:anchor>
    "John H" <[email protected]> wrote in message
    news:402138f5$[email protected]..
    Thanks for the replies. I figured it was going to require buildingmy own
    url
    to call the action. I had hoped there was an easier way to do it.Rich,
    the
    reason I want to do this is because I want to call the JavaScript
    function
    confirm()
    when a user clicks on a link (in a repeater/grid) to drop a record,I only
    want
    to call the drop action if the user confirms the drop. Maybe thereis a
    better
    way to do what I am trying to do??? I really appreciate any help
    you
    guys
    can
    give me on this, I am pretty new to this sort of stuff.
    Thanks,
    John
    "Rich Kucera" <[email protected]> wrote:
    "John H" <[email protected]> wrote:
    What is the best way to call a pageflow action from JavaScript?
    Thanks,
    JohnTry figuring out the URL to the pageflow action, create a hidden
    form
    in the
    page, then use JS to submit the form. Why would you want to though,
    isn't
    the server going to want to send you to the next page?

  • Classic PO Creation with Bidder added items

    Dear Experts,
                We are using SRM Bid Decoupled scenario. The Bidder logins to SUS system and responds to RFx. I have maintained the product category
    in the SUS system.
    Consider a scenario,  A RFx respondent will login to SUS --> access RFx--> Create Response --> Add few item (Item type : Material) in the RFx response, wit mentioning only Product category, UOM, quantity and price.
    When such RFx response is being awarded with PO, the Classic PO is failing in the ECC with error "Enter Material or account assignment details"
    Is this the standard feature in Classic Bid Decoupled Scenario? Is there a way to avoid this?
    Thanks,
    Krishna

    Hi krishna,
    I think same  product category should exist in ERP system also.
    Please see the note 1476447
    The following information should be considered, if you are planning to use 'Add items from catalog ' functionality in RFx/RFx response :
    1. When bidder selects items from MDM catalog in an RFx response, delivery date will be taken as current date. The delivery date is not visible and cannot be changed.
    2. Items are not added when bidder tries to add items of product categories from different logical systems in an RFx response.
    3. An error message is displayed when purchaser adds items of product categories from different logical systems in an RFx but items are added. Purchaser can correct the items to ensure that only items from one logical system are in a hierarchy.
    4. Bidder cannot add an item with blank product category in RFx response.
    The following checks are made in RFx/RFx response to ensure correct data entry:
    1. RFx/RFx response shall contain items with product categories from one logical system only within a hierarchy.
    2. In MM-SRV hierarchy, only backend ERP product categories are allowed.
    Best regards,
    Rohit

Maybe you are looking for

  • Unable to connect to the CDDB using iTunes 10.6.1.

    When I put my CD in and try to get the track names, I get this error: Unable to connect to the CDDB server. the network cannot be reached. The internet is fine, I checked the firewall and I unistalled/ reinstalled iTunes, but this error keeps popping

  • Fraudulent Skype Charge to Credit Card

    At least once a week, I review my credit card charges posted to my account.  Today, I noticed a charge for $25 posted by Skype Communications initiated on Jan 7, 2015.  I do have a Skype account; however, there is no billing information on file nor h

  • International input on Linux

    Hello, I have a problem with flash player on linux. It's working great except that it's impossible to enter text in any encoding other than latin. It can display unicode text but when you try to enter text in greek it is displayed in weird characters

  • Windows 7 64bit doesn't recognize the USB External HDD Stor E art 3.5"

    I purchase the External HDD Stor E art 3.5" and pass a few days the windows don't recognize the HDD. Try to connect the drive to other 2 USB ports and nothing happen. Use a USB pen drive to see if was a problem with the USB ports but all 3 are OK. Tr

  • Flash player shows disabled or activeX enabled when neither is the case. Constant pop-ups.

    I have a dual Pentium Compaq Presario SR5310F running Windows 8 and am besieged with pop-ups asking me to upgrade flash, video player, etc.