User Profile & Activity

Andrzej Sulej Member
Page
of 5
Posted: November 25, 2009 5:34 AM

Hi,

I get another issue.

Scenario the same: WebCombo1 and Button.

Javascript:

this.onload = Button1_onClick;

function WebCombo1_OnInitialize(ctrlId) {
            var WebCombo1 = ISGetObject("WebCombo1");
            WebCombo1.ShowDropDown();
            return true;
}
function Button1_onClick() {
            var WebCombo1 = ISGetObject("WebCombo1");
            alert(WebCombo1.IsValueInRange());
}

When the page (on the client side) trigger onload event , I've got alert with "false". When I click on Button1 once again I've got true.

 

More complicated scenario:
In my app I'd like to read some additional information (from my webcombo with multicolumn ) at onload page (client side) and call some method to enable, disable, set default parameters another controls.

How can I do that ? 

 

regards

Andrzej

Posted: November 25, 2009 4:13 AM

Hi

In this thread I've described server side events (please look at my example) 

protected void FormView1_ItemCreated(object sender, EventArgs e)
    {
        if (FormView1.CurrentMode == FormViewMode.Edit)
        {
            DataRowView rowView = (DataRowView)FormView1.DataItem;
            if (rowView != null)
            {
                //test binding
                WebComboCategory.Value = "2";//Condiments
                WebComboProduct.Value = "3";//Aniseed Syrup
            }
        }
    }

After Page_onLoad method , all WebCombo's on my page start connect to database (trigger method ISDataSourceList_Selecting) before FormView1_ItemCreated. But in this moment there is no any Value in WebComboCategory, so the WebComboProduct list empty, next start FormView1_ItemCreated event and I set some Value to both WebCombo's, I expect to refresh WebComboProduct, but there is no any action on ISDataSourceList_Selecting. I've tried to do that manully using WebComboProduct.ClearCachedDataSource(); , but no result:

//test binding
WebComboCategory.Value = "2";//Condiments
WebComboProduct.Value = "3";//Aniseed Syrup
WebComboProduct.ClearCachedDataSource();// ISDataSourceList_Selecting is't trigger

 

My question is :

1. Why my render page has WebComboProduct empty ??

2. How ClearCachedDataSource() works ?

 

regards

Andrzej

Posted: November 25, 2009 3:42 AM

Hi,

I've just tried and I've got alert with "value is Thomas Hardy"

Maybe it'e a question of my version: Combo: 4.0.7200.214 ; WebUI.Net Frm: 3.0.5000.702 !?

 

regards

Andrzej

Posted: November 25, 2009 2:51 AM

Hi,

Thank you for answer, but (please analyze comments):

function Button1_onclick() {var combo = ISGetObject("WebCombo1");

combo.SetText("Thomas Hardy", true); // true => text=value combo.LoadValue(

combo.LoadValue(true);

alert(combo.Value); // => alert show the same text as you set (Thomas Hardy), we expected Value='AROUT' not Text 

}

 

Try to put on the page second button, then click Button1 and next Button2, you get Value='AROUT'

<input id="Button2" type="button" value="button" onclick="return alert(ISGetObject('WebCombo1').Value);" />

 

regards

Andrzej

Hi,

In my app. I've more complicated situation , so Linked WebCombo solution is out.  Maybe I'm wrong, but I suppose that linked Webcombo don't create SQL syntax with conditions, but only filter cached data.How feel linked WebCombo with more than 1milion record in database ?

BTW, your suggestion about UpdateState() is perfect

Here is full javascript :

function WebCombo1_OnAfterItemSelected(controlId) {
var WebCombo1 = ISGetObject("WebCombo1");
var WebCombo2 = ISGetObject("WebCombo2");
WebCombo2.ClearSelection();
var wc1CatID = WebCombo1.Value;
switch (wc1CatID) {
case "1":
WebCombo2.SetText("Chai");
break;
case "2":
WebCombo2.SetText("Aniseed Syrup");
break;
default:
WebCombo2.IsDirty = true;
WebCombo2.NeedClearList = true;
break;
}
WebCombo1.UpdateState();
WebCombo2.LoadValue();
}

 

I tested and IsDirty and NeedClearList must be set to true, in other way we receive unexpected result.

Thank you

Andrzej

Posted: November 24, 2009 3:05 AM

Hi,

It's not the same, it's more complicated

I've have to set WebCombo Value in ItemCreated.

Please analyze the event trigger:

onLoad -> _Selecting(FV) -> _Selecting (List) ->_ItemCreated

If you set Value in OnLoad, that's Ok , but If we try set set in ItemCreated it's not working.

In my opinion it's BUG. How can we manualy refresh WebCombo on the server side ?

 

regards

Andrzej

Hi,

see attachment.

Hi,

I have similar problem, but I don't use SendCustomRequest(), but LoadValue() on combo2 and combo3 (it should be more efficient), Problem is on the server side I can't read Value of the combo1 (WHY!!!)  - It's a  BUG. We can obey this if, I write combo1.Value to some hidden fields and read this one on  the server - but it's not prof.

 

Any idea?

Posted: November 20, 2009 2:57 AM

Hi,

of course you're right, but it's a little bug in SetValueData function.

 

Regards
Andrzej

All times are GMT -5. The time now is 3:27 AM.
Previous Next