Class instantiation through mxml - setting properties

Hi,
I'm trying to create a reusable component with an actionscript class.
I'd like to be able to set a handful of the class' properties withmxml attributes. So far, I've had no success doing so.
I've subset my problem into a separate, simplied project in an attempt to rule out any of the other parts of the real application interfering with what I'm attempting to accomplish. Unfortunately, my simplified project produces the same result.
In my example, I'm just trying to set value of the property "myValue."  Can anyone tell me what I'm doing wrong? What am I missing?
Thanks in advance for any help!
Main application (TestProj.mxml)
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                  xmlns:s="library://ns.adobe.com/flex/spark"
                  xmlns:mx="library://ns.adobe.com/flex/mx"
                  minWidth="955" minHeight="600"
                  xmlns:pkg="pkg.*">
     <fx:Declarations>
          <!-- Place non-visual elements (e.g., services, value objects) here -->
     </fx:Declarations>
     <pkg:TestClass myvalue="some value" />
</s:Application>
Actionscript class (pkg\TestClass.as)
package pkg
     import mx.controls.Alert;
     import mx.core.UIComponent;
     public class TestClass extends UIComponent
          private var _myvalue:String;
          public function TestClass()
               Alert.show("myvalue=" + this._myvalue);     
          public function get myvalue():String
               return _myvalue;
          public function set myvalue(value:String):void
               _myvalue = value;

Hi,
The property gets set correctly, but the constructor of your class will always execute before the attributes - this is because Flex needs to create the instance and execute the c-tor before it can set the values on the instance.  Instead try something like this:
<pkg:TestClass id="foo" myvalue="some value" initialize="{Alert.show(foot.myvalue)}" />
This will execute the Alert.show when the component is being initialized.  If you need to put some init code in the component itself and that code relies on values set in MXML, then you can override UIComponent's public function initialize():void.
-Evtim

