Using dynamic context attributes with flashisland

I recently started looking at flashislands.
Going through the SDN tutorials on this topic, I noticed that the declarations of GACDATASOURCE and GACPROPERTY properties inside web dynpro and their counterpart variables inside flex are a bit static (all naming and binding is done at design time).
So I'm asking if there's a way inside flex to dynamically capture the values of the attributes of a web dynpro context node that is bound to an ArrayCollection variable inside flex without knowing the names and the amount of the attributes of the context node?
Here's my situation:
I have a context node (REPORT_DATA) inside web dynpro that at design time has no attributes.
The attributes and their names are created dynamically at runtime.
It is even so, that over time the amount of attributes may vary.
Inside the web dynpro, the contents of this context node (REPORT_DATA) are shown in a (dynamically built) table.
Besides using the table, I'm trying to show the same contents as a piechart and as a columnchart in a flashisland.
The ROOTUIELEMENTCONTAINER of the FlashIsland view in web dynpro only contains a GACDATASOURCE element at design time.
The 'dataSource' property of this GACDATASOURCE is bound to the context node REPORT_DATA.
The 'name' property of this GACDATASOURCE is bound to an ArrayCollection variable inside flex (named dataSource).
So much for the static part created at design time.
At runtime inside web dynpro the correct GACPROPERTY's are created, based on the - over time changing - amount and the names of the context node.
Suppose my REPORT_DATA context node at runtime starts with 3 attributes: ATTR1, ATTR2 and ATTR3
Also suppose the node contains 2 elements: [ {"1_1", "1_2", "1_3"} , {"2_1", "2_2", "2_3"} ]
The dataSource variable inside flex also contains 2 entries with 3 elements each.
The code to show the value of (for example) the first element of all entries inside the ArrayCollection variable would be:
+for each( var o:Object in dataSource) {
var s:String = o.ATTR1;
Alert.show( "the 1st value = " + s ); // 1_1 for the first entry, 1_2 for the second
}+
I can then use the myAC variable inside flex as dataprovider for various other objects.
This works fine.
But inside flex I can only capture the value of an attribute when I know its name at design time (like ATTR1 in the sample code above).
And that's not what I want.
Inside flex I want to capture the value of the context attributes dynamically in a (correctly typed) flex variable without knowing the names and the amount of the context attributes.
Is this possible?
Thanks in advance for - any - response.
Bart.

Hi again,
I tried the same thing by creating a dummy context node without any attributes, and adding all attributes at runtime using the add_attribute method. In that case too, it doesnt work. All the attributes are available in the dynamic attributes of the node element, but are not getting displayed.
Any help would be greatly appreciated. Thank you.
regards,
nithya

