Show On A Custom Component

I have a custom component based uon a VBox
I am using the following show="myFunction()"
private function myFunction():void{
trace("In the function);
But the trace never shows? The show is never hit.
If I change the name of the function, I get the call to a
possible undefined method error, so I know I have it set up
properly.
Any suggestions?
Thanks
Mathias

As you know, ViewStack  has containers, lilke VBox for its views.
Assuming one of your views VBox has an id of myVBox, and that VBox has the Button that when clicked will display the component, just have the component in the view already, but you can make it invisible with visible=false and includeInLayout=false, and then upon button click set those two variables to true.
You will probably want a show handler for the view VBox to make those properties false each time that view is displayed.
Here is some simple sample code.
If this post answers your question or helps, please mark it as such.
---------- MySimpleComponent.mxml ----------
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
  width="100%" height="100%" horizontalAlign="center">
  <mx:Label text="My Custom Component"/>
</mx:VBox>
---------- MainApp.mxml  ----------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  xmlns:comp="*" horizontalAlign="center" verticalAlign="middle">
  <mx:Script>
    <![CDATA[
    ]]>
  </mx:Script>
  <mx:LinkBar dataProvider="{vs}"/>
  <mx:ViewStack id="vs" width="100%" height="100%">
    <mx:VBox label="view1" width="100%" height="100%"
      horizontalAlign="center">
      <mx:Label text="View One"/>
    </mx:VBox>
    <mx:VBox label="view2"  width="100%" height="100%"
      show="myComp.visible=false;myComp.includeInLayout=true;"
      horizontalAlign="center">
      <mx:Label text="View Two"/>
      <mx:Button label="Make myComp Visible" click="myComp.visible=true;myComp.includeInLayout=true;"/>
      <comp:MySimpleComponent id="myComp" visible="false" includeInLayout="false"/>
    </mx:VBox>
  </mx:ViewStack>
</mx:Application>

Similar Messages

  • Reset custom component

    Hello!
    I have an app with some states.
    Each state shows a different custom component.
    My problem is that if someone types somthing in one of the states then changes state and then comes back the text will still be there.
    Is there a way to reintitialize the custom component on each state chage or do I have to create functions to reset everything myself?
    Thank you!

    Ok, thank you.
    Were they only Form fileds it would have been nice and easy.
    I have some AMF calls etc.
    I could probably remove the component with removeChild and add it when it's accessed again I guess, but that doesn't seem too elegant.

  • Button in custom component not showing

    I made a very simple custom component with a TextField and Button but when I add multiple instances of it to a Layout, only the first Button shows up while the other show only when I focus the corresponding TextField. I'm quite new to fx and I'm not sure I did everything correctly but I don't see any obvious error in my code.
    The component:
    public class TestComponent extends BorderPane {
        @FXML
        private Button browseButton;
        @FXML
        private TextField textField;
        public TestComponent() {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("TestComponent.fxml"));
            fxmlLoader.setRoot(this);
            fxmlLoader.setController(this);
            try {
                fxmlLoader.load();
            } catch (IOException exception) {
                throw new RuntimeException(exception);
    The fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.HBox?>
    <fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
        xmlns="http://javafx.com/javafx/2.2">
        <center>
            <TextField fx:id="textField" prefWidth="200.0" />
        </center>
        <right>
            <Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"
                minHeight="-Infinity" prefHeight="${textField.height}" text="Browse"
                textAlignment="CENTER"  />
        </right>
    </fx:root>
    and the test code
    @Override
        public void start(Stage primaryStage) {
            VBox box = new VBox(5);
            box.setPadding(new Insets(5));
            TestComponent a = new TestComponent();
            TestComponent b = new TestComponent();
            TestComponent c = new TestComponent();
            box.getChildren().addAll(a, b, c);
            Scene scene = new Scene(box);
            primaryStage.setScene(scene);
            primaryStage.show();
    I'm running on Ubuntu with jdk-8-ea-bin-b111-linux-i586-10_oct_2013. I tested with jdk 1.7.0_40 and the buttons don't show.
    I'd include screenshots but the button to add images is disabled.
    Thanks for the help

    The issue is with the bind definition in the FXML, if you remove that definition, the buttons will display.
       prefHeight="${textField.height}"
    I think the binding is working, but when there is some kind of error (bug) in the layout process such that the scene is not automatically laid out correctly when the binding occurs.
    You can get exactly the same behaviour by removing the binding definition in FXML and placing it in code after the load.
                browseButton.prefHeightProperty().bind(textField.heightProperty());
    When the scene is initially displayed, the height of all of the text fields is 0, as they have not been laid out yet, and the browser button prefHeight gets set to 0 through the binding.
    That's OK and expected.
    Then the scene is shown and a layout pass occurs, which sets the height of the text fields to 26 and the prefHeight of all of the browser buttons adjust correctly.
    That's also OK and expected.
    Next the height of one of the buttons is adjusted via a layout pass.
    That's also OK and expected.
    But the height of the other buttons is not adjusted to match their preferred height (probably because a layout pass is not run on them).
    That is not OK and not expected (and I think a bug).
    If you manually trigger a layout pass on one of the components which did not render completely, the button will be displayed - but that should not be necessary.
    You can file a bug against the Runtime project at:
       https://javafx-jira.kenai.com/
    You will need to sign up at the link on the login page, but anybody can sign up and log a bug.
    Here is some sample code.
    import javafx.application.Application;
    import javafx.geometry.Insets;
    import javafx.scene.Scene;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ComponentTestApp extends Application {
      @Override
      public void start(Stage primaryStage) {
        VBox box = new VBox(5);
        box.setPadding(new Insets(5));
        TestComponent a = new TestComponent();
        TestComponent b = new TestComponent();
        TestComponent c = new TestComponent();
        box.getChildren().addAll(a, b, c);
        Scene scene = new Scene(box);
        primaryStage.setScene(scene);
        primaryStage.show();
        b.requestLayout(); // I don't understand why this call is necessary -> looks like a bug to me . . .
      public static void main(String[] args) {
        launch(args);
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.fxml.FXML;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.control.Button;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.BorderPane;
    import java.io.IOException;
    public class TestComponent extends BorderPane {
        private static int nextComponentNum = 1;
        private final int componentNum = nextComponentNum;
        @FXML
        private TextField textField;
        @FXML
        private Button browseButton;
        public TestComponent() {
          nextComponentNum++;
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("TestComponent.fxml"));
            fxmlLoader.setRoot(this); 
            fxmlLoader.setController(this); 
            try { 
                fxmlLoader.load();
                browseButton.prefHeightProperty().bind(textField.heightProperty());
                System.out.println(componentNum + " " + browseButton + " prefHeight " + browseButton.getPrefHeight());
                textField.heightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + textField + " height " + newValue);
                browseButton.prefHeightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + browseButton + " prefHeight " + newValue);
                browseButton.heightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + browseButton + " height " + newValue);
                    new Exception("Not a real exception - just a debugging stack trace").printStackTrace();
            } catch (IOException exception) {
                throw new RuntimeException(exception); 
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.HBox?>
    <fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
             xmlns="http://javafx.com/javafx/2.2">
        <center>
            <TextField fx:id="textField" prefWidth="200.0" />
        </center>
        <right>
            <Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"
                    minHeight="-Infinity" text="Browse"
                    textAlignment="CENTER"  />
            <!--<Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"-->
                    <!--minHeight="-Infinity" prefHeight="${textField.height}" text="Browse"-->
                    <!--textAlignment="CENTER"  />-->
        </right>
    </fx:root>
    Here is the output of the sample code:
    1 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    2 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    3 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    1 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    1 TextField[id=textField, styleClass=text-input text-field] height 26.0
    2 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    2 TextField[id=textField, styleClass=text-input text-field] height 26.0
    3 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    3 TextField[id=textField, styleClass=text-input text-field] height 26.0
    2 Button[id=browseButton, styleClass=button]'Browse' height 26.0
    java.lang.Exception: Not a real exception - just a debugging stack trace
      at testcomponent.TestComponent$3.changed(TestComponent.java:69)
      at testcomponent.TestComponent$3.changed(TestComponent.java:65)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177)
      at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143)
      at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
      at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
      at javafx.scene.layout.Region.setHeight(Region.java:915)
      at javafx.scene.layout.Region.resize(Region.java:1362)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:583)
      at javafx.scene.Parent.layout(Parent.java:1063)
      at javafx.scene.Parent.layout(Parent.java:1069)
      at javafx.scene.Scene.doLayoutPass(Scene.java:564)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2341)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:329)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    java.lang.Exception: Not a real exception - just a debugging stack trace
      at testcomponent.TestComponent$3.changed(TestComponent.java:69)
      at testcomponent.TestComponent$3.changed(TestComponent.java:65)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177)
      at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143)
      at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
      at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
      at javafx.scene.layout.Region.setHeight(Region.java:915)
      at javafx.scene.layout.Region.resize(Region.java:1362)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:583)
      at javafx.scene.Parent.layout(Parent.java:1063)
      at javafx.scene.Parent.layout(Parent.java:1069)
      at javafx.scene.Scene.doLayoutPass(Scene.java:564)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2341)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:329)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    1 Button[id=browseButton, styleClass=button]'Browse' height 26.0

  • Show a custom component on button click in a view stack`

    Hello folks
    I have a view stack in which i have some custom components.
    Now there is one custom component in which there is one button. On the button click, i want to show another custom component but i dont know how to do it. Should i write the inline mxml click event in custom component?? If yes then how??
    Currently i am doing it as
    click="{customcomponent}"

    As you know, ViewStack  has containers, lilke VBox for its views.
    Assuming one of your views VBox has an id of myVBox, and that VBox has the Button that when clicked will display the component, just have the component in the view already, but you can make it invisible with visible=false and includeInLayout=false, and then upon button click set those two variables to true.
    You will probably want a show handler for the view VBox to make those properties false each time that view is displayed.
    Here is some simple sample code.
    If this post answers your question or helps, please mark it as such.
    ---------- MySimpleComponent.mxml ----------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
      width="100%" height="100%" horizontalAlign="center">
      <mx:Label text="My Custom Component"/>
    </mx:VBox>
    ---------- MainApp.mxml  ----------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:comp="*" horizontalAlign="center" verticalAlign="middle">
      <mx:Script>
        <![CDATA[
        ]]>
      </mx:Script>
      <mx:LinkBar dataProvider="{vs}"/>
      <mx:ViewStack id="vs" width="100%" height="100%">
        <mx:VBox label="view1" width="100%" height="100%"
          horizontalAlign="center">
          <mx:Label text="View One"/>
        </mx:VBox>
        <mx:VBox label="view2"  width="100%" height="100%"
          show="myComp.visible=false;myComp.includeInLayout=true;"
          horizontalAlign="center">
          <mx:Label text="View Two"/>
          <mx:Button label="Make myComp Visible" click="myComp.visible=true;myComp.includeInLayout=true;"/>
          <comp:MySimpleComponent id="myComp" visible="false" includeInLayout="false"/>
        </mx:VBox>
      </mx:ViewStack>
    </mx:Application>

  • Showing Error MEssage using Custom Component

    Hi,
    I have built the custom component to validate the File Size and File Extension.
    I.e user should be able to check in the document if size is less than 5MB and file extension is one of "Pdf", "doc", "tiff", "png".
    Here whenever the validation files i am throwing the exception "File Size Exeeds the Limit or Invalid file Type".
    I am able to get the custom component working as per the validation. And it is alsi logging the error in the Log file.
    But i need to show the error message when the user cllick on the check in button in UCM page.
    As of now it shows some generic error saying "Unable to execute service CHECKIN_NEW_SUB and function validateStandard.
    The error was caused by an internally generated issue. The error has been logged"
    Any help on this is highly appreciated.
    Regards,
    Rakshitha Shetty.

    Hi,
    You could throw a ServiceException in your filter with the message you want to display.
    Romain.

  • JPanel won't display my custome component

    Hi,
    I made a custome component class that in its paint method at this stage is suppose to paint a white rectangle on screen. However the when I add this custome component to my JPanel it doesn't show up. Does anybody have a solution for this?
    My code for the custome component is,
    public spaceMediaDisplayObject(mediaObject mo){
         x = mo.getSpaceX();
         y = mo.getSpaceY();
         height = mo.getHeight();
         width = mo.getWidth();
         name = mo.getName();
         System.out.println("Constructor");
         this.repaint();
    public void paint(Graphics g){
         System.out.println("Draw");
         g.setColor(Color.white);
         g.drawRect(x, y, height, width);
    And the fragment of code I am using to try and display in on the panel is as follows,
    spaceMediaDisplayObject smdo = new spaceMediaDisplayObject(toDisplay);
         spaceBodyPanel.add(smdo);
    Please help if able.

    If it's null then you need to set the size of each component explicitly:
    JPanel panel = new JPanel(null);
    Component customComponent = new CustomComponent();
    panel.add(customComponent);
    customComponent.setBounds(0, 0, 100, 100); // For exampleA simple layout manager could be used to make the component fill the panel, for example:
    JPanel panel = new JPanel(new GridLayout(1, 1));
    panel.add(new CustomComponent());Hope this helps.

  • 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

  • How to create custom component in CRM 2007

    Hi.
    I am new for the CRM 2007 Web UI.
    Here we have CRM_UI_FRAME.
    Like this so many Components are there.
    I want how to create our own component.
    I created it as follows.
    Open the Transaction code bsp_wd_cmpwb.
    Provide Z Name in the Component.
    Zcomponent
    Press Create button.
    Go to Run Time Repository.
    Press Change Mode.
    Create a MODEL as ALL.
    GO to Browser Component Structre.
    Select View.
    Provide View name.
    Create the View.
    Go to view Layout.
    Provide the code like this.
    <%@page language="abap"%>
    <%@ extension name="htmlb" prefix="htmlb"%>
    <%@ extension name="xhtmlb" prefix="xhtmlb"%>
    <%@ extension name="crm_bsp_ic" prefix="crmic"%>
    <%@ extension name="bsp" prefix="bsp"%>
    <cthmlb:overviewFormConfig/>
    Create the context under the context.
    Go to Configuration tab.
    Assigne the Attributes to the Screen.
    GO to the Run Time Repository.
    press change mode.
    Assigne the view name to the Window.
    Save it.
    Test the Componet. But it is not diaply anything on the screen.
    How i will get the data into the web UI.
    Can anybody expalin about this one to me with screen shorts if possible.
    I want add some fields into the web UI. Provide some values into that. Capture the values.
    Navigate the data from one screen to another screen. How it is possible. I did not understand. 
    If i am changing any screens in the pre define component it shows dump.
    So, now i need Custom component with adding of the fields.
    Please give me proper information regarding this one.
    Thank You.
    Krishna. B.

    Hi,
    Try put the htmlb to show a field:
    <thtmlb:label design="LABEL" for="//<context>/<field>" text="<field>"/>
    <thtmlb:inputField  id="<field>" maxlength="31" size="20" value="//<context>/<field>"/>
    In order to get value, you can write a simple code in the event_handler:
    LR_BOL                      type ref to IF_BOL_BO_PROPERTY_ACCESS
    LR_BOL = ME->TYPED_CONTEXT-><context>->COLLECTION_WRAPPER->get_current()
    var1 = LR_BOL->GET_PROPERTY_AS_STRING('FIELD').
    take a look at lr_bol methods so that you can see the set and get methods.
    Regards,
    Renato.

  • Using itemCreationPolicy with a custom component

    I'm working on a project where the users need to be able to have a 'filtered' view of one of the edit dialogs. I'm using view states to control which of the input fields show up for each view. The 'save' logic is the same for both states, so I still need to be able to pull data for the inputs even if they are not currently displayed. I tried setting itemCreationPolicy to immediate with no success. Some of the inputs were getting created but the initial values were not being set. The issue seems to be that the input component (an extended version of DropDownList) defers setting the selected value until the commitProperties() method. Since the inpit isn't actually being shown, the commitProperties() method is never getting called and the value is never being set.
    Can anyone suggest a workaround for this issue? The only thing I can think of would be to use includeInLayout and visible to show/hide the inputs, but that is going to get really messy since I would have to apply it to every input and the FormItem components that enclose them.

    Jasmin,
    Is your class included in the custom component?
    Yes, It is a annotated entity class,
    When creating sessionFactory it is not loading the class.
    i'm using flowing code block for creating sessionFactory,
    factory =
    new AnnotationConfiguration().addAnnotatedClass(dao.entity.UserEntity.
    class).setProperty(
    "hibernate.dialect",m_dialect ).setProperty(
    "hibernate.connection.driver_class", m_driverClass).setProperty(
    "hibernate.connection.url", m_connectionUrl ).setProperty(
    "hibernate.connection.username",m_userName).setProperty(
    "hibernate.connection.password", m_password).setProperty(
    "hibernate.hbm2ddl.auto", m_hbmTodll ).setProperty(
    "current_session_context_class",m_contextClass ).configure(resource).buildSessionFactory();
    Is the jar referenced in the class patch section of the component.xml?
    Yes , I have tried for this approch too , but class is entity class is not loaded.

  • Error when calling a custom component in Web UI.

    Hello Experts ,
    We have  created a custom component for guided procedure in Web UI . When we link the custome component with the standard component for the home page ( WCC_SSV_HOME ) we found that custom controller for guided procedure works . We are navigating the guided procedure for search functioanlity and it works fine and shows the search result .
    But when we click on any of the searched objects say a Case , then links on that  Case is not working .
    For example , we are getting the below  error :
    Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - Define NavigationalLink BP for source view ZSOA.MainWindow
    Any inputs on this is higly apreciated.
    Regards
    Vinayak

    Hi Vinayak,
    I am assuming that the implementation of the navigation from the search result to the object details is not working.
    The error you mentioned pointed me that you do not have the navigation link. I don't know what is missing so I am giving you the full details please cross check what you missed.
    1> create and eventhandler e.g. EH_ONSINGLESELECTION
    2> create an outbound plug in your view - this plug is used for the navigation to the target of the hyperlink.
    3> create an outbound plug in the window.
    Define the navigation link whth the name according to the string you have put in the event handler in the search component e.g. SINGLESELECTION
    as source define the component usage for the search. as target define the component usage of header    -> this will handle the connection from search to the header.
    Hope this will help.
    Thanks,
    Vikash.

  • 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

  • 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.

  • Including .as files in a custom component

    Can anyone tell me how to include an actionscript file in a
    custom component when the .as file resides one level above the
    component?
    All of my custom components are in the "src/components"
    directory and the actionscript file I need to include is one level
    up in the "src" directory. I assume this can be done easily, but I
    am new to Flex and can't get it working. I have tried ../ ,
    parentDocument, parentApplication, Application.application, and
    fully referencing the file from C: with no luck.
    The ../ version seems to point to the right place but my
    Problems panel is showing
    "1068: Unable to open included file:
    C:\CFusionMX7\wwwroot\c21hp\flex\src\yahooMap2.as"
    Any help would be greatly appreciated.

    @Ryan:
    Thanks for your reply. For type property in Inspectable metadata tag: http://livedocs.adobe.com/flex/gumbo/html/WS2db454920e96a9e51e63e3d11c0bf680e1-7ffe.html#W S2db454920e96a9e51e63e3d11c0bf69084-7a21
    It can have values like Boolean, Array, String etc. I am trying to have a custom one. But I notice that I have to close the property tag, even if it is a string or html for e.g. text property in TextInput, I have to write something like this:
    <mx:TextInput>
            <mx:htmlText>
                <![CDATA[
                ]]>
            </mx:htmlText>
        </mx:TextInput>
    and
    <mx:TextInput>
            <mx:text>something</mx:text>
        </mx:TextInput>
    But I still think, it should be there. Not sure
    Chetan

  • Help with creating a custom component.

    Hi. I have created a really simple custom component called
    myComp. It is a simple Canvas 100 pixels x 100 pixels with an Image
    control component.
    <mx:Canvas>
    <mx:Image id="image1">
    </mx:Canvas>
    After instantiating the component in Main.mxml eg. var
    pic1:myComp = new myComp(); I am having a problem setting the
    source property of the Image component.
    "image1" is the id of mx:Image in the custom compoenent so I
    tried pic1.image1.source = "assets/ball.jpg" but I get a run time
    error "Error #1009: Cannot access a property or method of a null
    object reference".
    Don't really know what I am doing wrong.
    Any help please!

    In your custom component, try adding a bindable public var
    which contains the path to your image. Also, set the image.source
    to this var.
    In your main app, set the var within the <mx:> tags of
    the custom component. Since it is a public var, it will show up in
    the code hint. You can also now change the image var from the main
    app anytime you like using ActionScript code.

  • Scroll bar, buttons and a Custom Component - help

    Thanks to another forum I was able to create a scroll panel and add a scroll bar to it.  That works fine.  Inside the scroll panel I have thumbnails of the product that I'm highlighting.  I want to be able to click on the thumbnail and have a full size photo of the product come up in the window next to the scroll panel.  I created a custom component that has a stage showing each full size product individually.  This worked fine when I simply had buttons and no scroll bar.  I could convert the thumbnail to a button and then add interaction so that it would go to the proper state of the custom component.  Where I'm having problems is now that I've imbedded the buttons in a scroll panel I'm no longer given the custom component as an option to pick from.  I can add interaction, but it only gives me the option of picking one of the pages, and not a component.
    I've attached a screen grab to help show what I'm describing.
    Any ideas?
    Doug

    Doug, thanks for asking this question.
    Hi ADAM...
    It seems that a lot of us are asking the same question: Scrollbar Navigation-Make Actionable
    (I created a low-fidelity proof-of-concept to test—using a datalist as you suggested. See link in my posting).
    I have reviewed the video you refer to here, but you example still does not allow for individual items in the datalist (scrollbar) to be assigned individual actionable events.
    Can you expain your thinking in Option 1, as a workaround? Do you have any other suggestions?
    BOTTOM LINE
    We are all looking to do the same thing... something we are going to see A LOT MORE of after Uncle Steve's TABLET presentation next week:
    A scrolling menu, with selected items in the menu causing "navigation" to a certain point in a scroll panel. (imitating the flick or slide effect of iPhone).
    Suggestion: Can you add a field to thedatalist so that when the "repeated item" (in edit mode) is configuredto do an action (i.e., On-Click, Transition to State), we can then assign the state  you'd like for each item in thetable itself?
    Now the issue is making it change the "State" within another component (i.e. scrolling panel). Can that be done?
    Thanks,
    - Rick

Maybe you are looking for

  • How can I see the size and colour of text in DW Cs5?

    Hi forum, how do you see the size and colour of a piece of text in Dreamweaver Cs5, I have some text in a dreamweaver file which is a size I like and a colour I like and I want to make a CSS rule with these characteristics. How can you see what size

  • Is it possible to change the amount of storage in an iphone 5

    i have a 32gb of storage on my iphone 5 and ive almost topped it off. im wondeing if there is anyway to upgrde the amount of storage i have to 64gb

  • Problem audit mismatch WCS/WLC for local net user

    HI, I have a problem in my WCS the audit status is mismatch for my two controllers. When I see the details of the mismatch, it is said that all my 400 users are "not present in controller". However, I checked directly on my web interface of my contro

  • Facebook Posts and Sounds Option

    Hi, my question regards the Facebook App and the function of Facebook Posts in the Sounds Menu.      I want to know if this has happened to other people, if its considered normal or if its an actual problem of my Ipad. The option of Facebook Posts in

  • Sony rx100 raw plug in

    As far as I can tell the Aperture plug in for the Sony RX100 has not been released yet. Would the first person to discover its release, please post. I've put the camera away, awaiting the plug-in's arrival. The available raw converters are just too c