Dynamic view creation in Flex

I am new to  Flex web applications and I am doing research to see if functionality
contained in an existing web application can be replicated in a Flex web app.
We currently have a JSP / Struts based web application that creates a data entry
web view dynamically based on information that describes the different widgets and
their view locations as recieved from the application backend.  We are looking at
migrating this application and this functionality to Flex.
When User X selects 1 of any number of data entry views, the Flex application would
receive data from the back end that  contains information describing the different widgets
to display on the dynamic view: what type of widget to display ( text field,combo, line,
box, etc), the pixel specific positional information as to where each widget exists in the
view.  These data entry views are not something the Flex developer designs or knows
what to expect from the backend. Flex has to generate the view on the fly based on the
information that describes the view.
The question:  I fully expect there to be coding within the action scripts; before trying to
                     learn how to do this, is this something that Flex support.  
Thanks,
Brian

Yep, we do something similar. We had to build out the infrastructure, but It works fine. E.g.,
var bDesc:XML = <button x="10" y="5" label="hello world" color="red"/>
var b:Button = new Button();
b.label = bDesc.@label;
b.x = bDesc.@x;
b.y = bDesc.@y;
b.setStyle('color', b.@color);
addChild(b);
In your app, the actual description (XML or other format) would be coming from the server. Then you just add it to the display list (and wire in any event handlers if necessary). In a real setting, you'll need error checking and a more formalized way of doing this, but it works reasonably well. No major snags.

