Hi again,
the problem is that recalculation of the values are not running correctly: The values of the repeat control are calculated two times during the refresh ( in JSF Phase 1 and 6 ), and the values from the computed field are only recalculated once in JSF phase 6. The SSJS variable is not available during Phase 1, that's why it fails.
You can use dataContext-Variables to fix this:
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:panel id="panel1">
<xp:this.dataContexts>
<xp:dataContext var="data">
<xp:this.value><![CDATA[#{javascript:txt = "myJSONCategories = [{'category' : 'a'},{'category' : 'b'},{'category' : 'c'}]";
var myJSONcategories = eval(txt);
return myJSONcategories;}]]></xp:this.value>
</xp:dataContext>
</xp:this.dataContexts>
<xp:br></xp:br>
<xp:repeat id="repeat1" rows="30" var="category"
value="#{javascript: return data;}">
<xp:link escape="true" text="#{category.category}"
id="link1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="panel1">
<xp:this.action><![CDATA[#{javascript:viewScope.selectedPeriod = "";}]]></xp:this.action>
</xp:eventHandler>
</xp:link>
<xp:br></xp:br>
</xp:repeat>
</xp:panel>
</xp:view>
Sven