It's currently not possible to augment the user-agent shadowRoot so what you can do by extending an element like <input> that already has a shadowRoot is limited. (e.g. http://jsbin.com/wixaj/1/edit)
On Fri, Aug 8, 2014 at 11:06 AM, 'Rob Dodson' via Polymer < [email protected]> wrote: > oh sorry, I was referring to the jsbin linked at the bottom which looks at > all the children of the form, and grabs their values: > http://jsbin.com/kurelaji/2/edit > > extending an element is a valid option as well. I'm not entirely sure why > the team chose to compose input elements instead of extend them. Yvonne, do > you know? > > > On Fri, Aug 8, 2014 at 11:01 AM, <[email protected]> wrote: > >> Thanks for the quick reply Rob! >> >> There are a few potential answers in that SO. Are you suggesting to have >> the custom Polymer element extend a native form element and expose the >> value attribute so FormData will pick that up? I'm building a star rating >> Polymer element and trying to decide if the best approach is to have that >> extend a native form element or if another approach is more preferred. I >> noticed that neither core-input nor paper-input extend the native input >> element and curious why that choice was made. >> >> >> On Friday, August 8, 2014 10:46:08 AM UTC-7, Rob Dodson wrote: >> >>> If the elements expose a value property then you can follow the example >>> from this SO answer: http://stackoverflow.com/questions/24461460/ >>> polymer-form-post-data >>> >>> >>> On Fri, Aug 8, 2014 at 10:22 AM, <[email protected]> wrote: >>> >>>> Are there any samples showing how to properly use custom elements >>>> within forms for submission like Addy proposed? >>>> >>>> >>>> >>>> On Monday, June 9, 2014 2:07:12 AM UTC-7, Daniel Chin wrote: >>>> >>>>> Hi Scott >>>>> >>>>> Thanks for your response >>>>> >>>>> I have tried coding a few scenario's to see which would work best but >>>>> with not much success each method felt like I was going down a rabbit >>>>> hole. >>>>> What I really would like to do is have a custom form element which exposes >>>>> a content tag which allows me to project custom components which are >>>>> really >>>>> wrapped form elements. >>>>> >>>>> <custom-form> >>>>> <custom-ui-input></custom-ui-input> >>>>> <custom-ui-button></custom-ui-button> >>>>> </custom-form> >>>>> >>>>> I would like these to also participate in form validation using html5 >>>>> form validation If possible, With response to using ajax I really don't >>>>> mind. I am just trying to determine the best approach to achieve this. >>>>> >>>>> On Wednesday, 4 June 2014 18:03:43 UTC+1, Scott Miles wrote: >>>>> >>>>>> It's possible to recreate `form submission` (how it looks from the >>>>>> server's perspective) using AJAX. If one is willing to work this way, >>>>>> then >>>>>> there is an extreme amount of freedom. >>>>>> >>>>>> However, some users insist on using vanilla `<form>` element and >>>>>> requiring native input support. >>>>>> >>>>>> These use cases have different answers as to what is possible and how >>>>>> to make them go. If you can identify your needs along these lines, we can >>>>>> provide a better answer. >>>>>> >>>>>> >>>>>> On Wed, Jun 4, 2014 at 7:46 AM, Daniel Chin <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> HI Guys >>>>>>> >>>>>>> I am trying to achieve the same thing >>>>>>> >>>>>>> I want to be able to create a custom form then embed my custom >>>>>>> elements inside and they participate in submission and validation. So >>>>>>> for >>>>>>> example >>>>>>> >>>>>>> <custom-form> >>>>>>> <custom-input></custom-input> >>>>>>> </custom-form> >>>>>>> >>>>>>> I know you can achieve similar extending elements (inputs etc) >>>>>>> >>>>>>> From what I can work out this sounds similar to what Gunter was >>>>>>> referring too, Is there a way or would this require a lot of ground work >>>>>>> what do you guys think >>>>>>> >>>>>>> Regards >>>>>>> >>>>>>> Dan >>>>>>> >>>>>>> >>>>>>> On Thursday, 10 April 2014 09:37:22 UTC+1, Addy Osmani wrote: >>>>>>> >>>>>>>> >>>>>>>> On Wednesday, April 9, 2014, Günter Zöchbauer wrote: >>>>>>>> >>>>>>>> I guess the most elegant way would be than to create a custom form >>>>>>>>> element <my-form> and provide it with the capabilities the DOM form >>>>>>>>> element >>>>>>>>> has and in addition with support for custom input elements like >>>>>>>>> core-input. >>>>>>>>> Custom input elements would just need to implement a specific >>>>>>>>> interface. >>>>>>>>> >>>>>>>> >>>>>>>> I've been using custom interfaces for handling forms in this manner >>>>>>>> in my own custom elements and it works. It's not the most elegant of >>>>>>>> patterns :) >>>>>>>> >>>>>>>> I think Dominic's suggestion of inserting <input> fields into yet >>>>>>>> another Shadow DOM layer should work, but you'd need to craft some >>>>>>>> additional plumbing in order to hook the values up correctly. >>>>>>>> >>>>>>>> Scott, I wonder if there's any value in us putting together some >>>>>>>> samples of how to handle forms in custom elements just for reference. >>>>>>>> There >>>>>>>> may already be good core-* elements that demonstrate this. >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wednesday, April 9, 2014 8:40:20 PM UTC+2, Scott Miles wrote: >>>>>>>>>> >>>>>>>>>> `core-input` was just born yesterday, and this was a tricky >>>>>>>>>> decision. It's not set in stone. >>>>>>>>>> >>>>>>>>>> Follow Polymer on Google+: plus.google.com/10718784980935 >>>>>>> 4688692 >>>>>>> --- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Polymer" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/polymer-dev/dc842770-52b7- >>>>>>> 4440-9964-6d594f96dc03%40googlegroups.com >>>>>>> <https://groups.google.com/d/msgid/polymer-dev/dc842770-52b7-4440-9964-6d594f96dc03%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>> . >>>>>>> >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>> >>>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692 >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Polymer" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit https://groups.google.com/d/ >>>> msgid/polymer-dev/b4fe61a1-34ea-4ad5-9d18-66eb2b54334b% >>>> 40googlegroups.com >>>> <https://groups.google.com/d/msgid/polymer-dev/b4fe61a1-34ea-4ad5-9d18-66eb2b54334b%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> Follow Polymer on Google+: plus.google.com/107187849809354688692 >> --- >> You received this message because you are subscribed to the Google Groups >> "Polymer" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/polymer-dev/5864603d-de5d-4dce-ac60-9cf8a9289cf3%40googlegroups.com >> <https://groups.google.com/d/msgid/polymer-dev/5864603d-de5d-4dce-ac60-9cf8a9289cf3%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/CAJj5OwCKQYqjkUyXdMy2CfdmDPTkTMzdtbmyDKiG5pewDh63WQ%40mail.gmail.com > <https://groups.google.com/d/msgid/polymer-dev/CAJj5OwCKQYqjkUyXdMy2CfdmDPTkTMzdtbmyDKiG5pewDh63WQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZiz_N20Cs3aHxJDArUvxCYXsCgCQETPdj-BK4Fddb7g6w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
