Dear Ariel:
Thank you for your kind reply. I hav just try the code for the view
cursor, and it works fine!. About the user text fields, is clear now that I
cannot insert a field twice using the same instance of the field. But I'm
curious, you said in your last e-mail that I must create ANOTHER instance of
the field using the same parameters for its creation. How can I create a new
instance of the same field that is already inserted. I use the following code
to insert the field (from my last e-mail)
private XDependentTextField createTextField(XMultiServiceFactory
documentFactory, String fieldName, String fieldValue) {
XDependentTextField userField = null;
try {
if (documentFactory != null) {
// Creamos el campo...
userField = (XDependentTextField)
UnoRuntime.queryInterface(XDependentTextField.class,
documentFactory.createInstance("com.sun.star.text.TextField.User"));
// Creamos el fieldmaster asociado al recientemente creado user
field...
XPropertySet masterPropSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class,
documentFactory.createInstance("com.sun.star.text.FieldMaster.User"));
// Le ponemos el nombre y valor al fieldmaster...
masterPropSet.setPropertyValue("Name", fieldName);
masterPropSet.setPropertyValue("Content", fieldValue);
// Finalmente le insertamos el fieldmaster al user field...
userField.attachTextFieldMaster(masterPropSet);
}
}
catch (java.lang.Exception e) {
e.printStackTrace();
}
return userField;
}
In the case of creating a new field, the above code is ok. But how do I get
another instance of the same field? Do I use the UnoRuntime.queryInterface to
acomplish this?, somewhere in the documentation I read something about the
field names, that the name of the field is something like
"com.sun.star.text.TextField.User.<MyFieldName>", do I have to use a sintax
like this to retrieve the new instance of the same field?
Thank you in advance for your kind reply.
Marco
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]