Package com.volantis.mcs.xdime.xforms.model

Examples of com.volantis.mcs.xdime.xforms.model.SIItem


        builder.addModel(MODEL_ID, new EmulatedXFormDescriptor());
        builder.addItem(REF, CONTENT);

        // verify that the item exists, is not referenced and the specified
        // model exists
        SIItem item = builder.getItem(REF, MODEL_ID);
        assertNotNull(item);
        assertFalse(item.isReferenced());
        assertNotNull(builder.getModel(MODEL_ID));
        // set the expectation that the setInitial method will be called
        attributes.expects.setInitial(CONTENT);

        element.setInitialValue(builder, REF, MODEL_ID);

        item = builder.getItem(REF, MODEL_ID);
        assertNotNull(item);
        assertTrue(item.isReferenced());

        // make sure that the field descriptor also has the initial value set
        assertEquals(CONTENT, element.fieldDescriptor.getInitialValue());
    }
View Full Code Here


        builder.addModel(MODEL_ID, new EmulatedXFormDescriptor());
        builder.addItem(REF, "a, b, c");

        // verify that the item exists, is not referenced and the specified
        // model exists
        SIItem item = builder.getItem(REF, MODEL_ID);
        assertNotNull(item);
        assertFalse(item.isReferenced());
        assertNotNull(builder.getModel(MODEL_ID));
        // set the expectation that the setInitial method will be called
        attributes.expects.setInitial("a, b, c");

        element.setInitialValue(builder, REF, MODEL_ID);

        item = builder.getItem(REF, MODEL_ID);
        assertNotNull(item);
        assertTrue(item.isReferenced());

        // make sure that the field descriptor also has the initial value set
        assertEquals("a, b, c", element.fieldDescriptor.getInitialValue());
    }
View Full Code Here

    // Javadoc inherited.
    protected void setInitialValue(XFormBuilder builder, String ref,
            String modelID) throws XDIMEException {

        // deal with any referenced items
        SIItem item = builder.getItem(ref, modelID);
        // the item could be null because the control could legitimately
        // refer to an non-existent model item.
        if (item != null) {
            item.setIsReferenced();

            String[] initialValues = item.getValue();

            if (initialValues != null) {
                if (initialValues.length > 1 &&
                        !((XFSelectAttributes) protocolAttributes).isMultiple()) {
                    // multiple values are only expected by multiple select
View Full Code Here

     */
    protected void setInitialValue(XFormBuilder builder, String ref,
            String modelID) throws XDIMEException {

        // deal with any referenced items
        SIItem item = builder.getItem(ref, modelID);
        // the item could be null because the control could legitimately
        // refer to an non-existent model item.
        if (item != null) {
            item.setIsReferenced();

            // the default implementation uses only the unprocessed value
            final String initialValue = item.getUnprocessedValue();

            if (initialValue != null) {
                ((XFFormFieldAttributes) protocolAttributes).setInitial(
                        initialValue);
                fieldDescriptor.setInitialValue(initialValue);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.xdime.xforms.model.SIItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.