Views within forms

9 posts, 1 answers
  1. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 08 Jul 2014 Link to this post

    Hi
      Can you explain whats happening here please?

    http://trykendoui.telerik.com/eMUf/2

    In short I have a web page with a form which holds everything, I want something similar for mobile, a default view and then another one within a form.

    Here it just flashes, I assume it's crashing in the background?

    thanks
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 09 Jul 2014 Link to this post

    Hi Anthony,

    You can initialize the application on the whole form, however in this case you will need to set explicit height of the form container. Please check the following demo:

    http://jsbin.com/vumic/1/edit

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 09 Jul 2014 in reply to Kiril Nikolov Link to this post

    Thanks for that.

    That was a cut down example to show my problem, what I ultimately want to do is have 2 views, each in different forms, and have a mobile tabstrip to navigate between them. Can you do this?

    I had a go in the below but I don't know what you would put in as a link
    http://trykendoui.telerik.com/ugeQ

    thanks

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 09 Jul 2014 Link to this post

    Hi Anthony,

    You need to initialize the app on a single container and then the views inside cannot be nested inside forms. In general using the forms approach is not recommended, could you please elaborate a bit more why exactly do you need to wrap the views within forms?

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 09 Jul 2014 Link to this post

    I have come from an Asp.Net background, there you can only have 1 form. I am now working in Asp.Net Mvc where multiple forms are allowed, e.g.

    http://stackoverflow.com/a/13644710/220545

    It seems useful to have the page split into parts that need to postback (within a view within a form) and those that don't need to (a view not in a form).

    If the page was a Single Page Application you could then have multiple views within forms, each view within its own form for posting back just it's own relevant parts 

    I'm assuming from your response that Kendo UI mobile can't support multiple forms? So the way forward is to have a single form enclosing all of the views and ignore any extra data that is sent back



  7. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 10 Jul 2014 in reply to Anthony Link to this post

    Just to be clear I was asking a question. Is it true that Kendo UI mobile can't support multiple forms and that there are no plans to make it do so?
  8. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 10 Jul 2014 Link to this post

    Hi Anthony,

    Wrapping Kendo UI Mobile Views in separate form elements is not supported and it is not part of our short term plans. You can wrap the whole application within a form - as I already showed in the previous example.

    If you want to have forms within the views and you want to submit these forms to a controller, here is a code-library project that will show you how to do it:

    http://www.telerik.com/support/code-library/submitting-forms-with-jquery-ajax

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  9. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 10 Jul 2014 in reply to Kiril Nikolov Link to this post

    So you can't have views within forms -but- you can have forms within views. That's fine for my purposes :-)

      This is a misunderstanding on my part that I bet a number of former Asp.Net coders will have, I always thought that form was an element which had to be at the top level next to body and you could only have one of them. Its not something I've ever needed to change or worry about.

      In reality a bit of reading shows they can be nested in just about anything.

     Summary: I'm sorted now, thanks for your help

  10. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 10 Jul 2014 Link to this post

    Hi Anthony,

    I am glad I helped.

    In case you have any further questions, please do not hesitate to contact us.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready