Passing function to a custom component

Hey so I have button that is in a custom component, say:
<mx:HBox width="200" height="72" xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Button width="72" height="72"  styleName="{buttonStyleName}"/>              
    <mx:Text text="{description}" width="100%" height="100%" textAlign="justify"/>
</mx:HBox>
And on another file i use it simply like this:
<local:LabelComponent buttonStyleName="componentRssButton"  />                          
However, I want the button on my custom component draggable, so I would like to pass a mouseMove handler but i could not find  a way to do that. Of course that easiest way is to have my whole custom component draggable like so:
<local:LabelComponent mouseMove="componentRssButton"  />                
but i want the button in the custom component the only one draggable.
Thanks.

it's wired to pass a function.
EventListener should be the way to go.
give your button an id, say btn1
<mx:Button id='btn1' width="72" height="72"  styleName="{buttonStyleName}"/>
and in your code
<local:LabelComponent id='myComp' creationComplete='makeButtonDraggable()' buttonStyleName="componentRssButton"  />  
<script>
function makeButtonDraggable():vd
     myComp.btn1.addEventListener(mouseMove, componentRssButton);

Similar Messages

  • Passing arguments to a custom component in the constructor

    I would like to know if it is possible to pass arguments to a
    custom component in the constructor when I'm instantiating it
    within Actionscript. I've not seen anyone do this, so at the moment
    I have a couple of public properties defined on the custom
    component and then do the following:
    var myComponent:TestComponent = new TestComponent();
    myComponent.propertyOne = true;
    myComponent.propertyTwo = 12;
    etc.
    Whereas I'd like to do something like:
    var myComponent:TestComponent = new TestComponent( true, 12
    Any ideas if this is possible?

    Another approach as opposed to creating init function is to link symbol with autogenerated class (just assign it a class but do not create *.as file for it) and use it just as graphical view with no functionality (well only MovieClip's functionality).
    ViewClip.as
    public class ViewClip extends MovieClip {
        public var view:MovieClip;
        public function ViewClip(){
            this.view = instantiateView();
            this.addChild(view);
        protected function instantiateView():MovieClip {
            return new MovieClip();
    Circle.as
    public class Circle extends ViewClip {
        public function Circle(scaleX:Number, scaleY:Number) {
            super();
        override protected function instantiateView():MovieClip {
            return new ClassView();

  • Function in a custom component

    My question is, if I have a function (example: restore( )) that for example change the background color and I created 2 or more
    of the custom component.
    is there a way that if I call the function restore( ), can it change the background color of all the custom components in the application?
    if so, how can this be done?
    Thank you.

    yes of course, if your component supports backgroundColor
    you should declare your function public, and change backgroundColor inside it.
    public function restore():void
         this.opaqueBackground = 0xFFFFFF;
         //or
         this.setStyle("backgroundColor","#FFFFFF");

  • Calling a function from a custom component

    I got source files from another company that did a flex project for us before I started working here.  They have custom compenents (mxml files) that they are currently calling public functions in, but when I add a new public function to the mxml component, it won't allow me to call that function.  It tells me it can't access a property of a method of a null object reference... but it still calls the function that was there before I started working with the file..
    I cleaned the project, and did a "build all" but can't figure out why it won't allow me to create new public functions to call.... can anyone tell me why?

    I have the partsLocator_panel in the mxml
    not sure what "new" is with that... first time working with custom components, but it looks like your just working with custom classes in AS3...
    <mx:Panel 
    width="100%" height="100%" layout="absolute" styleName="DashboardPanel" title="PARTS LOCATER" backgroundAlpha=".6" id="partsLocater_panel">
    <mx:Image x="10" y="38" source="assets/icons/gear.png"/>  
    <mx:Image x="10" y="63" source="assets/icons/gear.png"/>  
    <mx:Image x="10" y="89" source="assets/icons/gear.png"/>  
    <mx:Label x="40" y="39" text="Block 30" width="227" styleName="DashboardText" click="openParts()"/>  
    <mx:Label x="40" y="63" text="Block 40" width="227" styleName="DashboardText" color="#9D9D9D"/>  
    <mx:Label x="40" y="88" text="Block 50" width="227" styleName="DashboardText" color="#9D9D9D"/>  
    </mx:Panel>

  • Pass a parameter to custom component -  get null

    Main MXML (part of code):
    <s:Application
    xmlns:ns1="*"
    creationComplete="init();>
    import MyComponent;
    private function init():void {
    var myArray:Array=["FFF","TTT","RRR"];
    myComp.width=200;
    myComp.height=200;
    myComp.getArray = myArray;
    myContainer.rawChildren.addChild(myComp);
    <fx:Declarations>
    <ns1:MyComponent id="myComp" x="0" y="0" />
    </fx:Declarations>
    custom component:
    package
              public var getArray:Array;
    public class MyComponent extends Sprite { trace (getArray);//trace null

    What is myContainer?
    I have a working version with my container as UICOmponent inside main.
    public class MyComp extends Sprite
            private var _getArray:Array;
            public function MyComp()
            public function get getArray():Array
                return _getArray;
            public function set getArray(value:Array):void
                trace("setter ", value);
                _getArray = value;
    <?xml version="1.0" encoding="utf-8"?>
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:ns1="*"
                   minWidth="955" minHeight="600"
                   creationComplete="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    var myArray:Array=["FFF","TTT","RRR"];
                    myComp.width=200;
                    myComp.height=200;
                    myComp.getArray = myArray;
                    myContainer.addChild(myComp);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <ns1:MyComp id="myComp"/>
        </fx:Declarations>
        <mx:UIComponent id="myContainer"/>
    </s:Application>
    Not sure this is what you after though but it traces:
    setter  FFF,TTT,RRR
    Why do you add to rawChildren?
    C

  • Custom Validator for a Custom Component

    I am having troubling passing values from my custom component
    to my custom validator (via a model). For some reason when the
    validate() function is called for the validator the value parameter
    passed to the validator is not showing the value from my custom
    component.
    I have attached some example code to illustrate.
    Here is my model:
    <mx:Model id="myModel">
    <root>
    <mod>
    <name>{myTextInput.text}</name>
    <date>{myDateField.selectedDate.getTime()}</date>
    <length>{myComp.getLength()}</length>
    </mod>
    </root>
    </mx:Model>
    When I update the value of myTextInput or myDateField the
    model (as sent to the validator) shows the correct value. When I
    change the value of myComp the change is not reflected.
    Is there a particular event (or something) being dispatched
    in the other components to cause the model to get the new value
    that I need to include in my custom component? I am pretty stuck
    and would appreciate any help.
    Many thanks

    Does myComp extend EventDispatcher (or any class which does)?
    You need to flag the getLength() function as bindable and to
    dispatch an event:
    [Bindable('getLengthChange")]
    public function getLength() : Number
    // does whatever it does
    When you update myComp have it dispatchEvent( new
    Event("getLengthChange") ) and I think it will work.

  • Passing a reference / variable to a Custom Component

    Hi, I was wondering if someone could help me.
    It seems like a very simple problem but I cant for the life
    of me seem to work out a solution.
    I have created a Custom Component that extends from the
    UIComponent that consists of a “rev counter” style
    clock face etc….
    I want to use this component multiple times within my
    application – however feed it different data so for example
    each “rev counter” on the page will be displaying
    different data etc…..
    I want to be able to reuse my component and not have to
    create a new component every time I add a “rev counter”
    to my application, therefore I need some way of passing a reference
    / variable to the component (maybe from the <mx /> tag where
    I declare it in the MXML code ??? )
    <mx:Application ….
    xmlns:comps="components.*" …..>
    <comps:RevCounterComp id=”” (add something
    here to reference???) />
    </ mx:Application>
    Doing this will allow me to reuse my ONE custom component
    MANY times feeding it different data (different data provaiders for
    each instance of the single component)
    Hope this makes sense???
    Any help / advice is much appreciated,
    Thanks,
    Jon.

    Jon,
    jmryan's suggestion is the preferred way to go. This way you
    can use the simple MXML syntax that you described in your post.
    If your custom component is defined in ActionScript, you can
    use setters or the creationComplete event to update the component
    when the values are passed in from the tag (they are set *after*
    your constructor runs).
    Even easier, if your component is defined in MXML, you can
    add [Bindable] to your public field and then bind directly to it in
    the custom component's MXML code.
    - Peter

  • Custom component calling function from main.mxml

    I have a main.mxml that has the following function in it:
    public function SubChooseField(evt:Event):void{
    Alert.show( "Sub has been chosen" );
    main.mxml also places the following custom component:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="180" close="parent.SubChooseField(event)">
    <mx:dataProvider>
    <mx:Object data="1" label="choice 1 />
    <mx:Object data="2" label="choice 2" />
    <mx:Object data="3" label="choice 3" />
    </mx:dataProvider>
    </mx:ComboBox>
    I want it so that when you chose one of the options in the
    comboBox, it will call the function SubChooseField in the
    main.mxml. But when I compile this, no matter what i try, i get the
    error:
    Error: Call to a possibly undefined method SubChooseField
    through a reference with static type my_custom_opponent.
    OR if i change the codeand remove the 'parent' to say:
    close="SubChooseField(event)"> i get error:
    Error: Call to a possibly undefined method SubChooseField.
    any help much appreciated.

    Rather than trying to use parent, using events might help
    here. In your main mxml file, just listen for the change event that
    is dispatched from your custom component. Since it is a ComboBox
    component, it automatically dispatches this event. If your
    component was more complex, you would need to dispatch a custom
    event.
    If your custom component was named CustomCombo, then the mxml
    in your main file would look something like this:
    <ns1:CustomCombo id="cb" x="70" y="39" width="160"
    change="SubChooseField(event)"/>
    Vygo

  • Decode function not called for a custom component

    I know this problem happened in the past - in the EA2, EA4 and I believe the beta version as well, but does anyone know if it has been solved for the release ?
    In short - I'm working with the release, created a menuBar component and the decode method in the renderer is not called after I submit the page. In the past, there were rumors that this happened due to relative paths in the JSP (for js files, images, etc.).
    Does anyone else have this problem ? or better , know how to solve it ?
    Thanx,
    Netta.

    It's not that simple - The component is getting rendered, all the encode methods are called and the decode is called also , but only the first time the form is submitted.
    I added this custom component to the guessNumber application, and I have a menuBar in the greeting.jsp that leads to the response.jsp and vice versa. it looks like this in the greeting.jsp page -
    <!-- Start Menu -->
    <t:MenuBar id="bar1" styleClass="myClass" >
    <t:Menu id="menu1" name="menu1">
    <t:Menu id="menu2" name="menu2">
    <t:MenuItem id="item2_1" name="item2_1" action="/mytest/guess/response.jsp"/>
    <t:MenuItem id="item2_2" name="item2_2" action="http://www.msn.com"/>
    <t:Menu id="menu3" name="menu3">
    <t:MenuItem id="item3_1" name="item3_1x" action="http://www.msn.com"/>
    </t:Menu>
    </t:Menu>
    </t:Menu>
    <t:MenuItem id="item3" name="item3" action="http://www.cnn.com"/>
    </t:MenuBar>
    <!-- End Menu -->
    In the response it looks like this -
    <!-- Start Menu -->
    <t:MenuBar id="bar2" styleClass="myClass" >
    <t:MenuItem id="item3" name="item3" action="/mytest/guess/greeting.jsp"/>
    </t:MenuBar>
    <!-- End Menu -->
    and every time a menuItem is clicked on, the JS calls submit form.
    Since the menus are rendered, I assume there's nothing wrong with the rendererType and any other renderer problem. Since the decode is called only once, I assume the right form is being submitted.
    So, what can cause it to stop calling the decode ???
    Could it be that becase I go directly to the page and not through the navigation rules ( I call window.open directly from the JS), it creates a problem ??
    Please help, I've been wasting so much time on this !
    Netta.

  • Custom component property value handling at run time

    I would like to develop simple custom component which has three properties PROP1, PROP2 & RESULT . These parameters are bound to excel sheet cells as follows..
    cell A1 connected to PROP1
    cell A2 connected to PROP2 and
    cell A3 connected to RESULT.
    In excel A1 cell has excel formula set as =IF(A2<5,10,0).
    Custom component would be simple button display at runtime and on click of the same, I would like to perform following actions in sequence with N number of times.
    1. First push any random number to PROP2. (which is simple task, I believe)
    2. Pick new value of PROP1 which is changed due to existance of excel formula (+ using dispatchevent I could able to pass value to excel cell A2. But not able to read new value of PROP1+)
    3. check new PROP1 value equal to 10. If it is 10 then count it otherwise again push new random value to PROP2.
    4. Continue step 1 to 3 till N number of times. and finally
    4. Push number of counts for PROP1 value 10 to RESULT parameter.
    All the parameters are bindable (getter/setter with [Bindable]) in Flex component application and flex propertysheet application use binding ID to bind with cell address. with binding direction BOTH and SINGLETON
    Here is flex function code which triggered at button click.
    public function test002():void {
    while ( N < 100)
      this.PROP2 = Math.round(Math.random()*1000);
      dispatchEvent(new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE, false, false, PropertyChangeEventKind.UPDATE, "PROP2", null, PROP2, this));
         if (this.PROP1 == 10)
          cnt++;
       this.RESULT = cnt;
    My observations are as follows.
    - new push of value to PROP2 get reflected to excel A2 when button click event is over, not at the time of while loop process execution.
    - Also I observed PROP1 value never changes and it is the value which is recorded just before button click event of component at run time and remain the same till button click event is over.
    - Further to this I notice as click event is over, new value of PROP2 reflected in cell A2 and change value (if it passes IF formula of excel ) in A1 as well. Next button click action takes these new A1 and A2 values in consideration and process the function "test002".
    I would like to understand possibility of custom component event execution process, which can able to pass as well as read value from component parameters to underlying excel with changes due to excel formula existance.  If it is not limitations (If so) what is the set of commands which can be helpful to achieve this. I appreciate if anybody explain typical event execution required in such scenarios with some actionscript code directions.
    Thanks
    Sandesh
    Edited by: Sandesh Darne on Feb 8, 2010 11:48 AM
    Edited by: Sandesh Darne on Feb 10, 2010 5:23 AM

    Marton,
    I have tried your solution. It works well immediately after xcelsius dashboard get displayed or preview. It does not wait click event to happen. So I modified further by adding one switch ( "switch001" in code piece shown below) to control iteration by click event. That stops running of iteration immediate after dashboard display.
    In order to see iteration I have to click twice on button. First click does send "frm" parameter value to excel and excel formula operates. The excel formula result send back to component via SETTER of "frmResult" . But it stops over there. If I click second time the iteration starts for 100 times.
    Also I try to export this to PDF. PDF file get generated. If I try to open PDF file it raise error.
    My code is attached here.
    "frm" is the parameter that sends random number to excel.
    "frmResult" parameter receives excel formula output and send it back to component.
    "test()" function operate on button click event and set switch001 and then calls "Calc" function for iterations.
    MXML code..........
      <mx:VBox>
           <mx:TextInput id="frmResultLabel" width="100" />
           <mx:Button label="test..." click="test()"/>
      </mx:VBox>
    Actionscript code
    public var cnt:int;
              public var N:int = 0;
              public var sum:int = 0;
              public var switch001:Boolean = false;
             public function test():void {
                   N = 0;
                   sum = 0;
                   switch001 = true;
              public function Calc():void {
              if (switch001 == true)
                if (N < 100)
                    this.frm = Math.round(Math.random() * 1000);
                else if (N == 100)  // return the result
                     this.frmResult = sum;
                     // Label component use to display frm and frmResult values at runtime
                     frmResultLabel.text = sum.toString() + ">" + this.frm + ">" + this.frmResult;
                 N++;
              [Bindable]
              private var _frm:int;
              private var _frmChanged:Boolean = true;
              [Bindable]
              public function get frm():int
                   return _frm;
              public function set frm(value:int):void
                   //if (value == null)  value = 0;
                   if (_frm != value)
                        _frm = value;
                        _frmChanged = true;
                        invalidateProperties();
              override protected function commitProperties():void
                 super.commitProperties();
                 if (_frmResultChanged == true)
                        // start the cycle again by generating a new random number,
                        // or write out the result
                        Calc();

  • Adding Visual custom component in spark DataGrid

    I am working with flex 4.5. I want to create Gauge component Datagrid.
    I am using open source com.betterthantomorrow.components. I have created custom components like this
        <?xml version="1.0" encoding="utf-8"?>
        <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                   xmlns:s="library://ns.adobe.com/flex/spark"
                                                   xmlns:mx="library://ns.adobe.com/flex/mx"
                                                   xmlns:bttc="com.betterthantomorrow.components.*"
                                                   xmlns:gauge="com.betterthantomorrow.components.gauge.*"
                                                   xmlns:objects="tekhnia.com.tekhniag.objects.*"
                                                   width="30%" height="65" backgroundColor="black" borderColor="black"
                                                   creationComplete="init(event)">
                  <fx:Declarations>
                            <mx:NumberFormatter precision="1" id="formatter" rounding="nearest" />
                  </fx:Declarations>
                  <fx:Script>
                            <![CDATA[
                                      import mx.events.FlexEvent;
                                      import mx.messaging.channels.StreamingAMFChannel;
                                      [Bindable]
                                      public var cpuValue:Number;
                                      [Bindable]
                                      public var memoryValue:Number;
                                      [Bindable]
                                      public var diskValue:Number;
                                      [Bindable]
                                      public var mycomp:String;
                                      [Bindable]
                                      public var serverName:String;
                                      [Bindable]
                                      public var statusImage:String;
                                      protected function init(event:FlexEvent):void
                                                var strValues:String;
                                                var strColors:String;
                                                var strAlphas:String;
                                                strColors="0x009900,0xFFFF00,0xDD0000";
                                                strValues="0,50,70,100";
                                                strAlphas=".8,.8,.8"
                                                var values:Array=strValues.split(",");
                                                var colors:Array=strColors.split(",");
                                                var alphas:Array=strAlphas.split(",");
                                                gauge1.setStyle("alertValues",values);
                                                gauge1.setStyle("alertColors",colors);
                                                gauge1.setStyle("alertAlphas",alphas);
                                                gauge2.setStyle("alertValues",values);
                                                gauge2.setStyle("alertColors",colors);
                                                gauge2.setStyle("alertAlphas",alphas);
                                                gauge.setStyle("alertValues",values);
                                                gauge.setStyle("alertColors",colors);
                                                gauge.setStyle("alertAlphas",alphas);
                                                gauge.invalidateDisplayList();
                                                gauge1.invalidateDisplayList();
                                                gauge2.invalidateDisplayList();
                            ]]>
                  </fx:Script>
                  <s:layout>
                            <s:HorizontalLayout/>
                  </s:layout>
                  <s:TileGroup width="101" paddingLeft="20" paddingRight="2">
                            <bttc:Gauge id="gauge"
                                                          diameter="50" width="50"
                                                          verticalCenter="0" horizontalCenter="-111"
                                                          minValue="1"  maxValue="10" value="{cpuValue}"  valueFormatter="{formatter}"
                                                          bigTicks="9" smallTicks="45" showMinMax="false" showValue="false" pointerColor="white"/>
                  </s:TileGroup>
                  <s:TileGroup width="101" paddingLeft="20" paddingRight="2">
                            <bttc:Gauge id="gauge1"
                                                          diameter="50" width="50"
                                                          verticalCenter="0" horizontalCenter="-111"
                                                          minValue="1"  maxValue="10" value="{memoryValue}"  valueFormatter="{formatter}"
                                                          bigTicks="9" smallTicks="45" showMinMax="false" showValue="false" pointerColor="white" automationName="T"/>
                  </s:TileGroup>
                  <s:TileGroup width="101" paddingLeft="20" paddingRight="2">
                            <bttc:Gauge id="gauge2"
                                                          diameter="50" width="50"
                                                          verticalCenter="0" horizontalCenter="-111"
                                                          minValue="1"  maxValue="10" value="{diskValue}"  valueFormatter="{formatter}"
                                                          bigTicks="9" smallTicks="45" showMinMax="false" showValue="false" pointerColor="white"/>
                  </s:TileGroup>
                  <s:TileGroup width="40" paddingTop="3">
                            <s:Image source="assets/led/big/{statusImage}" />
                            <s:Label  color="white" text="{serverName}" textAlign="center"/>
                  </s:TileGroup>
        </s:BorderContainer>
    I want to add this component in Datagrid. I have tried a lot on net. I didn't find any help. I read books as well.
    Please help me. I found somewhere on the site one liner answer : write grid renderer. I don't how to write grid renderer and pass the data values to it.
    I will be more thank full someone gives me pointer to sample grid renderer or code.

    What's the flow here?
    Do you want to pop-up a JSP in a window to prompt the user for extra information before submitting the check-in form? If so, you need a custom component to override the resource that draws the "submit" button on the form.
    Or, do you want to execute something like a web service during the check-in process? If so, do a validateStandard filter. See the 'DynamicPrefix' comonent in the howtocomponents:
    http://www.oracle.com/technetwork/middleware/content-management/index-092832.html

  • Listening in main application for event coming from custom component

    I have a custom component that im using for a login.  i watch videos and tutorials on how to pass variables between custom components and application. the problem im having is that must tutorials or explanation have you put the event on the custom component and then it refers to some function within the main app.
    Is there a way to just listen on the main app when that event kicks off? ive been trying for hours and i know there has to be something im missing it cant be that hard. any help i would really appreciate.
    Thanks
    Miguel

    Sounds like you're asking about addEventListener():
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                        comp.addEventListener("test", testHandler);
                   private function testHandler(e:Event):void {
                        trace(e);
              ]]>
         </fx:Script>
         <local:TestComponent id="comp"/>
    Add an event listener on your custom component (first string is the 'type' of the event).

  • Instantiating a Custom Component

    I am somewhat new to this concept and I keep thinking about
    things the ActionScript 2 way where we can say:
    createObject(refObject,instanceName,depth,constructorObject);
    I am instantiating custom MXML components using a technique
    similar to the following:
    var classRef:Class =
    flash.utils.getDefinitionByName("Components."+module) as Class;
    var d:DisplayObject = new classRef() as DisplayObject;
    mainCanvas.addChild(d);
    where mainCanvas is a Canvas component on my main stage and d
    is a reference to the custom component attached to the mainCanvas.
    My question is what is the best practice means to pass data
    to d such that it will be available upon instantiation. I am
    looking to employ the constructor object concept from attachMovie
    and createObject of AS 2.
    Thanks in advance

    Look up ClassFactory - but what you are doing isn't very
    Flex-ish. The better way is to do:
    var d:Whatever = new Whatever();
    d.property1 = value;
    d.property2 = value;
    mainCanvas.addChild(d);
    This is the way we do it within the Flex framework and is
    pretty easy to understand. You might also want to look up the
    commitProperties function and override that in your custom
    component in case you need to combine or use your property values
    while your component is initializing.

  • Advice on creating a tricky custom component

    Hi,
    I'm working on creating a custom component which displays a image at the top of the canvas, and loops through a passed array collection, displaying each row of the array collection in a item renderer. So the component should look like this (see attached image).
    As you can see from this image the header is a image itself, this will differ every instance of the panel, there should be 3 of these panels on the page. Then each row of data is a item renderer displaying the data provided from a array collection of value object. If there are 4 items in this array collection then the panel should show 4 rows, if there are 2 row in the array then the panel will display 2 rows. Also the height of the panel will dynamically change depending on the number of rows to show.
    I was thinking of extending a Canvas component, and then passing in the image URL and trying to load and draw the image dynamically, then I was thinking of using the Drawing API to create the rectangle shape using the drawRoundRectComplex() of the graphics class.
    The problems I see with this is that I don't think the drawn rectangle shape can re-draw itself to show the change in height when more or less row of data need to be be displayed.
    Another option I have been thinking about is extending the Panel class to create my component, this may be better for handling the height resizing, but I'm not sure it can support the look of this component (the header image and the three rounded corners).
    Could anyone give me some advice on what would be the better option for creating this component.
    Thanks
    Stephen

  • Validation Error - JSF Custom Component

    I am trying to create a Custom Component. It is a pre-populated list of selection items. So all that the page author would have to do is use a tag like
    <jsfcust:mySelectOneComponent  value="#{requestScope.selectedItem}/>and this should display a drop-down list from which only one item can be selected. I got this working except for the final stretch.
    I created the following...
    1. tag in the .tld file
    2. CustSelectOneTag.java (set the value as a ValueBinding in setProperties() method)
    3. CustSelectComponent.java
    4. CustSelectRenderer.java (In the decode() method, called setSubmittedValue(value) on the component)
    5. updated the faces-config.xml file
    The display seems to be working fine. The problem is when I click on a Submit button and go to the next page where I want to display the selected value. It shows up as null. All that I want to do is be able to select an item from the custom drop down and display it in the next page after hitting submit.
    What is the proper way to send the value back in the response? In my case, I was merely trying to pass the value so that the next page can access it from the request scope and display it.
    I was not sure if I had to implement the getConvertedValue() method in my renderer. Can someone help?
    Thanks,
    JM

    Thanks for your reply! Your answer fixed my problems, so definitely thanks! I need to use escaped values for things like "<,&,#, etc", like the pound "amp" semicolon stuff. If I try to type out strings like these the forum unescapes them - fun part of posting forum questions about HTML escaping on HTML-based forums! :) I didn't realize an escaped querystring would still work as expected in a <a href ... />. You actually fixed both of my problems, and I... I do feel appropriately foolish now :) Had a feeling this might be a slaps forehead one. Thanks for the quick answer!,
    Jim

Maybe you are looking for

  • Modifying email address in Mail

    Hello, I have an new alumni email address, but it is only used through a forwarding address that I already have set up in my Mail program. I want the alumni address to be seen as a return address when I send emails using the email address that the al

  • HT1933 App Purchase problem

    I bought an app through iTunes and need to report a problem with it.  I follow the instructions and when I get to the point of reporting a problem where it should take me to the "Report a Prolem" button, it doesn't exist and I get routed back to the

  • Windows backup fails

    We are trying to backup server 2008, hyper v host, with 2 vms. Windows backup fails: the system writer is not found in the backup. Event log error: Log Name:      Application Source:        Microsoft-Windows-Backup Date:          11/22/2014 9:10:26 P

  • Can you use Lens Cleaner for eye glasses, to clean your iphone 5 screen

    I have glasses, and i have some glass cleaners and just wondering if it will work for cleaning my iphone 5 screen

  • Linux JVM: How to load shared libraries with mutual/circular dependencies

    Hi, I am using the API System.loadLibrary(String name) to dynamically link shared libaries to Linux JVM. The shared libraries has complex circular symbol dependencies among them. I am not able to load shared libraries due to java.lang.UnsatisfiedLink