simplified code, for save. The save as is same as a save at the gui
level, but different at the buttoncomponent level.