Thanks Sascha. That was it. :clap:

Cheers,
Anupam.


Sascha Jensen wrote:
> 
> Hi,
> just guessing: You use the wrong variable to extract the 
> ControlProperties. Your for-loop defines a virable j, but you are using i.
> 
> Agnisys schrieb:
>> Hello all,
>>   I'm trying to read a Writer (OO 2.4) form in Java (IDE: Netbeans 6.1,
>> java
>> 1.6u6) on Windows 2003. I have two buttons in the form but the
>> PropertySet
>> always gives me information for the first one that was added when the
>> form
>> was created! Here is the relevant code snippet ...
>> 
>> :
>>             XIndexContainer xForms =
>> UNO.queryIndexContainer(getFormComponentTreeRoot());
>>             int i = 0;
>>             while (xForms.hasElements()) {
>>                 XIndexContainer xForm =
>> UNO.queryIndexContainer(xForms.getByIndex(i));
>> 
>>                 for (int j = 0; j < xForm.getCount(); ++j) {
>>                     XPropertySet xControlProps =
>> UNO.queryPropertySet(xForm.getByIndex(i));
> use j instead of i                     ^^
> 
>>                     XPropertySetInfo xPropertySetInfo =
>> xControlProps.getPropertySetInfo();
>> 
>>                     Property[] property =
>> xPropertySetInfo.getProperties();
>>                     
>>                     for (int k = 0; k < property.length; k++) {
>>                         //// These property names and values are always
>> for
>> the first button!
>> 
>>                         // prop name =  property[k].Name 
>>                         // prop value = 
>> xControlProps.getPropertyValue(property[k].Name);
>>                     }
>>                    }
>>                 }
>>                 i++;            
>> :
>> 
>> Is it a bug or am I doing something wrong? Is there another (perhaps
>> shorter) way to do this?
> 
> hth,
> Sascha
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
  
-- 
View this message in context: 
http://www.nabble.com/Trying-to-read-a-form-in-Java-tp17733003p17733392.html
Sent from the openoffice - dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to