ADF triggering dynamic number of components

I have a three-level View object dependency Category -> Class -> Subclass and want to create a dynamic form with the following logic:
When user chooses a Category from drop down, page is updated with a number of Class drop-down lists presenting all the Subclasses - i.e. I have a dynamic number of selectOneChoice components depending on Category selection. Category to Class dependency is implemented with Category valueChangeListener querying Classes with category Id, Class to Subclass is simple View Link / tree value binding. Subclass value binding to backing bean is done with a HashMap.
Does ADF faces framework let me re-create actual page components with partial page rendering (or some other mechanism)?
I should fully re-generate all selectOneChoice components inside forEach every time user changes Category.
My page components:
<af:selectOneChoice value="#{bbean.category}"
label="Category"
autoSubmit="true" immediate="true"
id="category" valuePassThru="true"
valueChangeListener="#{bbean.categoryChanged}">
<f:selectItems value="#{bindings.Categories.items}"/>
</af:selectOneChoice>
<af:forEach var="class" items="#{bindings.Classes.children}">
<af:selectOneChoice value="#{bbean.subclass[class.id]}"
label="#{class.name}"
partialTriggers="category"
id="class" valuePassThru="true">
<af:forEach var="subclass" items="#{class.children}">
<af:selectItem label="#{subclass.name}" value="#{subclass.id}"/>
</af:forEach>
</af:selectOneChoice>
</af:forEach>
The above code is a development from earlier less-complex UI. For all I've tried I cannot come up with the desired effect. When I change Category it doesn't affect sub- drop downs in any way. If I activate the Category valueChangeListener, Category change will cause validation phase null property exceptions:
2.9.2008 14:05:40 com.sun.faces.lifecycle.ProcessValidationsPhase execute
SEVERE: Error testing property 'null' in bean of type my.project.view.managed.Search$1
javax.faces.el.PropertyNotFoundException: Error testing property 'null' in bean of type my.project.view.managed.Search$1
...

John & Frank,
Unfortunately enclosing layout component with partialTriggers="category" doesn't help - I've tried that already (panelgroup & panelpage, that is). Thanks for impressive response time though ;)
Edit: Sorry, yes it helps! Thanks. The problem happens to be the HashMap value binding, it breaks up things after valueChangeListener refreshes the Class VO. After removing that the surrounding panelGroup does component refresh correctly. Back to drawing board..
Erik
Edited by: Erik Westerinen on Sep 2, 2008 5:26 AM

Similar Messages

  • Number of components in a field symbol

    I have a field symbol but i don't know the number of components. How i can know it?
    I need copy the data from field symbol to another field symbol with same struct and another more fields.
    Ex:
    <f1> is filled
    <f2> some components are filled (x,y,z) And we need to fill the others components (we don't know how many) with the f1 components (same number but we don't know either)
    In other words:
    <f1> (a,b,c)
    <f2> (x,y,z,a,b,c) We don't know if we have a,b,c or a,b or a,b,c,d,e.....
    Thx in advance

    Hi
    see the doc
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols
    Reward points for useful Answers
    Regards
    Anji

  • Can I create a dynamic number of inputs during runtime?

    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID               NUMBER                (This will be the primary key)
    TBL_FILE_NAME          VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID               NUMBER               (This will be the primary key)
    TBL_FILE_ID               NUMBER                (This will be the forign key to the file table)
    TBL_META_COLUMN     VARCHAR2(30)     (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE          VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    Other things to note is that we would like this to be on a single page.
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.

    Welcome to the Oracle Forums !
    >
    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID NUMBER (This will be the primary key)
    TBL_FILE_NAME VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID NUMBER (This will be the primary key)
    TBL_FILE_ID NUMBER (This will be the forign key to the file table)
    TBL_META_COLUMN VARCHAR2(30) (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    >
    Creating Page Items dynamically is not available. You will have to create excess items and hide/show , etc. But you cannot change the Item Type. All in all, too many limitations in this approach.
    >
    Other things to note is that we would like this to be on a single page.
    >
    The 100 item limit will hit you if you go with extra item on page. With Tabular Form that should not be a limitation, unless you are exceeding the 50 item limit of APEX_APPLICATION.G_Fnn items, and the 60 column limitation of Report region with "Use Generic Column Names (parse query at runtime only)" of Dynamic region.
    >
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    >
    If the type if item is variable it only means you need a way to store the item type. Meta Data of the Meta Data.
    >
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    >
    Yes, you can do it. Updatable report/ Tabular Form query can be constructed from the Meta Data using PL/SQL Function Returning SQL Query . It will be a bit of coding in PL/SQL where you use the Meta Data and the Meta Data of the Meta Data to piece together your SELECT with the right APEX_ITEMs. It might have a performance penalty associated with it, but will not be a serious degradation.
    >
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.
    >
    I guess that is just a good TNF. It is the Master-Detail Design Pattern, that sound more modern ? ;)
    Regards,

  • Xy graph with dynamic number of plots

    I've got an XY Graph with some dynamic number of plots to graph. Once I know this number, I change the LegPlots property and plot the data from an array containing all the plots. The data is displayed correctly, but I get overlapping colors. Say I'm only trying to graph 3 plots. I get three lines (good) but then the three lines have 29 colors (bad), as if it's plotting all possible plots at the data points of the three. The legend updates to only show three (good), but am I missing something else? Does the LegPlot property not govern that, but only governs the legend itself?

    If the problem is the code then I'll take a look at my mess of wire, I just wanted to see if it was the LegPlots property first.
    Here's what it looks like, just in case
    Attachments:
    toomanycolors1.JPG ‏25 KB

  • How to create Dynamic number of attachments in BPM Process ?

    Hi All,
    I have a requirement to create a dynamic number of attachments, as per need. I am aware of attachment.create() but i believe with this i can only create only the fixed number of attachments. Is there any way by which i can play around with create() api or is there any other API to fullfill the requirement??
    Any response is well appreciated.
    Regards,

    Hi,
    You can create the n-items in the region by creating items in the controller. i mena to see say by looping..
    Thanks,
    Kumar

  • Dynamic Number of Column in a table

    Hi guys,
    I have a requirement that needs dynamic number of column in a tale.
    It is possible to do this in Adobe forms.
    Thanks,
    Chirantan

    Hello. It of course is possible in Adobe.
    You need to write a simple script using JavaScript or FormCalc to hide or show columns according to some special value. You will work with the presence attribute of the object. E.g. MYFIELD.presence = "visible" or "hidden" or "invisible". You will need to change your subforms content to flowed.
    Use these guides:
    http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf
    help.adobe.com/en_US/livecycle/es/FormCalc.pdf
    Hope this helps, good luck, Otto

  • Dynamic Number Of Data Columns

    Greetings - I'm attempting to create a report that has a dynamic number of columns.  The type of data in the columns varies (number, string), and I need the details to display, not a summary.
    If I knew the max number of columns I'm sure I could figure out some logic to make it work, but that is not the case.
    Data example:
    Row 1: Name Timestamp Country Height ...
    Row 2: Name Timestamp Country Weight ....
    Desired report:
    Hdr1-Hdr2Hdr 3-Height---Weight
    Name Timestamp Country Height   <blank>
    Name Timestamp Country <blank>  Weight
    There may be a solution in a cross-tab but I will need the Name, Timestamp, Country in separate columns as this may be output as CSV.
    Any assistance will be appreciated.

    Generally, when you don't know the number of columns, a cross-tab is the way to go.
    You can get the first three column that you stated by putting all three fields in the Rows section of the Crosstab Expert. 
    As for the data returned from the database, you'll want the three row fields, a "value name" field (containing value such as "Weight" and "Height"), and then a Value column with the value of the "value name" field.
    HTH,
    Carl

  • BI  Layout/Template | Table with dynamic number of columns

    hi!
    i have a problem concerning the creation of a dynamic report with the BI publisher.
    in my BI template i need a table with a dynamic number of columns. i have searched the
    forums but havent really found a solution for this type of problem.
    first of all this is A dummy-structure of my dataset:
    <ROWSET>
         <ROW>
              <FIELD1>1</FIELD2>
              <FIELD2>2</FIELD2>
              <FIELD3>3</FIELD3>
              <FIELD4>4</FIELD4>
         </ROW>
         <ROW>
              <FIELD1>a</FIELD2>
              <FIELD2>b</FIELD2>
              <FIELD3>c</FIELD3>
              <FIELD4>d</FIELD4>
         </ROW>
    </ROWSET>
    in the report the fields represent the columns i need in the table.
    the problem is, that the number of the fields vary. in this example i have 4 fields/columns
    but another time i may have 6 or 10 etc..
    my dataset is always different because i am loading my dataset via a http request which is
    returning the needed data in XML.
    is there a nativ possibility within the publisher to generate the columns dynamically?
    i read about <?split-column-header:group element name?> etc. but this is only for cross-tables.
    can anybody give me a hint how to approach this problem?
    would be very glad for some advice.
    thanks a lot in advance!

    Specific answer is here
    http://winrichman.blogspot.com/2008/09/dynamic-column.html
    but these link let you know, how to do
    http://winrichman.blogspot.com/search/label/Dynamic%20column
    http://winrichman.blogspot.com/search/label/Cross-tab
    http://winrichman.blogspot.com/search/label/cross%20tab

  • Panel - Maximum number of components

    Taking a Panel or any Layout (eg.GridLayout), how can I calculate the maximum number of components a panel or layout can hold?

    int counter = 0
    while(true){
      myComponent.add(new JPanel());
      System.out.println(counter++);
    }each layout has a set number of components it can hold. If you cant find documentation on it, run this and look at the last output before it crashes.
    fyi, boxLayout = 512 iirc... a problem I had about a week ago.

  • Maximum Number of Components per BOM(Per procurement type,if possible)

    Dear Colleagues,
    I have been told that certain materials belonging to a  specific procurement type,have their BOM set that it allows only up to 100 components to be built within it.I had a god look on IMG under most relevant categories and can't find where this is defined in...so I'm wondering if you have ever had the request to look at the maximum number of components that could be built under a specific procurement type of material? Generally speaking,where you could define maximum no of components per BOM.At what level this is usualy set up?
    All help,greatly appreciated,
    PAPJ1.

    Thanks Dario.
    Allegedly,I have been told that this is set to 100 components per BOm of that particular procurement type,so I need to change it 200 (if that's true and it is allowing me to do so)
    PAPJ1.
    Edited by: PAPJ1 on Jun 13, 2011 2:03 PM

  • Creating a dynamic number of objects

    Hi,
    I write a program that has to use a dynamic number of object let say Strings (st1, st2, st3.....)
    for (i=1;i<4;i++){
    String "str"+i = new String (" ");
    How do I do that?
    Eli

    use collections. list. hashtable or something like that. even an array would be ok and keep adding data to it

  • Dynamic number of Combo boxes in an applet

    Hi,
    I'm quite new to Java & rite now, i've an reqt to build an applet. The problem is my applet will be having a dynamic number of combo boxes in it. This number is based on the parameter passed to the applet..
    any eg or references to a similar reqt would be very helpful.
    Regards
    -Sree Ram

    Define your combo boxes dynamically and put them in a vector:
    int numberOfComboBoxes = 7;
    Vector comboBoxes = new Vector( numberOfComboBoxes );
    for ( int i = 1; i <= numberOfComboBoxes; i++ ) {
    comboBoxes.add( i - 1, new Choice() );
    Now you can reference the combo boxes any time you like, no matter how many of them there are:
    for ( int j = 1; i < numberOfComboBoxes; i++ ) {
    System.out.println( ((Choice)comboBoxes.get( j - 1 )).getSelectedItem() );
    }

  • Dynamic number assignment for crm orders

    Hello all,
    i am looking for a userexit/badi in TX: CRMD_ORDER to implement a sales organization-dependent (dynamic) number assignment for transactions to meet R/3 requests.
    Thanks in advance for your help.
    Kind regards
    Mark

    Hi Kaushal,
    thanks. I have already checked this badi. Unfortunately fm "CRM_ORDERADM_H_OBJECTID_DET_OW", where number assignment takes place, is called after this badi. According to SAP OSS there is no user exit avaiable.
    Regards Mark

  • Android - dynamic number of checkboxes & items

    i wanna make the Activity show a dynamic number of CheckBoxes/ListItems (not sure what it's called) depending on the number of records i have (something like the "show all SMS threads" and "delete SMS threads" screen).
    how do i do that?

    If you have a question about the java LANGUAGE, feel free to ask it.
    But that is not what you have. You can make snippy remarks all you want, you fail at thinking about what the right place is to ask your questions and thus you get an unhelpful response. That's your own failure.

  • ADF: Generate dynamic adf components. Jdev 11.1.2.3

    Hi Experts,
    I am trying to build a page where the user selects a table from a list of table values eg(Department table, Employee table). Once he selects this table, it displays a list of values of all the columns for that table Department (eg: Department Id, Department Name, Employee Id, Location etc..). The user can now select the column he wants and enters a value. My requirement is that When the user selects for example Department Name, adf should automatically display a Text Box or if a user selects Employee id it should automatically display an LOV which shows all the employee ids under that department.
    Please note that this is just an example that I have provided. In my scenario, I may have 20 different tables and each of these can have 10-20 different columns and depending on the column the user selects that particular adf component should be displayed (text box, list of values, input list of values, checkbox).
    It would be great if you could let us know how we can go about doing this.
    Thanks

    Hi,
    I followed the steps mentioned in the video and was able to dynamically display the output text but I was not able to dynamically display the List Of values. Any suggestion will be really helpful.
    Thanks

Maybe you are looking for