Access the Variable Var in a Collection model

Hi all

Guess I used an iterator which traverses a collection template.
The var attribute, which in this case is 'line' is used.
<af:iterator id="i1" value="#{bindings.Departments.collectionModel}"
             var="row">
    //call a managed bean method during iteration and used the var="row"???
</af:iterator>
Is it possible in a managed bean method where I could get a handle on this variable?
My goal is to influence the way in which the GUI is being developed, while the JSF iterator is an iteration?

Thank you

Hello

I'm NOT clear for your use case. Why do you do this?

But here's the sample, which can be used to achieve the same thing:
The example assumes that you have ministries and Instances of the employees View object where employees are the child of the departments.

MultiIteratorPage.Jspx:




*
ID = "tt1" >
*
ID = "ot2" / >
**
**

MultiIteratorPagePageDef.xml:


version = "11.1.1.59.23" id = "MultiIteratorPagePageDef".
Package = "View.pageDefs" > "




DataControl = "AppModuleDataControl" id = "DepartmentsIterator" / >




















MultiIteratorPageBean.java:

import java.util.List;

Import javax.el.ELContext;
Import javax.el.ExpressionFactory;
Import javax.el.ValueExpression;

Import javax.faces.context.FacesContext;

Import oracle.jbo.Row;
Import oracle.jbo.uicli.binding.JUCtrlHierNodeBinding;

public class MultiIteratorSampleBean {}
public MultiIteratorSampleBean() {}
Super();
}

private String departmentValue;

{} public void setDepartmentValue (String departmentValue)
this.departmentValue = departmentValue;
}

* public String getDepartmentValue() {*}
RootNode = JUCtrlHierNodeBinding
* (JUCtrlHierNodeBinding) This.evaluateEL("#{node}"); *
* if (rootNode! = null) {*}
Line currentRow = rootNode.getRow ();
* if (currentRow! = null) {*}
departmentValue =
* (String) CurrentRow.GetAttribute ("DepartmentName"); *
*}*
List children = rootNode.getChildren ();
* if (children! = null) {*}
* for (node JUCtrlHierNodeBinding: children) {*}
* if (node! = null) {*}
Line childCurrentRow = node.getRow ();
* if (childCurrentRow! = null) {*}
System.out.println (childCurrentRow.GetAttribute ("FirstName"));
*}*
*}*
*}*
*}*
*}*
Return departmentValue;
*}*

Private Object evaluateEL (el String) {}
FacesContext facesContext = FacesContext.getCurrentInstance ();
ELContext elContext = facesContext.getELContext ();
ExpressionFactory expressionFactory =
facesContext.getApplication () .getExpressionFactory ();
ValueExpression exp =
expressionFactory.createValueExpression (elContext, el,
Object.Class);
Return exp.getValue (elContext);
}
}

Thank you
Nini

Tags: Java

