I guess you could add this to the part of your page where the method is called again:
<apex:actionSupport event="onchange" action="{!UpdateWhatId}" reRender="inf_whatId,if_location">
<apex:param name="myFlag" value="true" assignTo="{!myBooleanValue}"/>
</apex:actionSupport>
Then in your class:
public boolean myBooleanValue {get;set;}
public void UpdateWhatId(){
If(myBooleanValue){
//do stuff when called from within page
}else{
//do stuff from action of vf pageload
}
myBooleanValue = false; //reset
}
Basically using the param tag you can set the value of a property in your class and tell if it came from where you wanted it or if the method was executed as part of the page load.
You could also have them call a different entry point:
add to class
public void fromPage(){
myBooleanValue = true;
updatewhatid();
}
Or on load you set the value of myBoolean to true when the method is executed and then you know it was ran. Subsequent calls to the method knows that it should enter the fromPage part instead of the on load part
public void UpdateWhatId(){
If(myBooleanValue){
//do stuff from action of vf pageload
}else{
//do stuff when called from within page
}
myBooleanValue = true; //Set to true to indicate it was ran the first time
}
It all depends on where this question goes after you have implemented the logic check