[Solved] Fetch dVariable Values for different button action?

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
pknerd
Posts: 31
Joined: Tue Dec 03, 2013 4:07 pm

[Solved] Fetch dVariable Values for different button action?

Post by pknerd »

In dispatch method I am calling different button actions as:

Code: Select all

String myvar = "";
if(_route.equals("Save"))
{
 myvar = "1";
}
But when I try to get value of myvar on clicking another Toolbar button then it returns blank. How to retrieve value saved in last action?

Code: Select all

if(_route.equals("Updated"))
{
 ٍٍٍٍSystem.out.println(myvar); // Returns Blank
}
Last edited by Hagar Delest on Wed Mar 05, 2014 9:31 am, edited 1 time in total.
Reason: tagged [Solved].
Open Office 4.01, MacOSX 10.6
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to fetch dVariable Values for different button actio

Post by RoryOF »

It depends where in your code myvar is declared.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
pknerd
Posts: 31
Joined: Tue Dec 03, 2013 4:07 pm

Re: How to fetch dVariable Values for different button actio

Post by pknerd »

RoryOF wrote:It depends where in your code myvar is declared.
as I said it is in dispatch Method

Code: Select all

public void dispatch( com.sun.star.util.URL aURL,
                           com.sun.star.beans.PropertyValue[] aArguments )
What I guess. Every toolbar button resets entire thing or call dispatch method again and again
Open Office 4.01, MacOSX 10.6
pknerd
Posts: 31
Joined: Tue Dec 03, 2013 4:07 pm

Re: How to fetch dVariable Values for different button actio

Post by pknerd »

I sorted it out. Created an external class and used getter and setters.
Open Office 4.01, MacOSX 10.6
Post Reply