Similar Questions

  • How to access the variable in the child video clip

    I have a flash file that uses php to manipulate a database and returns a variable (data_xml) to document data in XML from the database. In this case, as well as others within the parent company. Now, I have a child movieclip that shows analyzed data, but I'm unable to access the variable from the child movieclip. The code associated with this is:

    var myXML:XML = new XML();
    var myXML = XML (event.currentTarget.root.data_xml);

    and I get the following two errors that point to the second line as the problem:

    1151: there is a conflict with definition myXML in the internal namespace.

    WARNING: 3596: duplicate variable definition.

    I unchecked automatically "declare instances of the scene" because I have seen the one proposed for the 1151: error, but I still have not the same two errors.

    Can anyone help? Thank you!

    You've declared the variable twice. Variable can be declared only once in any scope. So, your code should be:

    var myXML:XML = new XML();
    myXML = XML (event.currentTarget.root.data_xml); Note there is no before var

  • Access the ArrayCollection class MXML ActionScript collection?

    I have a MXML file that has a collection for my tree component arraycollection. I am overriding the updateDisplayList function to add lines to all of my nodes in the tree... However, I can't seem to understand how to access this ArrayCollection collection of inside the actionscript class?

    I tried the methods used to pass variables between two MXML files (like a popup window - which I've used in the past and it works very well).

    My actionscript class code is almost identical to this example here:

    http://www.iepl.NET/treeControlSample/treeControlSample.html

    In the example above, the data is static, but sometimes my data's going to change and I need to access the set dataProvider (collection ArrayCollection) in order to make the lines work well... This has been very frustrating for me! :)

    If someone knows a better way to reach gettign lines for brothers and sisters in a tree... Please let me know!

    Any help would be super duper awesome!

    I found the solution to this. My problem was similar to cheftimo was seen in this post:

    http://www.Adobe.com/cfusion/webforums/Forum/MessageView.cfm?forumid=60&CATID=585&ThreadId = 1367784 & enterthread = y

    The answer is to import the component you are trying to access the variable from and then call using mx.core.Application ' Application.application.'

    Thanks to Greg Lafrance!

  • to access the variables in a page in another page qml

    Hey gang,

    I've been watching some of the other problems autour to access the variables from one page on another page qml qml, and I can't get this to work.

    I have a page, main.qml with a NavigationPane.  The NavPane has a Page and some containers.

    I have a property defined in the NavigationPane like this:

    NavigationPane {
        id: mainNav
        backButtonsVisible: true
        property int customInt: 2
    
        onCustomInt: {
            console.log("  -------------> App: customInt");
        }
    

    I have a ComponentDefinition for next page, called SettingsPage.qml.  In the settings, I have two drop-down lists and a slider.

    Page {
        actionBarAutoHideBehavior: ActionBarAutoHideBehavior.HideOnScroll
        id: pgSettings
    
        ScrollView {
            id: pageScroller
            scrollViewProperties.initialScalingMethod: ScalingMethod.AspectFit
            Container {
                topPadding: 25
                bottomPadding: 25
                rightPadding: 25
                leftPadding: 25
                Label {
                    text: "Settings"
                    textStyle.fontSize: FontSize.XLarge
                }
            Container {
                id: dropDown1
                topPadding: 25
                bottomPadding: 25
                rightPadding: 25
                leftPadding: 25
                DropDown {
                       id: ddOption1
                       title: "Option 1"
                       verticalAlignment: VerticalAlignment.Center
                       horizontalAlignment: HorizontalAlignment.Center
                      Option {id: o1o1; text: "One"; }
                      Option {id: o1o2; text: "Two"; }
                      Option {id: o1o3; text: "Three"; selected: true; }
                      Option {id: o1o4; text: "Four"; }
    
                    onSelectedIndexChanged: {
    
                        switch (selectedIndex){
                            case 0:
                                //
                                console.log(" -->App: Option 1 Selector, On");
                                customInt = 0;
                                break;
                            case 1:
                                //
                                console.log(" -->App: Option 1 Selector, Off");
                                customInt = 1;;
                                break;
                            case 2:
                                //
                                console.log(" -->App: Option 1 Selector, Top (default)");
                                customInt = 2;
                                break;
                            case 3:
                                //
                                console.log(" -->App: Option 1 Selector, Bottom");
                                customInt = 3;
                                break;
                        }
                    }
                }
            } }
    

    I look forward to the the statement will change the level property NavPane, called customInt, but it doesn't.

    the output of the console shows that the ' App: Option 1 selector "gets selected in the dropdown list selected index changes, but the onCustomInt() funtion slot never gets called.

    I tried "mainNav.customInt = X" too, but the parameters cannot solve the mainNav.  I get "unknown symbol 'mainNav'" error with alittle bulb.

    what I am doing wrong?

    When you call the second page, SettingsPage.qml, set it as an object.

    Don't do the following:

    attachedObjects: [
    
        ComponentDefinition {
            id: settingsPageDefinition
            source: "SettingsPage.qml"
        }
    ]
    

    Follow these steps:

    attachedObjects: [
        // Definition of the second Page, used to dynamically create the Page above.
        ComponentDefinition {
            id: settingsPageDefinition
            Settingspage{
    
            }
        }
    ]
    

    Then the second page main navigation page in the IDE.  I had the same problem with a multi-page application, I created.

  • Access the variable in different class

    Hey guys,.

    So I make a program that generates circles where you click, and I want to apply some physics. I was thinking about creating a new class that contains all of the physical code and then apply to the circles that are created, which is the way to do it?

    I can't use the name of the variable of the circle in the physics class. And some stuff on the web that is said to make the variable public, and static, but I create the variable inside of a function, and it wont let me make public or static it. Even if I put it in the class, I get the same error (access from the circle of property not defined). Here is the code:

    ------------------------------------------------------------------------------------------ ----------------------------------------

    package {}

    import flash.display.Shape;

    import flash.events.MouseEvent;

    import flash.display.MovieClip;

    import flash.media.Sound;

    import flash.media.SoundChannel;

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    import flash.utils.Timer;

    import flash.events.TimerEvent;

    SerializableAttribute public class Main extends MovieClip

    {

    var pop: PopSound;

    var soundChannel:SoundChannel;

    var circleReady:Boolean = new Boolean;

    var coolDown:Timer;

    public void Main()

    {

    stage.addEventListener (MouseEvent.MOUSE_DOWN, mouse click);

    pop = new PopSound();

    soundChannel = new SoundChannel();

    circleReady = true;

    cooldown = new Timer (500, 1);

    }

    function mouseClick(e:MouseEvent):void

    {

    If (circleReady is true)

    {

    var theX:Number = mouseX;

    var they: number = mouseY;

    var circle: Shape = new Shape();

    circle.graphics.beginFill ((Math.random () * 0xFFFFFF), 1.0);

    circle.graphics.drawCircle (0, 0, ((Math.round (Math.random () * 40)) + 20));

    circle.graphics.endFill ();

    Circle.x = definition x;

    Circle.y = they.

    stage.addChild (circle);

    var xTween:Tween = new Tween (circle, "scaleX", Bounce.easeOut, 0, 1, 0.5, true);

    var yTween:Tween = new Tween (circle, "scaleY", Bounce.easeOut, 0, 1, 0.5, true);

    soundChannel = pop.play ();

    circleReady = false;

    coolDown.addEventListener (TimerEvent.TIMER_COMPLETE, timeDone);

    coolDown.start ();

    }

    function timeDone (e:TimerEvent): void

    {

    circleReady = true;

    }

    {

    }

    }

    }

    }

    ------------------------------------------------------------------------------------------ ----------------------------------------

    Any help would be great, thanks

    How can ensure me that the compiler finds Collision.as?

    According to the file format that you are using:

    1. . FLA: Collision.as must live in the same folder as the FLA

    2..XFL: Collision.as has to live at a higher level the. XFL file (on the same level as the folder with the same PREFIX as your xfl)

  • to access the variables and functions between external loaded SWF?

    Using AS 3.0: say I have a menu.swf which loads a content.swf below using the following

    var newContent:Loader = new Loader();
    newContent.load (new URLRequest ("fowContent.swf"));
    addChildAt(newContent,0);

    Now I have an image tag in newContent do it is an animation ending to this swf display. When you click another menu key in menu.swf, can I access sequence at the end of this content by:

    newContent.gotoAndPlay (newContent.endingSequence);

    Alternatively, you can use while loops in AS 3.0? I would like to have a Boolean variable "completed" in the newContent don't which evaluates to true after that end animation played.



    While (newContent.ended! = true)
    {
    wait
    }

    then to have it perform the function to load and display the new content.swf

    :

    PS you can not use a loop for and you can't use a while loop to perform any time. They both run from end to end before something is updated on stage and no other code can run outside of these loops (except if it is called from in the loop).

  • to access the variables defined in the Document class

    I can't evaluate the values established in my document class.

    My document class: ZoneViewer.as:

    SerializableAttribute public class ZoneViewer extends Sprite {}
    private var zone_area_alpha_low:Number is. 2;
    }

    This code exists on a frame in a movieclip in my main script:

    This.zone_shape.Alpha = zone_area_alpha_low;


    How to access the valeur.2 which is declared in my class: document ZoneViewer.as? "zone_area_alpha_low" does not work.

    Solution to the problem of access to a variable value (zone_area_alpha_low) from actionscript code framework in a movieclip.

    FYI... my project file structure:

    Project_Folder/MyApplication.fla
    Project_Folder/MyApplication.swf
    Project_Folder/classes/ZoneViewer.as
    --------------------
    Document class: classes. ZoneViewer

    {classes package

    import flash.display.MovieClip;

    SerializableAttribute public class ZoneViewer extends MovieClip {}

    public static var zone_area_alpha_low:Number =. 1;
    }
    }
    --------------------
    This code exists on the first frame of my movieclip in my .fla file.

    import classes. ZoneViewer;< i="" was="" missing="" this="" import="" statement="" within="" my="">
    This.zone_shape.Alpha = ZoneViewer.zone_area_alpha_low;< this="" finally="" is="" referenced="">

    Kudos to ntbdy for the light. Is there better ways to do this?

  • To access the variables from a movieclip timeline

    Hey everybody!

    Normally, I use MovieClip (this.parent) to access a variable that is outside the movieclip I am writing code in. However, this does not work in both functions.

    For example:

    function editMainText (e:Event) {
         MovieClip(this.parent).headline.text = "Hello"
    }
    

    works.

    but

    function editMainText (e:Event) {
         function editText (e:Event){
              MovieClip(this.parent).headline.text = "Hello"
         }
         editText(null);
    }
    

    does not work

    There is probably some small errors in my code, but I need mainly to learn how to change MovieClip (this.parent) to work within the second function.

    Thank you!

    John

    does not work.

    In most all cases I've seen, nested functions will stand on their own

    function () {} editText
    MovieClip (this.parent).headline.text = 'Hello '.
    }

    function editMainText (e: Event) {}
    editText();
    }

  • How to access the variable script proc SQLplus?

    Lets start with the following SQLplus script:

    variable username varchar2 (100);
    Start select user in: user name of double; end;
    /

    print the user name;

    Select * from WHERE = owner all_tables "& username'"




    Issues related to the:

    Why do I get invited to enter a "/" when running the script in SQLplus? Even if I insert a / after the username 'impression' statement I am invited to enter an end delimiter.

    In addition, I would like to access the user name value in the following SELECT statement. However when I as code above the value of the variable is not taken. Instead, the user is prompted to enter a user name.

    No there is no way to 'transfer' of the value of the SQL user name?

    Peter

    You're confusing SQL * more variable substitution (those with '&') and bind variables.

    Replace the "& username" with: username as shown below:

    SQL> variable username varchar2(100);
    SQL> begin select user into :username from dual; end;
      2  /
    
    PL/SQL procedure successfully completed.
    
    SQL> print username;
    
    USERNAME
    ---------------------------------------------------------------------------
    SCOTT
    
    SQL> select * from all_tables WHERE owner=:username;
    
  • access the variable got on another timeline

    I have a variable declared in the CODE in the main timeline, I want to access it from the timeline of a movieclip underlying. How can I do this?

    Yes, AS3 is using 'root', and you must type references as you found it.  Then

    MovieClip (root) .yourVariable

    If get you there.

  • To access the Variables in the class file

    Say that I set a variable in a class file:

    public var container: sprite;

    I add the sprite to the scene and set it's x and y in the class file. How I would go about the change in x and y of the container in my fla file?

    You are welcome.

    using a method to expose parts of your class makes it easier to read and debug your classes.

    p.s. If your issue is resolved and that you are able, please mark this thread as answered.

  • ViewObject accesses the variable binding a sessionScope setting?

    Hello

    using the Fusion of ADF Jdev11g request
    ViewObject get a sessionScope parameter and set in the binding variable? without the help of executeWithParameter

    Thank you
    greenApple

    N °

    You must call a method in the model layer and pass the parameter.

    Timo

  • Remotely to access the variables of the cRIO

    I have a cRIO-9014 with a cRIO-9114 which is used as a stand-alone system controller (we use several types of modules c I / O and DI/O).  I want to connect a cable ethernet and view select input/output to facilitate tuning PID control.  I am currently using global variables for communication between the host on the PC and the vi rtexe vi.  This works that whent the vi rtexe is launched from the PC.  If I try to launch the host program, while the rtexe is running on the cRIO, when variables deployment stop the rtexe.  If I prevent deployment variables, global variables in the host are not communicating with the cRIO.   Anyone know how to get data in real time of the CRIO without interrupting the program running on the cRIO?

    Thank you!

    If you use variables published shared network and host them on the target (make sure that the library is below the target in the Project Explorer), variables will be deployed when you start the host VI. This way you will not interrupt the program of control over the cRIO.

    See the knowledge base article: How can I deploy a compiled executable shared network Variables? for more information.

    Hope this helps,

  • How to access the variable from a code of movieclip

    I have variable a = 0 and I want a movieclip that is running to change to 2, what can I write in the code of movieclip?
    I tried parent.a = 2 but it's mistake.
    Thank you

    If the parent is the correct path to a, expressed as a movieclip and try again:

    MovieClip (parent) .to = 2;

  • How to access the variable JoinColumn directly in an entity.

    I have the below two entities with relationship @OneToMany between them,

    Employee
    @Entity
    @Table (name = "EMPLOYEE")
    public class employee {}
    @Id
    int employe_id;
    String employee_name;

    I can uncomment this?
    int emp_department_id;

    @ManyToOne
    @JoinColumn (name = "emp_department_id")
    Department;
    }

    Department
    @Entity
    @Table (name = "DEPARTMENT")
    public class {Department
    @Id
    department_id int;
    String department_name;
    @OneToMany (mappedBy = "department")
    The value < employee > employeesSet;
    }

    I only want to make persistent employee since I already have the data of the Ministry in Db,

    * 1.purpose, if I Uncomment emp_department_id and try to do that, *.

    Employee e1 = new Employee();
    E1.employee_id = 1;
    E1.Employee_Name = "Employee1";
    E1.emp_department_id = 1;

    I get,
    Inner exception: java.sql.SQLException: ORA-00957: duplicate column name
    Error code: 957
    Call: INSERT IN EMPLOYEE3 (EMPLOYEE_NAME, employe_id, EMP_DEPARTMENT_ID, emp_department_id) VALUES (?,?,?,?)
    link = > [bound 4 parameters]

    * 2. Instead, I have to do something like that, *.

    Department d = new Department();
    1 = d.department_id;
    d.department_name = "Engineering";

    Employee e1 = new Employee();
    E1.employee_id = 1;
    E1.Employee_Name = "Employee1";
    E1. Department = d;

    Is there a way to uncomment Employee.emp_department_id and insert data about employees using PT. 1 ???

    The correct method is to define the ManyToOne and set it to the appropriate Department. You can use find() or getReference() to get the service object with the ID.

    If you want to have a base for both Id mapping, then you must use the same column name.

    @JoinColumn (name = "emp_department_id")

    should be,

    @JoinColumn (name = "EMP_DEPARTMENT_ID")

    But since you have two mappings for the same column, you must set one of them write,

    @JoinColumn (name = "EMP_DEPARTMENT_ID", insertable = false, updatable = false)

    Or you could remove the ManyToOne and have just the base.

    ----
    James: http://www.eclipse.org/eclipselink/

    Published by: jsutherl on 7 Sep 2011 06:57

