- Home
- Forum
- ASP.NET Core - EJ 2
- I want my Combobox return text
I want my Combobox return text
Hi,
I have a problem with combobox :
<ej-combo-box id="strECH_Site" datasource="ViewBag.Sitedatasource"></ej-combo-box>
The Sitedatasource is just a list of string : List<string>
In my model, "strECH_Site" is defined like this : public string strECH_Site { get; set; }
When i populate my combobox, it's ok, but when i select an item which contains several words, when i return to the controler, i get only the first word.
Exemple : The combobox contains "My value 1", "My Value 2", ... I select one of these.
And when i submit the form, i get only "My".
It seems that it stops at the first space character encountered.
Maybe there is a problem with "text" and "value" but i don't understand.
Can you help me please ?
Thx.
Fred.
SIGN IN To post a reply.
8 Replies
KR
Keerthana Rajendran
Syncfusion Team
March 21, 2018 09:51 AM UTC
Hi Frederic,
Sorry for the inconvenience .
We have validated your scenario and confirmed “Value is not set correctly to select element when space is added between value” as a defect. We will fix this issue and include in our upcoming Volume 1 SP1 ,2018 release which will be rolled out by the end of this month.
Regards,
Keerthana.
FP
Frédéric Peyronnin
March 30, 2018 01:34 PM UTC
Hi,
I just download your last version (16.1.0.32), and the problem with the space character is fixed. Thank's a lot.
But i have a new problem that i did not have with previous version. I didn't touch anything in my code and now, the value i select (or i type) in my combobox is no longer send to the controller.
In my form, i have just this : <ej-combo-box id="strECH_Site" datasource="ViewBag.Sitedatasource"></ej-combo-box>
Before submitting the form, alert(document.getElementById("strECH_Site").value) display the good value, but when i arrive in the controller, all my form fields are correctly filled, but all my combobox fields are "null" !
Am i forgetting Something ?
KR
Keerthana Rajendran
Syncfusion Team
April 2, 2018 09:12 AM UTC
Hi Frederic,
We regret for the inconvenience.
We have checked the reported issue and confirmed this as a defect. This fix will be included in our upcoming Volume 1, SP2 release which will be rolled out by the end of April.
Regards,
Keerthana.
KR
Keerthana Rajendran
Syncfusion Team
April 13, 2018 06:36 AM UTC
Hi Frederic,
Sorry for the inconvenience.
We suspect that you have modified the name attribute of ComboBox through htmlAttributes property. From the previous release Volume 1 SP1(16.1.0.32), the htmlAttributes will be added to the select element instead of input element so this replaces the default name of select element.
Please refer to the below given release notes.
If html-attributes is removed then value can be retrieved in the controller as shown below.
Please refer to the below given sample.
Regards,
Keerthana.
FP
Frédéric Peyronnin
April 13, 2018 09:37 AM UTC
Thx for your answer, but i don't use HtmlAttribute.
It is just declared like this : <ej-combo-box id="strECH_Site" ht datasource="ViewBag.Sitedatasource"></ej-combo-box>
And the problem is Inside the model class. As you can see, : strECH_Site is null :
KR
Keerthana Rajendran
Syncfusion Team
April 16, 2018 06:47 AM UTC
Hi Frederic,
We have checked the issue with the given sample. We can get the selected value in model class; For your reference, we have attached a video of our working sample. Please refer to the below given link.
Also, your code snippet doesn’t contain any field mapped to text or value field of ComboBox. Please ensure this at your end and map the required fields as shown below.
|
<ej-combo-box id="strECH_Site" datasource="(IEnumerable<Countries>)ViewBag.Sitedatasource" select="select">
<e-combo-box-fields text="text" />
</ej-combo-box> |
We suggest you to check this at your end and if issue persists, please share us a video or code snippet of View and Controller page so that we can proceed further.
Regards,
Keerthana.
FP
Frédéric Peyronnin
April 16, 2018 07:29 AM UTC
Thx for your answer !
I think i found the problem :
Your sample works well with chrome Navigator, but not with Edge !
Just look :
Whith Edge the value is null :
With Chrome, the value is good :
.
It works also with Firefox and Opera, but it does not works with safari.
Can you try with Microsoft Edge and safari please ?
Fred.
KR
Keerthana Rajendran
Syncfusion Team
April 17, 2018 10:44 AM UTC
Hi Frederic,
We regret for the inconvenience.
We have checked the reported issue with the mentioned browsers and confirmed this as a defect. This fix will be included in our upcoming Volume 1, SP2 release which will be rolled out by the end of April.
Regards,
Keerthana.
SIGN IN To post a reply.
- 8 Replies
- 2 Participants
-
FP Frédéric Peyronnin
- Mar 20, 2018 08:17 AM UTC
- Apr 17, 2018 10:44 AM UTC