cancel
Showing results for 
Search instead for 
Did you mean: 

Workdesk HR - Form customization/web-services

baaka
Champ in-the-making
Champ in-the-making
Hello there,

I'm using Alfresco Workdesk with HR app.
I want to add combobox in "New Dossier" form and then I want the data in combobox to be loaded via web-services.
From where can I start to make my idea alive?
Any suggestions,examples?


Thank you.
3 REPLIES 3

d_evil
Champ in-the-making
Champ in-the-making
Hi Baaka,

Workdesk allow to define custom handler for fields,
to achive that you can configure in the owbootstrap.xml a FieldControl.

You would need to implement the OwFieldManagerControl interface, which will be called in different context of the UI.

There you could implement your service based populated Combobox rendering.
FieldControls are registered on the Id of the field you want to manage in the UI, see the examples in owbootstrap.xml.

Cheers,
D.evil

baaka
Champ in-the-making
Champ in-the-making
Thank you D.evil,

Any examples? tutorials? please.
I'm in trouble creating custom form (with combobox/list) in which data'll be loaded dynamically.

d_evil
Champ in-the-making
Champ in-the-making
Well there are examples for handling Comboboxes, look into
com.wewebu.ow.server.fieldctrlimpl.OwNextDaysDateControl

it creates a simple combobox with "next days" content.


public void insertEditField(….)
{

        List items = new LinkedList();
        Set keys = TRANSLATION_KEYS.keySet();
        Iterator keysIterator = keys.iterator();
        while (keysIterator.hasNext())
        {
            Integer key = (Integer) keysIterator.next();
            String tranlationKey = (String) TRANSLATION_KEYS.get(key);
            String defaultValue = (String) DEFAULT_TRANSLATION_VALUES.get(key);
            String displayValue = getContext().localize(tranlationKey, defaultValue);
            items.add(new OwDefaultComboItem(key.toString(), displayValue));
        }
        OwComboModel model = new OwDefaultComboModel(false, false, "" + iSelectedKey, items);
        OwComboboxRenderer renderer = ((OwMainAppContext) getContext()).createComboboxRenderer(model, strID_p, null, null, null);
        renderer.renderCombo(w_p);
}

There are three methods to implement:

public void insertReadOnlyField(…)
public void insertEditField(…)
public Object updateField(…)

The first two are obvious for what they are used,
the last one is for extracting the value from HTTP request which was fired.