Determine if an element has the focus

Hello

I think that the subject is quite explanatory.

With the help of C++, I need to know if a particular TextField had the focus. I have a function that is associated with the event "onTextChanging" of many TextFields.

I see that I must manually set the new text, I'm taking as a reference the example of speed writer. But how can I decide which one is right?

I have not tried this in stunts, but Qt if you have a manager of signals in C++, you can call sender().  You try to do it from C++ or javascript?

Stuart

Tags: BlackBerry Developers

Similar Questions

  • Is there a way to make it clear which window has the focus on a multi-monitor Windows system?

    If there is nothing that makes me want to pick up my computer and throw it out the window, sound when a window that I just didn't have the focus starts to respond to commands, I type in another window I had focus; only to find out that I made a mistake. Yes, finally I'm the one to blame. I get that. But man, when I do something like watch a video of Pluralsight on a monitor, and I try to duplicate the code in Visual Studio on another monitor and find that instead I issue commands to control video Pluralsight, that really frustrates me! And unfortunately I too often do, so my reason to post this question.

    Thus it is possible, some settings I can do in Windows, so that when any window had the focus more visually obvious sound? Of course, I still want to be able to read another window on the same screen or on another monitor, but I just want to be able to see, at a glance, that for example the browser with Pluralsight video controller window now has the focus, not my instance of Visual Studio. Something like the title of windows is perhaps more "BOLD", or a different color or anything to make it obvious.

    Hello

    Thanks for posting your query in Microsoft Community.

    Your question is beyond the scope of what is generally answered in this forum of consumer and would be better suited for the IT Pro in MSDN public.

    Please post your question in the Forum MSDN.

  • Assignment of an element of the application when an element loses focus

    I'm trying to implement this feature in my APEX application:
    When the user enters a value in a text element loses focus, a RadioGroup on the form should be greyed out.
    But the problem is that I need to access the value of the RadioGroup so that the code which is then executed to work properly, but that the value is therefore more accessible if the RadioGroup is disabled.
    So I thought that if I put the value of the Radio group in an application-level element before I turn it off, the code can access the value.
    But how can I do this? It must arrive at the point where a value is entered in the text element and the focus is lost.
    But, as far as I know, the only thing I can implement at this time there is an onblur statement that calls a Javascript function.
    And I don't think I can assign a value to a javascript application-level item, can I?
    Bottom line: I need a way of executing the command
    : F100_Category: =: P1_Category (where P1_Category is the RadioGroup) - what it does to a place in time.
    Any ideas?

    'FALSE' must be all lowercase as 'false '. Without the quotes are necessary

    CITY

    Published by: City aissaoui on December 10, 2008 11:07

  • FTP has the syndrome of 'follow the pot '.

    I know it sounds strange, but on my mac FTP transfer unless I look at it, so to speak.

    I start a ftp download, it starts to go. As long as my ftp client is the focus of the window, it passes very well.

    Then I slide on to a new space and start browsing the web. When I slide back 5 minutes later to check on the progress, the download is "blocked". As soon as my ftp client has the focus of the window once again, the client reconnects to the server and resume the download.

    In this case each. unique. time. It's frustrating, because I can not observe the behavior. Downloads are perfectly fine if the window has focus.

    I tried Yummy, Transmit, CyberDuck, all exhibit the same behavior, believe it or not, so I guess that OSX is to blame. The network does not know that I went to spaces or apps, so it cannot be ISP or server related.

    I don't know even where to start with this one. Is there any function in El Capitan, which would suspend a ftp session once the customer loses focus of the window?

    It is probably 'an app package' in action...  OS X El Capitan: Nap App

    There is an easy way to disable this behavior by app: method to properly disable App Nap for specific Applications

    But not all applications show this option by CBS. For those who are not I have found this solution, but have not tried myself: https://www.reddit.com/r/mac/comments/3xnaqi/disabling_app_nap_for_specific_apps _on_el_capitan /

  • Tab behavior of the focus in the search of selected text

    In versions previous to Firefox, when I selected some text on a Web page, right click on the text for the menu popup and click on the option 'Search' (search Google for "my text selection") tab that currently has the focus would stay focused and a new tab would be launched to manage appropriate search in the background. Since I updated to Firefox 13, the new tab now receives focus when I do a search on the selected text.

    How can I switch to the old behavior? This change in functionality is driving me crazy. When you read a Web page, I often like to select words and phrases I need to learn more and search Google or Wikipedia via the context menu. I almost always like to finish reading the current page before going off to read the new tabs. Even if I did intend to stop reading the current page, and go to the new tab, there are often several seconds to ensure that the new tab to load and I prefer to keep the page being read and manually switch the new tab that watching a blank tab while I wait for it to load.

    In the "Tabs" window tab options, there is a check box for "When I open a link in a new tab, switch to it immediately." Is there something like that for the new tabs launched by a search from context menu?

    Thank you!

    Hey bob, you can enter Subject: config in the address bar of firefox, confirm notification of information (where it appears), search for the preference named browser.search.context.loadInBackground & switch true by double-clicking it. that should bring back the old behavior...

  • How BasiEditField The Focusable makr

    I have my BasicEditField, based on the condition, my basicEditField, values must be based on the condition of changeed

    for example if cond == 0

    My basicEditField, values must be changeed

    on the other

    My basicEditField, the values must not be changeed

    How to achieve this, the value of does not have to be changed to remove the focus or someother thing avaiable

    How to do

    Hi, I got the output, just used even the basiceditfield, after that the condition, so it has the focus, once I deleted it, it worked, thanks for the help

    Error code

    Switch (CTR)
    {
    case CreateView.TYPE_PREDEFINED:
    {
    This.Add (new LabelField ("1"));
    This.log_method.setEditable (true);
    break;
    }
    case CreateView.TYPE_CUSTOM:
    {
    This.Add (new LabelField ("case2"));
    This.log_method.setEditable (false);
    break;
    }
    }

    This.log_cal. SetText (String.valueOf (res)); - this line is the problem, I let him know

    This.Invalidate ();

    Error code:

    He worked after changing the line below

    This.log_cal. SetText (String.valueOf (res));

    Switch (CTR)
    {
    case CreateView.TYPE_PREDEFINED:
    {
    This.Add (new LabelField ("1"));
    This.log_method.setEditable (true);
    break;
    }
    case CreateView.TYPE_CUSTOM:
    {
    This.Add (new LabelField ("case2"));
    This.log_method.setEditable (false);
    break;
    }
    }

    This.Invalidate ();

    anyway thanks for the help

  • iMac hangs after update of recent software - "an element of the liberated area has been modified in the area of pipe.

    I have an iMac 21.5 "2009 end which I never had no problem with. It is Yosemite 10.10.5 running and after a recent software update has become very unstable. After I restarted recently he crashed 5 times a day. It seems to be the internet causing the problem (I use Google and Safari and had adbloc on Google).

    This is a copy of the last problem report. Any help would be appreciated.

    Anonymous UUID: 7DBCDA8C-8FD9-63FE-7843-971A36805010

    Mar 22 19:13:35 dec 2015

    Panic report *.

    panic (cpu 0 0xffffff800c76bf7d appellant): "an element of the liberated area has changed in the area of pipe: expected 0xc0ffeeb11389b206 but found 0xc0ffeef11389b206, wicks 0 4000000000 changed x, offset 168 of 176 in the element 0xffffff801a243a70, cookies 0x3f00113109ad8bc6 0x53521947e0c1049"@/SourceCache/xnu/xnu-2782.50.1/osfmk/kern/zalloc.c:496.

    Backtrace (CPU 0), frame: return address

    0xffffff809f79bc70: 0xffffff800c72ad21

    0xffffff809f79bcf0: 0xffffff800c76bf7d

    0xffffff809f79bd60: 0xffffff800c76b9f1

    0xffffff809f79bda0: 0xffffff800c76a837

    0xffffff809f79bed0: 0xffffff800cbefd61

    0xffffff809f79bf50: 0xffffff800cc4b376

    0xffffff809f79bfb0: 0xffffff800c8344a6

    The process corresponding to the current thread BSD name: firmwaresyncd

    Mac OS version:

    14F1509

    Kernel version:

    14.5.0 Darwin kernel version: kills Sep 1 21:23:09 PDT 2015; root:XNU-2782.50.1~1/RELEASE_X86_64

    Kernel UUID: 06D286E3-A8A1-3BE7-A7EB-EAC6E0C69758

    Slide kernel: 0x000000000c400000

    Text of core base: 0xffffff800c600000

    Text __HIB base: 0xffffff800c500000

    Name of system model: iMac10, 1 (Mac-F2268CC8)

    Availability of the system in nanoseconds: 350747261770

    last load kext to 295918008027: com.apple.filesystems.msdosfs 1.10 (addr 0xffffff7f8ef37000 size 69632)

    Finally unloaded kext to 148510260291: com.apple.iokit.IOAHCIPassThrough 1.0.3 (addr 0xffffff7f8e061000 size 36864)

    kexts responsible:

    com.rim.driver.BlackBerryUSBDriverInt 0.0.68

    com Apple.filesystems.msdosfs 1.10

    com.apple.driver.AudioAUUC 1.70

    com.apple.driver.AppleHWSensor 1.9.5d0

    com.apple.driver.AGPM 110.19.6

    com Apple.filesystems.autofs 3.0

    com.apple.iokit.IOBluetoothSerialManager 4.3.6f3

    com.apple.driver.AppleOSXWatchdog 1

    com.apple.driver.AppleMikeyHIDDriver 124

    com.apple.driver.AppleHDA 272.18.3

    com.apple.driver.AppleMikeyDriver 272.18.3

    com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.3.6f3

    com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0

    com.apple.driver.AppleLPC 1.7.3

    com.apple.iokit.IOUserEthernet 1.0.1

    com.apple.Dont_Steal_Mac_OS_X 7.0.0

    com.apple.driver.AppleHWAccess 1

    com.apple.driver.AppleHV 1

    com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0

    com.apple.driver.AppleBacklight 170.7.4

    com.apple.GeForceTesla 10.0.0

    com.apple.driver.AppleUpstreamUserClient 3.6.1

    com.apple.driver.AppleMCCSControl 1.2.12

    com.apple.driver.AppleIRController 327,5

    com.apple.driver.AppleUSBCardReader 3.5.5

    com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1

    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0

    com.apple.BootCache 36

    com.apple.iokit.SCSITaskUserClient 3.7.5

    com.apple.driver.XsanFilter 404

    com.apple.iokit.IOAHCIBlockStorage 2.7.1

    com.apple.driver.AppleFWOHCI 5.5.2

    com.apple.driver.AirPort.Atheros40 700.74.5

    com.apple.driver.AppleUSBHub 705.4.2

    com.apple.driver.AppleHPET 1.8

    com Apple.nvenet 2.0.22

    com.apple.driver.AppleAHCIPort 3.1.2

    com.apple.driver.AppleUSBOHCI 656.4.1

    com.apple.driver.AppleUSBEHCI 705.4.14

    com.apple.driver.AppleRTC 2.0

    com.apple.driver.AppleACPIButtons 3.1

    com.apple.driver.AppleSMBIOS 2.1

    com.apple.driver.AppleACPIEC 3.1

    com.apple.driver.AppleAPIC 1.7

    com.apple.driver.AppleIntelCPUPowerManagementClient 218.0.0

    com Apple.NKE.applicationfirewall 161

    com Apple.Security.Quarantine 3

    com.apple.security.TMSafetyNet 8

    com.apple.driver.AppleIntelCPUPowerManagement 218.0.0

    3.10.25 com.apple.AppleGraphicsDeviceControl

    com Apple.kext.Triggers 1.0

    com.apple.iokit.IOSerialFamily 11

    com.apple.driver.DspFuncLib 272.18.3

    com.apple.kext.OSvKernDSPLib 1.15

    com.apple.iokit.IOFireWireIP 2.2.6

    com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.3.6f3

    com.apple.driver.IOPlatformPluginLegacy 1.0.0

    com.apple.driver.AppleSMBusPCI 1.0.12d1

    com.apple.driver.IOPlatformPluginFamily 5.9.1d7

    com.apple.iokit.IOUSBUserClient 705.4.0

    com.apple.driver.AppleHDAController 272.18.3

    com.apple.iokit.IOHDAFamily 272.18.3

    com.apple.iokit.IOAudioFamily 203.3

    com.apple.vecLib.kext 1.2.0

    com.apple.iokit.IOSurface 97.4

    com.apple.iokit.IOBluetoothFamily 4.3.6f3

    com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0

    com.apple.driver.AppleBacklightExpert 1.1.0

    com.apple.driver.AppleSMC 3.1.9

    com.apple.nvidia.classic.NVDANV50HalTesla 10.0.0

    com.apple.driver.AppleSMBusController 1.0.13d1

    com.apple.nvidia.classic.NVDAResmanTesla 10.0.0

    com.apple.iokit.IONDRVSupport 2.4.1

    com.apple.iokit.IOGraphicsFamily 2.4.1

    com.apple.driver.AppleUSBHIDKeyboard 176,2

    com.apple.driver.AppleHIDKeyboard 176,2

    com.apple.iokit.IOUSBHIDDriver 705.4.0

    com.apple.driver.AppleUSBMergeNub 705.4.0

    com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.7.5

    com.apple.iokit.IOBDStorageFamily 1.7

    com.apple.iokit.IODVDStorageFamily 1.7.1

    com.apple.iokit.IOCDStorageFamily 1.7.1

    com.apple.iokit.IOAHCISerialATAPI 2.6.1

    4.5.8 com.apple.iokit.IOFireWireFamily

    com.apple.driver.AppleEFINVRAM 2.0

    com.apple.iokit.IO80211Family 730.60

    com.apple.driver.AppleEFIRuntime 2.0

    com.apple.iokit.IONetworkingFamily 3.2

    com.apple.iokit.IOAHCIFamily 2.7.5

    2.2.9 com.apple.driver.NVSMU

    com.apple.iokit.IOHIDFamily 2.0.0

    com.apple.iokit.IOSMBusFamily 1.1

    com Apple.Security.sandbox 300.0

    com.apple.kext.AppleMatch 1.0.0d1

    com.apple.driver.AppleKeyStore 2

    com.apple.driver.AppleMobileFileIntegrity 1.0.5

    com.apple.driver.AppleCredentialManager 1.0

    com.apple.driver.DiskImages 398

    com.apple.iokit.IOReportFamily 31

    com.apple.driver.AppleFDEKeyStore 28.30

    com.apple.iokit.IOUSBMassStorageClass 3.7.2

    com.apple.driver.AppleUSBComposite 705.4.9

    com.apple.iokit.IOSCSIBlockCommandsDevice 3.7.5

    com.apple.iokit.IOStorageFamily 2.0

    com.apple.iokit.IOSCSIArchitectureModelFamily 3.7.5

    com.apple.iokit.IOUSBFamily 720.4.4

    com.apple.driver.AppleACPIPlatform 3.1

    com.apple.iokit.IOPCIFamily 2.9

    com.apple.iokit.IOACPIFamily 1.4

    com.apple.kec.Libm 1

    com Apple.KEC.pthread 1

    com Apple.KEC.corecrypto 1.0

    System profile:

    Airport: spairport_wireless_card_type_airport_extreme (0x168C, 0x8F), Atheros 9280: 4.0.74.0 - P2P

    Bluetooth: Version 4.3.6f3 16238, 3 services, 27 aircraft, 1 incoming serial ports

    Crush Bus:

    Memory module: BANK 0/DIMM1, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020

    Memory module: BANK 1/DIMM1, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020

    USB device: Keyboard Hub

    USB Device: Apple keyboard

    USB device: ISight built-in

    USB device: Memory card reader internal

    USB Device: IR receiver

    USB device: USB optical mouse

    USB device: Hub BRCM2046

    USB Device: USB Bluetooth host controller

    Serial ATA Device: WDC WD5000AAKS-40V2B0, 500,11 GB

    Serial ATA Device: OPTIARC DVD RW AD - 5680H

    Model: iMac10, 1, IM101.00CC.B00 of BootROM, 2 processors, Intel Core 2 Duo 3.06 GHz, 4 GB, MSC 1.52f9

    Network service: Airport, AirPort, en1

    Graphics card: NVIDIA GeForce 9400, NVIDIA GeForce 9400, PCI, 256 MB

    Model: iMac10, 1, IM101.00CC.B00 of BootROM, 2 processors, Intel Core 2 Duo 3.06 GHz, 4 GB, MSC 1.52f9

    Graphics card: NVIDIA GeForce 9400, NVIDIA GeForce 9400, PCI, 256 MB

    Memory module: BANK 0/DIMM1, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020

    Memory module: BANK 1/DIMM1, 2 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142353637334648302D4346382020

    Airport: spairport_wireless_card_type_airport_extreme (0x168C, 0x8F), Atheros 9280: 4.0.74.0 - P2P

    Bluetooth: Version 4.3.6f3 16238, 3 services, 27 aircraft, 1 incoming serial ports

    Network service: Airport, AirPort, en1

    Serial ATA Device: WDC WD5000AAKS-40V2B0, 500,11 GB

    Serial ATA Device: OPTIARC DVD RW AD - 5680H

    USB device: Keyboard Hub

    USB Device: Apple keyboard

    USB device: ISight built-in

    USB device: Memory card reader internal

    USB Device: IR receiver

    USB device: USB optical mouse

    USB device: Hub BRCM2046

    USB Device: USB Bluetooth host controller

    Crush Bus:

    com.rim.driver.BlackBerryUSBDriverInt 0.0.68

    Try to uninstall RIM.

    Uninstallation of RIM

  • What causes certain elements "saved" in the files to the 'blue' color while some has the color "black"?

    What causes certain elements "saved" in the files to the 'blue' color while some has the color "black"?

    Blue are compressed.  Are not blacks.

    Good luck

    K

  • which method is called when the screen has lost focus but stays on blackberry?

    Hello

    I want to know in which method is called when the screen has lost focus, but always visible BlackBerry?

    For example, a screen is in the foreground and we disply dialog box so that the screen is visible but not to focus, therefore, at this time that methos called when we close this dialog box?

    Please, help me please please

    Override the following methods in your class to screen according to your needs

    1. when the screen button to the stack

    Call

    onDisplay() or

    onUiEngineAttached(boolean attached) - so attached is true then your screen is at the top of the screen

    2. When you are in a backlight and the lcd screen turns off to your state of rest and turns on again when you actively use this form

    call

    onVisibilityChange(boolean visible) - if visible is set to true, then you get the focus when the lcd display turns

    3. when your application moves to the background by clicking the red end button (i.e. without quiting the app, yet yours is active in the background)

    call

    onExposed() - when your application comes to the foreground of the background or during any type of screen that is in the top get popped

    & call

    onObscured() - when your application moves to the background, or when a screen pushed above your current screen more

  • Hi, I had problems with the addition of soundtrack to Adobe premiere elements 13. When I add it or drag it immediately comes crashing windows, where says "Adobe Premiere Elements has stopped working". I can add videos with no problems, but cannot add any

    Hi, I had problems with the addition of soundtrack to Adobe premiere elements 13. When I add or drag it happens immediately windows crash, where says "Adobe Premiere Elements has stopped working". I can add videos with no problems, but cannot add .mp3 files.

    I had Windows 8.1, 2.4 GHz, 6 GB of RAM. How to solve this problem?

    Fixed a problem when converting the mp3 file. WAV...

    some poor Adobe Premiere Elements if there is for example simple bug in the software.  Waste of money for this software.

  • Add-PSSnapin: an element with the same key has already been added

    When you run Add-PSSnapin, I get the above error. This seems to happen if I try to add the snap a second time, but when this happens, none of the power CLI commands are then available up to what the server is restarted.

    Add-PSSnapin: an element with the same key has already been added.

    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

    + Add-PSSnapin $SnapinName;

    +     ~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (:)) [Add-PSSnapin], ArgumentExcept)

    ion

    + FullyQualifiedErrorId: System.ArgumentException, Microsoft.PowerShell.Co

    mmands. AddPSSnapinCommand

    Failure of the attempts to remove the snap-in at this point with:

    Remove-PSSnapin: no Windows PowerShell snap-ins for the model

    "VmWare.VimAutomation.Core" were found. Check the pattern and then try the

    command again.

    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

    + Remove-PSSnapin $SnapinName;

    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: InvalidArgument: (VmWare.VimAutomation.Core:Stri

    NG) [Remove-PSSnapin], PSArgumentException

    + FullyQualifiedErrorId: NoPSSnapInsFound, Microsoft.PowerShell.Commands.R

    emovePSSnapinCommand

    I already tried to uninstall the dll and put it back, that makes no difference

    $dllpath = "C:\Program Files (x 86) \Vmware\Infrastructure\vSphere PowerCLI\VMWare.VimAutomation.VICore.Cmdlets.dll.

    $SnapinName = "VmWare.VimAutomation.Core".

    #get the path to instalutil

    $path = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory();

    #create an alise for installtuil

    set-alias installutil (resolve-path (join-path $path 'installutil.exe'));

    #uninstall snap

    InstallUtil /u $dllpath;

    InstallUtil $dllpath;

    I tried appdomain unloading, then adding the snap-in with the same result:

    $appdomain = [AppDomain]: CurrentDomain

    $appdomain. # Of unloading | Out-Null

    Add-PSSnapin "VMware.VimAutomation.Core".

    $appdomain. Load

    Everything simply jump beyond the error is not good because it is impossible to find the following commands:

    Add-PSSnapin "VMware.VimAutomation.Core" - ErrorAction SilentlyContinue

    Get - VM $VirtualMachine

    The term 'Get - VM' is not recognized as the name of a cmdlet, function, script file, or an executable program. Check the spelling of the name, or if a path has been included, make sure the path is correct, and then try again.

    Any help to fix this would be greatly appreciated.

    Thank you

    OK, I was kind of what went wrong here.

    The snap has been loaded from a powershell module. When the module is removed and added again, the snap ceases to function, but also can not be added again.

    If the snap is loaded first outside the module everything works fine until you try never to remove or add snap-in module.

  • PowerCLI - an element with the same key has already been added ERROR

    Hello

    I opened a case with VMware on a problem using PowerCLI. And pretty well, they said that they do not support scripts... But the error is not related to any script. It is related to the first command I run against one of our Vcenter and we have 6 of them.

    Everything worked well until we went from 4.1 to 5.1

    I can connect to our VCenter fine, but the first command always give an error and fail to the powercli but the task still occur in vCenter.

    When it gets ugly, is we have several powershell script to maintain and automate our environment but now these script fail.

    Example, we have a script to deploy the VM model and then configure the appropriate hardware configuration and add Notes and custom attributes. But the script fails after that deployment so the rest will not run. It will be possible that deploy us to the first virtual machine.

    So for 'Band-aid' question, I added a line to my script to start a virtual dummy machine, to make sure that what is in the script will work fine.

    Error:

    PowerCLI C:\Program Files\VMware\Infrastructure\vSphere PowerCLI > start-vm vm - Server-m46

    Start-VM: 2013/06/26 11:57:05 Start-VM an element with the same key has already been added.

    Online: 1 character: 9 + start-vm < < < <-vm server-m46 + CategoryInfo: NotSpecified: (:)) [start-VM], ViError + FullyQualifiedErrorId: Client20_VMServiceImpl_StartVM_ViError, VMware.VimAutomation.ViCore.Cmdlets.Commands.StartVM)

    As far as I know, done to the PowerCLI VMware supports.

    I don't think they support the client script debugging, but the product PowerCLI itself is supported.

    I created a few calls myself in the past.

    What you see is a known problem, there are a few discussions in this community who has something similar.

  • An element with the same key has already been added

    Hi all

    I see a strange problem when you try to add a new disk to a virtual computer via powershell

    I use the following commands:

    Add-PSSnapin VMware.VimAutomation.Core

    to connect-viserver-Server $MyVC

    $server = "MyServer".

    $vm = get - vm $server

    $NewDisk = new-disk-hard - VM CapacityGB - $DiskSize - StorageFormat $StorageFormat $VM

    When I run it, the drive is added, but what follows is cast in the output:

    New hard drive: 24/06/2013-11:04:22New-harddiskAn element with the same key has already been added.

    On line: 1 char: 11

    + $NewDisk = new-disk-hard - VM $VM CapacityGB - $DiskSize - StorageFormat $StorageForm...

    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo: NotSpecified: (:)) [new-harddisk], ViError)
    + FullyQualifiedErrorId: Client20_VirtualDeviceServiceImpl_NewVirtualHardDisk_ReconfigError, VMware.VimAutomation.

    ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk

    When I restarted the command in the same pssession and then it is executed without error.

    Has anyone seen this behavior before?

    This could be a bug?

    I searched for this error, but this seems like something very generic...

    Thanks in advance!

    Filip

    Hi Filip,

    This looks like the same problem as already reported in first New - VM: an element with the same key has already been added.

  • First New - VM: an element with the same key has already been added.


    I get a strange error that I have seen a few other posts, but with no resolution (or at least one that I can find).  When you try to create a new virtual machine using the cmdlet New - VM, I get the error "an item with the same key has already been added."

    Now, here's the key that I've not seen many others to mention.  This ONLY happens on the first attempt for each new connection with Connect-VIServer.  I can create as many of the same machines that I want after that first mistake with the same settings (new name of course).  If I disconnect and reconnect again, the error appears for the first time.

    Normally with PowerShell, I have just to catch the error and be on my way.  However, in this case I use the parameter - RunAsync, so that I can capture the task that is returned in a variable.  From there, I use Wait-task until the virtual machine is complete before moving on with the script.  Everything works fine when the error occurs, but when it happens that the object of the task is not returned and the rest of her vomit script errors.

    I am running the latest version of PowerCLI and I tried this on PowerShell v2.0 and v3.0 and get the same results.  I tried different models and guests without success.  I also tried this with and without assistance - AllLinked on Connect-VIServer-bound mode.  I should mention that I am cloning model, by specifying a spec customization and host cluster data store.  Again, the only common denominator repeatable here is that this ONLY happens on the first attempt to use New - VM session to vCenter.

    Any ideas or suggestions?

    If this is useful at all, here are the details of the output on the exception:

    PS C:\ > $Error [0]
    New - VM: 05/06/2013-09:49:22 new-VM an element with the same key has already been added.
    On line: 1 char: 11
    + $VMTask = new-VM-name "NEWTEST20" - model 'Template' - OS...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo: NotSpecified: (:)) [new-VM], VimException)
    + FullyQualifiedErrorId: Core_BaseCmdlet_UnknownError, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

    PS C:\ > $Error [0]. Exception | Select *.


    ErrorId: Core_BaseCmdlet_UnknownError
    ErrorCategory: NotSpecified
    TargetObject:
    RecommendedAction:
    SessionId:
    Login ID: /VIServer=USERNAME@SERVER:443/
    Severity: error
    Message: 05/06/2013-09:49:22 new-VM an element with the same key has already been added.
    Data: {ParameterValues}
    InnerException: System.ArgumentException: an item with the same key has already been added.
    to System.Collections.Generic.Dictionary'2.Insert (TKey key, TValue value, Boolean add)
    at VMware.VimAutomation.ViCore.Impl.V1.Service.StaticDataServiceImpl.PopulateTaskDescriptionDict
    ionary()
    at VMware.VimAutomation.ViCore.Impl.V1.Service.StaticDataServiceImpl.GetTaskDescription (String
    taskDescriptionId)
    at VMware.VimAutomation.ViCore.Impl.V1.Task.TaskImpl.Create (ManagedObjectReference moRef,
    Customer VimClient, accessories 2 dictionary, extensionData object)
    to VMware.VimAutomation.ViCore.Impl.V1.Task.ViCoreTaskCoreServiceProviderImpl. < GetTaskListForCli
    ENT > d__7.MoveNext)
    System.Collections.Generic.List to ' 1.InsertRange (Int32 index, 1 IEnumerable collection)
    at VMware.VimAutomation.ViCore.Impl.V1.Task.ViCoreTaskCoreServiceProviderImpl.GetTaskList (IEnume
    uidList Maple 1, IEnumerable 1 connectionUidList)
    to VMware.VimAutomation.Sdk.Impl.V1.Task.CoreTaskServiceImpl.GetTaskList (IEnumerable 1 uidList,
    IEnumerable 1 connectionUidList)
    to VMware.VimAutomation.ViCore.Impl.V1.Service.TaskServiceImpl.GetTaskCore (Nullable State 1,)
    IList 1 connectionUidList)
    to VMware.VimAutomation.ViCore.Impl.V1.Service.TaskServiceImpl.GetTask (Nullable State 1,)
    CmdletTaskInfoProvider cmdletTaskInfoProvider)
    at VMware.VimAutomation.ViCore.Impl.V1.Service.TaskServiceImpl.GetTaskById (String uid,
    CmdletTaskInfoProvider cmdletTaskInfoProvider)
    VMware.VimAutomation.ViCore.Impl.V1.Service.VmServiceImpl.NewVM (model TemplateInterop,
    VMHostInterop vmHost, string name, resourceContainer, FolderInterop location VIContainerInterop,.
    StorageResourceInterop data store, Nullable 1 diskStorageFormat, OSCustomizationSpecInterop
    customization, Boolean, Boolean, string 1 Nullable description isRequestedAsync allowNested
    Nullable, 1 haIsolationResponse, Nullable 1 drsAutomationLevel, haRestartPriority, [AdvancedOption]
    options)
    to VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM.DoWork (customer VIAutomation, moList list 1)
    at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.DoWork (VIConnection connection,
    MoList list 1)
    at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.BaseCmdlet.DoWorkEx (VIConnection connection,
    MoList list 1)
    to
    VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ConnectionDispatchHelper.ExecuteRunlist (dictionary 2
    runlist, DoWorkDelegate doWorkDelegate, UidDispatchHelper uidDispatchHelper, result of list 1)
    TargetSite:
    StackTrace:
    HelpLink:
    Source:

    PS C:\ > $Error [0]. Exception.InnerException | Select *.


    Message: An element with the same key has already been added.
    ParamName:
    Data: {ConnectionId}
    InnerException:
    TargetSite: Void Insert (TKey, TValue, Boolean)
    StackTrace: At System.Collections.Generic.Dictionary'2.Insert (TKey key, TValue value, Boolean add)
    to
    VMware.VimAutomation.ViCore.Impl.V1.Service.StaticDataServiceImpl.PopulateTaskDescriptionDictionary)
    at VMware.VimAutomation.ViCore.Impl.V1.Service.StaticDataServiceImpl.GetTaskDescription (String
    taskDescriptionId)
    at VMware.VimAutomation.ViCore.Impl.V1.Task.TaskImpl.Create (ManagedObjectReference moRef,
    Customer VimClient, accessories 2 dictionary, extensionData object)
    to VMware.VimAutomation.ViCore.Impl.V1.Task.ViCoreTaskCoreServiceProviderImpl. < GetTaskListForClient
    > d__7.MoveNext)
    System.Collections.Generic.List to ' 1.InsertRange (Int32 index, 1 IEnumerable collection)
    to
    VMware.VimAutomation.ViCore.Impl.V1.Task.ViCoreTaskCoreServiceProviderImpl.GetTaskList (IEnumerable 1)
    uidList, IEnumerable 1 connectionUidList)
    to VMware.VimAutomation.Sdk.Impl.V1.Task.CoreTaskServiceImpl.GetTaskList (IEnumerable 1 uidList,
    IEnumerable 1 connectionUidList)
    to VMware.VimAutomation.ViCore.Impl.V1.Service.TaskServiceImpl.GetTaskCore (Nullable State 1,)
    IList 1 connectionUidList)
    to VMware.VimAutomation.ViCore.Impl.V1.Service.TaskServiceImpl.GetTask (Nullable State 1,)
    CmdletTaskInfoProvider cmdletTaskInfoProvider)
    at VMware.VimAutomation.ViCore.Impl.V1.Service.TaskServiceImpl.GetTaskById (String uid,
    CmdletTaskInfoProvider cmdletTaskInfoProvider)
    VMware.VimAutomation.ViCore.Impl.V1.Service.VmServiceImpl.NewVM (model TemplateInterop,
    VMHostInterop vmHost, string name, resourceContainer, FolderInterop location VIContainerInterop,.
    StorageResourceInterop data store, Nullable 1 diskStorageFormat, OSCustomizationSpecInterop
    customization, Boolean, Boolean, string 1 Nullable description isRequestedAsync allowNested
    Nullable, 1 haIsolationResponse, Nullable 1 drsAutomationLevel, haRestartPriority, [AdvancedOption]
    options)
    to VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM.DoWork (customer VIAutomation, moList list 1)
    at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.DoWork (VIConnection connection,
    MoList list 1)
    at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.BaseCmdlet.DoWorkEx (VIConnection connection,
    MoList list 1)
    to
    VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ConnectionDispatchHelper.ExecuteRunlist (dictionary 2
    runlist, DoWorkDelegate doWorkDelegate, UidDispatchHelper uidDispatchHelper, result of list 1)
    HelpLink:
    Source: mscorlib


    I was informed that this is actually a "known" bug and a fix has already been planned for the release of the future code.  After getting the access to a beta version, it does not seem to be fixed in the next release.

  • I recently bought 13 elements for Mac OS and can not download N - OS and can not download files NEF RAW taken on my Nikon d5500 has been added. The model is not among those supported by the elements, but the D5300 is, which is almost identical. Is there a

    I recently bought 13 elements for Mac OS and can not download N - OS and can not download files NEF RAW taken on my Nikon d5500 has been added. The model is not among those supported by the elements, but the D5300 is, which is almost identical. Is there a quick fix?

    What is N - OS?

    For the problem of camera raw, every new device has its own raw format, and ACR must be updated to include the latter. Happened yet for the d5500 has been added, so you'll just have to use the Nikon software until Adobe gets the info and releases an updated version of ACR. It is not uncommon to be in your situation, if you buy a camera model that was only a month. You just wait a bit.

Maybe you are looking for