Similar Messages

  • General class and setting properties vs specific inner class

    This is a general question for discussion. I am curious to know how people differentiate between instantiating a standard class and making property adjustments within a method versus defining a new inner class with the property adjustments defined within.
    For example, when laying out a screen do you:
    - instantiate all the objects, set properties, and define the layout all within a method
    - create an inner class that defines the details of the layout (may reference other inner classes if complex) that is then just instantiated within a method
    - use some combination of the two depending on size and complexity.
    - use some other strategy
    Obviously, by breaking the work up into smaller classes you are simplifying the structure since each class is taking on less responsibility, as well as hiding the details of the implementaion from higher level classes. On the other hand, if you are just instantiating an object and making some SET calls is creating an inner class overkill.
    Is there a general consensus for an approach? I am curious to hear the approach of others.

    it's depends on your design..
    usually, if the application is simple and is not expected to be maintain (update..etc..) than I just have all the building of the gui within the same class (usually..the main class that extends JFrame).
    if the application follows the MVC pattern, than I would have a seperate class that build the GUI for a particular View. I would create another class to handle the ActionEvent, and other event (Controller)
    I rarely use inner class...and only use them to implements the Listerner interface (but only for simple application)..

  • Mojarra doesn't implement setting properties on declared converters?

    Hi,
    I tried to register a custom converter in faces-config, by means of the following declaration:
    <converter>
              <description>Formats a number with exactly two fractional digits.</description>
              <converter-id>numberformat.two</converter-id>
              <converter-class>javax.faces.convert.NumberConverter</converter-class>
              <property>
                   <property-name>maxFractionDigits</property-name>
                   <property-class>java.lang.Integer</property-class>
                   <default-value>2</default-value>
              </property>
              <property>
                   <property-name>minFractionDigits</property-name>
                   <property-class>java.lang.Integer</property-class>
                   <default-value>2</default-value>
              </property>
         </converter>I've used this kind of code before a long time ago when using MyFaces, and this always Just Worked. However, with Mojarra it just doesn't work.
    I used the converter on my view like this:
    <h:outputText value="#{bb.someVal}">
         <f:converter converterId="numberformat.two"/>
    </h:outputText>By putting a breakpoint in javax.faces.convert.NumberConverter, I can check that the converter is being called, but the properties just aren't set on the instance.
    I hunted the Mojarra source code, but I also can't find any code that is supposed to set these properties.
    For instance, the ApplicationImp.createConverter method consists of this code:
    public Converter createConverter(String converterId) {
            if (converterId == null) {
                String message = MessageUtils.getExceptionMessageString
                    (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "convertedId");
                throw new NullPointerException(message);
            Converter returnVal = (Converter) newThing(converterId, converterIdMap);
            if (returnVal == null) {
                Object[] params = {converterId};
                if (logger.isLoggable(Level.SEVERE)) {
                    logger.log(Level.SEVERE,
                            "jsf.cannot_instantiate_converter_error", converterId);
                throw new FacesException(MessageUtils.getExceptionMessageString(
                    MessageUtils.NAMED_OBJECT_NOT_FOUND_ERROR_MESSAGE_ID, params));
            if (logger.isLoggable(Level.FINE)) {
                logger.fine(MessageFormat.format("created converter of type ''{0}''", converterId));
            return returnVal;
        }So without all the error checking, the method basically boils down to just this:
    return (Converter) newThing(converterId, converterIdMap);The heart of newThing consists of this:
    try {
                result = clazz.newInstance();
            } catch (Throwable t) {
                throw new FacesException((MessageUtils.getExceptionMessageString(
                      MessageUtils.CANT_INSTANTIATE_CLASS_ERROR_MESSAGE_ID,
                      clazz.getName())), t);
            return result;So there's no code that's supposed to set these properties in sight anywhere.
    Also the converter tag (com.sun.faces.taglib.jsf_core.ConverterTag) nor any of its base classes seems to contain such code.
    Either I'm doing something very wrong, or Mojarra has silently removed support for setting properties on custom converters, which would seem awkward.
    Any help would be greatly appreciated.

    rlubke wrote:
    Mojarra has never supported such functionality, so it hasn't been silently removed.Thanks for explaining that. Like I said, the silently removed option thus was the less likely of the two ;)
    The documentation for this converter sub-element states:
    <xsd:element name="property"
    type="javaee:faces-config-propertyType"
    minOccurs="0"
    maxOccurs="unbounded">
    <xsd:annotation>
    <xsd:documentation>
    Nested "property" elements identify JavaBeans
    properties of the Converter implementation class
    that may be configured to affect the operation of
    the Converter.  This attribute is primarily for
    design-time tools and is not specified to have
    any meaning at runtime.
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    That documentation is quite clear indeed. I now notice that the project I was working on still had a JSF 1.1 faces-config DTD, and that documentation said this:
    Element : property
    The "property" element represents a JavaBean property of the Java class represented by our parent element.
    Property names must be unique within the scope of the Java class that is represented by the parent element,
    and must correspond to property names that will be recognized when performing introspection against that
    class via java.beans.Introspector.
    Content Model : (description*, display-name*, icon*, property-name, property-class, default-value?,
    suggested-value?, property-extension*)So there it actually says nothing about the design time aspect.
    I do have to mention that I think this entire difference between design time and run time could maybe have been a bit more officially formalized. Don't get me wrong, I think JSF and the whole of Java EE is a really good spec that has helped me tremendously with my software development efforts, but this particular thing might be open for some improvements. A similar thing also happens in the JPA spec, where some attributes on some annotations are strictly for design time tools and/or code generators, but it's never really obvious which ones that are.
    More on topic though, wouldn't it actually be a good idea if those properties where taken into account at run-time? That way you could configure a set of general converters and make them available using some ID. In a way this wouldn't be really different in how we're configuring managed beans today.

  • Setting properties

    hi,
    is it possible to set properties on one java class and then acess them from another?
    setting on one
    <jsp:useBean id="employee" class="com.Database.Employee scope="page"/>
                                           <jsp:setProperty name="employee" property="forename" value="Helen"/>
                                           <jsp:setProperty name="employee" property="surname" value="McArthur"/>
                                  </jsp:useBean>setting on another:
         <jsp:useBean id="empskill" class="com.Database.EmployeeSkill" scope="page">
             <jsp:setProperty name="empskill" property="sname" value="Java"/>
         </jsp:useBean>
         so that i may call this?:
    public ArrayList getReport()
            System.out.println("calling getEmployeeSkills(ename, sname, yearsexp");
            ArrayList employeeSkillDetails = new ArrayList();
            try
                JDBCConn conection = new JDBCConn();
                this.con = conection.Connect();
                stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                StringBuffer sb = new StringBuffer();
                sb.append("SELECT Forename, Surname, SkillName, SkillLevel, YearsExperience  " +
                        "FROM TB_Employee, TB_Skill, TB_EmpSkill " +
                        "WHERE TB_EmpSkill.EmpID = TB_Employee.EmpID  " +
                        "AND TB_EmpSkill.SkillID = TB_Skill.SkillID ");
                if (Employee.forename != null)
                    sb.append("AND forename = '" +Employee.forename+ "' ");   
                if (Employee.surname !=null)
                    sb.append("AND forename = '" +Employee.surname+ "' ");   
                if (this.yearsexperience != null)
                    sb.append("AND YearsExperience = '" +this.yearsexperience+ "' ");
                System.out.println(sb.toString());
                rs = stmt.executeQuery(sb.toString());
                while (rs.next())
                    EmployeeSkill empSkill = new EmployeeSkill();
                    Employee.forename = rs.getString(1);
                    Employee.surname = rs.getString(2);
                    empSkill.skilllevel = rs.getString(4);
                    empSkill.yearsexperience = rs.getString(5);
                    employeeSkillDetails.add(empSkill);
            catch (Exception e)
                e.printStackTrace();
            return employeeSkillDetails;
        }or do all the varables have to be in the same class

    all iget when i do this is:
    org.apache.jasper.JasperException: /main.jsp(34,73) equal symbol expected
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: /main.jsp(34,73) equal symbol expected
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
         org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:193)
         org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
         org.apache.jasper.compiler.Parser.parseUseBean(Parser.java:1014)
         org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1240)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1576)
         org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • NPE setting properties with CustomEvent

    Hello, I am trying out CustomEvents, but there is something strange setting properties. I try to do a
    public class CustomEvents extends VBean {
       private ID myEvent = ID.registerProperty("MY_EVENT");
       private ID myData = ID.registerProperty("MY_DATA");
       private IHandler handler = null;
       private void log(String message) {
          System.out.println(message);
       public CustomEvents() {
          log("Constructor");
       public final void init(IHandler handler) {  
          this.handler = handler;
          super.init(handler);
          log("Init");
          try {
             CustomEvent customEvent = new CustomEvent(handler, myEvent);
             if ( (myEvent == null) || (myData == null) || (handler == null) || (customEvent == null) ) {
                log("There be nulls");
             handler.setProperty(myData, "hep");
             dispatchCustomEvent(customEvent);
          } catch (Exception e) {
             e.printStackTrace();
          log("done");
    }but end up with an
    Constructor
    Init
    java.lang.NullPointerException
         at oracle.forms.handler.JavaContainer.setProperty(Unknown Source)
         at fi.affecto.webmarela.forms.CustomEvents.init(CustomEvents.java:31)
         at oracle.forms.handler.UICommon.instantiate(UICommon.java:2984)
         at oracle.forms.handler.UICommon.onCreate(UICommon.java:1040)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Runform.java:2254)
         at oracle.forms.engine.Runform.processMessage(Runform.java:3347)
         at oracle.forms.engine.Runform.processSet(Runform.java:3491)
         at oracle.forms.engine.Runform.onMessageReal(Runform.java:3099)
         at oracle.forms.engine.Runform.onMessage(Runform.java:2857)
         at oracle.forms.engine.Runform.sendInitialMessage(Runform.java:5635)
         at oracle.forms.engine.Runform.startRunform(Runform.java:1207)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    done
    */any suggestions? myData is not null but has it failed to hook on to something during initialization? I decompiled JavaContainer and it only has null checks for top-level incoming parameters and the stack trace doesn't give any more detail. Or am I misunderstanding the usage of Custom Events completely?
    Thankful for help,
    -Nik

    Nicklas,
    the problem is that Forms does not have a property
    handler.setProperty(myData, "hep");
    You need to override
    public boolean setProperty(ID ID, Object object)
    in your Java implementation. Then within this method you evaluate if the ID is "myData" and if, do something. If no ID match can be found then you call
    return super.setProperty(_ID, _object);
    Thsi way all custom properties are handled by you and all Forms properties are passed to Forms.
    Frank

  • How to set properties in a loop in jsp

    I have a problem to set properties for beans in jsp
    this is part of my code:
    <jsp:useBean id="searchHandler" class="searchHandler.class"
    scope="session">
    </jsp:useBean>
    <%
    String[] tempStr={"hello","you","happy"};
    for(int i=0; i<tempStr.length; i++)
    %>
    <jsp:setProperty name="searchHandler" property="beanStr" value="<%= tempStr[i] %>" />
    <%
    %>
    it doesn't work well.
    something wrong?

    Hi,
    why do you use the print-tag in your setProperty-Tag.
    Try it without <%=tempStr%>.
    Try <%tempStr%>
    or only tempStr.

  • Use wscompile to set properties in generated client.

    It seems to me that there should be an easy way to set properties in generated code.
    My client code generates properly, for instance:
            try {
                stub._initialize(super.internalTypeRegistry);
            } catch (JAXRPCException e) {
                throw e;
            } catch (Exception e) {
                throw new JAXRPCException(e.getMessage(), e);
            }      However, at this point, I am now having to insert the properties for user/pass (basic authentication) by hand.
            try {
                stub._initialize(super.internalTypeRegistry);
                stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"any user");
                stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"any password");
            } catch (JAXRPCException e) {
                throw e;
            } catch (Exception e) {
                throw new JAXRPCException(e.getMessage(), e);
            }Simple enough.
    Has anyone done this automatically, using wscompile? Manually changing generated code just seems like bad form to me.
    Thanks,
    DaShaun

    Ok, don't do what I tried to do. Very bad form, my apologies. Instead of adding the authentication code to the generated classes, I should have been adding it to my client code.
    Each client then needs to authenticate itself. My approach would have allowed any client to use the code and be authenticated as 'any user'. This is not good.
    DaShaun

  • Core not instantiated through a PrimaryClassloader

    Every time I restart/start my Macbook Pro I get this ominous warning in the console log.
    +Warning: Core not instantiated through a PrimaryClassloader, this can lead to restricted functionality or bugs in future versions+
    Here is the log entry in full:
    +Mac OS X Version 10.4.11 (Build 8S2167)+
    +2009-04-15 15:04:33 -0400+
    +Apr 15 15:04:34 belisle mDNSResponder: NOTE: Wide-Area Service Discovery disabled to avoid crashing defective DNS relay 192.168.1.1.+
    +Apr 15 15:04:41 belisle /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Error: WirelessAssociate2() = 88001006 for network murphy. The operation timed out.+
    +2009-04-15 15:04:47.748 SystemUIServer[158] lang is:en+
    +Apr 15 15:04:49 belisle /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Error: WirelessAssociate2() = 88001006 for network murphy. The operation timed out.+
    +Apr 15 15:04:58 belisle /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Error: WirelessAssociate2() = 88001006 for network linksys. The operation timed out.+
    +Apr 15 15:05:00 belisle /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Error: Apple80211Scan() failed 16+
    +Apr 15 15:05:00 belisle /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Error: Apple80211Scan() failed 16+
    +Apr 15 15:05:00 belisle /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport: Error: Apple80211Scan() failed 16+
    +Apr 15 15:07:39 belisle mDNSResponder: NOTE: Wide-Area Service Discovery disabled to avoid crashing defective DNS relay 192.168.1.1.+
    +2009-04-15 15:08:57.209 Safari[320] Loaded GrowlSafari 1.1.4+
    +2009-04-15 15:08:57.209 Safari[320] Using Growl.framework 1.1.4 (1.1.4)+
    +FoxyProxy settingsDir = /Users/brodiestevenson/Library/Application Support/Firefox/Profiles/pssd7l3s.default+
    +2009-04-15 15:46:51.326 Mail[336] 0x1692e020: observer lock is held, postponing release. break at /SourceCache/Message/Message-753.1/Utilities.subproj/FoundationAdditions.m:649 to debug+
    +2009-04-15 15:46:51.349 Mail[336] 0x1692e020: observer lock is held, postponing release. break at /SourceCache/Message/Message-753.1/Utilities.subproj/FoundationAdditions.m:649 to debug+
    +2009-04-15 15:46:52.425 Mail[336] 0x1692ade0: observer lock is held, postponing release. break at /SourceCache/Message/Message-753.1/Utilities.subproj/FoundationAdditions.m:649 to debug+
    +Apr 15 15:58:56 belisle mDNSResponder: Repeated transitions for interface en0 (192.168.1.2); delaying packets by 5 seconds+
    +OSXAccess v1.03 Load complete!+
    +*Warning: Core not instantiated through a PrimaryClassloader, this can lead to restricted functionality or bugs in future versions*+
    +changeLocale: *Default Language* != English (United States). Searching without country..+
    +changeLocale: Searching for language English in any country..+
    +changeLocale: no message properties for Locale 'English (United States)' (en_US), using 'English (default)'+
    /Applications/Vuze.app/Contents/plugins/azemp:/Applications/Vuze.app/Contents/Re sources/Java/dll:/System/Library/PrivateFrameworks/JavaApplicationLauncher.frame work/Resources
    +DEBUG::Wed Apr 15 16:14:34 EDT 2009 Disposing Native PlatformManager...+
    +DEBUG::Wed Apr 15 16:14:34 EDT 2009 Done+
    +Apr 15 18:15:01 belisle mDNSResponder: NOTE: Wide-Area Service Discovery disabled to avoid crashing defective DNS relay 192.168.1.1.+
    +Apr 15 18:15:14 belisle mDNSResponder: Repeated transitions for interface lo0 (127.0.0.1); delaying packets by 5 seconds+
    I am not sure what is being referred to or if this is even a serious issue with my operating system. This is new though.
    Any info would be sincerely appreciated as I have not found anything on this yet.
    My thanks in advance,
    bbelisle

    Thanks for the tip. After a little trouble shooting it appears that the culprit is indeed Vuze.
    Cheers,
    bbelisle

  • "Message from Webpage (error) There was an error in the browser while setting properties into the page HTML, possibly due to invalid URLs or other values. Please try again or use different property values."

    I created a site column at the root of my site and I have publishing turned on.  I selected the Hyperlink with formatting and constraints for publishing.
    I went to my subsite and added the column.  The request was to have "Open in new tab" for their hyperlinks.  I was able to get the column to be added and yesterday we added items without a problem. 
    The problem arose when, today, a user told me that he could not edit the hyperlink.  He has modify / delete permissions on this list.
    He would edit the item, in a custom list, and click on the address "click to add a new hyperlink" and then he would get the error below after succesfully putting in the Selected URL (http://www.xxxxxx.com), Open
    Link in New Window checkbox, the Display Text, and Tooltip:
    "Message from Webpage  There was an error in the browser while setting properties into the page HTML, possibly due to invalid URLs or other values. Please try again or use different property values."
    We are on IE 9.0.8.1112 x86, Windows 7 SP1 Enterprise Edition x64
    The farm is running SharePoint 2010 SP2 Enterprise Edition August 2013 CU Mark 2, 14.0.7106.5002
    and I saw in another post, below with someone who had a similar problem and the IISreset fixed it, as did this problem.  I wonder if this is resolved in the latest updated CU of SharePoint, the April 2014 CU?
    Summary from this link below: Comment out, below, in AssetPickers.js
    //callbackThis.VerifyAnchorElement(HtmlElement, Config);
    perform IISReset
    This is referenced in the item below:
    http://social.technet.microsoft.com/Forums/en-US/d51a3899-e8ea-475e-89e9-770db550c06e/message-from-webpage-error-there-was-an-error-in-the-browser-while-setting?forum=sharepointgeneralprevious
    TThThis is possibly the same information that I saw, possibly from the above link as reference.
    http://seanshares.com/post/69022029652/having-problems-with-sharepoint-publishing-links-after
    Again, if I update my SharePoint 2010 farm to April 2014 CU is this going to resolve the issue I have?
    I don't mind changing the JS file, however I'd like to know / see if there is anything official regarding this instead of my having to change files.
    Thank you!
    Matt

    We had the same issue after applying the SP2 & August CU. we open the case with MSFT and get the same resolution as you mentioned.
    I blog about this issue and having the office reference.
    Later MSFT release the Hotfix for this on December 10, 2013 which i am 100% positive should be part of future CUs.
    So if you apply the April CU then you will be fine.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • The KitKat upgrade has been a disaster. home wireless is no longer recognized, even going through the set-up process.  It does not connect to the car through Bluetooth seamlessly--I have to add my phone as a new device each time I get in the car.  In atte

    My home wireless is no longer recognized, even going through the set-up process.  It does not connect to the car through Bluetooth seamlessly--I have to add my phone as a new device each time I get in the car.  In attempting to solve these problems I have gone to settings-phone-upgrade and it states that the upgrade is available-select to continue-(which I do)- it checks -please wait and it then states that update not available - try later.

    Maybe not too late to help you.
    For specifically fixing the Bluetooth, un-pair your phone with the car, and go through the process of repairing the two.
    In general, the KK update requires many of us (different phones) to perform a Factory Data Reset after we back up our personal content (pictures, music, movies, or other downloaded files) to a PC or MAC. This will result in you having to do a bit of work to setup icons for the programs you use, and maybe putting in the specifics again for email accounts and other specialized apps. So if you are going to do this sort of thing... copy important information/settings down on paper.
    HTH.

  • TDMS Set Properties in a loop?

    I am using LV 8.5 and am trying to apply TDMS properties to multiple channels in one fell swoop, with the idea of being able to automate it for the number of channels currently active.  I know how to do this, except for one step I'm struggling with.  I keep getting the error:
    "LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
    =========================
    NI-488:  Command requires GPIB Controller to be Controller-In-Charge."
    coming from the tdms set properties.  I'm feeding it an an indexing array of strings, which I believe are C-strings so null terminator as the help files says it struggles with such, and no addresses.  I've attached a partially completed VI that is otherwise working.
    Thanks for your assistance,
    Bret Dahme
    Solved!
    Go to Solution.
    Attachments:
    Multiple_inputs.vi ‏102 KB

    Bingo!  Glad that it was a quick and easy solution.  The help file says group or channel and nothing that i can see of requireing either.
    Thanks for the help!
    Attachments:
    Multiple_inputs.vi ‏98 KB

  • SETTING PROPERTIES FOR A MAPPING VIA OMBPLUS ISN'T WORKING

    Hi, i have a problem with OMBPLUS:
    I have a script which creates a mapping and then is supposed to change properties for the mapping and seems to do so via OMBRETRIEVE. But when looking in OWB the properties aren't changed.
    If I change any of the properties inside OWB and then run the script again, then the properties are changed. Does anyone know why the behavior is like this?
    /thanx Joel
    When running the script the output looks like this:
    CREATE MAPPING 'XXX_1_IN'... DONE
    DEFAULT_OPERATING_MODE={SET BASED FAIL OVER TO ROW BASED}
    ALTER MAPPING PROPERTIES FOR 'T_A_TEST_XXX_1_IN'... DONE
    DEFAULT_OPERATING_MODE={SET BASED}
    -- ALL DONE --
    The script:
    set temp_module "TMP"
    set tmp_table1 "XXX_1"
    set tmp_table2 "XXX_2"
    set map_name "XXX_1_IN"
    puts -nonewline "CREATE MAPPING '$map_name'... "
    OMBCREATE MAPPING '$map_name' \
    ADD TABLE OPERATOR '$tmp_table1' BOUND TO TABLE '../$temp_module/$tmp_table1' \
    ADD TABLE OPERATOR '$tmp_table2' BOUND TO TABLE '../$temp_module/$tmp_table2' \
    ADD CONNECTION \
    FROM GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table1' \
    TO GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table2'
    OMBCOMMIT
    puts "DONE"
    set prop [OMBRETRIEVE MAPPING '$map_name' GET PROPERTIES (DEFAULT_OPERATING_MODE) ]
    puts "DEFAULT_OPERATING_MODE=$prop"
    puts -nonewline " ALTER MAPPING PROPERTIES FOR '$map_name'... "
    OMBALTER MAPPING '$map_name' \
    SET PROPERTIES (DEFAULT_OPERATING_MODE) \
    VALUES ('SET BASED')
    OMBCOMMIT
    set prop [OMBRETRIEVE MAPPING '$map_name' GET PROPERTIES (DEFAULT_OPERATING_MODE) ]
    puts "DEFAULT_OPERATING_MODE=$prop"
    puts "-- ALL DONE --"
    puts ""
    OMBDISCONNECT

    Thanks for your idea Roman, but it doesn't solve my problem.
    The problem is regardless of which property (Runtime parameters in OWB) I try to change. Before ANY property is changed via OWB (GUI) the changes via OMB doesn't come to effect (even if RETREIVE after OMBCOMMIT says so).
    Regards, Joel

  • SETTING PROPERTIES FOR A MAPPING VIA OMBPLUS ISN'T WORKING (OWB10gR2)

    Hi, i have a problem with OMBPLUS:
    I have a script which creates a mapping and then is supposed to change properties for the mapping. The script worked in previous releases of OWB but after upgrading to 10gR2 I get an error that DEFAULT_OPERATING_MODE property does not exist.
    Does anyone know why I get the error?
    /thanx Joel
    When running the script the output looks like this:
    CREATE MAPPING 'XXX_1_IN'... DONE
    DEFAULT_OPERATING_MODE={SET BASED FAIL OVER TO ROW BASED}
    ALTER MAPPING PROPERTIES FOR 'T_A_TEST_XXX_1_IN'...
    OMB02902: Error setting property DEFAULT_OPERATING_MODE of T_A_TEST_XXX_1_IN: MMM1034: Property DEFAULT_OPERATING_MODE does not exist.
    -- ALL DONE --
    The script:
    set temp_module "TMP"
    set tmp_table1 "XXX_1"
    set tmp_table2 "XXX_2"
    set map_name "XXX_1_IN"
    puts -nonewline "CREATE MAPPING '$map_name'... "
    OMBCREATE MAPPING '$map_name' \
    ADD TABLE OPERATOR '$tmp_table1' BOUND TO TABLE '../$temp_module/$tmp_table1' \
    ADD TABLE OPERATOR '$tmp_table2' BOUND TO TABLE '../$temp_module/$tmp_table2' \
    ADD CONNECTION \
    FROM GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table1' \
    TO GROUP 'INOUTGRP1' OF OPERATOR '$tmp_table2'
    OMBCOMMIT
    puts "DONE"
    set prop [OMBRETRIEVE MAPPING '$map_name' GET PROPERTIES (DEFAULT_OPERATING_MODE) ]
    puts "DEFAULT_OPERATING_MODE=$prop"
    puts -nonewline " ALTER MAPPING PROPERTIES FOR '$map_name'... "
    OMBALTER MAPPING '$map_name' \
    SET PROPERTIES (DEFAULT_OPERATING_MODE) \
    VALUES ('SET BASED')
    OMBCOMMIT
    puts "-- ALL DONE --"
    puts ""
    OMBDISCONNECT

    Hi, don't look at the script it was copied and pasted from an old thread. The problem is the error I get when trying to execute:
    OMBALTER MAPPING 'map_name' \
    SET PROPERTIES (DEFAULT_OPERATING_MODE) \
    VALUES ('SET BASED')
    OMB02902: Error setting property DEFAULT_OPERATING_MODE of map_name: MMM1034: Property DEFAULT_OPERATING_MODE does not exist.
    //Joel

  • [JS CS3]setting properties of inline rectangle

    Hi,
    This doesn't seem to work for somes reason...
    myLibItem = myLib.assets.item("Steunvraag");
    var myIP = myFrame.texts.item(0).insertionPoints.item(-1);
    myLibItem = myLibItem.placeAsset(myIP);
    myLibItem.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
    So I've placed a library asset in an insertion point - so far so good - but when i want to set properties of the result (a rectangle), I get an error about the object not supporting the method anchoredObjectSettings. I use the same construction elsewhere in the script with a textframe created from scratch, and that works fine.
    Any suggestions?
    thnx

    placeAsset returns an array (even for this case where there can only ever be one item). So:
    myLibItem = myLibItem.placeAsset(myIP)[0];
    Dave

  • OMBPLUS - Setting properties of objects in Collection.

    Hi All,
    I am trying to set the Deployable property of objects in a collection in order to automate our deployment process. Basically, we use collections for our releases, and I want to set the property as above before running our deployment script which looks for objects that are marked as deployable.
    see below my attempt at this:
    #logging file
    set OMBLOG C:\\CORT_BAUV_13\\OMB\\omblog.txt
    set fParams [open Params.lst r]
    gets $fParams OwbUsername
    gets $fParams OwbPasswd
    gets $fParams Hostname
    gets $fParams Port
    gets $fParams Database
    gets $fParams StgUsername
    gets $fParams OdsUsername
    gets $fParams ClnUsername
    gets $fParams DwhCrtUsername
    gets $fParams DwhLdwUsername
    gets $fParams CtlUsername
    gets $fParams DwhAdmUsername
    gets $fParams Passwd
    gets $fParams resetAll
    gets $fParams Collection
    close $fParams
    #REPOSITORY CONNECTION
    set reposConnection $OwbUsername/$OwbPasswd@$Hostname:$Port:$Database
    #CONSTANTS
    set projectName MI_HEAD
    puts "Connecting to: $reposConnection"
    OMBCONNECT $reposConnection
    puts "Connected to Repository..."
    OMBCC '/$projectName/'
    OMBCONNECT CONTROL_CENTER
    set dtaList [OMBRETRIEVE COLLECTION '$Collection' GET DATA_AUDITOR REFERENCES   ]
    puts "Resetting Data Auditors $dtaList"
    foreach dtaName $dtaList {
    OMBALTER DATA_AUDITOR '$dtaName' SET PROPERTIES (DEPLOYABLE) VALUES (1)
    OMBCOMMIT
    OMBDISC
    Currrently, I get this error:
    OMB01004: Current context is not an Oracle module context.
    Any ideas?

    thanks david...
    the main problem is getting the module to switch context to..
    the result of the puts "Resetting Data Auditors $dtaList" is as follows:
    Resetting Data Auditors /MI_HEAD/TGT_STAGE/VALID_BUSINESS_AREA_AUDIT
    /MI_HEAD/TGT_STAGE/VALID_DRAWDOWN_AUDIT /MI_HEAD/TGT_STAGE_LD/VALID_LD_CONNECTION_AUDIT
    the result above does show the module of each object but how do i dynamically change context to each module
    i.e
    foreach dtaName $dtaList {
    OMBCC $dtaName
    OMBALTER DATA_AUDITOR '$dtaName' SET PROPERTIES (DEPLOYABLE) VALUES (1)
    i tried OMBCC$dtaName
    OMBCC '..'
    to get into the context of the module that holds the object, but that still did not work...
    thanks,
    Olu

Maybe you are looking for