Maybe you are looking for

  • Hydrogensensor with 6009 usp (German)

    Hallo, Ich bin Schüler und am an einem Projekt in dem mit Hilfe eines Wasserstoffsensors eine Gasgemisch auf den Wasserstoffgehalt untersucht werden soll.Da is Elektronik nicht zu meinem Fachbereich belongs wanted ich wissen Folgendes: Mir steht eine

  • Gap at the beginning of the XY graph?

    Hey there, It's basically the way I learned to build graphs XY. Works perfectly fine, with the exception of the gap at the beginning which is of variable size that changes with the time, but never goes away. Can someone tell me where it comes from an

  • How to save all the subvis in the LLB

    I am using labview 2010. How to record my program and its sub - VI in a new library? I used the other program subvis and I want to save these screws in my new folder/library. whenever I tried to do. She recorded the locations of where the subvis. the

  • How to solve 12 Code in the device without help function Manager?

    Recently noticed the triangle/point of yellow exclamation mark in device for my graphics (Intel 82865 G) Manager. Turns out to be a Code 12 problem. I tried the path to solve the problems, but I still get this error message: "Microsoft Help and Suppo

  • My internal SATA HDD recognised by XP in the removable drive

    Hi, I have currently updated my PC with the new HARD SATA 3 drive and connected to the motherboard using SATA 3 controller card. The problem is that XP see my hard drive as a removable drive. Is it possible to fix this. I already tried with latest BI