I connected the cables for the solar charger directly to battery 2. So battery 2 always charges when the solar panel is connected regardless of what position the switch is in. I however always keep my switch on both/dual so the batteries are connected and both maintain their charge. I also did it this way so when i'm out on the water just using the radio and accessories and draining battery 2 i could keep the solar charger connected and keep the battery juiced up a bit longer.
If you had more concerns for battery 1, then alternative you could connect the solar charger directly to battery 1. But I preferred keeping battery 2 maintained since you tend to use that one when the boat engine isn't running and charging batteries on it's own.
If I recall right I originally tried connecting the positive cable from the solar charger to the positive "common" bolt on my switch. In hopes I could pick what I charged based on the position of the switch. I either ended up not doing this because it didn't charge or maybe the connector wouldn't fit over the bolt.
Next time it's nice out I'm going to attempt to move the positive connector from the solar charger to the battery switch common to see why I didn't do it that way to begin with. Can't recall exactly why since it's been 3 years.
Another thing to keep in mind this seems to work for me for the last 3 years using a solar powered trickle charger that only maintains your battery power. I've read several articles that state if you are using a battery charger you need to charge 1 battery at a time or you need to have one of those dual battery charger systems that can accurately charge both batteries to their full capacity without overcharging which could cause the battery to leak, expand, catch fire, explode, etc. I couldn't find any articles on if this warning about using a battery charger vs a trickle charger made any difference. But I've been doing this for 3 years and haven't had an issue.