Similar Messages

  • Validation of context attributes with adaptive webservice model

    Hi, I am creating a Web Dynpro Java application (on top of Netweaver AS 7.0) using an adaptive webservice model to invoke a webservice.
    The webservice has some request attributes of type string with limited length (for example limited to 1 character). I bound the model to component controller context and created a mapping between the component controller context and view context. In the view, I created a form which is bound to the context attributes.
    When user enters string values, which are longer than the maximum length specified in webservice WSDL, and submits the form, an exception is thrown when Web Dynpro runtime is trying to assign entered values into context attributes:
    com.sap.dictionary.runtime.DdCheckException: Length of character string "abcdef" must be smaller than or same as MaxLength 1;
        at com.sap.dictionary.runtime.DdTypeString.checkValid(DdTypeString.java:195)
        at com.sap.tc.webdynpro.model.webservice.base.model.BaseGenericModelClass.setAttributeValue(BaseGenericModelClass.java:304)
        at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClass.setAttributeValue(WSTypedModelClass.java:62)
        at at.gov.bmf.demo.comp.employee.model.OrganizationalAssignment.setEmployeeGroup(OrganizationalAssignment.java:52)
        at at.gov.bmf.demo.comp.employee.wdp.IPublicEmployeeDemo$IOrganizationalAssignmentElement.wdSetObject(IPublicEmployeeDemo.java:1552)
        ... 32 more
    This exception is thrown before my non-validating action is executed, so I am not able to prevent it or handle it.
    Is there any way how to catch this exception or prevent it?
    Does anyone know where these model restrictions are stored? I searched the XML files generated for the model, but I haven't found anything. Does the Web Dynpro runtime access WSDL everytime it needs to validate request parameters?
    Thanks,
    Tomas

    No ,This is the preferred and safer way to separate the Model Node and and Input Node and relationship between them by using mapping.
    You create your context structure for input and then on action set user input to model data.
    Safer it means  : Sometimes it happen that model data not populated properly due to network or wrong user input etc ,this time our presentation will be safe and display the proper error message rather the screen went away with null pointer exception.
    Regarding your - it require a lot of work. It too much convince for us that rather than writing 50 lines of code
    for only input length validation WebDynpro provides us a better model driven solution.
    Best Regards
    Satish Kumar

  • Using view context attribute values in view methods

    Hello,
    I have a view context mapped to a window context.  The window context has a supply function that gets some data.  I would like to use some of this data in one of my view methods but can't seem to find the syntax to use the values in the mapped view context attributes.  I know for displaying on the view you map the screen field to the context attribute but I just need to use this value in a method.  Any help will be greatly appreciated.
    Thank you,
    JR

    Hi Joseph,
    If you already had mapped the view context with the window context, all you have to do in the view method is to read the view context. For this, you can use the next code:
      DATA: lo_node      TYPE REF TO if_wd_context_node,
            lo_element   TYPE REF TO if_wd_context_element,
            lv_attribute TYPE wd_this->element_node-attribute.
      lo_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
      lo_element = lo_node->get_element( ).
      lo_element->get_attribute(
        EXPORTING
          name =  `ATTRIBUTE`
        IMPORTING
          value = lv_attribute ).
    This is supossing you have a node named 'NODE' with an attribute named 'ATTRIBUTE'.
    Also, you can use the Web Dynpro Statement Structure. It's a wizard that helps you to generate some code. The icon is like a magic wand.
    Regards,
    Isaac Meléndez

  • Using Dynamic JDBC Credentials with jazn security (web.xml) in BC

    I have followed the document “How To Support Dynamic JDBC Credentials” http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html to connect to the database using Business Components, as the user who logs in the application. (Proxy)
    The only matter is that as I could see, I cannot use the application server integrated security (with roles) to protect the web resources.
    The main objective is to protect the web resources using Declarative J2EE authentication and authorization using the Data Base users (and roles). I have implemented the solution for the first part (authentication) using DBLoginModule (DBSystemLoginModule) from Frank Nimphius and Duncan Mills, it’s working OK, but I need the second part; how to use the user that is logged in as the PROXY user of the BC connection.
    Using the DBLoginModule, and the “How To Support Dynamic JDBC Credentials” separates works fine, but I can’t make them work together.

    Frank, Thanks a lot for your quick answer.
    "Maybe you should look at using database proxy users with ADF BC so you can use the J2EE authenticated user principal as the database schema to connect through. I am working on documenting this approach, which however needs some more time of writing and testing."
    Yes, that's exactly what I need!!!
    Can you give me some tips about how to do that.. Do you have any idea of when you will finish that document?.
    By the way, I'm using FORM authentication, but I don't know how to modify what’s in the “How To Support Dynamic JDBC Credentials” document, to use the J2EE authenticated user principal as the database schema to connect through.
    One of the problems is that when using this approach, I cannot get the J2EE security to redirect to the login page...
    Any help would be really appreciated

  • Dynamic context attributes and ALV

    Hi all,
    I already posted my question in this [thread|WD4A Dynamic ALV Table with dynamic tables;,
    but in the ABAP UI programming forum, but I think it fits better in the WD4A forum.
    It's dazzling that there are two forums for WD4A.
    Maybe a moderator with the authorization can move my thread into this forum and delete this new thread.
    Best Regards,
    Marcel

    Hi
    I use the SALV_WD_TABLE component. I have bind my static MTX node to the INTERFACECONTROLLER_USAGE Data node in design time.
    At runtime, when I modify my demo table structure, for example the number of colums or rows, in the view can I see it. But the data no. I have found a tutorial, where I can made a dynamic node from DDIC, and in this case can I show the data in the ALV table.
    My big problem was, that my table is not in DDIC.
    If this road is not possible, can You show me an other solution?
    Thanks
    Krisztian

  • Firefox doesn't let me copy the web address from the address bar using the context menu with second button in mouse or trackpad

    Hello!
    I write to report a problem I have with the new update v35 and v35.0.1 Firefox on address bar
    With the new version 35 of Firefox on Mac OSX Yosemite, clicking directly with the right mouse button in the address bar to copy the web address, context menu NOT allowed to copy the link, it shaded in gray, inactive ... you have to click on another browser free zone before returning to click a second time and be able to copy the link from the context menu
    I mean, with the first right click in the address bar context menu that appears don't allow me to copy the link directly, you have to click on another area and then clicking again with the right mouse button in the address bar to copy the web address (happens to all pages)
    I tried to open Firefox with inactive complements and plugins, and reset Firefox to first time use (like the first install) and the problem is here again... With or without complements and plugins the problem is here
    This happens before and then when I format my computer
    Here I put a screenshot that explains the problem better than my words
    http://i.imgur.com/QxKd8P1.gif
    I hope you can help me

    ''guigs2 [[#answer-685712|said]]''
    <blockquote>
    The icons that show up when you right click in that image do not look like the default version of Firefox, even with the Spanish Dictionary/Language pack.</blockquote>
    Hello
    The icons in the screenshot is from Linux OS, because I don't know how to capture screen, and somebody in Linux OS made it to show the problem that I was talking about
    I don't have any icon addons only have 2 plugins, quicktime (integrated in OS) and adobe Flash, updated both
    Before I format my Mac, I upgraded Firefox to v35 and here came this error
    Then I format my Mac after days, by subjects of hard disk space, etc... when I install Firefox 35 (new install) the problem was here again
    I tried to Open Firefox with disabled Add-ons, and Reset Firefox to an install version, but the problem is here always

  • How to use dynamic internal table with FOR ALL ENTRIES

    Hello SDNers,
    I am having a dynamic internal table & want to use FOR ALL ENTRIES(FAE) using this dyn. table.
    This works fine for me:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE ztable
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE (lv_dynwhere). "lv_dynwhere -> dynamic where clause
          ENDIF.
    SAP documentation says:
    "The logical expression sql_cond of the WHERE condition can be comprised of several logical expressions using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one comparison with a column of the internal table itab that can be specified statically or dynamically. "
    How do we specify the column of the internal table dynamically ? Can we do something like this:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE key_field1 = (dynamic token for column1 of <lt_tmp>)
                           key_field2 = (dynamic token for column2 of <lt_tmp>)
          ENDIF.
          ENDIF.
    Let me know if i am not clear about my requirement.
    BR,
    Suhas

    Hello Thomas,
    What i meant was something like this:
    WHERE key_field1 = ('<LT_TMP-COL1>') AND
          key_field2 = ('<LT_TMP-COL2>')
    I am confused by what SAP means with "dynamic representation of internal table columns" in FAE ?
    @Rob: I was referring to SAPNW 7.0 documentation & the phrase (release 6.40 & higher) is missing. Anyways fyi i am on ECC5.0 ABAP release 6.40.
    @Subhankar: This is what Marcin had proposed in For all entries and dynamic table.
    Thanks,
    Suhas
    Edited by: Suhas Saha on Apr 6, 2010 11:53 AM

  • How to bind webdynpro abap context attributes with interactive form table

    hi,
    I was created table in interactive form and add the all context attributues to each column of the table.
    And add the table into the subform.
    i want to bind the table using bapi values form Webdynpro abap.
    please give the detailed explanation.
    by
    Parthasarathi

    Hey Lingam,
    Check out this link...
    [Inserting a Table or Loop|http://help.sap.com/erp2005_ehp_04/helpdata/EN/4c/9cc19e5c874091a99790e540b06f3a/frameset.htm]
    It's for EhP4, so I'm not sure if it would apply.
    Hope this helps...
    Cheers,
    Kevin

  • Use dynamic ORDER BY with DISTINCT in SQL SERVER

    DECLARE @OrderBy VARCHAR(100)
    SET @OrderBy='DealerCode ASC'
    SELECT DISTINCT TOP (10)    
        d.Id, d.DealerCode,d.AffiliationCode,d.LegalName,d.ShipperCode,d.PrimaryUserId,d.PrimaryContactId,d.Zip,              
        d.Address1,d.Address2,d.IsActive,u.IsActive,d.City,d.[State],c.Name,u.UserName,d.RegistrationIntiatedDate,
        d.RegistrationCompletedDate,              
        rs.[Description],u.EntityId,dbo.fnGetCheckHours(d.Id)               
        FROM Dealer d              
        LEFT JOIN [User] u ON d.PrimaryUserId=u.Id              
        LEFT JOIN RegistrationSource rs ON d.RegistrationSourceId=rs.Id              
        LEFT JOIN Country c ON d.CountryId=c.id              
        LEFT JOIN ShippingNote sn ON d.Id=sn.DestinationId              
        LEFT JOIN Yard y ON sn.YardID=y.Code              
        LEFT JOIN Terminal t ON y.TerminalId=t.Id                
        WHERE t.Id='9a77168f-e5b6-4dd0-b26e-f95249c8e189' AND sn.destinationtype='Dealer'
        ORDER BY +'d.'+@OrderBy
    But I am getting below error:
    Msg 145, Level 15, State 1, Line 4
    ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
    I am also using CASE but again I got above error
    Please suggest.
    I Waiting for your valuable response.
        

    Hey Naunihal Maurya,
    Appropriate forum for your question is called
    "Transact-SQL"
    link for this forrum:
    http://social.technet.microsoft.com/Forums/en-us/home?forum=transactsql&filter=alltypes&sort=lastpostdesc
    Please Mark This As Answer if it helps to solve the issue
    Tzuri Ben Ezra | My Certifications:
    CompTIA A+ ,Microsoft MCP, MCTS, MCSA, MCITP
    |
    FaceBook: Tzuri FaceBook | vCard:
    Tzuri vCard | 
    Microsoft ID:
    Microsoft Transcript 
     |

  • REDIRECT JDBC URL WHEN USING DYNAMIC JDBC CREDENTIALS SO NOT HARDCODED

    I have taken over an application that uses row-level security and ADF (using
    dynamic JDBC Credentials). I have been able to set the internal_connection to
    a JDBCDatasource, but cannot set the Connection Type in the Oracle Business
    Component Configuration to a JDBCDatasource. When I do, I receive errors that
    tables are not found. When I set the value back to a JDBC URL, everything
    works fine again.
    I am looking for a solution where the userid and password are not hardcoded in
    the BC4J.xcfg or a way to redirect this information, as we change our system
    passwords every nighty days. Otherwise, I will have to redeploy the
    application every nighty days.
    I did not create this application, but I am sure that you could simply follow
    the "How to Support Dynamic JDBC Credentials" article. From that point, you
    will probably be where I am, where I have the internal_connection set to a
    JDBCDataSource and working properly, but cannot set the Connection Type to
    anything where the userid and password will not be hardcoded or cause failure.
    I wanted to let you know that I have
    found the updated How to Support Dynamic JDBC Credentials
    (http://www.oracle.com/technology/products/jdev/howtos/bc4j/howto_dynamic_jdbc.h
    tml) and was going to run through the "Advanced: Supporting Dynamic JDBC URLs",
    but once I was done keying in
    env.remove(ConnectionStrategy.DB_CONNECT_STRING_PROPERTY); I received a
    depreciation message on the DB_CONNECT_STRING_PROPERTY. (Note: I am coding in
    JDeveloper 10.1.3, so this may be depreciated as of then, but the ADF Libraries
    for JDeveloper 10.1.3 are on our Oracle 10gAS 10.1.2 server.)
    I thought maybe this would resolve my issue, but I can't be sure as the
    deprecation message leads me to believe that this solution may not be viable in
    the future.
    UPDATE
    =======
    The article you are referencing is definitely an older version.
    There is a newer article for 10g at:
    http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
    Please see if that helps.
    I have already reviewed this article.
    In fact, I have reviewed many versions of this document. I have not seen one
    created yet for 10.1.3 though (especially without JSF as our 10.1.2 AS server
    will not support it). I need to find an example or documentation that shows
    how we can keep from having the JDBC URL stored in the BC4J.xcfg or a way to
    use dynamic JDBC credentials with a JDBCDataSource. We do not want to store
    the userid and password in the application, rather, we would like to setup
    something that can be configurable from the application server.
    I think we need to use the dynamic JDBC credentials because we are using the
    row-level security, where we setup a database context for the user and only
    allow certain records of a database table to be returned to the browser based
    on that context.
    Might there be a way to still use the JDBCDataSource?

    I understand that the user provides the userid and password and that these values are setup using the Configuration class.
    However, when I am to deploy the ADF Business Module with my application, I have to specify either a JDBC URL or a JDBC DataSource in the Oracle Business Component Configuration.
    When I use JDBC DataSource, the code does not work properly, almost like the user's credentials are not used for the connection (I get errors like table or view does not exist).
    When I use the JDBC URL, the bc4j.xcfg stores a reference in the JDBCName attribute to a ConnectionDefinition in the same file. It is in this tag of the bc4j.xcfg where the userid, sid, and password (encrypted) is stored and used when retrieving the initial context of the ADF business components.
    It is these values that I want to have stored else where so that the application does not have to be redeployed in order for the password (or sid, or other connection information) to be change.

  • Dynamic Context Dynamic and UI table Dynamic

    Hello,
    I created a dynamic context and a dynamic table that use this dynamic context.  I have the following error:*     *   The following error text was processed in the system XAP : Could not find attribute AMOUNT2009**
    The error occurred on the application server sat190_XAP_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
          Method: IF_WD_CONTEXT_NODE_INFO~GET_ATTRIBUTE of program CL_WDR_CONTEXT_NODE_INFO======CP
          Method: GET_ATTRIBUTE_INFO of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L3STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L8STANDARD==============CP
          Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/L7STANDARD==============CP
    AMOUNT2009 is a new attribute that add to my context, i made the next code, can you review and say me where i have the error?  I start with the second year is for this reason that i use a count.
    Reading FINCATYGROUP
      DATA lo_nd_fincatygroup TYPE REF TO if_wd_context_node.
      DATA lo_el_fincatygroup TYPE REF TO if_wd_context_element.
      DATA ls_fincatygroup TYPE wd_this->element_fincatygroup.
      DATA :  lv_year   type STRING,
              ls_attribute         type wdr_context_attribute_info, "To create dynamic node in the context
              lr_container         TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
              lr_table             TYPE REF TO CL_WD_TABLE,
              lr_input_field       TYPE REF TO CL_WD_INPUT_FIELD,
              lr_cell_editor       TYPE REF TO if_wd_table_cell_editor,
              lr_column            TYPE REF TO CL_WD_TABLE_COLUMN,
              lr_column_header     TYPE REF TO CL_WD_CAPTION,
              lv_headerColumn      TYPE STRING,
              lv_id_input_field    TYPE STRING,
              lv_name              TYPE STRING,
              lv_id_table_column   TYPE STRING.
      DATA: lr_node_info TYPE REF TO if_wd_context_node_info, "To get node info
      lr_table_type TYPE REF TO cl_abap_tabledescr, "To get table and stuct descriptor
      lr_line_type TYPE REF TO cl_abap_structdescr,
      lt_components TYPE cl_abap_structdescr=>component_table, "To get component table
      ls_components_line LIKE LINE OF lt_components, "One line of component table
      lr_elem_type TYPE REF TO cl_abap_elemdescr.
        LOOP AT lv_periods_tt INTO lv_periods_ts.
      get all declared attributes
          lv_periods_ts->get_static_attributes(
            IMPORTING
              static_attributes = ls_wa_period ).
      navigate from <CONTEXT> to <FINCATYGROUP> via lead selection
          lo_nd_fincatygroup = wd_context->get_child_node( name = wd_this->wdctx_fincatygroup ).
          IF lv_cont = 1 OR lv_cont = 2.
            lv_cont = lv_cont + 1.
          ELSE.
      Create dynamic context and dynamic view
      get node_info
            lr_rootnodeinfo = lo_nd_fincatygroup->get_node_info( ).
            lv_year = ls_wa_period-zyear.
            SHIFT lv_year BY 15 PLACES LEFT.
            CONCATENATE 'AMOUNT' lv_year INTO lv_name.
      put attributes of add_attrbute node
            CONCATENATE 'Y' lv_year INTO ls_attribute-name.
            ls_attribute-name = lv_name.
            ls_attribute-type_name = '\TYPE=/RPM/TV_CURR_AMOUNT'.
            lr_rootnodeinfo->add_attribute( "Add attribute for amount of year
              EXPORTING
                attribute_info = ls_attribute ).
    ********************* table *******************************************************
    Get ROOTUIELEMENTCONTAINER
            lr_container ?= view1->get_element( 'ROOTUIELEMENTCONTAINER ' ).
    Get TABLEFCG
            lr_table ?= view1->get_element( 'TABLEFCG' ).
    Create cell_editor
            CONCATENATE 'TABLEFCGIF_Y' lv_year '_EDITOR' INTO lv_id_input_field.
            lr_input_field = cl_wd_input_field=>new_input_field(
                                  id = lv_id_input_field bind_value = ls_attribute-name ).
            CONCATENATE 'TABLEFCG_Y' lv_year '_EDITOR' INTO lv_headerColumn.
            lr_column_header = cl_wd_caption=>new_caption( id = lv_headerColumn ).
            lr_column_header->set_text( ls_attribute-name ).
    Create table column
            CONCATENATE 'TABLEFCG_' lv_year 'COLUMN' INTO lv_id_table_column.
            lr_column = cl_wd_table_column=>new_table_column( id = lv_id_table_column ).
            lr_column->set_table_cell_editor( lr_input_field ).
            lr_column->set_header( lr_column_header ).
            lr_table->add_grouped_column( lr_column ).
    ********************* end table *******************************************************
          ENDIF.
        ENDLOOP.
    Thanx.

    1.
    Code if the Transparent container's layout is Matrix ( method WDDOMODIFYVIEW )
    data lr_container type ref to cl_wd_transparent_container.
    data lr_input        type ref to cl_wd_input_field.
    data lr_layout_data type ref to cl_wd_matrix_head_data.
       lr_container ?= view->get_element( '<Transparent container ID>' ).
       lr_input = cl_wd_input_field=>new_input_field( bind_value = '<node>.<attribute>'                                                                               
    view = view
                                                                                    ID = 'INP' ).
       lr_layout_data = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_input width = '100%' ).
    2.
    Dynamic Context Attribute in a node.
    data lr_node     type ref to if_wd_context_node.
    data lr_info       type ref to if_wd_context_node_info.
    data ls_attr       type WDR_CONTEXT_ATTRIBUTE_INFO.
    lr_node = wd_context->get_child_node( '<Node_name>' ).
    lr_info   = lr_node->get_node_info( ).
    ls_attr-name = '<attribute_name>'.
    ls_attr-type_name = 'STRING'.
    lr_info->add_attribute( ls_attr ).

  • Error creating dynamic context node in Webdynpro for ABAP. Plesae help!

    Hi
       I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
    Note
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    My code is like the following:
    TYPES: BEGIN OF t_type,
                CARRID TYPE sflight-carrid,
                CONNID TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
      dyn_node   type ref to if_wd_context_node,
      rootnode_info   type ref to if_wd_context_node_info,
      i_node_att type wdr_context_attr_info_map,
      wa_node_att type line of wdr_context_attr_info_map.
          wa_node_att-name = 'CARRID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
          insert wa_node_att into table i_node_att.
          wa_node_att-name = 'CONNID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
          insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
                                       attributes = i_node_att
                                       is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition

    Ok, I think I found a bug... It seems for adobe forms in WD4A, the root context node must be 1-1 and you must nest the 1-n node within that... Not sure why, but it worked. So in my case my context would look like this:
    FOO_NODE (1-1)
         Widget (1-N)
              -Widget_info (1-1)
                   *Name
                   *Sku
                   *Description
              -Widget_plant (1-M)
                   *Plant_Code
                   *Plant_State
                   *Plant_City
              -Widget_pic (1-1)
                   *Picture

  • Dynamic context binding in web dynpro alv

    I use dynamic context binding (see code below to show and edit the ALV table.
    'DB_TABLE' is a tranparent table. It works fine.
    But now this table should be expanded with additional fields which are only known at runtime and could be different from case to case.
    How can I get these fields in the context dynamically?
      DATA:
            rootnode_info TYPE REF TO if_wd_context_node_info,
            dyn_node      TYPE REF TO if_wd_context_node,
            tablename   TYPE string.
      rootnode_info = wd_context->get_node_info( ).
      tablename = 'DB_TABLE'.
      cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
        parent_info = rootnode_info
        node_name = tablename
        structure_name = tablename
        is_multiple = abap_true ).
      DATA:
            stru_tab TYPE REF TO data.
      FIELD-SYMBOLS: <tab> TYPE table.
      CREATE DATA stru_tab TYPE TABLE OF (tablename).
      ASSIGN stru_tab->* TO <tab>.
      SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.
      dyn_node = wd_context->get_child_node( name = tablename ).
      dyn_node->bind_table( <tab> ).

    You should create a structure dynamically and use this as the context structure. See the coding below, where a structure is created, which contains CARRID and CONNID.
    DATA: node_info type ref to if_wd_context_node_info,
          struct_type TYPE REF TO cl_abap_structdescr,
          table_type  type ref to cl_abap_tabledescr,
          comp_tab    TYPE cl_abap_structdescr=>component_table,
          comp        LIKE LINE OF comp_tab,
          my_table    type ref to data,
          my_row      type ref to data.
      field-symbols: <table> type table,
                     <row> type data,
                     <flight> type sflight.
    * build a structure description from the list of single fields
      comp-name = 'CARRID'.
      comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CARR_ID' ).
      APPEND comp TO comp_tab.
      comp-name = 'CONNID'.
      comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CONN_ID' ).
      APPEND comp TO comp_tab.
    * note this structure contains the fields "CONNID" and "CARRID"
      struct_type = cl_abap_structdescr=>create( comp_tab ).
    * now the nodeinfo is created
      node_info = wd_context->get_node_info( ).
      node_info = node_info->add_new_child_node(
        name                         = 'MY_NODE'
        IS_MANDATORY                 = ABAP_true
        IS_MULTIPLE                  = ABAP_true
        STATIC_ELEMENT_RTTI          = struct_type
        IS_STATIC                    = ABAP_false
    * fill new node;
      data: l_node type ref to if_wd_context_node,
            l_flight type STANDARD TABLE OF sflight.
      l_node = wd_context->get_child_node( 'MY_NODE' ).
      l_flight = wd_assist->get_flights( ).
    *  if you could create a local data type, would be fine, but if you have to do it dynamically ...
      struct_type = node_info->GET_STATIC_ATTRIBUTES_TYPE( ).
    * create tabledescriptor from structdescription (standard table, no keys)
      table_type = cl_abap_tabledescr=>create( p_line_type = struct_type ).
      create data my_table type handle table_type.
      assign my_table->* to <table>.
      loop at l_flight assigning <flight>.
        create data my_row type handle struct_type.
        assign my_row->* to <row>.
        move-corresponding <flight> to <row>.
        append <row> to <table>.
      endloop.
      l_node->bind_table( <table> ).

  • The use of id attribute in html tags

    Hi
    I use http://java.sun.com/jsf/html as follows:
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <h:form id="myid">
    <h:panelGrid id="mypanelgrid" columns="1">
    </h:panelGrid>
    </ht:form>When I don't use the id attribute with the UI components, the components are not displayed.
    I would like to confirm that id attribute is MUST in jsf.
    Your kind response is appreciated.
    Thanks
    Murthy

    Actually I see an exception thrown on Windows XP
    10:24:45,717 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
            at org.apache.catalina.session.StandardSession.setAttribute(StandardSess
    ion.java:1233)
            at org.apache.catalina.session.StandardSessionFacade.setAttribute(Standa
    rdSessionFacade.java:129)
            at com.sun.faces.context.SessionMap.put(ExternalContextImpl.java:556)
            at com.sun.faces.application.StateManagerImpl.saveSerializedView(StateMa
    nagerImpl.java:88)
            at net.sourceforge.myfaces.taglib.core.ViewTag.doEndTag(ViewTag.java:138
            at org.apache.jsp.pages.template.TemplateRightPane_jsp._jspx_meth_f
    _view_0(org.apache.jsp.pages.template.TemplateRightPane_jsp:246)
            at org.apache.jsp.pages.template.TemplateRightPane_jsp._jspService(
    org.apache.jsp.pages.template.TemplateRightPane_jsp:121)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
    .java:322)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    14)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
    atcher.java:672)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
    tionDispatcher.java:463)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
    ispatcher.java:398)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
    patcher.java:301)
            at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImp
    l.java:322)
            at net.sourceforge.myfaces.application.jsp.JspTilesViewHandlerImpl.rende
    rView(JspTilesViewHandlerImpl.java:178)
            at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePha
    se.java:87)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
            at com.xyz.framework.security.authorization.AuthorizationFilter.doFilter
    (Unknown Source)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
    lter.java:81)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:178)
            at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
    ipalValve.java:39)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
    yAssociationValve.java:153)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
    e.java:59)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :856)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:744)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
    int.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
    kerThread.java:112)
            at java.lang.Thread.run(Unknown Source)
    10:24:45,748 INFO  [STDOUT] org.apache.jasper.JasperException: setAttribute: Non
    -serializable attribute
    10:24:45,748 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServletWrapper.s
    ervice(JspServletWrapper.java:370)
    10:24:45,748 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServlet.serviceJ
    spFile(JspServlet.java:314)
    10:24:45,748 INFO  [STDOUT]     at org.apache.jasper.servlet.JspServlet.service(
    JspServlet.java:264)
    10:24:45,748 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(HttpSe
    rvlet.java:810)
    10:24:45,748 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:252)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:173)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationDispatche
    r.invoke(ApplicationDispatcher.java:672)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationDispatche
    r.processRequest(ApplicationDispatcher.java:463)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationDispatche
    r.doForward(ApplicationDispatcher.java:398)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationDispatche
    r.forward(ApplicationDispatcher.java:301)
    10:24:45,764 INFO  [STDOUT]     at com.sun.faces.context.ExternalContextImpl.dis
    patch(ExternalContextImpl.java:322)
    10:24:45,764 INFO  [STDOUT]     at net.sourceforge.myfaces.application.jsp.JspTi
    lesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:178)
    10:24:45,764 INFO  [STDOUT]     at com.sun.faces.lifecycle.RenderResponsePhase.e
    xecute(RenderResponsePhase.java:87)
    10:24:45,764 INFO  [STDOUT]     at com.sun.faces.lifecycle.LifecycleImpl.phase(L
    ifecycleImpl.java:200)
    10:24:45,764 INFO  [STDOUT]     at com.sun.faces.lifecycle.LifecycleImpl.render(
    LifecycleImpl.java:117)
    10:24:45,764 INFO  [STDOUT]     at javax.faces.webapp.FacesServlet.service(Faces
    Servlet.java:198)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:252)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:173)
    10:24:45,764 INFO  [STDOUT]     at com.xyz.framework.security.authorization.Auth
    orizationFilter.doFilter(Unknown Source)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:202)
    10:24:45,764 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:173)
    10:24:45,764 INFO  [STDOUT]     at org.jboss.web.tomcat.filters.ReplyHeaderFilte
    r.doFilter(ReplyHeaderFilter.java:81)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.internalDoFilter(ApplicationFilterChain.java:202)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterCha
    in.doFilter(ApplicationFilterChain.java:173)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapperValve
    .invoke(StandardWrapperValve.java:213)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.core.StandardContextValve
    .invoke(StandardContextValve.java:178)
    10:24:45,779 INFO  [STDOUT]     at org.jboss.web.tomcat.security.CustomPrincipal
    Valve.invoke(CustomPrincipalValve.java:39)
    10:24:45,779 INFO  [STDOUT]     at org.jboss.web.tomcat.security.SecurityAssocia
    tionValve.invoke(SecurityAssociationValve.java:153)
    10:24:45,779 INFO  [STDOUT]     at org.jboss.web.tomcat.security.JaccContextValv
    e.invoke(JaccContextValve.java:59)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.core.StandardHostValve.in
    voke(StandardHostValve.java:126)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.valves.ErrorReportValve.i
    nvoke(ErrorReportValve.java:105)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.core.StandardEngineValve.
    invoke(StandardEngineValve.java:107)
    10:24:45,779 INFO  [STDOUT]     at org.apache.catalina.connector.CoyoteAdapter.s
    ervice(CoyoteAdapter.java:148)
    10:24:45,779 INFO  [STDOUT]     at org.apache.coyote.http11.Http11Processor.proc
    ess(Http11Processor.java:856)
    10:24:45,779 INFO  [STDOUT]     at org.apache.coyote.http11.Http11Protocol$Http1
    1ConnectionHandler.processConnection(Http11Protocol.java:744)
    10:24:45,779 INFO  [STDOUT]     at org.apache.tomcat.util.net.PoolTcpEndpoint.pr
    ocessSocket(PoolTcpEndpoint.java:527)
    10:24:45,779 INFO  [STDOUT]     at org.apache.tomcat.util.net.MasterSlaveWorkerT
    hread.run(MasterSlaveWorkerThread.java:112)
    10:24:45,779 INFO  [STDOUT]     at java.lang.Thread.run(Unknown Source)
    10:24:45,779 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet
    threw exception
    java.lang.IllegalStateException
            at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFac
    ade.java:423)
            at com.xyz.framework.security.authorization.AuthorizationFilter.doFilter
    (Unknown Source)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
    lter.java:81)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:178)
            at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
    ipalValve.java:39)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
    yAssociationValve.java:153)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
    e.java:59)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :856)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:744)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoI'd appreciate your kind help.
    Thanks
    Murthy

  • Performance of context index with sorting

    Dear All,
    I've got a problem and don't know how to solve this.
    there has a table which have a XMLTYPE field to store the unstructred xml, and created with context index.
    When I try to select a record from it by using contains (res, '[searchingfield]')>0, the response time is quick, but when I try to order by another field which in the same table, the response time is drop down slightly. (ex. select id, path, res, update_date from testingtbl where contains(res, 'shopper')>0 order by update_date desc.
    Actually there is a context index build for field 'res', any other index build for field 'update_date', when sql without 'order by update_date', the context index will use, but the update_date index will not be used even have ordering criteria.
    Is there any expect can tell how to solve this? how to keep the performance even doing the sorting process?
    Thanks and Regards
    Raymond

    Thanks for your quick reply.
    The mentions information provide after back to office, actually I just want to know if there is any method(s) which can use the context index (with contains keyword) and sorting without slow down the performance.
    Thanks and Regards
    Raymond

Maybe you are looking for

  • How to get my MacBook to open new space when plugged into tv via HDMI?

    Alright. All of my roommates & myself have MacBook Pros. When they plug them into the tv via HDMI, the computer opens a new separate empty space on the tv where you can drag windows from your laptop to the tv screen so you can still use the computer

  • I Just bought Final Cut Pro X and now I find out

    I just bought Final Cut Pro X, I have used Final cut Express 4 with no problem using a firewire supported camera, Now I find out there is no video camers I can buy for Final cut Pro X for under $500, all the video cameras are now USB and for PC Micro

  • New Mac Mini - Existing Wireless Network - Can't Connect

    I have an existing wireless network that works fine with an iBook G3. I just hooked up my Mac Mini and it can see the network, but it can't connect. The menu of available networks on the Mac Mini is also much more limited than that of the iBook. Is t

  • Can you filter emails so as to put them into appropriate folders?

    I have useful folders set up on iCloud. It would be convenient to be able to set up a filter to put emails directly into the relevant folder. Is there any way of doing this on my iPad 2?

  • No values found in sxmb_moni

    Hello together, We are communicating with different sap application system over ABAP proxies. But in the sxmb_moni on application system we can not choose any service in the selection in the xml monitor. The same result is for choosing the interface