Skip to main content

List Cross-form Values

1. Create Setup Custom Form

1a. Create your Setup form:

custom-form-cross-1.png

Note: use TextArea component as editor!

1b. Create and copy Data item to clipboard (i.e. myNastavovatkoValuesArea in this case)

2. Set Setup Custom Form

2a. Open ActivityPanel's Layout designer on your context, add FormView application and select our Setup form from step 1

custom-form-cross-2.png

2b. Open your context and set some values (test case)

custom-form-cross-3.png

3. Create View Custom Form

WARNING: use ContextualCombo instead of basic Combobox! and Folder selector as Context selector

custom-form-cross-4.png

3a. Create your View form

FYI: ComboBoxContextual get values from context (selected by Folder selector) by selected FormItemName.

Make pair Folder selector <-> ComboBoxContextual

Folder selector setup: (Identificator required!)

custom-form-cross-5.png

ComboBoxContextual setup: (Identificator and FormItemName required!)

custom-form-cross-6.png

3b. Select FormItemName created in step 1b:

custom-form-cross-7.png

3c. Script setup (make combo-context pair)

Note: You can use one of Ready-to-use Scripts - check attachments (3context-3combo.txt in this case)

custom-form-cross-8.png

3d. Validate your script

custom-form-cross-9.png

4. Set View Custom Form

4a. Open ActivityPanel's Layout designer on your context, add FormView application and select our View form from step 3

custom-form-cross-10.png

4b. Open your context:

(1) Select any context

(2) Select value from another form

custom-form-cross-11.png

Done, good job.

  • One context selector with one combobox
getComp("myCombo").contextId = getComp("contextSelector").valueId;

this.createListener("contextSelector", "change", changeContextHandler);

function changeContextHandler(evt:Object):void
{
    getComp("myCombo").contextId = getComp("contextSelector").valueId;
}
  • One context selector with three comboboxes
getComp("firstCombo").contextId = getComp("contextSelector").valueId;
getComp("secondCombo").contextId = getComp("contextSelector").valueId;
getComp("thirdCombo").contextId = getComp("contextSelector").valueId;


this.createListener("contextSelector", "change", changeContextHandler);

function changeContextHandler(evt:Object):void
{
    var contextId:String = String(getComp("contextSelector").valueId);
    getComp("firstCombo").contextId = contextId;
    getComp("secondCombo").contextId = contextId;
    getComp("thirdCombo").contextId = contextId;
}
  • Three context selectors with three comboboxes
getComp("firstCombo").contextId = getComp("firstContextSelector").valueId;
getComp("secondCombo").contextId = getComp("secondContextSelector").valueId;
getComp("thirdCombo").contextId = getComp("thirdContextSelector").valueId;


this.createListener("firstContextSelector", "change", changeFirstContextHandler);
this.createListener("secondContextSelector", "change", changeSecondContextHandler);
this.createListener("thirdContextSelector", "change", changeThirdContextHandler);


function changeFirstContextHandler(evt:Object):void
{
    getComp("firstCombo").contextId = getComp("firstContextSelector").valueId;
}

function changeSecondContextHandler(evt:Object):void
{
    getComp("secondCombo").contextId = getComp("secondContextSelector").valueId;
}

function changeThirdContextHandler(evt:Object):void
{
    getComp("thirdCombo").contextId = getComp("thirdContextSelector").valueId;
}