Bug with EmptyMessage?

13 posts, 0 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 27 Apr 2009 Link to this post

    Hi,

    I'm trying to work out why my code isn't working with the  "control_name.EmptyMessage = message" type command from server side code.  It works when running in the initial page load but then on ajax calls it doesn't set the fields.

    Also in Javascript the set_emptyMessage command doesn't seem to work on a similar basis...Interestingly I can use the set_text command to acheive the same goal. 

    Is there a known bug with the emptymessage commands or will I need to post some code?

    Regards,

    Jon
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 28 Apr 2009 Link to this post

    Hello Jon,

    We haven't such a known bug with the EmptyMessage property of RadComboBox. Could you please send us a sample which demonstrates the issue to examine it locally?

    Sincerely yours,
    Helen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 28 Apr 2009 Link to this post

    Hi Helen,

    Short of posting the whole page code on the forum (which I'd prefer not to do) is there an email address that I can send the code to? 

    Regards,

    Jon
  5. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 28 Apr 2009 Link to this post

    Hello Jon,

    I'd suggest you open a formal support ticket and send us a simple running project (incl. your custom skin, CSS, images, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

    Thanks,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 28 Apr 2009 Link to this post

    Hi Paul,

    I'll post some relevant bits of the code here as I don't have the time to rebuild the page in a simpler format :(

    It now looks as though this issue affects the SelectedValue field as well as EmptyMessage so I suppose that it is something quite basic and will affect more fields in the control.  The really odd thing is that the data in the control gets populated just fine but anything else doesn't work.

    Essentially I've got multiple cascading drop downs and they are all setup using your methods posted on this site. 

    In the following code the LoadClients is triggered from the PageLoad event and using a ClientID value from the DataBound event I can get that to select the existing value and if necessary set the emptyMessage.  LoadClients calls LoadComboBox to do the database load. 

    The part that fails is the LoadContacts, it is called in javascript on the PageLoad event.  It is called with the selected ContactID value and debugging the code I can see the value going into the LoadComboBox sub.  Once the page loads, all of the values are in the drop down but there is no selected value....  Very weird.

    It's all very fustrating as the effort to get cascading drop downs working is pretty immense.  This is the last hurdle for me now. 

       Protected Sub LoadComboBox(ByVal comboBoxControl As StringByVal idField As StringByVal textField As StringByVal unselectedMessage As StringByVal sqlString As StringOptional ByVal selectedValue As String = ""Optional ByVal storedProcedure As Boolean = FalseOptional ByVal parameterArray() As String = NothingOptional ByVal valueArray() As String = Nothing)  
            Dim sqlConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)  
     
            Dim sqlDataAdapter As New SqlDataAdapter(sqlString, sqlConnection)  
            If storedProcedure Then sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure  
            If parameterArray IsNot Nothing AndAlso valueArray IsNot Nothing AndAlso parameterArray.Length() = valueArray.Length() Then 
                For i As Integer = 0 To UBound(parameterArray)  
                    sqlDataAdapter.SelectCommand.Parameters.AddWithValue(parameterArray(i), valueArray(i))  
                Next 
            End If 
     
            Dim dataTable As New DataTable()  
            sqlDataAdapter.Fill(dataTable)  
     
            Dim uxRadComboBox As RadComboBox = DirectCast(uxFormView.FindControl(comboBoxControl), RadComboBox)  
            uxRadComboBox.DataTextField = textField  
            uxRadComboBox.DataValueField = idField  
            uxRadComboBox.DataSource = dataTable  
            uxRadComboBox.DataBind()  
     
            If selectedValue <> "" Then uxRadComboBox.SelectedValue = selectedValue  
            If unselectedMessage <> "" Then uxRadComboBox.EmptyMessage = unselectedMessage  
        End Sub 
     
        Protected Sub LoadClients()  
            LoadComboBox("uxClient""ClientID""Name""""usp_CRUD_CLI_ClientsSelectByContactPermissions", _clientID, TrueNew String() {"@contactID"}, New String() {Session.Item("ContactID").ToString()})  
        End Sub 
     
        Protected Sub LoadContacts(ByVal dataID As String)  
            Dim valueArray() As String = dataID.Split(","c)  
            Dim selectedValue As String = "" 
            If valueArray.Length = 2 Then selectedValue = valueArray(1)  
            LoadComboBox("uxContact""ContactID""ContactName"" - Select a Contact - ""usp_CRUD_CON_ContactsSelectByClient", selectedValue, TrueNew String() {"@ClientID"}, New String() {valueArray(0)})  
        End Sub 

    Thanks in advance for any help!

    Regards,

    Jon

    PS.  It's worth noting that this post below is similar although it seems to indicate that a fix was due (I have the most recent version - 2009.1.402.35)
    http://www.telerik.com/community/forums/aspnet-ajax/combobox/combobox-and-emptymessage.aspx
  7. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 28 Apr 2009 Link to this post

    Also worth noting on this is that all of the drop downs that are affected end up with their font being Italic for ALL values not just the top empty message....
  8. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 29 Apr 2009 Link to this post

    Hi Jon,

    We tried to reproduce the problem at our samples, but without much success. Please find attached our test files for details. Is it possible to modify them so we to be able to see the exact problem locally?

    Regards,
    Helen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 29 Apr 2009 Link to this post

    Hi Helen,

    They work fine!  Typical.

    I suspect that the problem revolves around me having to use the DirectCast as the control is within a formview and hence the code behind can't see the control except via a search (Dim uxRadComboBox As RadComboBox = DirectCast(uxFormView.FindControl(comboBoxControl), RadComboBox))

    I'm stuffed for time now so can't play with the code much for now.

    Your example did show me one thing that has given me a good work around.  I was assuming that because of the load triggering a child load that I couldn't put the children into the PageLoad.  In your example you did that and it worked. As such I've had a stab and it works fine for me.  I suppose that it's in the name isn't it - onclientselectedindexchanging?  Client - not server.

    Given that the controls are now populated in the initial server page load, the font problem has also disappeared!  I wonder if the problem stems from the fact that the child controls don't get setup properly when the page loads initially (no databinding done on them).

    The following is the Contact drop down box that is affected by the problem:
    <telerik:RadComboBox ID="uxContact" Runat="server"  EmptyMessage=" - Select a Client - " AllowCustomText="true" 
        CssClass="fullWidthTextBox" 
        onitemsrequested="uxContact_ItemsRequested" 
        OnClientItemsRequested="DropDownLoaded">  
    </telerik:RadComboBox> 

    If I get time over the next few weeks I'll try and look into it some more.

    Thanks for the assistance,

    Regards

    Jon
  10. Sunil
    Sunil avatar
    230 posts
    Member since:
    Jan 2004

    Posted 30 Oct 2015 in reply to Jon Link to this post

    I found a similar issue when using client-side api to change the empty message.

    After some trying I found that the method of set_emptyMessage by itself will not update the empty message of radcombobox, but if you call clearSelection method on client-side, then the new empty message will show for the radcombobox.

     I am using Q3 2015 version. May be a Telerik support professional can confirm this.

    combo2.set_emptyMessage("Select a deleted Product to Recover");
    combo2.clearSelection();//this line is needed for new empty message to show up

  11. Sunil
    Sunil avatar
    230 posts
    Member since:
    Jan 2004

    Posted 31 Oct 2015 in reply to Sunil Link to this post

    In my situation, with reference to my above post, the combobox had no items initially, and then when an item was added from client-side to this empty combobox, the empty message did not change even though set_emptyMessage api was used and there was no item selected.
  12. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 02 Nov 2015 Link to this post

    Hi,

    Could you please open a support ticket and send us your complete code, which will help us to understand the problem better?


    Regards,
    Helen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  13. Sunil
    Sunil avatar
    230 posts
    Member since:
    Jan 2004

    Posted 05 Nov 2015 in reply to Helen Link to this post

    Hi Helen,

    You are right.

    Actually in my scenario, I had 2 RadComboxes with checkboxes, and when I transfered  checked items on client-side from one to another, I did not uncheck these items when adding tto the second RadComboBox.   By calling clearSelection, it seems the items added to second RadComboBox got unchecked which then displayed the empty message. If I did not call clearSelection method on second RadComboBox, then it showed an empty text and also no empty message.

    Thanks

    Sunil

     

  14. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 10 Nov 2015 Link to this post

    Hi,

    As I already mentioned below we are not sure about the exact your scenario. This particular solution works for your case, but it is not necessary in general.

    Please send us a sample project which demonstrates the issue to investigate it locally.

    Regards,
    Helen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017