iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
I am using your WebCombo4 in a project, I keep running into a problem where although I have the AllowAddItem="true"property set, I am unable to enter text not already in the bound list.
To help troubleshoot this I created a small test project with only a single WebCombo and ASP button.
I set some values in the InitializeDataSource of the Combo.
When I run it and enter text into my combo box and click sumbit, when the page_load is hit during the postback the webcombo still contains my entered text, but by the time it gets to the click event of the button my text value is empty.
I don't know why this is happening or how to get around it but it didn't happen in Webcombo2. This sample contains no additional code, so I don't know what could be causing that text to disappear.
Hi Ethan,
Unfortunately, our WebCombo is not case insensitive. The additem event in serverside should be triggered always, except you handle some conditions on AddItem client side event. On your scenario, i think you will need to check the validation manually on AddItem clientside event. With this way you can return false the event to avoid AddItem server side event to be called. Hope this helps.
Regards,HAndy
I am not trying to add the text value into the list, I just want the text accessibly by the button_click. I recreated a sample page as suggested and it worked like you said it would. However within my project it does not work this way, the dlls are the same and the aspx code is the same. Within my project I put breaks in for most of the functions, the text was present in the page_load of the postback but the initializedatasource was never hit, then the text was gone in the on_click. I did as you suggested and used the addItem event, but the text was also gone by the time it hit the breakpoint in this event. What would cause my project to handle the webcombo functions different than a project I create from scratch? Is there some other file that contains settings that may need to be changed? Or is there code hidden somewhere in the webcombo? This project is one that I just upgraded from Webcombo2.
Thanks,
Hello Ethan,
Could you create and send me a video that show recording about the issue? I will try to follow your behaviour and dicuss it also with our developer. Btw, it is true that some of the lifecycles are different from WebCombo2. When PostBack, InitializeDataSource should be called again except if you set AllowAutoDataCaching true.
Regards,Handy
What tools doyou suggest for making a video?
In here, i am using Camtasia Studio as a recording tools.
Handy,
Attach find the videos you requested.
Video 1:
Shows the performance in our .net 1.1 application that has used webcombo for 4 years. As you can see, upon load of page, the initializedatasource is hit. After that, the initialize datasource is not hit again when the user enters a value (one in the list or one that is not). Upon click of submit button I am able to read the value of the webcombo in the button click event regardless of whether it is in the list or not. At no point do I attempt to add it to the underlying list of values. I am just using the value temporarily.
Video 2:
Shows the .net 2.0/3.5 application we are working on now. In this movie you see that much like in video 1 the initialize datasource only gets hit once--the first time the page is loaded. Even on the click of the submit button, the initialize datasource does not get hit again. However, when I get to the click event of the button, the webcombo.text value is blank.
If I put a stop in the onload event, the webcombo.text value will be correct. By the time I get to the button click event it has been cleared. None of my code runs in between these 2 events.
I also created a new test page (within the same project) with just a webcombo and a button. The same performance occurred here.
video 3:
Shows a .net 2.0/3.5 new project created just to test this issue. There is one form with a single combo box and button. Here I see different performance than in video 1 and video 2. In video 3 the initialize datasource is hit multiple times--on initial load of page, when user starts to type, when user tabs from webcombo, and after I click submit button.
In this project I agree with you that when it hits the initialize datasource after the click of the submit button it will clear the value from the combo if it is not in list.
So I added a variable to hold the wc.value until after the combo populates. It then sets the value if the temp variable is not blank. As you can see from the movie, the value appears to be set while I am in the initialize datasource event. However, as I step into the button click event, the value is gone.
The only way that I can get this to work is if I check for a value in the field and then build a union query with the value that does not exist in list. I would rather not have to rewrite all my code to take this into account.
So, my questions are the following:
-- Why am i getting such different performance between video 2 and video 3?
-- What is your suggested solution?
-- If video 3 is how it is supposed to work, is there anyway to prevent the numerous hits to the intialize datasource. I don't understand why the webcombo has to requery so many times for a user entering one value into one webcombo. In .net 1.1 version I hit the sql server once for each combo. Now it is approx. 5 or so connections to the sql server for a user entering a single value.
Thanks for your time,Ethan
As my colleague has explained, the lifecycle in WebCombo 2 and WebCombo 4 has been changed. In the WebCombo 4, the text value will be processed much earlier compared to WebCombo 2. Since the text youentered is not in the WebCombo data source list, the text will be set to empty string.
In order to simulate the WebCombo 2 behavior, you could buffer the text value during onlostfocus client side event handler to a hidden input. During click server side event handler, you will need to check the hidden input value to get the last value of WebCombo, if the entered text is not in the dropdown list. Here is the snippet:
function WebCombo1_OnLostFocus(ctrlId) { var combo1 = ISGetObject("WebCombo1"); document.getElementById("hiddenBuffer").value = combo1.TextObj.value;}
The hidden input and WebCombo markup:
<input type="hidden" id="hiddenBuffer" runat="server" /><ISWebCombo:WebCombo ID="WebCombo1" runat="server" OnInitializeDataSource="WebCombo1_InitializeDataSource" UseDefaultStyle="true" AllowWildCardSearch="true"> <LayoutSettings> <ClientSideEvents OnLostFocus="WebCombo1_OnLostFocus" /> </LayoutSettings></ISWebCombo:WebCombo>
Hello Glenn,
Thanks for your reply.
I am still a little puzzled as to the differences between video 2 and video 3 which are both webcombo 4. Regardless, for now I have it working by adding code to the server-side AddItem event to repopulate webcombo with datasource "unioned" with the new item:
select countryid from countries union select 'newitem' as countryid
The only thing that I am noticing is that the additem event is being hit if I type "Us" when "US" is in the list of country IDs (additem does not get hit when I type "US"). In webcombo 2 it did not seem to care about case. Is there a way to make it case insensitive?
Thanks for your time,
Ethan
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname