Jump to content

UniDBLookupCombobox Editable and Empty Value And value not in list


TNT23

Recommended Posts

For those having problems allowing empty value or the selection of only items in list with incremental search in an editable DBLookupComboBox... (i was one too :rolleyes: ) Add to the DBLookupCombobox -> ClientEvents -> ExtEvents -> OnAfterrender 

function OnAfterrender(sender){ 
sender.allowBlank=true; 
sender.editable = true;//This allows you to edit the DBLookupCombobox 
sender.forceSelection=true;//This line allows only item in list to be selected
sender.beforeBlur= function(){ 
var value = this.getRawValue(); 
if(value == ''){
this.lastSelection = []; 
}
 this.doQueryTask.cancel(); 
this.assertValue(); 
}
}

I face a problem on setting null value to the coresponding field at server because the above trick does not set null value to field. I tryed and an ajax request to achieve the update.. but it keeps the last keyfieldvalue of the field.. if anyone can help :(

  • Upvote 4
Link to comment
Share on other sites

I found the solution for the database problem and its working like a charm.. :)

Add the code of the previous post and then just add a dummy value to your query

eg. : SELECT -1 as id,'' as descr  from dummy union all select id, descr FROM books ;

You can now search the unidblookupcombobox list values and CLEAR the data, also if value not in list lookup will get previous value ...

 

  • Upvote 1
Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...