[Project_owners] Preferences in Mozilla

Neil neil at parkwaycc.co.uk
Mon Dec 29 23:26:27 EST 2003


Jaap A. Haitsma wrote:

> Neil wrote:
>
>> Jaap A. Haitsma wrote:
>>
>>> 1. Why are the values in the doOnOk callback not the ones I entered, 
>>> but the ones that were there when the panel got lauched.
>>
>> Are the values actually getting saved when you switch panels?
>
> If I switch panels none of my code gets called. If I hit OK in another 
> panel my doOnOk gets called, and my preferences get saved somehow but 
> in the doOnOk I still don't see the current values when I dump them. 
> If I just switch panel and then go back I see the correct values I 
> entered in the dialog.
>
> My doOnOk looks like this
>
> function doOnOk(){
>     var prefWindow = parent.hPrefWindow;
>     // OK could have been hit from another panel, so we need to
>     // get at dictionarysearchData the long but safer way
>     var dictionarysearchData = prefWindow.wsm.dataManager
> .pageData["chrome://dictionarysearch/content/pref/pref-dictionarysearch.xul"]
>                                          .dictionarysearchData;
>
>     var url = dictionarysearchData[0];
>     var label = dictionarysearchData[1];
>     var accesskey = dictionarysearchData[2];

Hmmm... how are you setting dictionarysearchData?
If your preferences are getting saved, why do you need an onOk anyway?



More information about the Project_owners mailing list