How do I create a resource and select it on a custom editing form when the user saves?

2 replies. Last post: October 28, 2009 8:59 AM by David Williams
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

I would like to control the resources on the custom editing form in code including creating the resource and choosing it for the user. Can someone provide a sample for how to do it? I have tried something like the following... First change the OnClientClick of the save button to my own function that then calls the original function when finished.

function wbSave_OnClick() {
    var wr = ISGetObject("wcResources");

    //create and add a new resource if one is not selected (an existing event)
    if (wr.Value == "") {
        ISGetObject("wiResourceName").SetValueData("New Resource");
        ISGetObject("wcResourcesColor").SetSelectedIndex(0);
        ISGetObject("wiRLocation").SetValueData("N/A");
        ISGetObject("wiRDescription").SetValueData("New Resource");
        WS_OnSaveResource();

        //Now select the new row
        wr.UpdateUI();
        wr.Rows[wr.Rows.length - 1].Select();
    }

    //Now call original function and return
    WS_OnSave();
    return true;
}

The new row appears in the WebCombo, but I cannot seem to see it in the rows collection right after creating a new one. Is there some other way of getting the resources WebCombo to repopulate?

 

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