How to access attribute in its owner method?

var group : Group = Group{
content: for(i in [0..10])
for(j in [0..10])
Rectangle{
x:20
onMouseClicked: function( e: MouseEvent ):Void {
var xc = x // why can't access here x???? How to access?
insert
Line {
startX: x//How to access x attribute from rectangle??
startY: y //How to access y attribute from rectangle??
endX: x+gap
endY: y+gap
strokeWidth: 1
stroke: Color.BLACK
into stage.scene.content
};

You can define global variables by using a public variable on script-level. Just make sure you define it outside of any class definition. For example if you want to define a global environment, you can create a script Environment.fx and put there your global variables:
public var GLOBAL_VAR1 = 42;You can access this variable from anywhere with:
Environment.GLOBAL_VAR1 = ...

Similar Messages

  • How to access attribute name (xml) in Servlet ?

    Hi All,
    Anybody please tell me how to access attribute name in servlet ?
    Thanks

    Parser.java
    public class Parser
    public static String getAtt()
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setNamespaceAware(true);
              DocumentBuilder parser = factory.newDocumentBuilder();
              Document doc = parser.parse("customer.xml");
              Element root = doc.getDocumentElement();
    return root.getAttribute("name");
    public static void main(String [] argc)
    Parser p = new Parser();
    p.getAtt();
    Servlet.java
    Parser p1 = new Parser();
    String att1 = p1.getAtt();
    Hope this will help u.
    ....yogesh

  • How to access attribute

    Hi all,
       I am new to webdynpro for ABAP.  How to access the attribute which is directly under the root context.
    ex.
    Root Context
    |
       Name   ---> attribute.
    Regards,
    Gnid.

    Hi Gopi,
    Accessing a context element or a context attribute requires to first have a  reference to the related context node. The context root node can be accessed by the standard attribute WD_CONTEXT. 
    To Access a Node Element: After having accessed a context node, the reference to the element at lead selection  of this node can be obtained by calling the method get_element( ). Thismethod  returns a reference to the element instance of type IF_WD_CONTEXT_ELEMENT. Accessing the Node Element at Lead Selection  The element with index n can be accessed using the method get_element( index  = n ) .
    Once we access the element we can access the attribute by GET_ATTRIBUTE().
    Child nodes of the context root node can be identified using the get_child_node(  ) method. This method returns a reference to the node instance of type  IF_WD_CONTEXT_NODE. The get_child_node( ) method requires the name of  the node and, optionally, the index of the element in the parent node to which the  desired node instance belongs. In this case, the parent node is the context root,  which only ever has one element; therefore, the index parameter is 1 (default =  lead selection of parent element).
    Best regards,
    Suresh
    Message was edited by:
            Suresh Honnappanavar

  • HOW TO ACCESS ATTRIBUTES FROM DIFFERENT VIEW SET

    Hi Experts,
    How i can  access the variables declared in context class from component controller class
    and vice-versa.
    Thanks & Regards
    Ansal

    Hi Ansal
    You can bind your context node of view to component controller context node and then you can access the data.
    You can do this binding by inserting following statements in create_context_node method of your _ctxt class.
    owner->do_context_node_binding( iv_controller_type = cl_bsp_wd_controller=>co_type_component
       iv_target_node_name = 'BUILHEADER'  
       iv_node_2_bind = builheader ).
    Regards,
    Rashmi

  • How to Access Attributes of Fields in VARIANT

    Hi,
    Can anyone let me know how we can access Field attributes of a variant? I need to change and create these attributes dynamically.
    Below are the attributes of screen field saved when creating an variant
         Required field                            O
         Switch GPA off                            L
         Save field without values          P
         Selection variable                       L
         Hide field 'BIS'                            N
         Hide field                                    I
         Protect field                               P
        Field name                   Type   P  I  N  L  P  L  O
        P_REPID                        P                               X
        SO_VNAME                  S
    For Example
    If 'O' is marked as u2018Xu2019 against any field in the variant then it says that this field is OBLIGATORY
    I want to access this sort of information of a variant.
    Thanks
    Rajgopal Dara

    Hi RAJ,
    Although the question is not so clear, but as far as i understand you want to see the attributes associated with all the fields in your variant. if so then you can go to maintain variant. just go to se38, select variant as radio button and change it. In the variant maintenance screen you can select change attribute of your variant. you can click on that and pass dynamically values (either from some table like TVARV or from program)
    Hope this information will be helpful for you.
    Cheers !!
    Sourabh Batwara

  • How to access attribute value from another VO using groovy?

    Hello, I am using JDeveloper 11.1.2.3.0
    I read a lot of information about this but still I am missing something. I am trying to set the value of a bind variable through Groovy expression in my VO. I want this Bind variable
    to have the value from an attribute from another VO. I tried ''adf.object.MyAppModuleImpl.findViewObject('Users1').currentRow.Iduser''
    I am getting "oracle.jbo.expr.JISyntaxError: Variable MyAppModuleImpl not recognized". I tried with 'MyAppModule' only but the result is the same.
    Can anyone help please?
    Thanks

    Check out http://www.oracle.com/technetwork/developer-tools/adf/learnmore/august2011-otn-harvest-457288.pdf Page 18 'Optimized Groovy data access to view objects'
    Timo

  • How to access attributes of an instance?

    For example, I declared an instance of a CustomNode class "workspaceRow".
         Group{
             translateX: 50
             translateY: bind (wsY * -1) + (i*25);
             content:[
                     workspaceRow{
                          lineNumber: i.toString();
                        myColor: theColor;
                        onMouseEntered: function( e: MouseEvent ): Void {
                            selectedRow = i.toString();                  
         }How do I access lineNumber? I'm trying to use it for the onMouseEntered function inside the workspaceRow (as seen above), but Eclipse says it cannot find lineNumber, because it's looking for it at the top of the hierarchy (as in, looking for lineNumber declaration on my main *.fx file, instead of inside the instance). It's because I need to be able to store some data inside, and retrieve it later on.

    For that lineNumber thing, sorry about that. I was trying to access it in the onMouseEntered function, but decided to use var "i" instead, since it was what I used to generate a loop, and I use that same variable for lineNumber, but I know it'll give me problems later on.
    Yeah, forgot about capitalized class names, and yes, WorkspaceRow is a class extending CustomNode.
    Thanks a lot, your way worked. I am just wondering though, why doesn't JavaFX want to put the declaration and instantiation of the node inside Group{}? When I move those code blocks inside, Eclipse highlights the line "Group{" and says "unexpected type required: variable found : value".
    If I proceed with initializing the instance right on the declaration inside Group{}, it says "This is the type of cyclic reference to workspaceRowNow that prevents type inference.". As in like this:
              var workspaceRowNode = WorkspaceRow{
                     lineNumber: i.toString();
                   myColor: theColor;
                   onMouseEntered: function( e: MouseEvent ): Void {
                       selectedRow = i.toString();
                       print(workspaceRowNode.lineNumber);                  
              }Can anyone explain what that means?

  • How to access XM attribute name in servlet ?

    Hi All,
    Anybody please tell me how to access attribute name in servlet ?
    Thanks

    Hi All,
    I have modified the source code of af:showDetailItem as following:
    <af:forEach items="#{bindings.VerticalAppMenus.children}" var="globalMenu" varStatus="globalMenuVarStatus">
               <af:showDetailItem text="#{globalMenu.MenuLabel}" id="sdi1" disclosureListener="#{pageFlowScope.globalMenus.refreshLineMenus}"
                 disclosed="#{(pageFlowScope.globalMenus.currentVerticalMenuId == globalMenu.MenuId) ? true : false}">
                  <f:attribute name="currentVerticalMenuId" value="#{globalMenu.MenuId}"/>
    </af:showDetailItem>
    </af:forEach>For the code *disclosed="#{(pageFlowScope.globalMenus.currentVerticalMenuId == globalMenu.MenuId) ? true : false}"*, at runtime it is giving the following error:
    *java.lang.IllegalArgumentException: Cannot convert 32 of type class oracle.jbo.domain.Number to class java.lang.Long*.
    Is there any way to cast the long to number or number to long in EL?
    Any help will be highly appreciated
    Thanks ... Best Regards
    Bilal
    Edited by: Bilal on 04-Apr-2012 19:32

  • How to access the table type field in the structure

    Hi All,
    I have a BADI CRM_MKT_ADR_SEARCH and a method CHANGE_SEARCH_RESULTS in this method I have a parameter CT_BP_CP_CHANNEL .This parameter has type CRMT_BP_CP_CHANNEL_TAB(this is table type) this has the line type CRMT_BP_CP_CHANNEL(this is structure) in this line type we have one field addrnumber.How to access this field in my method?Please help me in this regard.

    data lw_tab type CRMT_BP_CP_CHANNEL.
    loop at CRMT_BP_CP_CHANNEL_TAB into lw_tab.
       lv_field = lw_tab-addrnumber.
       <further processing>
    endloop.

  • How to access Business object type attribute from a method/function modul ?

    Hello,
    i have created a business object type object along with attributes and methods. Now inside the method i want to access the attributes. inside the method i am writing:
    data a type XXX.
    a = me->attribute
    this is creating a compilation error.
    Now the method is defined as a function module in some package, so can anyone inform me how to access object attributes from the function module ?
    pointes are awarded
    Regards

    Hello,
    thanks for your answer, but this too did not work, "=>" is for static attributes and the attributes i have are not static. Moreover, i tried it but it gave the same error :
    the abap error was when i was checking the code is :
    the type me=>documenttype is unknown
    as you know in SWO1 i created an object and when i create a method you link it to a function module and this is where you have the implementation of the method, so from this method how can i access the attributes on the main object that i created in SWO1
    regards

  • How to access the attributes from a method

    Hi,
    Thanks to all who replied to my previous thread. Please let me know how to access the attributes in method of component controller in the view.
    Let Component_method be my method in component controller which contrains few attributes like this
    method component_method.
    data : node1 type ref to if_wd_context_node,
            itab type standard type of mara.
    endmethod.
    I want to access the above attributes in method of view.
    method view1.
    wd_comp_controller->method_component( ).
    ????? how to access the data of the method_component?
    endmethod.
    Kindly help me out in the syntax.
    Rgrds
    Mahathi

    Hi mahathi
    You should define the parameters in the header, not in the body of the method:
    You can define it as importing, exporting, changing or returning, as you need. For example, in SE80
    Parameter             Cl.declar.          RefTo        Opt        Type ref
    node1                    importing            X                          if_wd_context_node
    itab                       exporting                                        mara
    method_component().
    " code here...
    endmethod.
    and when you have to call the method,
    wd_comp_controller->method_component(
                    EXPORTING     node1 = nodelocal   " not importing!!!
                    IMPORTING      itab   = itablocal      " not exporting!!!
    i think that it's this what you want, don't i?

  • How to access custom attribute value on the timecard at runtime

    I have created 2 attributes; Project and Task.
    Once a employee selects the Project from the Projects custom LOV I want the Task LOV to display only the tasks related to that particular project.
    How to access the PROJECT_ID during runtime which the user selects from Projects LOV?

    Hi
    I have added the below text in the ldt file.
    But its not working? Any suggestions?
    What may be going wrong?
    # CSR Project List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRPROJECT"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_PROJECT"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "211"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom1VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE6 =
    "XxcsrProjectId|Projects List|RESULT|N"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom1VO"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute1"
    QUALIFIER_ATTRIBUTE28 = "Projects List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Project List
    # CSR Task List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRTASK"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_TASK"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "212"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom2VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom2VO"
    QUALIFIER_ATTRIBUTE14 =
    "HxcCuiTaskProjectId|PROJECT|Y"
    QUALIFIER_ATTRIBUTE15 =
    "pro_id = ::XxcsrProjectId"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute2"
    QUALIFIER_ATTRIBUTE28 = "Task List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Task List
    ###########################################################

  • How come property attribute of jsp:getProperty  knows which method to call

    Hello friends,
    I could not understand How come property attribute of <jsp:getProperty knows which method to call
    <jsp:useBean id="test" class="BeanTest.testing" scope="page" />
    <jsp:getProperty name="test" property="name" />
    there is no method "name" in testing.class file
    if u see the existing examples "date" given in TOMCAT , it is using many <jsp:getProperty tag, but the property name is not equal to the method method name in the Bean file
    thanks,

    First do you know what a
    bean property sheet is?
    If not say so.
    Second, to your question
    The Java Runtime Environment (JRE) uses introspection to identify the appropriate get() or set() methods of that bean. What is introspection?
    Introspection is a process that allows the class to expose its accessable variables and methods and allows other classes to see what they can do with that class when requested. Eg:
    public class MyBean{
    private String someValue = null;
    public MyBean(){
    someValue = "Some String Value";
    //Introspection will reveal this method
    public String getSomeValue(){
    return someValue;
    } and
    <jsp:getProperty name="...." property="someValue" />
    will call the getSomeValue() method

  • Is there a way using lab view objects to let an object that is contained within another object get access to its owner?

    I've been playing with lvoop for 4 or 5 months now, and in general I like it very much, but I've repeatedly wanted to build classes that know something about who owns them and I can't figure out how to make this happen.
    The simple example I've been thinking about is imagine having a person class which contains a car class. Now say that I get an instance of a car class and I want to ask it who its owner is. In C++, I'd do this by giving the car class a pointer to the person class it belongs to. (Of course you have to worry about car objects that don't belong to anyone in which case the pointer has to point to NULL.)
    I've tried copying this idea by giving the car class a data value reference to a person class, but when I dereference the reference using an in place loop and call a method on it I get data from the moment the reference was made and not the current data of the person class.
    I realize this is sorta breaking data flow so maybe it's not possible on purpose?

    Scot18 wrote:
    I've tried copying this idea by giving the car class a data value reference to a person class, but when I dereference the reference using an in place loop and call a method on it I get data from the moment the reference was made and not the current data of the person class.
    Yes, LVOOP uses value based references, and when you split the wire to write the owner you created a data copy. The function you're after requires you do use a DVR for all class functions in which case you'll get reference based OOP, which is more familiar coming from text based OOP.
    It just so happens that G# uses that approach, take a look at it.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How to get nodes and its attributes of an XML file usiong DOM parsing?

    how to get nodes and its attributes of an XML file usiong DOM parsing?
    i am new to XML parsing.......
    Thanking you........

    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;      ...
    //Setup the document
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
         Document doc = docBuilder.parse (new File("MY_XML_FILE.xml"));
    //get elemets by name
         String elementValue = doc.getElementsByTagName("MY_ELEMENT").item(0).getTextContent();
    //This method can return multiple nodes, in this instance I get item(0) , first nodeRead the api for other methods of getting data.

Maybe you are looking for

  • Open Directory Usefulness for Home Server

    I'm using Mountain Lion Server primarily as a web server, but as a retired tech writer/programmer I like to fool around with things in case I ever need to return to work. I set up the Open Directory master as part of the installation process, but I'm

  • Record set size in Gantt Chart

    Hi all, I am developing an application that has a Gantt Chart. The tree drawn is a 2 level tree. I have two VOs. The second VO (Child) has more than 20 rows. I want to show only 10 child at once. Record set size attribute is the one that is used to r

  • Campaign possible to canceleld ..?once it is released along woth po's also

    HI GURU'S&MENTORS, Is it possible to stop a campaign from being cancelled if it has purchase orders attached to it, using standard functionality?  Reason Iu2019m asking is cos at MY PROJECT there have been instances where the campaign has been cancel

  • Created by & Updated by in the Oracle forms

    Hi All, As you know in the menu window -> Record history we can trace who created updated the PO or Invoice or Receipt etc. For the update by, it will record the lastest update person for the object. But if the object has been updated by different pp

  • Sql query  logic

    Hi everyone, i have source table r_dott , column: Top_d, datatype: number sample records: 2654.6559048 1446.800001 1438 1438.800001 6559048.2654 6559048.6559048 my requirement is before and after (.) i want six characters using sql query i.e, out put