Ask by writing a Custom Event class

Hello

I'm working with events for pratic epurposes, when I copy, paste the web tutorilas code they work Flory, but whne I try myself that they do not work.

Please help me

It's my Custom Event.

I want to pass the VO object by event. If please see this code below and let me know that where I am doing wrong.


package events
{
import flash.events.Event;

import Vos. User;
SerializableAttribute public class LoginEvent extends Event
{
public static const = "LoginEvent"; LOGIN_EVENT:String
public var user: user;

public void LoginEvent(type:String,user:User)
{
Super (type, User);
This.User = user;
}
}
}

Please let me know

What are the parameters to be passed within the constructor of the event class and the parameters inside the super()

Waiting for your answers.

When you call super(type,user), you pass an object of type User to the event class where its actually expects a Boolean value for the value of bubbles.

Just call super (type), if you do not cancel/bubble

Tags: Flex

Similar Questions

  • Create the custom handler class touch

    Hi all! I have a problem that seems easy enough to fix, but I'm doing it with reusable code, which is to do something I do not understand yet. I googled this continually and read dozens of articles and I'm still just as lost than when I started. I hope that human life can help me to make sense.

    I have a clip on the stage. When you press this clip, I want to play a certain slice of another clip for as long it is being touched. (This is a map of the United States, that display the name of each State that he's in a hurry).

    I COULD write 50 different functions, each to call a different image of the film displayName, or I could write my own custom event which would be able to receive every key event a string variable and then say displayName that frame to play.

    So basically, I have, for example:

    alaskaMovieClip

    displayNameMovieClip

    When you press alaskaMovieClip, I want to address to the string of the 'Alaska' variable to a touch custom event class, which will then a bunch of stuff as well execute displayNameMovieClip.gotoAndStop ('Alaska').

    1 is it possible?

    2. how? I'm if confused about how custom touch events are created and executed, I've read dozens of articles, and they have just the code that I do not understand. This tutorial should I be looking for that could help me?

    Thank you!!!
    Amber

    One way is to store a public var (say var state = "AZ"; for example) in your puzzleAZ. So you'd just:

    puzzleAZ.addEventListener(TouchEvent.TOUCH_BEGIN, unitTapHandler);
    
    function unitTapHandler (e:TouchEvent): void {
        e.target.gotoAndStop("Over");
        nameDisplay.gotoAndStop(e.target.state); // e.target.state is "AZ"
    }
    

    The other way is to let your MovieClip to send a custom event (which holds the 'State' var) Touch to start the event. Then the mother (or the main timeline or the document class) listen to the custom of your MovieClip event.

    // custom event
    package {
        import flash.events.Event;
    
        public class UnitTapEvent extends Event {
    
            public static const TAPPED:String = "tapped";
            public var state:String;
    
            public function UnitTapEvent(type:String, state:String):void {
                super(type);
                this.state = state;
            }
    
        }
    }
    
  • Custom events ScriptUI

    Hi all

    Is there a chance I can spread custom in ScriptUI events? I tried this example in ESTK and it works very well. However, I tried to run in multiple CS applications and all my attempts raised errors. My intenttion is to create custom components that raise events listened to by the parent window. Am I asking too much?

    function test()
    {
    
              var w = new Window('dialog');
              var btn = w.add('button');
    
              w.addEventListener ('custom', tata);
    
              btn.onClick = function()
              {
                        w.close()
                        var e = new UIEvent('custom', true, true, w, null);
                        e.data= {test:"hello"};
                        w.dispatchEvent(e)
              }
    
    
              function tata(e)
              {
                        alert(e.data.test);
              }
              w.show();
    }
    
    
    test();
    

    Thanks for any advice/advice,

    Loïc

    This whole event ScriptUI thing is not intended to be comprehensive. It works in ESTK is probably an anomaly. ScriptUI events, you can only do 1 of 3 types (keyboard events, mouse events, and...? uh...).

    And do you that through ScriptUI.events.Event.createEvent () (or syntax-it comes to submissions within the time of CS4).

    But what you can do is to write your own event system...

    Something like that - of course you can write an event class, data pass, you name it.

    See the attachment for a primitive way to do...

  • Custom events are not heard or sent successfully

    Hey guys, I did experiments with the writing of my first custom event.  So I have a MovieClip class in the library called "curtains."  He plays an animation and at the end of the animation, I have the code:

    Stop();

    dispatchEvent (new Event ("closed"));

    Now, I create an instance of this MC curtains in my class below.  The custom event is not detected.  Did I put the event listener in the wrong place?  What I've done wrong?

    package {}

    import flash.utils.Timer;

    import flash.events. *;

    import flash.display. *;

    SerializableAttribute public class TransitionTimer extends MovieClip {}

    var localTimer:Timer = new Timer (4000,1);

    curtains: curtains of var = new Curtains();

    public void TransitionTimer() {}

    localTimer.addEventListener (TimerEvent.TIMER_COMPLETE, playTransition, false, 0, true);

    addEventListener (Event.ADDED_TO_STAGE, addedHandler);

    }

    public void addedHandler(e:Event):void {}

    starts the timer which called Transition curtain

    localTimer.start ();

    Adds the event listener for the custom event 'closed' to frame 27 curtains MC.

    curtains.addEventListener ("closed", loadNextScreen);

    }

    public void playTransition(e:TimerEvent):void {}

    addChild (curtains);

    }

    public void loadNextScreen(e:Event):void {}

    trace ("loadNextScreen");

    curtains.gotoAndPlay ("open");

    }

    }

    }

    Thanks in advance for any help

    Add a track to your class TransitionTimer to confirm that it is used as the document class.

    Add a line to the last frame of your movieclip where your 'closed' event is dispatched.

    Copy and paste the instructions of tracing so that might not be obvious what is your problem.

  • Custom event is not captured by the Task Scheduler and unable to trigger by e-mail for the event

    Hello world

    We have installed the 9.0 table in our windows 2008 R2 server and Scheduler tasks to send if you find error occurred for the application in it. That's why we created SMTP inside. First, we have implemented the Task Scheduler and generate an error in the application of the table and run the task manually and we receive by e-mail. But when we go for automation by the custom event. The steps below that I follow:

    1. click the Start button, and then select administrative tools > Task Scheduler.

    2. click on the task of creating in the Actions pane on the right.

    3. in the dialog box create a task in the name text box, type a name for the task and provide a description if you want.

    4. in the section security options, select run whether user is logged in or not.

    5. click on the triggers tab, and then click the new button.

    6 to start the task drop-down list, select an event.

    7. in the settings section, select custom and click the new event filter.

    8. for the event level, select the error box.

    9. selection of the Source, in the event source drop-down list, select the table server checkbox.

    10. click OK to close the new dialog box even filter and then click OK again to close the new trigger dialog box. The event trigger is now configured.

    11. in the dialog box create a new task, click the Actions tab and click the new button.

    12. in the Action new dialog box, in the drop Action, select send e-mail.

    13. under the settings section, fill in the form as required, including the SMTP server.

    Note: It is necessary to enter the valid e-mail addresses in the From and to text boxes.

    14. click OK to close the new dialog Action.

    15. click OK to close the dialog box create a task and finish configuring e-mail alert.

    If please see this and feel free to contact me if you have any information.

    Concerning

    Valerie

    Mob: 469 345 3625

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • Custom event listener callback fails

    Hello

    I have a mobile project Flex 4.6 and I created a custom event, I can see different tracks that the event is currently distributed as planned, but no matter what I do I cannot get a listener to the work that they just sit there and nothing ever happen, please take a look and tell me what might be wrong.

    Custom event:

    package classes.events

    {

    import flash.events.Event;

    SerializableAttribute public class cartLoaded extends Event

    {

    public static const = "cartLoadSuccess" CART_LOAD_SUCCESS:String

    public void cartLoaded (type: String, bubbles: Boolean = false, cancelable: Boolean = false)

    {

    trace ("event_dispatched");

    Super (type, bubbles, cancelable);

    }

    override public function clone (): event

    {

    trace ("event_cloned");

    return new cartLoaded (type, bubbles, cancelable);

    }

    }

    }

    The event is dispatched to a class, after a ResultEvent returned by a Web service call, so in the ResultEvent reminder I have:

    var cl: cartLoaded = new cartLoaded (cartLoaded.CART_LOAD_SUCCESS);

    e.currentTarget.dispatchEvent (cl);

    And I see "event_dispatched" in the console when my results come back. So, I know that the event is triggered. Now on the file of main Application in the ViewInit on a list, on a view that I add, I have almost tried this anywhere.

    lst_cart.addEventListener (cartLoaded.CART_LOAD_SUCCESS, LoadData);

    function loadData(e:cartLoaded):void

    {

    trace ("data set provider");

    }

    I never see "set the data provider, now I understand that the listener must be saved before the event is dispatched, and in my case, it certainly is:

    I have a vision (tried to addEventListener here in an initialization handler)

    the view contains a list with a custom converter (tried here)

    the itemrenderer contains a button (have tried here)

    the button calls a method in a class that raises a web service call (this is where the event to send)

    the web service call triggers a result event

    the result event is triggered my custom event

    Please help, because it is seriously holding me back, I have to be able to capture this event, and I've tried everything.

    Concerning

    Shaine

    Post edited by: sfisher_sticky_kiwi

    Pauleta is true that there is a loss in the case of the chain, like the wrapper it cannot listen on the list because the list itself is not part of the hierarchy of the event.

    I think you can get around this in two ways.

    1. Have your Cart class extend the EventDispatcher class. If this is not possible at least implement IEventDispatcher interface and have a composite object that is the event dispatcher. Anyway, given the class cart is a form of an event dispatcher.
    2. Have your item converter listen directly to the event on the Cart class.
    3. Your event handler converters, to ship another event that spreads to the top of the display object hierarchy.

    Something like this:

    public class Cart extends EventDispatcher
    {
         public function doStuff() : void
         {
              ...
              dispatchEvent(...);
         }
    }
    
    OR if you can't extend it
    
    public class Cart implements IEventDispatcher
    {
         private var _eventDispatcher:EventDispatcher;
         //contains all the methods of the IEventDispatcher interface but uses a facade layer
         public function Cart()
         {
              _eventDispatcher = new EventDispatcher();
         }
    
         public function addEventListener(params...) : void
         {
              _eventDispatcher.addEventListener(params...);
         }
    
         public function doStuff() : void
         {
              ...
              _eventDispatcher.dispatchEvent(...);
         }
    }
    
    public class MyItemRenderer
    {
         public function buttonClick() : void
         {
              var cart:Cart = new Cart();
              cart.addEventListenerer(...);
              cart.doStuff();
         }
    
         public function doStuffEventListener(event:Event) : void
         {
              //Make sure the bubbles property is set to true
              dispatchEvent(event.clone());
         }
    }
    

    This should ensure that the event now on the queue from the list view... If she is probably not a good idea to constantly be adding some that this event listeners, it is probably better just to have a callback function and pass it to point converters to pass based on the cart process.

  • What is the custom event that fires?

    Hello

    What is customized event triggered in the OPA.

    I heard that, at the time of the training online OPA in last week.

    A custom event is a way to write a rule that will send a signal. When executing time event listeners can be attached to the motor of the OPA, and a custom event can be used as a way to signal that something should happen.

    For Documentation on writing a raiseevent rule see rules of use to trigger external software applications in modeling of political Oracle Help.

    For Documentation on the event listeners, see events and event handlers and example: handle the events of modules with an inference event listener in Oracle policy Automation Developer Help.

  • Variables that may be related to custom events Vs

    Greetings to all...

    I'm working on an application that is too great, so whenever we can, we create custom components and classes to organize the entire procedure as good as possible.

    Today, I was working on a login form that is also a custom component.

    So, this component has a remote object to get the user to the server if the connection is successful.

    This user must be sent to other components too and also in the main application that is the parent of the connection.

    I created a custom event that is shipped to the component if the connection is successful.

    My main application is to listen to this event in order to get the logged in user.

    It's a way to do it.

    The other way would be to make two user objects can be bound and whenever the user inside the element object is ready it would change too.

    Which do you think is the best approach for what I'm doing?

    In my opinion (since I read a looooot on memory leaks with objects that can be linked) the best approach is to work with objects that can be linked only when its necessary.

    Your opinion about this?

    Binding is not prohibited, as it is a valuable element of Flex, but sometimes when you use the binding, you end up elements of hard wiring in your application, which limits your ability to code reuse more easily.

  • Custom button class WordWrap

    Someone knows how to make text wrap to a custom button class? I tried everything (as you can see below)! I even tried the Flexlib CanvasButton class, but not really sure how to apply only to one class custom. BTW, these buttons are inside a TileList component if that makes a difference... I love Flex but sometimes its really simple things that you SHOULD be able to easily do that just drive me NUTS!

    Thanks in advance!

    -Mike

    package action.button
    {
    import flash.display. *;
    import flash.events. *;

    Import mx.controls.Button;
    Import mx.controls.listClasses.BaseListData;
    Import mx.controls.listClasses.ListData;
    Import action.button.NoTruncationUITextField;
    Import mx.core.UITextField;
    Import flexlib.controls.CanvasButton;

    SerializableAttribute public class ButtonCatSearch extends button
    {
    private var _baseListData:BaseListData;
    private var _listData:ListData;
    private var _label:String ="";

    public void ButtonCatSearch()
    {
    Super();
    the cursor always behave as if it were a button
    mouseChildren = false;
    buttonMode = true;
    useHandCursor = true;
    height = 150;
    width = 20;
    setStyle ("paddingLeft", 50);
    setStyle ("paddingRight", 50);
    setStyle ("paddingTop", 50);
    setStyle ("paddingBottom", 50);

    setStyle("horizontalGap",100);
    setStyle ("wordWrap", true);

    wordWrap = true;

    addEventListener (MouseEvent.MOUSE_DOWN, onButtonClick);

    }
    public void onButtonClick(e:Event):void
    {
    _label = e.target.label;

    }
    //----------------
    to return to the line
    for button
    override protected function createChildren() (): void
    {
    Create a UITextField to display the label.
    If (! textField)
    {
    textField = new UITextField();
    textField.styleName = this;
    addChild (DisplayObject (textField));
    }
    super.createChildren ();
    textField.multiline = true;
    textField.wordWrap = true;

    super.createChildren ();
    }
    //-----------------
    override public function get listData (): BaseListData
    {
    Return _baseListData;

    }

    /**
    * @private
    */
    override public function set listData(value:BaseListData):void
    {
    super.listData = value;
    _baseListData = value;
    _listData = _baseListData as ListData;
    }
    //-----------------
    override public function set data(value:Object):void
    {
    / * If {(_listData)
    If {(_listData.icon)
    this.setStyle ("icon", _listData.icon);
    }
    }
    */

    Super.Data = value;
    setStyle ("wordWrap", true);
    }
    //-------------------------
    override the updateDisplayList(unscaledWidth:Number,_unscaledHeight:Number):void function
    {
    super.updateDisplayList (unscaledWidth, unscaledHeight);


    this.textField.multiline = true;
    this.textField.wordWrap = true;

    Data.@price < = 0)? NEGATIVE_COLOR: POSITIVE_COLOR);
    }
    }
    }

    You need to replace [] Measure to get the correct behavior. By default, the button sets the width of the TextField child. What you want is for the width of the TextField to be limited by the width of the button and the button height to vary the height measured from the TextField object.

    I had a quick go at below, but it will probably need more work. I used the example of radio button Alex Harui multiline as a starting point:

    http://blogs.Adobe.com/aharui/2007/04/multiline_buttons.html

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

    package
    {
    import flash.display.DisplayObject;
       
    Import mx.controls.Button;
    Import mx.core.IUITextField;

    SerializableAttribute public class WordWrapButton extends button
    {
    Protected Overrides function createChildren() (): void
    {
    If (! textField)
    {
    textField = IUITextField (createInFontContext (UITextFieldNoTruncation));
    textField.styleName = this;
    addChild (DisplayObject (textField));
    }
               
    super.createChildren ();
               
    textField.multiline = true;
    textField.wordWrap = true;
    }
           
    Override protected function [] Measure: void
    {
    If (isNaN (explicitWidth) is false)
    {
    textField.text = label;
                   
    textField.width =
    explicitWidth-
    Value ("paddingLeft")-
    Value ("paddingRight");
                       
    measuredHeight =
    textField.getExplicitOrMeasuredHeight () +.
    Value ("paddingTop") +.
    Value ("paddingBottom");
    }
    on the other
    {
    Super.Measure ();
    }
    }
           
    override protected function updateDisplayList)
    unscaledWidth: unscaledHeight, number: number): void
    {
    super.updateDisplayList (unscaledWidth, unscaledHeight);
               
    () textField.setActualSize
    textField.width,
    textField.getExplicitOrMeasuredHeight ());
               
    textField.move (textField.x, value ("paddingTop"));
    }
    }
    }

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

    package
    {
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
       
    Import mx.core.UITextField;

    SerializableAttribute public class UITextFieldNoTruncation extends UITextField
    {
    Public Overrides function truncateToFit (truncationIndicator: String = null): Boolean
    {
    Returns false;
    }
    }
    }

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


    <>
    "xmlns:MX ="http://www.adobe.com/2006/mxml"
    Layout = "vertical".
    "xmlns:local =" * ">
       
        <>
    Width = "50".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "100".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "200".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "300".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "400".
    label = "A very long label I want the button to encapsulate" / >

  • Management of the custom event sent by loading SWF fails

    I loaded and SWF using SWFLoader. Not a component, but just a regular Flash AS3 SWF. I can access its properties and functions but when I listen to a custom, event distributes, I get the error:

    Error #1034: Type coercion failed: cannot convert com.subhumanmedia.classes::SoundCueEvent@911ad61 to com.subhumanmedia.classes.SoundCueEvent.

    Here's the event:
    package com.subhumanmedia.classes
    {
    import flash.events.Event;
    SerializableAttribute public class SoundCueEvent extends Event
    {
    public static const = "cueSound" CUE_SOUND:String

    private var soundCueObjectInstance:Object;

    public void SoundCueEvent (type: String, bubbles: Boolean, cancelable: Boolean, soundCueObject:Object)
    {
    parameter soundCueObject:
    soundCueObject.cueSoundURL is the string with the name of file to play
    soundCueObject.cueSoundStartTime is the number giving the millisecond offset to read from
    //
    Super (type, bubbles, cancelable);
    soundCueObjectInstance = soundCueObject;
    }
    public function get soundCueObject (): Object
    {
    Return soundCueObjectInstance;
    }
    override public function clone (): event
    {
    return new SoundCueEvent (type, bubbles, cancelable, soundCueObjectInstance);
    }
    }
    }

    Here is the statement in the loaded SWF, the event:
    dispatchEvent (new SoundCueEvent (SoundCueEvent.CUE_SOUND, true, false, soundCues [cueCounter]));


    soundCues is an attay soundCueObjects.

    Here is the definition of the listener in my main class:
    slide.slideGraphic.swfObject.content.addEventListener (SoundCueEvent.CUE_SOUND, cueSoundHandler);

    And here's the Manager:
    private void cueSoundHandler(e:SoundCueEvent):void
    {
    trace (e);
    }

    If I change the type of parameter of the event Manager, it does not take a mistake, but I can't yet ride a SoundCueEvent event in order to obtain tracking information.

    Now both the right loaded SWF and main class get the definition of the event from a compiled SWC, but I tried several other ways to do it without any better result.

    I don't know even what causes the error and am totally baffled by how to solve it. Can anyone help?

    It is equivalent to the problem of shared code described in the presentation of the modules on my blog.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Custom events

    Hello

    I want to trigger an event to a class and listening to the other.  There are several examples on the net but I don't really understand them.  Can someone explain please how can I get the value of newTextInput in the lower class on the evolution and pick it up in another class.

              public function changeHandler(event:Event):void{
                   
              }
              
              //  Creates a text input 
              public function setText(label:String, type:String, id:String):void{
                   var newFormItem:FormItem = new FormItem;
                   var newTextInput:TextInput = new TextInput;
                                  
                   newFormItem.label = label;
                   newTextInput.id = type;
                   newTextInput.text = id;
                   newTextInput.addEventListener(Event.CHANGE, changeHandler);
                                  
                   this.addChild(newFormItem);
                   newFormItem.addChild(newTextInput);                                   
              }
    

    This is the class I want to get the value of newTextInput:

    package components{
         
         import mx.controls.TextArea;
              
         public class KamTextArea extends TextArea{
              
              public var label:String;
              public var required:Boolean;
              
              public function KamTextArea(){
                   label = "Null";
                   required = false;           
                                  
              }
    
              public function setupProperties(propertyInstance:PropertiesForm):void{
                   
                   propertyInstance.setText('Label','label',this.id);
                   propertyInstance.setBool('Required', 'required');
              
              }
              
              private function update():void{
                   this.text = "df";
                   
              }
    
         }
    }
    

    Thank you

    You need to understand the basics of the custom events, please read the Adobe LiveDocs page:

    Ching http://www.google.com/search?hl=en&q=Flex+3+dispatching+Custom+Events&AQ=1&OQ=Flex+3+dispa & AQI = g2

    So create a custom event and make the event type 'myEvent '.

    Can have a property of the custom event to the value of newTextInput.

    Your other class listens for the event and accessing the property of the event object that contains the value ofnewTextInput.

    You may need to add the event listener to systemManager:

    systemManager.addEventListener (MyCustomEvent.MY_EVENT, myHandler);

    My post Cookboo Flex deals with custom events. It's a bit long, but if operate you locally, it can clarify certain points.

    http://www.Adobe.com/cfusion/CommunityEngine/index.cfm?event=ShowDetails&ProductID=2&postI d = 11246

    If this post answers your question or assistance, please mark it as such.

  • Create a custom event

    I use a class with an instance name of textParser1. After you create the instance, I want to be able to use a property of the class, but the value that is returned is appears to be back too early (i.e. before the class has finished processing completely).

    Here's what I want to do:

    textParser1 = new TextParser (content);

    trace (textParser1.someVal);

    I believe that the solution is to create a custom event, but don't know how to do this. Here's what I think I should do:

    textParser1 = new TextParser (content)
    textParser1.addEventListener(Event.???,completeListener)

    function completeListener (): void {}
    trace (textParser1.someVal)
    }

    Is that correct and can you point me to an example of the right way to do it.

    Thanks for your time.

    Good deal!  (Please hang me up with the 'right answer' points!)  Thank you.

  • Event Bubbling: Relay of the custom events

    Background:
    The bubbling in the action script 3 event causes an event to travel from the responsible subject through all its objects from parent to the root application. The event then moves back down to the original object.

    Goal: keep the data, the controller and the loosely coupled views
    1. When display objects are instantiated, they send an event by saying that they need certain information. The event has the type of information they need.
    2. the purpose of data capture this event, determines if it it has in memory. If it isn't, it retrieves information from a web service and pushes the result in a table.
    3. once the result in memory, it takes an event that contains the index of the result table.
    4. the view captures the result, out of the index and use it to link to the correct array element

    Result: The display is automatically updated every time that the data object is called by the web service with an update.

    In this scenario, nor the view or the data can be parents of each other, but each must be able to respond to the events of each and other. The reason is so that I can have multiple views generated dynamically, using the same data.

    Question:
    If the data (model) and the views are children of the same application, how does one maintain loose coupling between them?

    Current solution:
    The only thing I could get to is having the object application or controller catch all custom events and then their reconsignment to the children. The problem is that it is messy.

    I could also design a handler class that would have the forwarding of events to the right of the child hierarchy. I could include a private string variable that would capture the name of the object responsible for when my custom event was known as the class handler could do dynamic mapping.

    Is there a better solution?

    Thanks - I posted the question on something awful and someone suggested that I use a microwave recommended architecture on Adobe Labs called Cairngorm , I'll go through the documentation and give it a test drive this week.

  • Resolver of custom events and custom notification event

    Hello

    I have to build a custom resolver of Notification event that is used to generate a custom event.

    I've not done this before. Could you please let me know how can I do this IOM.

    Thank you

    When you perform the import, put your xml on

    /someFolder/custom/yourfile.XML and point import.sh to /somefolder to

    preserve the custom as a part of the full path

  • Question about the use of the custom component class define what declarative component

    12.1.3 jdev

    I'm trying to define a declarative component with my custom component class.

    This is the code for my component jsf declarative. I'm trying to use the label on selectManyListbox attribute to pass queryClass for my component class name. It does not work. I also try to use f: attribute to my component class. It does not work too. Question 1: how to move my declarative component attribute to my class of component?

    < af:panelLabelAndMessage label = "#{attrs.displayLabel}" id = "dc_plam1" > "

    < af:switcher id = "dc_s1" defaultFacet = "a lot" facetName = "#{attrs.single eq 'true'?' unique ': 'a lot'}" >

    < f: facet name = "a lot" >

    < af:selectManyListbox id = "namingp1" simple = "true" label = "#{attrs.queryClass}" "

    ' autoSubmit Binding = "#{dropListComp.selectManyListBox}" = "true" valueChangeListener = "#{dropListComp.selectManyValueChange}" >

    < f: attribute name = "queryClass" value = "#{attrs.queryClass}" / >

    < / af:selectManyListbox >

    < / f: facet >

    < f: facet "single" = name >

    < af:selectOneListbox id = "sl_2" simple = "true" label = "#{attrs.queryClass} '"

    autoSubmit Binding = "#{dropListComp.selectOneListBox}" = "true" valueChangeListener = "#{dropListComp.selectOneValueChange}" > "

    < / af:selectOneListbox >

    < / f: facet >

    < / af:switcher >

    < / af:panelLabelAndMessage >

    That's how I try to retrieve the label or f: attribute queryClass in my component class. I get null for both directions.

    {} public void setSelectManyListBox (RichSelectManyListbox selectManyListBox)
    this.selectManyListBox = selectManyListBox;
    If (this.selectManyListBox.getChildCount () == 0) {}
    queryClass = (String) this.selectManyListBox.getLabel ();
    System.out.println (".. queryClass of the label..." + queryClass);
    If (queryClass is nothing)
    {
    queryClass = (String) this.selectManyListBox.getAttributes () .get ("queryClass");
    System.out.println (".. queryClass of attr..." + queryClass);
    }
    If (queryClass is nothing)
    queryClass = "glog.server.query.powerdata.InvolvedPartyQualQuery";
    this.selectManyListBox.getChildren () .addAll (buildDropListSelectItems (queryClass));
    }
    }

    Thank you.

    Hello

    If your declarative component has a defined class of request attribute then #{attrs.name_of_attribute} called from Java should be able to solve

    Frank

Maybe you are looking for