Dynamic Variables and New-Object - in a GUI

so, i have not found anything that i can parlay into a solution for what i am attempting to do.  
Basically i am using powershell to build a GUI to manage websites on various servers.  
in a nutshell:
- i have an array with the servers i want to query
- a foreach loop gets me the site names for each server (number of sites can vary on a server).
- need put checkboxes on a GUI for every site to do something (25-30 sites across 8 servers).
currently i am passing the $dir.name variable to a function that will create the new variable using this command:
$pName = $dir.name New-variable -name $pName -value (New-Object System.Windows.Forms.CheckBox)
$pName.Location -value (New-Object System.Drawing.Size(10,$i))
$pName.Size -value (New-Object System.Drawing.Size(100,20))
$Pname.Text -value $dir.name
$groupBox.Controls.Add($pName) 
Problem is i am not able to do anything with my newly created variable.  I am trying to use the following code to position the new checkbox but i get nothing (same for text, size, etc.)  I am not seeing any errors, so i don't know what i have going
wrong.  
is this even possible?
I am able to create static checkboxes, and i can create dynamic variables.  But i can't mix the two...

Here is how we normally use listboxes to handle form situations like this one.  The listboxes can automatically select subgroups.
The hash of arrays can be loaded very easily with a script or the results of the first list can be used to lookup and set the contents of the second.
Notice how little code is actually used.  This is all of the setup code needed aside from the from definition:
$FormEvent_Load={
$global:serversToSites=@{
Server1=@('S1_SITE1','S1_SITE2','S1_SITE3')
Server2=@('S2_SITE1','S2_SITE2','S2_SITE3')
Server3=@('S3_SITE1','S3_SITE2','S3_SITE3')
$listbox1.Items.AddRange($serversToSites.Keys)
$listbox1_SelectedIndexChanged={
$listbox2.Items.Clear()
$listbox2.Items.AddRange($global:serversToSites[$listbox1.SelectedItem])
$listbox2_SelectedIndexChanged={
[void][System.Windows.Forms.MessageBox]::Show($listbox2.SelectedItem,'You Selected Site')
Here is the complete demo form:
[void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
[void][reflection.assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
[System.Windows.Forms.Application]::EnableVisualStyles()
$form1 = New-Object 'System.Windows.Forms.Form'
$listbox2 = New-Object 'System.Windows.Forms.ListBox'
$listbox1 = New-Object 'System.Windows.Forms.ListBox'
$buttonOK = New-Object 'System.Windows.Forms.Button'
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
$FormEvent_Load={
$global:serversToSites=@{
Server1=@('S1_SITE1','S1_SITE2','S1_SITE3')
Server2=@('S2_SITE1','S2_SITE2','S2_SITE3')
Server3=@('S3_SITE1','S3_SITE2','S3_SITE3')
$listbox1.Items.AddRange($serversToSites.Keys)
$listbox1_SelectedIndexChanged={
$listbox2.Items.Clear()
$listbox2.Items.AddRange($global:serversToSites[$listbox1.SelectedItem])
$listbox2_SelectedIndexChanged={
[void][System.Windows.Forms.MessageBox]::Show($listbox2.SelectedItem,'You Selected Site')
$Form_StateCorrection_Load=
#Correct the initial state of the form to prevent the .Net maximized form issue
$form1.WindowState = $InitialFormWindowState
$form1.Controls.Add($listbox2)
$form1.Controls.Add($listbox1)
$form1.Controls.Add($buttonOK)
$form1.AcceptButton = $buttonOK
$form1.ClientSize = '439, 262'
$form1.FormBorderStyle = 'FixedDialog'
$form1.MaximizeBox = $False
$form1.MinimizeBox = $False
$form1.Name = "form1"
$form1.StartPosition = 'CenterScreen'
$form1.Text = "Form"
$form1.add_Load($FormEvent_Load)
# listbox2
$listbox2.FormattingEnabled = $True
$listbox2.Location = '237, 26'
$listbox2.Name = "listbox2"
$listbox2.Size = '120, 134'
$listbox2.TabIndex = 2
$listbox2.add_SelectedIndexChanged($listbox2_SelectedIndexChanged)
# listbox1
$listbox1.FormattingEnabled = $True
$listbox1.Location = '13, 26'
$listbox1.Name = "listbox1"
$listbox1.Size = '120, 134'
$listbox1.TabIndex = 1
$listbox1.Sorted = $true
$listbox1.add_SelectedIndexChanged($listbox1_SelectedIndexChanged)
# buttonOK
$buttonOK.Anchor = 'Bottom, Right'
$buttonOK.DialogResult = 'OK'
$buttonOK.Location = '352, 227'
$buttonOK.Name = "buttonOK"
$buttonOK.Size = '75, 23'
$buttonOK.TabIndex = 0
$buttonOK.Text = "OK"
$buttonOK.UseVisualStyleBackColor = $True
#Save the initial state of the form
$InitialFormWindowState = $form1.WindowState
#Init the OnLoad event to correct the initial state of the form
$form1.add_Load($Form_StateCorrection_Load)
#Clean up the control events
$form1.add_FormClosed($Form_Cleanup_FormClosed)
#Show the Form
$form1.ShowDialog()
You can easily substitute  CheckedListbox if you like checkboxes.
¯\_(ツ)_/¯

Similar Messages

  • Issues in persisting dynamic entity and view objects using MDS

    Hi All,
    I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
    I'm facing following two errors while trying to run the app module:
    1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
    2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
    I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
    [http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
    [http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
    Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
    ///////////App Module Implementation Class/////////////////////////
    public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
    private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
    * This is the default constructor (do not remove).
    public DynamicEntityGenModuleImpl() {
    public ViewObjectImpl getDepartmentsView1() {
    return (ViewObjectImpl) findViewObject("DynamicDeptVO");
    public void buildDynamicDeptComp() {
    ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
    if (internalDynamicVO != null) {
    System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
    return;
    EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
    ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
    addViewToPdefApplicationModule(viewDef);
    private EntityDefImpl buildDeptEntitySessionDef() {
    try {
    EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
    entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setName(entDef.getName());
    System.out.println("Application Module Path name: " + getDefFullName());
    System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setAliasName(entDef.getName());
    entDef.setSource("DEPT");
    entDef.setSourceType("table");
    entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
    entDef.addAttribute("Name", "NAME", String.class, false, false, true);
    entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
    entDef.resolveDefObject();
    entDef.registerSessionDefObject();
    entDef.writeXMLContents();
    entDef.saveXMLContents();
    return entDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
    try {
    ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
    viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
    System.out.println("ViewDef :" + viewDef.getFileName());
    viewDef.setUseGlueCode(false);
    viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
    viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
    viewDef.addAllEntityAttributes("DynamicDeptUsage");
    viewDef.resolveDefObject();
    viewDef.registerSessionDefObject();
    viewDef.writeXMLContents();
    viewDef.saveXMLContents();
    return viewDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
    oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
    if (pDefAM == null) {
    pDefAM = new oracle.jbo.server.PDefApplicationModule();
    pDefAM.setFullName(getDefFullName());
    pDefAM.setEditable(true);
    pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
    pDefAM.applyPersonalization(this);
    pDefAM.writeXMLContents();
    pDefAM.saveXMLContents();
    ////////adf-config.xml//////////////////////
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
    xmlns:sec="http://xmlns.oracle.com/adf/security/config">
    <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
    <defaults useBindVarsForViewCriteriaLiterals="true"/>
    <startup>
    <amconfig-overrides>
    <config:Database jbo.locking.mode="optimistic"/>
    </amconfig-overrides>
    </startup>
    </adf-adfm-config>
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
    </adf:adf-properties-child>
    <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
    </sec:adf-security-child>
    <persistence-config>
    <metadata-namespaces>
    <namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
    <namespace path="/model/" metadata-store-usage="mdsRepos"/>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
    <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
    <property name="metadata-path" value="/tmp"/>
    <!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
    <property name="repository-name" value="TestDynamicEC"/>
    <property name="jdbc-userid" value="adfmay28"/>
    <property name="jdbc-password" value="adfmay28"/>
    <property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    </adf-config>
    //////////////////////////////////////////////////////////////////////////////////////////////////////////

    Hi Frank,
    I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
    These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
    Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
    Nik

  • Use String Variable in New Object Creation

    Thanks to those who review and respond. I am new to Java, so please be patient with my terminoloy mistakes and fumblings. I am reading in a file and I want to create a new object based on specific field (car for example). As you will notice I grab field 8 here label sIID.
    String sIID = dts.group(8);
    BTW this regex grouping works fine. The problem is seen when I try to use the sIID variable in my new object creation process.
    DateParse sIID = new DateParse();
    My IDE is reporting "Variable sIID is already defined in the scope"
    Is this possible? The assumption is that the sIID will have different value during the processing of the file. For example, car could mean truck, sedan, etc with operators like color, number of doors, mileage, top speed, etc.

    Thanks for the reply. I have include similar and much shorter code for the sake of brevity.
    My problems are centered around the x variable/object below. Ideally this would translate to three objects PersonA, PersonB, etc that I could reference later in the code as PersonA.newname if I wanted to. Hopefully this makes sense.
    public class TestingObjects {
      public static void main(String[] argv) {
           String [] names;
           names = new String[3];
           names[0] = "PersonA";
           names[1] = "PersonB";
           names[2] = "PersonC";
           for (String x:names) {
             PN x = new PN();  // <- Problem
             x.name = x;
             x.SayName();
            System.out.println(x.newname);
    public class PN {
           String name;
           String newname;
      public String SayName() {
           newname = "Name = " + name;
           System.out.println(name);
          return newname;
    }

  • List of Modified and New objects between two consecutive TRs/ TOCs

    Hi gurus,
    My requirement is to create a Z program that will give me a report of the objects that have been modified or newly created between two Transport Requests or Two TOCs containing the objects.
    I had created the program, but facing these difficulties -
    1. While comparing the objects in the two TRs./ TOCs , I tried comparing the Program, Id and Object definition. but learned that, when we are creating an object say Report, then the object entry after putting in a TR (say TR1)is :
    Object Name | Pgm_Id | Object Def
    ZXXYY         | R3TR    | PROG
    Next, I modified this report and added a comment. Then I put this object in another TR say (TR 2) and released it. But, now when I check the entry of this object in Table E071 for the TR , I find this  -
    Object Name | Pgm_Id | Object Def
    ZXXYY         | LIMU    | REPS
    So, you see,  the object entry has changed when I modified it.
    So, when I go to compare the two TRs for new and modified objects, I have only the Name of the Object (ZXXYY) , to compare and state that this object has been modified.
    2. This difficulty arise out of the first -
        When I tried to compare objects with their Names only, then I found out that for Tables, (for eg.) , the modification of a Table field has the name of the table as object name, when put in to a TR. Same is the case while modifying a Table's attributes.
    Hence, If I modified a table's attribute, my program shows the table as modified instead of showing the tables attribute as modified.
    Kindly propose a solution to fix this issue.

    Hi Thomas, thanks a lot for your help.
    Solution: I checked first if the pgmid and object column entries matched . If not then I called the FM 'TR_CHECK_TYPE' and passed the details of the object in table E071, whose original pgmid and object entry is to be fund out. This returned me the original PGMID and OBJECT, which I compared with the entries of the object in the target TOC. If matched, I declared it as modified entry.

  • Dynamic variable and/or XML LazyLoader HELP

    I am loading images via xml lazyloader into my air app
    I need var b to be "img" +  item.id dynamically
    any ideas???
    for each (var item : LoadingItem in lazy.items)
                        var b : Bitmap = lazy.getBitmap(item.id);
                        addChild(b);
    If you dont know the lazyloader code then can you please explain how to create a dynamic variable for a bitmap???

    so i should set type here
    var img:bitmap = {}
    then create the variable like this in my for statement?
    img[this[item.id]] = lazy.getBitmap(item.id);
    lets say item was 1,2,3
    Then
    img[1]
    img[2]
    img[3]
    would be able to hold a different bitmap
    thanks in advanced

  • Dynamic Quorum and new DAG (no CNO)

    With Exchange 2013 SP1 on Windows 2012 R2, you can create a DAG without a CNO.  Which is great, I no longer need a CNO or IP address for my DAGs.  Which should make it much simpler to have a stretched DAG.  However without the CNO, I cannot
    figure out how to create a dynamic quorum since it does not show in the Failover Cluster Administrator.  Does this mean that I don't need Dynamic Quorum, or do I have to do it through Powershell, or can it not be done.  And if it is the last option
    am I better of having no dynamic quorum and a no CNO, or having a dynamic quorum with a CNO?

    if I try (get-cluster ex13dag1).DynamicQuorum=1 I get the following error: get-cluster : Check the spelling of the cluster name. Otherwise, there might be a problem with yournetwork. Make sure
    the cluster nodes are turned on and connected to the network or contact your network administrator.

  • (JC) static variable and derived object

    Hi there!
    It is glad to know you from Java Card Forum. Can I ask for your help on the following question?
    It is about static variable. The following is my sample code:
    ========================================
    package com.Test01;
    import javacard.framework.*;
    import javacard.security.*;
    import javacardx.crypto.Cipher;
    public class Test01 extends Applet {
    OwnerPIN Pin;
    static DESKey[] keys;
    protected Test01(byte[] buffer, short offset, byte length) {
    keys = new DESKey[4];
    length = 0;
    while (length < 4) {
    keys[length] = (DESKey)KeyBuilder.buildKey((byte)3, (short)0x80, false);
    length = (byte)(length + 1);
    public static void install(byte buffer[], short offset, byte length) {
    new Test01(buffer, offset, length);
    ===========================================================
    If there are two instances, A and B, created in the package.
    My issues:
    1. Are keys[0]~ keys [3] kept while B is deleted?
    2. Does each instance have itsown object while "keys[length] = (DESKey)KeyBuilder.buildKey((byte)3, (short)0x80, false);"? or they share the same object?
    3. follow item 2, if A and B share the same object, is the object kept while B is deleted? Where can I get the information in Sun's spec?
    Thank you very much.
    Best regards,
    kantie

    Thanks a lot. You mean that keys variable will be removed while instance B deleted, right? I think the idea of database applet is very good, but I can't force applet provider the way of their implementations : )
    I still got question, does it get no use to set the keys variable to be "static"? So that I can keep it to other instances, if applied.
    And I think that any object derived under the static variable shall be kept, until the package is deleted.
    For example, if you declare a static pointer, and it points to an object newed by the instance at the first time. We say every instances (A and B) of this package (PckM) share this same static pointer and this same object, right? There are two situations:
    1. if this referred object is removed when B is deleted, so the memory of this object will be released. Then user might create an instace C of another package (PckN), and instance C new its objects just overlapping on the released memory. In this case, it will cause instance A to be crashed, because its static pointer has been referred to illeagle address.
    2. if this referred object is kept when B is deleted, then instance C will new its objects in other free memory. In this case, instance A will work well, because its static pointer still refers to correct object.
    What do you think? Am I missing any concepts?
    Thank you for your great opinions.
    Best regards,
    kantie

  • Golbal variables and new forms??

    Hi!
    I'm a total newbie to java but have done a lot of programming in Visual Basic. I'm using JBuilder 3.5 to create a testapplication that count the nuber of times a button (swing) has been pressed. In VB this is possible by using a global variable which increases by one for each buttonpress, but how do I do the same thing in Java??
    I also wounder how to create another frameclass and make it visible on the buttonpress?? (like the messagebox in VB)
    Thanks for helping
    (Here's my code...)
    //Application1.java------------
    package test;
    import javax.swing.UIManager;
    public class Application1 {
    boolean packFrame = false;
    //Construct the application
    public Application1() {
    Frame1 frame = new Frame1();
    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout
    if (packFrame) {
    frame.pack();
    else {
    frame.validate();
    frame.setVisible(true);
    //Main method
    public static void main(String[] args) {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception e) {
    e.printStackTrace();
    new Application1();
    //Frame1.java-------------------------------
    package test;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame {
    JPanel contentPane;
    BorderLayout borderLayout1 = new BorderLayout();
    JPanel jPanel1 = new JPanel();
    JButton jButton1 = new JButton();
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    jPanel1.setLayout(null);
    jButton1.setText("jButton1");
    jButton1.setBounds(new Rectangle(88, 93, 101, 20));
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton1_actionPerformed(e);
    contentPane.add(jPanel1, BorderLayout.CENTER);
    jPanel1.add(jButton1, null);
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton1_actionPerformed(ActionEvent e) {
    //Show the value of the variable i (integer)
    //How do I declare the variable i ???
    System.out.println(i);
    i=i+1;
    }

    I made this code look as close to what JBuilder 3.5 would create so that you could get an idea. Personally, try writing the code without JBuilder so that you know what is really going on.
    A Message box type dialog was created using JOptionPane from the swing package.
    <pre>
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class IncrementTest extends JFrame
    implements ActionListener
    private JButton myButton;
    // DECLARE GLOBAL VARIABLE HERE
    private int i = 0;
    public IncrementTest()
    try
    jbInit();
    catch(Exception e)
    e.printStackTrace();
    public void jbInit()
    throws Exception
    this.setTitle("My Test");
    this.getContentPane().setLayout(new FlowLayout());
    myButton = new JButton("Click Me");
    myButton.addActionListener(this);
    this.getContentPane().add(myButton);
    this.setSize(200, 200);
    // EXIT APPLICATION WHEN X IS CLICKED
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.show();
    public void actionPerformed(ActionEvent ae)
    if(ae.getSource() == myButton)
    // CALL METHOD FOR BUTTON
    myMethod();
    private void myMethod()
    i += 1; // Same as i = i + 1
    JOptionPane.showMessageDialog(null, "Value is: " + i);
    public static void main(String args[])
    IncrementTest incrTest = new IncrementTest();
    </pre>

  • Query with dynamic variables and customised caption

    How to change the Field label when the query asking dynamic values during the execution?
    for example:  in where condition i want to give a country name during the query execution, but in the small window it will display as 'Name' which is a country name.  i want to display it as 'Country Name' which should be more readable for the end user. How can we achieve this?
    Thanks
    SV Reddy

    Hi,
    Unfortunately, it is not possible to change the system field description.
    Refer to this thread
    Re: Parameter Display Name Reg.
    Regards,
    Vijay Kumar
    SAP Business One Forums Team

  • AS2 syntax and dynamic variable names

    Hi all,
    Trying to learn AS2 and hoping someone can help me by
    explaining the problems with the following sample code and what
    would be needed to make it work (i.e. to create dynamic variables
    and movie clips from an array).
    Thanks for your time!

    kglad: Thanks for the super-quick and tremendously helpful
    response! Much appreciated!
    A couple of quick follow-up questions:
    kglad wrote that "createEmptyMovieClip() returns a reference
    to the created movieclip".
    How would I use/access this reference?
    Also, in the updated code below, I have two issues:
    1. rolling over a movie clip yields "this is button
    undefined" rather than "this is button a" for example; and
    2. clicking on a movie clip outputs the result of the trace
    command for all four clips (in reverse order) rather than just the
    one clicked.
    Any insights into what I need to do differently? Thanks
    again!

  • Dynamic variable issue

    i have two dynamic variables latest week,latest week-1
    when i am applying the filter condition: between latest week and latest week-1
    (latest week,latest week -1 both are dynamic variables)
    if i click on result it's showing no resultent data for current applied fiter
    thanks
    bethamsetty

    Please Conform below steps.
    The variable name is latestweek-1 ?
    Please test dynamic variable in IntBlock whether are getting value or not? -- Do you know how to test variable in intblock.., If yes check first result.
    Please follow the my blog and recreate new dynamic variable and follow the steps.
    Note: Did you get any error?
    Hope this help's
    Thanks,
    Satya

  • Jndi and serializable objects

    Hi,
    I am attempting to create a cache on the web server to store
    frequently accessed reference data. I do so by running a series of
    queries in a startup class. The data retrieved from the result set of
    each query is stored in a custom class and bound to the server context.
    My understanding is that when serializable objects are bound, they are
    written to disk (so as not.to waste valuable Heap space I assume). As a
    test I made the startup query return a large amount of data and I
    expected to see the amount of free disk space decrease as the objects
    were bound however I did not see this occurring. I examined the memory
    usage of the java process with the NT task manager, and the memory usage
    was increasing pretty dramatically as the query results were performed
    and new objects created to store this data.
    Based on these observations I assume that the objects I created and
    bound are stored in the Java Heap and not written to disk. Would
    Weblogic at some point write these to disk if memory became tight or is
    my understanding that binding an object serializes it incorrect?
    If it turns out that what I am attempting here consumes a lot of heap
    space, I assume that server performance will suffer which is
    unacceptable. Would using read-only entity beans be a better solution?
    The container could manage this memory more effectively but it would
    seem to add a lot of overhead for a simple read only data cache.
    Thanks,
    Steve Snodgrass

    We never write jndi data to the disk. So if you add more objects your are
    going to take up more heap space. You should be looking at other
    alternatives to implement this.
    -- Prasad
    Steve Snodgrass wrote:
    Hi,
    I am attempting to create a cache on the web server to store
    frequently accessed reference data. I do so by running a series of
    queries in a startup class. The data retrieved from the result set of
    each query is stored in a custom class and bound to the server context.
    My understanding is that when serializable objects are bound, they are
    written to disk (so as not.to waste valuable Heap space I assume). As a
    test I made the startup query return a large amount of data and I
    expected to see the amount of free disk space decrease as the objects
    were bound however I did not see this occurring. I examined the memory
    usage of the java process with the NT task manager, and the memory usage
    was increasing pretty dramatically as the query results were performed
    and new objects created to store this data.
    Based on these observations I assume that the objects I created and
    bound are stored in the Java Heap and not written to disk. Would
    Weblogic at some point write these to disk if memory became tight or is
    my understanding that binding an object serializes it incorrect?
    If it turns out that what I am attempting here consumes a lot of heap
    space, I assume that server performance will suffer which is
    unacceptable. Would using read-only entity beans be a better solution?
    The container could manage this memory more effectively but it would
    seem to add a lot of overhead for a simple read only data cache.
    Thanks,
    Steve Snodgrass

  • Dynamic creation of variables and alv grid output/internal table

    Dear Experts
    I am stuck in an inventory ageing report which is to be done year wise. the scenario is as follow.
    selection screen i enter the year 2011 or 2010 or 2009.
    the output should show me 2011-2007 or 2010-2007 or 2009-2007. the alv grid should always start from 2007 and end at the year that is entered in the selection screen.
    Now how can i create a dynamic variables to store the values of the corresponding yr and also how can i create a dynamic internal table to store these values.
    Thanks & Regards
    Zamir Parkar

    Hi Zamir,
    if you are new to ABAP you may leave old and buggy techniques behind.
    If you want to create the table dynamically, please do not use l_alv_table_create=>create_dynamic_table because it is limited and always triggers a possibly unwanted database commit.
    You better use RTTS dynamic runtime type services, i.e. check the example for [Creating Flat and Complex Internal Tables Dynamically using RTTI|http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI].
    As done here, leave all outdated ALV technologies behind and start with CL_SALV_TABLE. It is following the object-oriented approach and does not need a field catalog.
    You will get used to field-symbols that can be compared to the data referenced by a pointer. For dynamic fields, you may build the field names dynamically, i.e.
    DATA:
          lo_structdescr         TYPE REF TO cl_abap_structdescr,
          lo_typedescr           TYPE REF TO cl_abap_typedescr,
          lo_tabledescr          TYPE REF TO cl_abap_tabledescr,
          lr_data                TYPE REF TO data,
          lt_comp_all            TYPE cl_abap_structdescr=>component_table,
          lv_index               TYPE numc2.
        FIELD-SYMBOLS:
          <any>                  TYPE ANY,
          <component>            TYPE LINE OF abap_component_tab,
           <table>                TYPE table.
        DO nnn TIMES.
          lv_index = sy-index.
          lo_typedescr   =  cl_abap_typedescr=>describe_by_name( <name of data element> ).
          APPEND INITIAL LINE TO lt_comp_all ASSIGNING <component>.
          <component>-type ?= lo_typedescr.
          CONCATENATE 'YEARVAL' lc_underscore lv_index INTO <component>-name.
          <component>-as_include  = abap_true.
          CONCATENATE lc_underscore lv_index INTO <component>-suffix.
        ENDDO.
    * create description object for structured type
        lo_structdescr = cl_abap_structdescr=>create( lt_comp_all ).
    *  create table description object for this
        lo_tabledescr = cl_abap_tabledescr=>create(
                        p_line_type  = lo_structdescr
                        p_table_kind = cl_abap_tabledescr=>tablekind_std
                        p_unique     = abap_false ).
    * create data object
        CREATE DATA lr_data TYPE HANDLE lo_tabledescr.
    ASSIGN lr_data->* to <table>.
    This is a fragment. Please adapt to your needs.
    Regards,
    Clemens

  • Dynamic Variable Naming for Sound Object

    Is it possible to dynamically name a variable? I'd like to
    create a new Sound Object on the fly, so that I can use the
    Sound.load() method multiple times. I would simply like to create
    and name the variable and add a number to the end of the name
    (i.e.; var "audio_1":Sound). I'm sure that this is possible.
    However, I can't seem to get it figured out.

    This code worked great! However, how can I set a global
    variable equal to the newly created Sound Object so that it is
    available globally via a reuseable reference?
    Here's an example of how I attempted to do this. Please note:
    audioObject is a global variable that I am trying to use to
    reference the new Sound Object in various places.
    audioObjectCount is a global variable that I am using to set
    or get the next number to use when dynamically creating the next
    new Sound Object

  • Return statement and accessing object's variable

    I want to return object variable but I am not sure how
    that is the constructor which takes int as arg.
    public class VHS implements MyInterface
    int year;
    public VHS (int year)
    this.year = year;
    Now I create new object in main class
    VHS currentMovie;
    currentMovie = new VHS(1995);
    int movieYear;
    System.out.println("enter the year of movie: ");
    movieYear=Keyboard.readInt();
    currentMovie.movieTitle(movieYear);
    System.out.println("passed as parameter when creating obj = new VHS(" currentMovie ")" );
    currentMovie.userInput();
    // it printout the year entered by user and works fine, however the thing above it dont, it is supposed to return the same thing
    // the problem is with currentMovie. I know I could do it differently, but I am curious if I could somehow printout the argument that was passed to the object using currentMovie.
    I quess I would need toString method but if I create it I got a message incompatible types :
    public String toString()
    return year; // year is an int
    If anyone is able to understand what I am trying to do, please respond
    and thank you , this forum already helped me very much, much more than my professors :) who are extremally weird

    public String toString()
    return year; // year is an int
    }Of course it says incompatible types. You're trying to return with an int, when you declared that the method should return String.
    String, although it is an object in Java, is treated differently. You can convert any primitive value to String easily. You also can convert any kind of objects to String as well.
    In case of primitives, one of the "wrapper" classes will be used to convert the primitive to string. In case of objects, the toString method of the object will be used to convert.
    Since you want to convert an int (primitive) to string, the easiest way perhaps:
    return "" + year;
    Since one of the operands has the type of String, the operator will change to be the "concatenate strings" operator, and the other operand will be converted to string. The returning type of the expression is String, and that's what it should be.
    You also might use the static method of the Integer wrapper class:
    return Integer.toString(year).

Maybe you are looking for

  • Jdev 11.1.1.5 R1 How To Get Row Data From ADF Table

    Hi everyone, I have an ADF Table Populated with dummy data (for now). Below the Table there is an InputText field. What I need to do is have the body of the message show up in the InputText field when the user clicks on a message in the inbox(Table).

  • HT4527 how do I get my Itunes library from my desktop/mac to my laptop?

    I would like to have my Itunes library that I have on my desktop, on my laptop as well. How do I do that?

  • Can't access multiple mail accounts through mail access through the web OK

    Mail will not let me access more than one web mail account. The error message reads that the server will not accept my password. When I go to the web mail site, I have no problem with any of the accounts. I have checked and rechecked the mail prefere

  • Restart message scheduled for outbound processing

    Hi, I'm having a BPM process that collects IDocs. A lot of messages got stuck now in the status message scheduled for outbound processing. Can I manually restart these messages? What will it happen if I restart them? Will they be sent twice or just o

  • Db batch update problem

    I have a real problem with doing a batch update in SOA Suite and have tried a number of different approaches but they have all failed at some point. My requirement is really quite simple. I have a simple table - MY_TABLE: Columns: PK_ID - primary key