How to iterate Cascading Object List?

Hi All,
I faced an issue when iterate a List like below,
class Program
private List<Question> questionList = new List<Question>();
// Add serveral questions in questionList.
static void Main(string[] args)
// Currently, I got a Question instance. and I will loop in questionList. Since as you can see, the Question Object is a Cascading object.
// How to Loop the question the Question List.
public class Question
public List<Question> Questions { get; set; }
public string Title { get; set; }
public string Score { get; set; }
Thanks a lot.

Hi All,
Sorry for my bad English. I am not a native English Speaker. What I want to do is remove the item in the Question list.
List<Question> QuestionList = new List<Question>();
Question Q11 = new Question()
Title = "1.1",
Score = 5,
Question Q12 = new Question()
Title = "1.2",
Score = 5,
Question Q13 = new Question()
Title = "1.3",
Score = 5,
List<Question> Q13List = new List<Question>();
Question Q131 = new Question()
Title = "1.3.1",
Score = 5,
Question Q132 = new Question()
Title = "1.3.2",
Score = 5,
List<Question> Q132List = new List<Question>();
Question Q1321 = new Question()
Title = "1.3.2.1",
Score = 5,
Question Q1322 = new Question()
Title = "1.3.2.2",
Score = 5,
Question Q1323 = new Question()
Title = "1.3.2.3",
Score = 5,
Q132.Questions = Q132List;
Q13List.Add(Q131);
Q13List.Add(Q132);
Q13.Questions = Q13List;
List<Question> Q1List = new List<Question>();
Q1List.Add(Q11);
Q1List.Add(Q12);
Q1List.Add(Q13);
Question Q1 = new Question()
Title = "First One",
Score = 25,
Questions = Q1List,
Question Q2 = new Question()
Title = "Second",
Score = 25,
Question Q3 = new Question()
Title = "Third",
Score = 25,
QuestionList.Add(Q1);
QuestionList.Add(Q2);
QuestionList.Add(Q3);
// The question need delete in Question List. How should I found the Question in the QuestionList.
Question needDeleteQuestion = new Question()
Title = "1.3.2",
Score = 5,
Thank you very much guys for your help.