Similar Messages

  • Problem in Dynamic View Creation

    Hello  Every1,
       I have to create 2 views (view1 and view2). If there is any alternation (adding/deleting fields) in view1 it has to reflect automatically in view2 also.If u have any idea how to do this please let me know.
    Regards,
    Siva.

    Siva,
    While creating the view, you mentiond the tables, right?
    Instead of mentioning the table name, mention the view name.
    Regards,
    Ravi
    Note : Please reward the posts that help you.

  • Error in creating dynamic view

    Hi,
    I am using the following to create a dynamic view which will be created on runtime and conditions will be provided by user. Here is the code:
    CREATE OR REPLACE PROCEDURE DYN_VIEW_PROC(PARA IN NUMBER)
    AS
    DEPT_NO NUMBER(3) := PARA;
    DYN_QUERY VARCHAR2(1000);
    BEGIN
    DYN_QUERY := ' CREATE OR REPLACE VIEW DYN_VIEW
    AS SELECT EMPNO,ENAME,DEPTNO FROM EMP_NEW
    WHERE DEPTNO > :1 ';
    EXECUTE IMMEDIATE DYN_QUERY USING DEPT_NO;
    END;
    But when i execute this code i got the following error:
    SQL> EXEC DYN_VIEW_PROC(10);
    BEGIN DYN_VIEW_PROC(10); END;
    ERROR at line 1:
    ORA-01027: bind variables not allowed for data definition operations
    ORA-06512: at "SYS.DYN_VIEW_PROC", line 9
    ORA-06512: at line 1
    If i hardcode the condition in the defenation of view then it works fine. Any solution of it.

    It looks strange.And more so, since the view name seems the same across each invocation (unless the example is missing that detail). So, if two users were creating this view one after the other and then subsequently try to use it, what would each user see in their output???
    Not the rows based on their where condition, possbily.
    You would create the view only once with all the necessary joins and any static conditions. Then users would use it as and when necessary, supplying their custom where condition on top of it.
    What is the need you are trying to solve using this dynamic view creation?

  • Dynamic re-creation of Entity/View Objects

    Does anybody know if the following is possible with JDeveloper/ADF, and if so, any suggestions on where to start?
    My boss wants to be able to re-define a series of database views dynamically at any time, adding/removing columns. This will be handled by PL/SQL etc so it is not part of the JDeveloper question.
    But he then wants the J2EE Swing GUI application to be able to "see" the changes to the view immediately e.g. to display new fields on the client form, without having to re-compile any code.
    The Swing GUI appears to be a given, unfortunately as it would be easier to re-create at least the GUI dynamically using JSP etc.
    Right now, I'm trying to figure out how to pass the database changes through the J2EE tiers e.g. how do I dynamically re-define the Entity Object based on the modified view, without re-compiling it? How do I reflect these changes in the corresponding View Object(s)?
    Personally I think this requirement will be the death of the project, as it will absorb 95% of our limited intellectual/Java resources for 5% of the functionality: Welcome to Dilbertland!
    But given this requirement, does anybody out there have any ideas?
    Thanks,
    Chris

    Hi Chris ,
    well you can always create dynamic attribute in the view object using viewObject.addDynamicAttribute(DynamicAttributeName);
    and you can store any serialazable object in this attribute like any other attribute. It should be serializable coz BC4J needs to send it to Database in case you are using spillover feture
    to cache records.
    you can also create Dynamic view object based on an entity or a SQL query.
    AppModule.createViewObjectFromQueryStmt();
    But of course dynamic view based on SQl Query
    will not be updatable. I doubt , You can dynamically create attribute on Entity or dynamic Entities.
    I have already posted one question for this ..and waiting for reply ..:-(
    Updatable , Dynamic VIEW OBJECT ??
    hope it'll help
    Prasoon

  • Dynamic view object loses bind variables after passivation

    I am creating a view object definition/view object programmatically in Jdev 11.1.1.2.0. The query requires a named bind parameter. All was working fine but now I am testing with app module pooling disabled and the bind variable is not being restored after passivation -- it's like the definition has disappeared or something.
    Here is my VO creation code:
    ViewObject vo = findViewObject("FinalistsWithEvalDataVO");
    if (vo != null){
    vo.remove();
    ViewDefImpl voDef = new ViewDefImpl("FinalistsWithEvalDataVODef");
         // I add a bunch of viewAttrs here...
    voDef.setQuery(fullQuery);
    voDef.setFullSql(true);
    voDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    voDef.resolveDefObject();
    voDef.registerDefObject();
    vo = createViewObject("FinalistsWithEvalDataVO", voDef);
    vo.defineNamedWhereClauseParam("Bind_SchlrAyId", null, new int[] {0});
    vo.setNamedWhereClauseParam("Bind_SchlrAyId", new Number(1)); //For testing
    vo.executeQuery();
    The query executes fine right there and then the VO seems to passivate fine. I even see the bind var in passivation:
    <exArgs count="1">
    <arg name="Bind_SchlrAyId" type="oracle.jbo.domain.Number">
    <![CDATA[1]]>
    </arg>
    </exArgs>
    But then when it reactivates prior to rendering the page, it invariably throws a missing parameter exception and this in the log:
    <ViewUsageHelper><createViewAttributeDefImpls> [7409] *** createViewAttributeDefImpls: oracle.jdbc.driver.OraclePreparedStatementWrapper@1af78e1
    <ViewUsageHelper><createViewAttributeDefImpls> [7410] Bind params for ViewObject: [FinalistsWithEvalDataVO]AwardViewingServiceAM.FinalistsWithEvalDataVO
    <ViewUsageHelper><createViewAttributeDefImpls> [7411] ViewUsageHelper.createViewAttributeDefImpls failed...
    <ViewUsageHelper><createViewAttributeDefImpls> [7412] java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    I have worked on this for hours and can't see anything wrong. Like I said, it works fine when not forcing passivation...
    Any help would be appreciated.
    Thanks.
    -Ed

    @Jobinesh - Thanks for the suggestions. I have read all the documentation I can find. Everything works fine without passivation. Everything still breaks with passivation. I have given up on trying to get the bind variable to restore after passivation and am currently just building the query with all values embedded in the query rather than bind variables. This is bad practice but avoids the problem. However, now that I avoided that obstacle, I'm on to the next issue with passivation of this dynamic view object, which is that the current row primary key apparently cannot be reset after activation. I get the following error:
    <Key><parseBytes> [7244] Key(String, AttributeDef[]): Invalid Key String found. AttributeCount:1 does not match Key attributes
    <DCBindingContainer><reportException> [7254] oracle.jbo.InvalidParamException: JBO-25006: Value 00010000000A30303033383133343734 passed as parameter String to method Constructor:Key is invalid: {3}.
         at oracle.jbo.Key.parseBytes(Key.java:537)
         at oracle.jbo.Key.<init>(Key.java:179)
         at oracle.jbo.server.IteratorStateHolder.getCurrentRowKey(IteratorStateHolder.java:34)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3877)
    I've been trying various workarounds for over a day now with no luck. Very frustrating.
    Thanks for trying to help.
    -Ed

  • Reg View creation in Generic

    Hi SDN,
    Im trying to create Generic Data source of View Method. I wanted to create View on BSID ( Closed Customer Invoices) and BSAD ( Open Customer invoices) Tables, But while creating its giving error as "THERE IS NO RELATION BETWEEN THE TABLES"  I want to know how to create Relation Between the tables. Both BSID & BSAD are standard tables, so we cant make any changes.
    Please let me know the procedure to bulid Rlation between the tables.
    Regards
    Sujan

    Hi Siva,
        You have to give relation between these two tables in tab "Table/Join Conditions".
    Creating Views:
    http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm
    View creation fr generic extraction
    Hope it Helps

  • Select from Query ? / Dynamic view ? Anything else ?

    Hello,
    This could be a bit challenging. (or maybe not, i hope)
    I have to create a report which is based on 3/4 tables with pretty complex SQL.
    Step 1. I have to use views (in the database currently) to select data from these tables.
    Step 2. Then create the next set of views (in the db) based on the previous views.
    Step 3. Then finally join the last set of views in Reports and create the report based on the PARAMETERS entered.
    This was fine, until the client changed the criteria. Now the views have to be created but the PARAMETERS affect the FIRST set of views.
    That is, the views in the FIRST STEP will have a where condition based on the parameters at RUN TIME.
    I was wondering about how to do this ?
    1. Can I use dynamic views (in db) passing the where condition parameter to the where clause ? Alternatively use DDL in Reports.
    OR
    2. Create a query in Reports and create subsequent QUERIES BASED ON THE FIRST QUERY (like MS Access). Can this be done ?
    3. Any other way ?
    If you need any clarification, I can provide that.
    THANKS for taking the time to read it. It would be great if you could give me any ideas.
    Pat.

    hello,
    you might look into REF-CURSOR-QUERIES for this particular case. it might help.
    regards,
    the oracle reports team

  • View creation very slow - not materialized view

    I have a view creation script which is running in a fraction of a second in the dev environment but takes over an hour to run in the test environment.
    The test environment is off-site, so I have no direct access to it. It does have a lot more data in than dev, but this is not a materialised view so as far as I understood it the amount of data in the system shouldn't affect the time to create the view.
    I haven't been able to find any information on what can make this happen. In the development environment I can be querying the view (or can lock it directly), and am still able to run the CREATE OR REPLACE statement without any performance impact. The view does contain function calls and is created with the FORCE keyword, but I can't find any evidence that this should affect the speed of creation.
    I am running Oracle 10g (10.2.0.4.0) on Solaris in both dev and test environments.
    Any ideas on what could be causing this are very welcome.
    CREATE OR REPLACE FORCE VIEW DB_OWNER.PER$AGE
    SYSTEM,
    LOCATION,
    EVENT_START,
    SURNAME,
    DOB_STRING,
    DESCRIPTION,
    GENDER,
    OLD_ID,
    URN,
    COMBINED_SCORE,
    LOAD_DATETIME,
    AGE,
    EVENTDATE_FROM,
    EVENTDATE_TO,
    DETAILS,
    AOB
    AS
    SELECT /*+ leading(ad) */
    p.system,
    p.location,
    p.event_start,
    p.surname,
    CAST (
    NVL (
    NVL2 (
    p.dob,
    TO_CHAR (p.dob, 'dd/mm/yyyy'),
    TO_CHAR (
    p.apparent_age
    + ROUND ( (SYSDATE - p.created_datetime_from) / 365, 0))),
    0) AS VARCHAR2 (10))
    AS dob_string,
    p.description,
    p.gender,
    p.old_id,
    p.urn,
    NVL2 (
    p.dob,
    db_owner.app_age_score (p.dob, ssearch.get_target_age),
    db_owner.age_score (p.apparent_age,
    p.created_datetime_from,
    ssearch.get_target_age))
    AS combined_score,
    p.load_datetime,
    psd.age,
    psd.eventdate_from,
    psd.eventdate_to,
    e.details,
    NVL (e.aob, 'N/A') aob
    FROM db_owner.person p,
    db_owner.psd psd,
    db_owner.entity e
    WHERE p.db_key = psd.db_key
    AND psd.age IS NOT NULL
    AND e.system(+) = p.system
    AND p.system IN (SELECT internal_name
    FROM ops$tomcat.feed_details
    WHERE inSearchList = 'true')
    AND e.urn(+) = p.urn;

    Hi,
    Thanks for the response.
    Trying the same thing without the FORCE keyword made no difference, the view still takes a long time to compile and there are no compilation errors.
    On the development system, I have run a long-running query on the view and checked V$Access. This returns a record for the view, but I can still successfully run the CREATE OR REPLACE statement on the view in another session. This appears to show that a record in V$Access doesn't mean that the view can't be recompiled.
    On the test system there are no other sessions connected and no records for the view in V$Access.
    Does anyone have any other ideas?

  • Set operator NE in Database View creation in  join condition

    Hi Experts,
         I have a requirement to set NE(not equal) operator in join condition of Database View creation. Could you please help me how to set in operator.
    Join condition :
    Ex : BSAK-AUGBL NE BSAK-BELNR.
    You know that by default operator is '='. i want to set NE in place of '='.
    Thanks,

    Hi Chinna,
    Check whether if there is any possibility or not to include more key fields like bukrs, lifnr, gjahr etc in the where condition, so that you query may result faster. Then, there won't be any necessary to create the view.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Automatic storage location view creation in maintenace order (IW31)

    Hello,
    Seems like I need some help.
    Have configured automatic storage location view creation for GR and reservation. Configured movement types are 101, 201, 261. While creating reservations (201, 261 mvmnt. types) with mb21 the sloc view is automatically created in material master, and everything seems fine.
    But in iw31 when I specify material number and sloc in a Components tab, I get an error message CO312: "The storage location data is not created". Automatic reservation is not created, and maintenance order can not be saved. Movement type 261 is used for automatic reservations for the maintenance order.
    If I configure message CO312 as a (W)arning  message, then it allows me to save the order and reservation, but sloc view in material master still is not created. Think that's not good and may lead to MRP issues.
    How can I configure automatic sloc view creation in iw31? Is that possible?
    Edited by: Konstantin Dudura on Nov 17, 2009 8:11 PM

    Hi,
    The customization required for Automatic Storage location creation at reservation are:
    Goto : SPRO -> MM -> inventory Management and physical inventory -> Goods issue/ Transfer posting -> Create storage location automatically
    first of all go to Plant and tick the automatic Storage location creation for the Plant. After that goto Movement type and tick the automatic Storage location for movement type 261.
    Regards

  • Personalized view creation in OA Framwork

    HI ,
    I am developing a search Trasaction in OAF using Query Region (AtuoCustomization Mode ). I developed the simple search and advanced search with dyamanic where caluse (I am setting the where clause and not using the where caluse genrate by Search Framwork ) . now i have to develope the personalized View page . i am using same method used in simple search and advance search for genrating where caluse dayanamiclly . but problem is that in personiazied view i am not able to invoke that method as i am not getting the how to handle the apply and apply & view result button in view panal . if anyone work on personalized View creation or know anything about creation of personalized view , please share your knowladge . its urgent , please help me
    regards,
    Vishal

    Looks like you are running a page which is part of a multipage transaction. Check the page function and make sure that page is not expecting any parameter, all the corresponding class files are present in the myclasses folder.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • View creation fr generic extraction

    Hai Experts,
    when we are create view from two different table ,wht is the crieteria that should  satisfy  between tables..... and at the time of datasource creation which type we need to select (master/trans)..as i found both master and transaction field in one table
    Can any one send the step by step process to create view..
    I have one more scenario ie .,i need to create a datasource from tables which belong to diff applications and their primary key is different ,can any one tell me how to create a datasource using function module,step by step process..
    thnks in advance,
    Regards,
    Suri

    hi,
    try these links for view creation...
    http://help.sap.com/saphelp_nw04/helpdata/en/f5/35c83ecedc636be10000000a114084/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9b/43473ccf20514ee10000000a114084/content.htm
    http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm
    http://www.sapdb.org/7.4/htmhelp/ee/1c5be2eba711d4aa2800a0c9430730/content.htm
    hope it helps...

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • Updatable , Dynamic VIEW OBJECT ??

    Hi ,
    I want to create a dynamic VO which is updatable.
    I dont have any information about the table on which my View Object is based on, at DESIGN TIME. At run time I create query for the view and create dynamic view using AM.createViewObjectFromQueryStmt(String, String) but this kind of view will not be an updatable view.
    I think if I use createViewObjectFromQueryClauses() from entity, it will be updatable,,,but in that I will have to create entities for all the table in my schema ..which sounds BAD...
    is there any thing as DYnamic Entities ??
    or any other trick to do this.....
    BC4J should support something like changing QUERY_DATA_SOURCE_NAME at runtime in oracle forms.. which allow you to update record.
    Thanx,
    Prasoon

    Hi Prasoon,
    Steve Muench's "Dive Into BC4J" page has the following example: http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html
    But this is based on pre-defined Entity Objects. It might give you some ideas, though.
    Good luck!
    Chris

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object.
    Here is the code:
    newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql);
    VariableValueManager vvm = newVO.ensureVariableManager();
    if (vvm != null)
    Variable vars[] = vvm.getVariables();
    vars will be empty, even though the sql statement in strSql has bind variables in it.
    Is there any way to determine the bind variables of a dynamic view object?
    Thanks!

    I got the same problem as yours and still could not find any way out.
    However, as I can see, you wanted to get VariableValueManager of newly created ViewObject that may be not available at this moment.
    If you find way to solve the problem, please help.
    Cheer,
    MinhTran

Maybe you are looking for

  • Links replaced with question marks

    I have two songs I placed on my site. I noticed tonight that the links are not there and instead there are two question marks. So, I uploaded the site again and still there are question marks. Then I looked at the index folder on my desktop and the l

  • How do I keep a rented movie locally stored for the authorised period?

    Okay, so just bought an Apple TV for the first time, so this is all new to me! So far, most of it makes sense, but I'm wondering about how the unit manages downloaded content. It seems to me that you rent a movie, Apple TV starts downloading it and m

  • How do I get my menus to display?

    I just had a new computer built. It's a learning curve but this is my current issue. My firefox menu at the top of my page is missing. How do I get the menu (Help, tools, etc.) to be displayed at the top of the page?

  • Accessing components in TabNavigator on unselected tabs

    Hi there, I want to set the value of components (says a rich text editor, or image source attribute value, etc.) in tabs that are NOT selected. So if I have three tabs say, and I currently have tab 1 selected and I want to set the value of a text fie

  • How are they going to resolve the 4s 3g problem??

    How are they going to resolve the 4s 3g problem?