[Project_owners] Preferences in Mozilla

Jaap A. Haitsma jaap at haitsma.org
Mon Dec 29 23:12:28 EST 2003


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];


     dump(url);
     dump(label);
     dump(accesskey);
}



>> 2. Why do the normal callbacks (ondialogaccept etc.) not work??
> 
> 
> Because you're a page, not a dialog...
Silly me!!

Jaap


More information about the Project_owners mailing list