X().Panel() Items issue

  1. #1

    X().Panel() Items issue

    Hi,

    I'm working with Ext.Net in Razor C#.Net and I don't know if what I trying to do is posible, I'm building an app that reproduces previews of some tests like "exams" from courses, to do this I manage a full entity for every test (every entity contains another one inside, something like: test > questions > answers).

    This is how my entity looks like
    public class Test
    {     
         public QuestionContaier questions { get; set; } //my container works an IList<T> class.
    }  
    
    public class Question
    {
        public AnswerContainer answers { get; set; } //same here
    }
    I'm need to do a preview of a test, inside I need a Radio Group (MAX 5) for each question and Radio or RadioFor (MAX 4) for each answer. I tried a lot of things to achieve this but nothing seems to works for me.

    I tried something like:
       @model BE.Test 
    @{
        var panel = Html.X().Panel()
            .ID("panel");
    
        foreach (BE.Question q in Model.questions.Items)
        {
            panel.Items(i =>
            {
                i.Add
                (
                   Html.X().Panel()
                   .Title(q.question)
                   .Items(item =>
                   {
                       item.Add
                       (
                           Html.X().RadioGroup()
                           .Items
                           (
                               from a in q.answers.Items
                               select new Radio
                               {
                                   ID = a.idAnswer.ToString(),
                                   FieldLabel = a.answer
                               }
                           )
                       );
                   })
                );
            });
        }
          
        var winTestPreview = Html.X().Window()
            .Title(Model.test)
            .Width(600)
            .Modal(true)
            .Height(450)
            .Layout(LayoutType.Fit)
            .Items
            (
                panel
            );
    }
    
    @(
        winTestPreview.Show()
    )
    But It throws and exception with a legend "ItemTag validation (_tkn_5): Reference token (13_ClientInit) was not found."
    Hope somebody can help me.

    EDIT:
    I achieved this, thank you. You can close this post.
    Last edited by alexiism; Apr 09, 2013 at 5:08 PM.

Similar Threads

  1. Replies: 0
    Last Post: Dec 06, 2012, 11:55 AM
  2. Replies: 3
    Last Post: Dec 05, 2012, 1:38 PM
  3. [CLOSED] HBoxLayout Issue w/Hidden items
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 18, 2010, 6:52 PM
  4. [CLOSED] [1.0] Add hidden panel to items of dynamic panel
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 30, 2010, 6:37 PM
  5. Replies: 1
    Last Post: Aug 06, 2009, 5:32 PM

Tags for this Thread

Posting Permissions