medblocks / medblocks-ui

Web Components Library for Medblocks Ecosystem
https://www.npmjs.com/package/medblocks-ui
Apache License 2.0
54 stars 15 forks source link

mb-context not submitted from mb-form #45

Closed Mo-la-machette closed 1 year ago

Mo-la-machette commented 1 year ago

Hello,

I followed @sidharthramesh tutorial from youtube. I have a problem from setting an mb-context Here is my mb-form :

`

<mb-input path="name[0].given[0]" label="Name"></mb-input>
<mb-date path="birthDate" label="Date of Birth"></mb-date>
<mb-buttons type=code path="gender" label="Gender">
  <mb-option value="male" label="Male"/>
  <mb-option value="female" label="Female"/>
  <mb-option value="other" label="Other"/>
</mb-buttons>
<mb-submit>
  <sl-button {loading} type="info">Submit</sl-button>
</mb-submit>

`

The context is set when i look up on the mb-element list before submitting. But in the handleSubmit method, the context of the resourceType doesn't appeared Have you the same behaviour ?

Thanks for this tutorial, it's very great Have a nice day Thomas

sidharthramesh commented 1 year ago

Hey @Mo-la-machette , seems like you figured it out?

Mo-la-machette commented 1 year ago

Hello @sidharthramesh

Yes, since your video, the way to handle mb-context (use "bind" rather than "data" element) have changed and it's well documented on the main page of this repository.

My fault, sorry Have nice day Thomas