Similar Messages

  • JSF How to iterate over the list of a panelForm's child elements.

    Hi all
    My users have asked me to create a "clear all" button that initializes all input values of a search form's fields to null.
    To do this I created a managed bean and added the following code
    public String ClearFieldsBtn_action()
    String[] fieldIDs = {
    "Material",
    "Description",
    "Length",
    "Width",
    "Thickness",
    for (int i = 0; i < fieldIDs.length; i++ )
    try {       
    AttributeBinding attr = (AttributeBinding)getBindings().getControlBinding(fieldIDs);
    attr.setInputValue( null);
    } catch (Exception e) {
    System.out.println(e.toString());
    return null;
    I wonder if there any other more elegant way to iterate over the fields contained inside the JSF panelForm that contains all these "Material", "Description", etc fields and thus be able to easily transport the same functionality in more that one page?
    Thanks in advance
    Thanassis

    Thanassis,
    I use some code like this (where "target" is a variable in the managed bean representing the parent component - the panelForm in your case):
        List children;
        int  i, cnt;
        children = target.getChildren();
        cnt = target.getChildCount();
        for (i=0; i< cnt; i++)
          // do whatever you need here, such as clearing fields
        }This doesn't operate on the model, just on the UI components themselves. I do use something like this in a superclass backing bean for when I need to iterate over a bunch of UI components.
    John

  • How to do cascading select lists  in ADF table

    I have bulk update ADF table and two of the columns are select lists. For example, in a row of the table, if first select list is changed, then is it possbile to populate second list based on the value in first select list within that row?. any ideas are appreciated.
    Regards,
    Surya

    Cascading LOV's .. refer http://andrejusb.blogspot.com/2008/12/cascading-lovs-in-oracle-adf-11g-update.html
    In table just set the PRR on column 2 for the column 1 component. Also set the AutoSubmit/PartialSubmit to true for the column1 component.
    Amit

  • How we find object list  for SAP MM T codes.

    Dear Experts,
    How can i find object list  for SAP MM T codes.
    Actualy that is required for SAP User autorization review.
    Regards
    Kumar

    Get t.codes list from table TSTCT using SE16,Enter t.code as MM* or M*. Execute it.
    You will get a list of MM t.codes.
    Also you can refer SU22 for authorization objects from above t.codes list.

  • How do you turn a List into a String?

    Hi,
    Have a simple question for all of you out there, hope you can help:
    How do you turn a list of words into a string?
    For example:
    List matchList = new ArrayList();
    matchList.add(word 1);
    matchList.add(word 2);
    matchList.add(word 3);
    String s = matchList(all of the words)How is this possible?

    but how would i go about doing that? Thats what i am
    askingIf you don't know how to iterate over a list, see this tutorial: http://java.sun.com/docs/books/tutorial/collections/If you don't know how to use StringBuffer, it should be somewhere in one of the links under Resources for Beginners at http://www.thejword.com/3.html#beginner_resources

  • Crystal report - Object list binding

    Anyone can show me how to bind the object list into crystal report?
    I am using the Visual Studio 2010 with CR. I cannot create a temporary dataset in the project.
        public class Invoice
           public string Name { get; set; }
           public DateTime CreatedDate { get; set; }
           public List<LineItem> LineItems { get; set; }
           public Invoice() { ... }
        public class LineItem
           public string Name { get; set; }
           public decimal Amount { get; set; }

    Sorry, looking at this again I realize I made a mistake.
    I thought this was a Crystal Report as a  webservice as opposed to  a webservice using CR APIs.
    Try setting Table.Location in your code.
    Alternatively try DatasourceConnections off of the reportdocument object.
    Ludek

  • How to populate another page item based on cascading select lists?

    Oracle 10gXE
    APEX 3.2
    I've created cascading select lists based on the examples (using Javascript and AJAX) that i've seen on this forum. Thanks for help on that!
    Now that I have these LOV's being populated without needing to submit the page, how do I take the value that is presently in each LOV and concatenate them together to populate another page item? I'm trying to build the URL string that will execute an Oracle Report once the user clicks a button.
    Previously, when I had multiple Select Lists with a submit, the URL was being put together using an After Submit Computation that would set the value for an item (P26_REPORT_URL) on the page. Notice that a report parameter (i.e. parameter name and Select List value) is only included if the user has provided a value. The page item that holds these values is then referenced by a button for URL redirect. The URL Target for the button currently is: javascript:popupURL('&P26_REPORT_URL.'), but will not work at the moment because P26_REPORT_URL page item is not changing based on what is selected in the LOVs. Since I'm not submitting anything (do I need to?), how do I put together the values needed?
    Computation for P26_REPORT_URL:
    DECLARE
    l_param VARCHAR2(2000);
    BEGIN
    l_param := '&REPORTS_URL.&report=&P26_RPT_VIEW..rdf&desformat=&P26_DESFORMAT.&destype=cache';
    IF REPLACE(:P26_OLO_CODE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_olo_code=&P26_OLO_CODE.';
    END IF;
    IF REPLACE(:P26_BEG_DATE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_start_dt=&P26_BEG_DATE.';
    END IF;
    IF REPLACE(:P26_END_DATE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_end_dt=&P26_END_DATE.';
    END IF;
    IF REPLACE(:P26_ORG_CODE_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_org_code=&P26_ORG_CODE_2.';
    END IF;
    IF REPLACE(:P26_FLAIR_ORG_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_flair_org_code=&P26_FLAIR_ORG_2.';
    END IF;
    IF REPLACE(:P26_BUDGET_ENTITY_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_agy_code=&P26_BUDGET_ENTITY_2.';
    END IF;
    RETURN l_param;
    END;

    Andy,
    This is a great suggestion! After I posted, I started looking at a Javascript solution and figured it's probably what I had to do.
    However, now the cascading select list no longer working for some reason after I added the function to concatenate the item values. When I remove the showReport() function the select list works again.
    Here is what I have in the HTML Header portion of the page:
    <script language="JavaScript" type="text/javascript">
    function popupURL (url) {
      w = open(url,"winLov","resizable=1,width=800,height=600");
      if (w.opener == null)
      w.opener = self;
      w.focus();
    function showReport()
      var l_param = '&REPORTS_URL.&report=' + $v('P26_RPT_VIEW') + '.rdf&desformat=' + $v('P26_DESFORMAT') + '&destype=cache';
      if ($v('P26_OLO_CODE' != '')
       l_param += '&p_olo_code=' + $v('P26_OLO_CODE');
      if ($v('P26_ORG_CODE_3' != '')
       l_param += '&p_org_code=' + $v('P26_ORG_CODE_3');
      popupURL(l_param);
      function get_AJAX_SELECT_XML(pThis,pSelect){  
         var l_Return = null; 
         var l_Select = $x(pSelect); 
         var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ORG_SELECT_LIST',0); 
         get.add('TEMPORARY_ITEM',pThis.value); 
         gReturn = get.get('XML'); 
         if(gReturn && l_Select){ 
             var l_Count = gReturn.getElementsByTagName("option").length; 
             l_Select.length = 0;
             for(var i=0;i<l_Count;i++){ 
                 var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) { 
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{ 
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>

  • PM: how to track the operations in prev.maint order against object list

    Dear PM Guru's.
    i have one issue in my preventive maintenance scenario. i clubed the same type of machines in one maintenance order under object list tab. and i mention the list operations in maintenance order. suppose in one preventive maintenance order 10 operations are maintained and 5objects are mentioned in that order. Now i like to mention all these 10 operations activities against to 5 objects. how i can assign sequentially? i required like 10operations one by one row wise and 5objects side by side column wise. i would like to update the each operation activity against each machine column? how i have to do this one?
    Please suggest me and help me.
    regards
    Jalendhar Merugu

    Using Object functionality, we can maintain many equipments in the order.
    But the constraint is that one operation can be assigned to only one equipment. In your case, you have 5 objects. If all 10 operations will be performed on 5 objects, then you have to maintain 50 operations & you should assign the objects.
    In other words, if one operation will be performed on 5 objects, then you should define that one operation 5 times & you have to assign to technical objects. You can't share one operation to many equipments.

  • How to assign the cost to objects in object list in a PM order ?

    Hello,
    If there are many equipments in object list in one PM order, how can I assign the cost to every equipment in the order  ?  And how can I query the cost of every equipment in the order?
    I have tried to find the threads posted in the past, but I got no idear.
    Waiting for your reply. Thanks.

    Xifeng Xing
    As stated above, when EHP5 arrives it promises operation level costing functionality.
    At present this functionality is not available without designing your own reports
    PeteA

  • How to generate an SE63 object list in batch periodically ?

    Dear experts,
    we translate program and DDIC-texts of our add-ons continiously to english and
    french, in order to keep up translations with the ongoing development we create
    the necessary SE63-object list once a week. Since this process is creating
    several background-jobs dynamically it is not possible to mark this inital job as
    to be repeated periodically. I do understand that but I don't know why there
    seems to be absolutely no way to get this done automatically once a week.
    Here is what I have already tried in vain in order to achieve this:
    - a report performing a CALL TRANSACTION on transaction SE63/SLW3
    - an eCATT-script including a TCD-Script on transaction SLW3
      (the script works fine if it is started directly, but the only FM that I have found
       to start a script with in batch ( 'ECATT_EXECUTE' ) does not do it, but comes
       back with a returncode zero, as if it did.
    - and I even tried to start the above mentioned eCATT-script by a report doing
      a CALL TRANSACTION on transaction SECATT providing the necessary
      field settings for the initial and following popup start screen.
    Nothing seems to work. The SAP notes on this topic are as useful as the
    SAP documentation on the subject "object list" (forget about it).
    Who has some experience with this issue respectively ideas for my problem?
    How can I generate an object list for translation once a week automatically in
    background?
    Thanks in advance
    Andreas

    Hi Lorant,
    attached you'll find a download of the ABAP which is to be used as a job step
    and an XML-Download of the eCATT-testscript, that processes the generation of a new object list in SE63.
    As both developing objects were in our companys namespace ("/HOAG/") which you cannot use, I made a copy in the z-namespace first, from which I have removed a couple of specialties that are certainly of no value for you at all, before I downloaded them for you.
    You need to give the script a name in your namespace or in the Z-namespace and then you have to adapt the scripts name in the BDCDATA generation procedure in the ABAP program appropriately.
    It may be possible that the eCATT-script doesn't run properly on your system. This is due to the fact, that the sequences of dynpros and fields contained in the dynpros differ a little in all of our 4 SAP development systems that we decided to be translation relevant, This is also the reason why I recorded individual eCATT-scripts for each one of them. It may be possible that you need to record your "own" system compliant script.
    An example: the popup screen with the print parameters can be personalized and may therefore look differently for every user in every system.
    This is also a good reason why the background job should be scheduled and performed under the name of the same user who recorded the eCATT script before!
    And just one last remark: The returncode of the job only gives you an information about wether or not the eCATT script has been executed properly but you do not know if the chain of jobs usually created by the SE63 objectlist creation functionality have been executed completely. The "system" that we set up for the automated objectlist creation is completed by a third ABAP program which is also scheduled daily as a background job. It is started about an hour after the the object list creation should be through and it verifies if the standard SAP jobs (the names of which are beginning with something like "OBJL") ran completely that day and that they are in the status "finished". If this is not the case, our "objectlist verification ABAP" sends a couple of SAP express mails to a certain selection of key users who are supposed to take a look at the system). This all works pretty well in combination!
    If you (or the person that you are going to give this task to) know enough of the german language to read it, you won't have any problem with adapting this to your needs because you'll find everything neatly commented in the source code.
    regards
    Andreas

  • Any Pointers on how to get object list values and component values in iw32

    Hi,
    I have a requirement where whenever a user enters a creates(iw31) or changes(iw32) an order then we have to validate the materials entered by the user before saving the order.We have en interface structure for the transaction 'CAUFVD'.Which gives us the values of functional location and equipment entered under the Reference object.But we need to validate all the object list functional locations and also Order components enetered by the user.Can any one tell me how to get the values of all these fields entered by the user?
    And also I need to query Equipment Bill of Material.What does this equipment BOM refers to .Is it the equipments under Object list or something else.
    Please Help.
    Thanks

    Hi Anu
    There is a user exit that gets trigerred when you try to save a work order . The exit is 'EXIT_SAPLCOIH_009' . This exit has the structure CAUFVD_IMP which will give you all the order header values entered by the user.
    User exit 'EXIT_SAPLCOBT_001' will give all the values entered by the user including order components. Also check the package CO  amd see if there is any other function group suiting your requirement.
    hope this helps you.
    cheers
    shivika

  • How to filter Choose from list object rows?

    Hi everyone,
    I'd like to show Choose from list window using SBO 2005 PL07, Actually I want to show the Active Account of G/L Account, I set the CFL object to one column as following:
    oCFLCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_GLAccounts
    oCFLCreationParams.UniqueID = "CFL"
    oCFL = oCFLs.Add(oCFLCreationParams)
    Who knows how to set Choose From list object only show Active Account and do not show Title Account.
    Thanks for your help!
    Kathy

    Hi kathy
    I have not tried it on the gl accounts. But basicaly you need to add conditions to filter it. The following is an example that you would of used for business partners but only customers.
      Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "2"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
                ' Adding Conditions to CFL1
                oCons = oCFL.GetConditions()
                oCon = oCons.Add()
                oCon.Alias = "CardType"
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "C"
                oCFL.SetConditions(oCons)
                oCFLCreationParams.UniqueID = "CFL2"
                oCFL = oCFLs.Add(oCFLCreationParams)
    The above also compensates for the tab.
    Hope it helps

  • How to find the WhereUsed List for a Business Object Event?

    How to find the WhereUsed List for a Business Object Event?

    Can anybody let me know how to get which
    Whereused  function will get the data from
    different Werks in multi-level?
    Any sample program please!!!

  • How can I delete objects in my list of purchased objects?

    How can I delete objects like books or music from my list of bought items?

    You can't.
    Being able to do so would NEGATIVELY affect Apples iCloud system of memorizing all consumer purchases as a means of storing such info in the Cloud.

  • How to find object list for each OSS Note

    Dear all,
    I would like to know whether there is any ways to search for affected objects in each OSS Notes without manually open each note and see in correction instructions.
    Thank you in advance

    Maybe you can use SE03 function "merge object lists" for this purpose. You can enter the 300 numbers and merge all objects e.g. into a transport of copies, that you can delete again after your exercise. Don't lock the objects inside this temporary request.
    The benefit is that each object will only appear once (if not, choose "object list -> aggregate" in the request details), and you can navigate to the underlying objects, something which a simple SE16 for E071 does not offer.
    Thomas

Maybe you are looking for