JSField.CALENDAR

Hello,

Can I use this specification on a dialog, when the user selects something from a pop-up? E.g.,

case JSColumn.DATETIME:
application.setValueListItems(‘query_compare_1’,dsNumber);
queryValue1.displayType = JSField.CALENDAR;
break;

In my case, it’s for a custom query dialog. The user selects a field name from the first pop-up, and an on data change event determines the type of the field selected. If the field is DATETIME, then I would like to set the type of a corresponding entry area on the form to CALENDAR.

The setValueListItems line is working, but not the JSField line.

Thank you,
Don

Hi Don,

Setting the displayType can’t be done with a runtime property. You would have to recreate the form to change this property.
So you need to use the solutionModel like so:

case JSColumn.DATETIME:
    application.setValueListItems('query_compare_1',dsNumber);
    var _oForm = solutionModel.getForm(controller.getName()),
        _oField = _oForm.getField('queryValue1');
    _oField.displayType = JSField.CALENDAR;
    controller.recreateUI();
    break;

Hope this helps.

Hi Robert,

Would I run that code each time the user selects a different field? If the user selects a date, then selects an alphanumeric field – do I redraw each time, while the form is still displayed?

Along the same lines, is it possible to get the valuelist name that is associated with the field that the user selects? For example, suppose the field that the user selects is “std_type_of_degree_id” in the query dialog (above), and there is a valuelist on the student data entry form named “degree_valuelist”. Can I get that valuelist name when the user selects the field?

Thank you,
Don

Don,

Alternatively, you can create a set of fields per display type and show only the ones that belong to the selected value, hide the others.

Rob

Hi Rob,

I tried doing something that was somewhat like that on another form, and finally got it to work (they could not be on top of each other, or it wouldn’t). So I will try it here.

On the second question, is there some way to inquire of a data provider (on another form) the name of its valuelist?

Thank you,
Don

just get the right field from that form through the solution model and ask for its JSValueList?