Dataviews and JTextField

From: roberto.garron..astwebnet.it
Date: Thu Feb 17 2005 - 11:04:51 EST

  • Next message: Pirola Davide: "BigDecimal vs Integer -- StoredProcedure out parameter vs Query"

    I'm building an interface using dataviews, at this point I have to show a
    single dataobject for editing. Well I just need a transposed JTable but it
    seems impossible unless rebuilding JTable itself from scratch. So I ended
    with this idea: dinamically group many pairs of jlabel-jtextfield in a gridbag,
    with some code ripped from DOTableModel I can get:

                int fieldCount = view.getFieldCount();
                for (int i = 0; i < fieldCount; i++) {
                    ObjEntityViewField field = view.getField(i);
                    if (!field.isVisible())
                        continue;
                    rowMap[rowCount] = i;
                    rowNames[rowCount] = field.getCaption();
                    editableRows[rowCount] = field.isEditable();
                    //java.lang.Double etc...
                    rowClasses[rowCount] = field.getJavaClass();
                    if (rowClasses[rowCount] == null)
                        rowClasses[rowCount] = String.class;
                    rowCount++;

    Ok, now I have Captions,Types and Mappings of each property of the Dataobject
    and I can fill my thing. But how to setup the formatter for each jtextfield
    using Dataviews, I see there is a formatterfactory in dataviews but I can't
    find in the code how it is used. Please someone may help?

    Thanks

    Roberto Garrone



    This archive was generated by hypermail 2.0.0 : Thu Feb 17 2005 - 11:04:54 EST