Displaying components dynamically.

Hi All,
   I don't know how to fix this problem in Flex.
   I'm having questions and its responses in combo box.
   The main question is Q1 and user selects response as 'Yes' then I need to display 3 more questions. Those are Q2,Q3,Q4.
   When user selects response as 'I Dont Know' in Q3 then I need to display Q3.1 similarly for Q4 response is 'I Dont Know' then need to display Q4.1
   When user changes Q1 response to other than 'Yes' then I shouldn't display any of these questions.
   I tried adding all these questions in HBOX inside VBOX, but when it is showing initially all Q2,Q3,Q3.1,Q4,Q4.1 will be visible set to 'false' because of this it is leaving some much space and showing 'Submit' button.
  How to show these questions dynamically without pre-occupying spaces.
   Please find my code in attachment.
  Thanks in advance.
Regards,
Sharath.

I tried using states and found one small issue. I didn't know how to resolve this issue
say I defined states as follows
<mx:TitleWindow x="29" y="67" width="90%" height="685" layout="absolute" title="Create A New Report" fontWeight="normal" fontSize="13">
     <mx:Canvas width="787">
     <mx:VBox width="768">
         <mx:HBox>
             <mx:Label text="Information: " fontSize="12" fontWeight="bold" color="#34B05D"/>
         </mx:HBox>
         <mx:HBox>
             <mx:Label text="Report Type: " fontWeight="normal"/>            
         </mx:HBox>             
         <mx:HBox>
             <mx:Label  text="First Name:" fontWeight="normal"/>
             <mx:TextInput id="first_name"/>
             <mx:Label  text="Last Name:" fontWeight="normal"/>
             <mx:TextInput id="last_name"/>
         </mx:HBox>        
         <mx:HBox id="h1">
             <mx:Text  text="Question 1:" fontWeight="normal"/>
            <mx:ComboBox  width="152" id="Q1" dataProvider="{sel_list}" change="bb_service()" ></mx:ComboBox>
            <!--<mx:Button label="Change State" click="currentState = currentState=='NewButton' ? 'NextButton':'NewButton';"/>-->
         </mx:HBox>                
        <mx:HBox>
            <mx:Button label="Submit"/>
        </mx:HBox>
        </mx:VBox>
    </mx:Canvas>
    </mx:TitleWindow>
<mx:states>
        <mx:State name="basic">
                <mx:AddChild relativeTo="{h1}" position="after">
                <mx:VBox>            
                 <mx:HBox width="50%" borderStyle="none" height="36" id="hbox2">
                    <mx:Label text="Question 2:"/>
                    <mx:ComboBox  width="152" id="sel_Q2" dataProvider="{second_list}"></mx:ComboBox>
                </mx:HBox>
                <mx:HBox width="50%" borderStyle="none" height="36" id="hbox3" >
                    <mx:Label text="Question 3: "/>
                    <mx:ComboBox  width="152" id="sel_Q3" dataProvider="{third_list}" change="change_service3()"></mx:ComboBox>
                </mx:HBox>           
                <mx:HBox width="50%" borderStyle="none" height="36" id="hbox4" >
                    <mx:Label text="Question 4: "/>
                    <mx:ComboBox  width="152" id="sel_Q4" dataProvider="{fourth_list}" change="change_service4()"></mx:ComboBox>
                </mx:HBox>   
               </mx:VBox>
            </mx:AddChild>
        </mx:State>
        <mx:State id="ext31" name="extended31" basedOn="basic">
            <mx:AddChild id="child31" relativeTo="{hbox3}" position="after">
               <mx:HBox width="50%" borderStyle="none" height="36" id="hbox31" >
                    <mx:Label text="Question 3.1: "/>
                    <mx:ComboBox  width="152" id="sel_Q31" dataProvider="{fifth_list}"></mx:ComboBox>
                </mx:HBox>   
            </mx:AddChild>
        </mx:State>
        <mx:State id="ext41" name="extended41" basedOn="extended31">
            <mx:AddChild relativeTo="{hbox4}" position="after">
               <mx:HBox width="50%" borderStyle="none" height="36" id="hbox41" >
                    <mx:Label text="Question 4.1: "/>
                    <mx:ComboBox  width="152" id="sel_Q41" dataProvider="{sixth_list}"></mx:ComboBox>
                </mx:HBox>   
            </mx:AddChild>
        </mx:State>
    </mx:states>
<mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.states.*;   
        public function bb_service():void {
            if(Q1.text.toString() =='Yes')
                this.currentState = "basic";   
            else
                this.currentState = "";
        public function change_service3():void {
            if(sel_Q3.text.toString() =='I Dont Know')
                this.currentState = "extended31";                   
            //else
                //this.hbox31.visible = false;   
            //    this.currentState = "basic";   
        public function change_service4():void {
            if(sel_Q4.text.toString() =='I Dont Know')
                this.currentState = "extended41";               
            //else
                //this.hbox41.visible = false;
            //    this.currentState = "basic";   
    ]]>
</mx:Script>
   Now my problem is say when user selects Q3 with 'I Dont Know' then I need to display 'extended31' state. State 'extended41' is  basedOn 'extended31' so when I select 'I Dont Know' in Q4 it is displaying Q3.1 because it is based on 'extended31'.
   Can we add multiple states rather than using basedOn clause?
   I'm attaching my code for your reference.
Thanks,
Sharath.

Similar Messages

  • Displaying image dynamically

    Hi,
    i am getting data from backend sys its working fine.
    when eve we r give input like material number like 1, 2, ....... then then press button it shows data and IMAGE also
    here i have taken images 1.jpg, 2.jpg, .......... workspace -
    > mimes-----> comp.............
    i am setting source of that image prop like 1.jpg here
    when i give input   1   and click button it display r/3data and image but it is used for that only. if i want to display 2  then i change image prop source (here material number is 1 and image is 1.jpg.........depends up on material num can we write code here)
    i want to display it dynamically (depends upon material num it can show the data and image)
    can any one help
    Regards
    bhanu

    Hi Nikhil,
    i am explaining about my thread clearly
    i have taken 1.jpg, 2.jpg, 3.jpg....... images in workspace ..mimes ... components ... packageee
    now take button and image with  visible prop
    In  init() method i have take instance,bind for backend data
    setting visible prop none(image)
    In onaction()
    have taken execute,invalidate in try catch
    setting visible prop is visible(image)
    when i give material no  1  then it can display output  data and image
    if i want to display material no 2 data
    when i give  material no 2 then it can display output data  but image is 1.jpg  b'coz  i set source of image porp as 1.jpg
    the above posted code i have taken in onaction button().
    through hard coding i can display it individually but i want to display it dynamically  likee
    when we give material no 1 it can display 1's data and image 
    when we give material no 2 it must  display 2's data and image
    can u explain me clearly if possible with step by step.
    sorry for the late reply
    Regards,
    bhanu.

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • Is it possible to display only dynamically selected fields in the out put?

    Is it possible to display only dynamically selected fields in the out put? i need to display set of columns in the selection criteria, but in the output i have display only input given fields. because i need to convert it into .csv file. So i have to display selected fields from internal table. In oracle they are using"execute immediate". is there any equivalent in SAP?
    thanks in advance.

    Hi Remya,
    Are you talking about dynamic programming in ABAP ?
    If yes, there are concepts like RTTS which facilitates it.
    Yes, the select query also supports dynamic selection of fields. ( Please care about ( ) in dynamic sql ).
    Do more research on Field Symbols and statements like ASSIGN COMPONENT OF.
    Regards,
    Philip.

  • How can I create UI components dynamically based on the result of WebService/HttpService call?

    I would like to create child components of the component
    based on a XML which is retrieved by WebService/HttpService call.
    createChildren() is the one to be used to create components
    dynamically. But if I use createChildren() and call a
    WS/HttpService request in createChildren method, I can not get the
    result of WS/HttpService request in createChildren().
    It seems that the result event is processed later after
    createChildren() is completed.
    How can I implement my requirement?
    I would appreciate any pointer or suggestion.
    Best regards
    Masa

    1) Use a List, with a custom itemRenderer
    2) Use a Repeater (Probably easiest)
    3) use Actionscript to addChild() components.
    Tracy

  • Not able to display a dynamic image

    I'm not able to display a dynamic image on Adobe print form.
    Here is what I did.
    Please let me know what I need to do to get this working...
    1. Created a Graphics node in the Context of the Adobe form.
    2. In the URL tab of the graphics node defined the following two lines:
         <URL pointing to the MIME repository folder>
         IM_FILENAME_1
         Where IM_FILENAME_1 is being passed to the Adobeform function module.
    3. In the Layout mode, dragged and dropped the Graphics node from the
        contenxt tab to the form layout. On doing so it appears as a image field in the form layout.
    4. Activated the form.
    BUT, when I run the form , the image is not showing up.
    The idea is to pass the image file name to the form so that it will show up a dynamic image at run time.
    PLEASE HELP.

    Hi Atul,
    Try this, that should work.
    In the interface , define a parameter type string where you will store the URL of the image .
    In the initialization part of the interface , check if the URL is defined, in case it's empty define a default URL . You should put the compelte URL of the image like "http://www.company.org:8080/logo.logo.jpg" .
    Then link this parameter to the Grpahic Node in the URL parameters .
    Let me know if that works

  • Displaying a dynamic image in a jsp

    I am interested in the way of dynamically generating an image in a web browser. The image should be formed on the servlet, more precisely with the aid of a servlet, and reloaded in the web browser every time it suffers modifications (for example, elements are drawn). The drawing and displaying part is already functioning not as a server application, but as a desktop one. The result of the drawing actions are displayed in a Bufferd Image view. What I have to do is to display this image in the browser, encoded as a gif (I already know how to do the encoding part).
    //code from TheServlet.java
    ImageViewPort view = new ImageViewPort(600, 600); // BufferedImage type
    Image image = view;
    g = image.getGraphics();
    response.setContentType("image/gif");
    GifEncoder encoder = new GifEncoder(image, out);
    encoder.encode();
    How would I correctly reference in the HTML form this servlet? In the HTML form I have to display the dynamically created GIF image as a server side image map?
    // code from the HTML form
    <img WIDTH=600 HEIGHT=600 BORDER="2" src="http://localhost:8080/servlet/TheServlet");
    ISMAP/>
    How should be written the source of these image map?

    you can use AJAX for this.. google maps is using ajax for rendering their maps..

  • How to display the dynamic region in full size

    Hi,
    I'm not able to display the dynamic region in full size.
    In my page, i attached a dynamic region which refers a page fragment. This dynamic region contents are showing as small (scroll is there but i want to display fully).
    How to do this?
    Thanks in advance,
    Sundar

    More than likely it has something to do with your parent layout element. I'd suggest putting your region in an af:panelStretchLayout or similar container that stretches its children. Some of the elements can be a little tricky though, such as af:panelTabbed. It has an attribute that must be set to stretch its first child.

  • How to display the dynamic text in the selection screen

    Hi All,
    I want to display the dynamic text in the selection screen .... ( I searched in forums , didnt get the any answer fot this sort of qustion ).....
    EX: If i have the date of today 31st  it has to show message like " today date is 31 like some thing "  when i execute the report .
    Could any one face this sort of requirment, Please let me know.
    Thanks in advance.
    Reagrds,
    Bharani

    Where would you like this dynamic text being displayed? As an "message" or in some parameter field?
    If first
    parameters date type d.
    data: text type string.
    at selection-screen.
       concatenate 'Today is' date into text.
       message text type 'I'.
    If second
    parameters pa_text type c length 50.
    at selection-screen on date.
      if date is not initial.
        concatenate 'Today is' date into  pa_text.
      enidf.
    at selection-screen output.
       "show it as read only
       loop at screen.
        if screen-name = 'PA_TEXT'.
               screen-input = abap_false.
              modify screen.
        endif.
       endloop.
    Regards
    Marcin

  • Display a dynamic header

    Dear Vinod,
    IMHO i don't think this is a spec dumping. I did try to search and even tried hands on it. Unfortunately i didn't get any luck with that.
    Morever i'm not asking for any spoon feeding...It's just about some pointer's or any ideas that would help me.
    Hope that clarifies much better.
    Thanks in advance,
    Arya.
    My selection screen has a parameter P_WEEK.
    Suppose if user enter's a week no for ex: 5. My ALV header should display as
    Week5  Week6  Week7  Week8  Week9  Week10
    i.e. Up to next 5 weeks. How to design a ALV that would display a dynamic header?
    Any ideas or suggestion would be of great help.
    Thanks,
    Arya
    Moderator message : Search for available information. Moved to basic(points-free) forum.
    Edited by: Vinod Kumar on Oct 19, 2011 3:37 PM
    Edited by: arya.soumya on Oct 19, 2011 12:22 PM
    Edited by: Suhas Saha on Oct 19, 2011 4:08 PM

    Hi,
    you just try to write below logic in TOP-OF-PAGE routine in your program.
    parameter: p_week(3) type c.
    Form top_of_page .
    do p_week times.
    pass the required data to your internal table and append it.
    enddo.
    Endform.
    Ram.

  • How to display  servlet dynamically generated image ?

    Hi,
    How to display servlet dynamically generated image ?
    I have a servlet generating a buffered image in the doGet. I want to display the image in a jsp page with other information. I'm not able to get it properly displayed.
    **Try n# 1 **************************************************************
    This displays my image but nothing elle :
    ServletOutputStream sos = pResponse.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
    encoder.encode(img);
    **Try n# 2 ****************************************************************
    I tried also :
    In the servlet :
         request.setAttribute("renderedImage", img);
    and in the jsp page :
         BufferedImage image = (BufferedImage) request.getAttribute("renderedImage");
         <img src="<%=ImageIO.write(image,"jpeg",response.getOutputStream())%>" width="300" height="280"/>
    This last try draws big crap in the jsp page, thank you in advance.
    Nelson

    Call another servlet from the IMG tag. Have the servlet stream out the image using ImageIO (instead of writing HTML).

  • Display components for process chains

    Hi all,
    i remember a sap note or a how to guide to configure the display components for process chains as hierarchy like:
    - my chains
        - daily
        - weekly
        - monthly
             - monthly admin
             - monthly xyz
    but right now i find no information about that.
    Do you?
    thanks for your help.

    Hi,
    Check below threads -
    Change the Directory of a Process chain.
    Process chain: Moving chain from one u0093folderu0094 to the other
    AleX

  • ALV display using dynamic field catalog and dynamic internal table

    hi ,
    please guide me for ALV display using dynamic field catalog and dynamic internal table.
    Thank you.

    Hi Rahul,
    maybe thread dynamic program for alv is helpful for you. More information about the [SAP List Viewer (ALV)|http://help.sap.com/saphelp_nw70/helpdata/EN/5e/88d440e14f8431e10000000a1550b0/frameset.htm]. Also have a look into the example programs SALV_DEMO_TABLE*.
    Regards Rudi

  • Is it possible to let Labview create displays himself dynamically?

    the number of displays can´t be fixed right now.
    i want to create a huge number of display by using a menu "create a new display". everyone should show another value from a global variable (Array).
    So i don´t want to use static elements - if i would do so, i had to create about 80 digital displays, 20 analog display and a few graphs. But i don´t need them every time - sometimes i need 3 digital and 15 analog displays, another time i need 60 digital an no analog displays. i only want to create 3 foundamental dislays and use them very often with different properties and pointers to the global variable!
    Is this possible?
    Thanks a lot...

    I have in many applications done this by using the picture control. Jean-Pierre first suggested an excellent approach to this in this link.
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000A33B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_INCLUDE_0=Ben+picture&USEARCHCONTEXT_INCLUDE_S=0&UPostedFromTimeSearchArg_0=8&UPostedFromTimeSearchArg_1=3&UPostedFromTimeSearchArg_2=2000&UPostedFromTimeSearchArg_S=4&UPostedToTimeSearchArg_0=4&UPostedToTimeSearchArg_1=9&UPostedToTimeSearchArg_2=2004&UPostedToTimeSearchArg_S=4&USEARCHCONTEXT_TIER_0=2&USEARCHCONTEXT_TIER_S=0
    You can use the "Invoke Node" to get the image of a control. If you combine this method with events configured for the picture control, you can simul
    ate normal LV objects.
    This method takes a bit bit of work, but it does allow the GUI to be taylored as your end user requires.
    You do not have to re-code all of the normal behaviour of your control elements. When a clcik is detected on a simulated device, a real LV FP object can be made visable and moved from its off-screen location to where the user clicked, and key-focus transfered. The user then interacts with the LV object that is on top of the the picture if it.
    It is not easy, but it works great!
    So as to:
    "Is it possible to let Labview create displays himself dynamically?"
    YES!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to Render Components Dynamically

    Hi All,
    I have a Problem with the valueChangeListeners and selectionListners. I'm trying to render the components dynamically in the listeners by making the rendered attribute '"true" or "false" . But it is not working. when I'm doing the samething in command button action method. I'm getting the result(i.e rendering components to "true" or "false"). But why my code is not working in the listeners.
    Can anyone help me how to render the components partially.
    Thanks in Advance,
    -Satish Dasari

    I tend to agree with Simon's comments regarding programatic usage of the PPR APIs. Fernando, can you post an example so that we can have a look at where you having issues?
    --Ric                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • 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

  • How to change the excel file name which already exists

    Hi,     I want to rename the already existing excel file, is there any way to do it in Lab View. Please help me in this regards. Regards Shiva Kumar Singh

  • Need help in Developing the Smartform for Delivery notes

    I'm developing the smartform for tcode vl02n. My question is when writing the print program which is the best way : 1) By making use of standard print program RLE_DELNOTE 2) developing from scratch by declaring my own types and subroutines as per my

  • Tab opens in new window by itself

    I have several tabs open that I switch between, one of them being Facebook, and that is the only one that ever gives me issues. Sometimes when switching between tabs, the Facebook tab pulls itself out of the group, and into it's own new window, and I

  • Hash Partitioning and Partition-Wise Joins

    Hi, For the ETL process of a Data Warehouse project I have to join 2 tables (~10M rows) over their primary key. I was thinking of hash partitioning these 2 tables over their PK. Through this the database (9.2) should be able to do a Hash-Hash Full Pa