User Profile & Activity

Gopal Pandian Member
The Link does not navigate to any page.Kindly check and update the link please.

Hai Hans,

One final query. do you have any idea about how to get the cursor position(either client side or server side) among the selected items(tokens) in the textbox object of webcombo.

 

Hai Hans,

Thanks for your response.

The  idea suggest by you itself require the item value which is going to be deleted.

currently we have solve this using different logic but it requires database storage and retrival and more coding efforts.This leads to Performance issue when i am using 11 webcombo controls in a page.

I have found some idea from http://doc.evget.com/HelpDocument/WebCombo2013CAB/topic213.html.

This link describes WebCombo Features .In which i had found the below description.

3.Item Deletion :
Item deletion can be done using the Delete or Backspace key. WebCombo is capable of identifying tokens in the cursor position and delete the previous item when the Backspace key is pressed, it can also delete the next item if the Delete key is pressed.

If we get the cursor position among the selected items(tokens),then we could find the item which is going to be deleted.Is it possible becase the above highighted line says like that.

using cursor position and key code i can capture the item to be deleted then i will compare that item with webcombo rows to check wheather it is disabled or not.If disabled then i quit the delete function else i let the action to happen.

Please suggest it is possible?. i am waiting for your response.

Kindly Provide response for this.

Hai Hans ,

Thanks for your response.

your solution is fine, but our client required to type text in webcombo text field inorder to search and add the webcombo items.

They will use large no. of items, so they feel search and add the items is easier then selecting the checkbox by scrolling among the large no.of items in webcombo.so we could not set the “TextBoxMode” property to “ReadOnly”.

Is there any posibility to get the item which is going to be deleted (If i got that, then i can control the deletion of disabled item) OR is there any alternate way to handle this without affecting the client requirement. Kindly suggest.

Hello Kristian,

Thanks for your response.Please find the below details regarding the query.

Initially I had selected some items in core Process webcombo ,Based on the  certain condition i am going to disable the some of the selected items in core Process webcombo using the below code.

var WCSubProcess = ISGetObject("WCSubProcess");

var result = Transactions_TestPage.GetTestCaseRequirementMap(TestCaseID);//Retrive Data Set from Data Base.

for (var RM = 0; RM < result.value.Tables[0].Rows.length; RM++)

{
   bol = false;
   for (var CP = 0; CP < WCCoreProcess.GetRows().length; CP++)

   {
    if (WCCoreProcess.GetRows()[CP].Value == result.value.Tables[0].Rows[RM].TCP_CoreProcessID)

   //If CoreProcess id match with combo item then we disable the combo item

    {
       WCCoreProcess.GetRows()[CP].RowElement.disabled = true;
        bol = true;
    }
  }

}

After disabling the selected item now the user going to remove the selected item,here i need to control the delete process as per below conditions,

1) I should not  allow the deletion of the disabled selected items

2) But  user can able to delete the non disabled selected items.

I am using Intersoft wecombo 4.0. Below is my Webcombo control.

<ISWebCombo:WebCombo ID="WebCombo1" runat="server" UseDefaultStyle="True" Width="310px"
    DataTextField="CoreProcessName" DataValueField="CoreProcessID" Height="200px">
    <Columns>
        <ISWebCombo:WebComboColumn BaseFieldName="CoreProcessName" Bound="False" HeaderText="Core Process Name"
            Name="ProcessName" Width="310px" />
    </Columns>
    <MultipleSelectionSettings Enabled="True" AllowBrowseAll="true" AutoPositionResultBox="false"
        AutoSelectFirstMatch="true" AllowNotInListText="true" />
    <LayoutSettings ComboMode="SingleColumn" SearchImage="./images/Search.jpg" TextBoxMode="Editable"
        AlwaysShowHelpButton="false">
        <ClientSideEvents OnValueItemNotInList="Combo_OnValueItemNotInList" />
    </LayoutSettings>
</ISWebCombo:WebCombo>

Code to bind the Control:

var combo = ISGetObject(cntrlName);

var rows = combo.GetRows();

//res Has Data Set Retrived from Data Base Using Ajax Method.

if (res.value != null && rows <= 0)

{
        var Tbl = res.value.Tables[0];

                for (i = 0; i < Tbl.Rows.length; i++)

                {
                    newRow = combo.NewRow("CoreProcess"); newRow.Value = Tbl.Rows[i].CoreProcessID;
                    newRow.Text = Tbl.Rows[i].CoreProcessName; newRow.SetChanged(); rows.Add(newRow);
                }

combo.UpdateUI();

}

I am using Keydown event as below to identify the del or backspace key press but i cant able to get the current item which going to be deleted.Please provide the suggestion to meet my requirement.

 

 function WebCombo1_OnInitialize(controlId)
        {
            var WebCombo1 = ISGetObject(controlId);
            var comboText = document.getElementById(controlId + "_text");
          Listener.Add(comboText, "onkeydown", WCCoreProcessOnKeyDown);
            return true;
        }

All times are GMT -5. The time now is 4:17 PM.
Previous Next