Hi,

I created a selectOneMenu with an valueChangeListener. After choosing another value in the menu a Method is called which links to website. It all works fine, but then I added another selectOneMenu
with another valueChangeListener method.
If I choose a value in one of the menus both valueChangeListener methods will be called
and I don't know why?!


xhtml:
-------------------------------------------------------------------------------------------------------------------
           <h:selectOneMenu id="itemPosPicr"
                            rendered="#{currentData.renderedPicrPos}"
                            onchange="submit()"
valueChangeListener="#{statisticsPageData.processValueChangePicrPosResult}">
               <f:selectItems value="#{currentData.itemPosPicr}"/>
           </h:selectOneMenu>

           <br></br>

           <h:outputText value="Proteins could not mapped to UniProt:"/>
           <h:selectOneMenu id="itemNegPicr"
                            rendered="#{currentData.renderedPicrNeg}">
                <f:selectItems value="#{currentData.itemNegPicr}"/>
           </h:selectOneMenu>



           <h:outputText value="Proteins identified in Pride:"/>
           <h:selectOneMenu id="itemPosPride"
                            rendered="#{currentData.renderedPridePos}"
                            onchange="submit()"
valueChangeListener="#{statisticsPageData.processValueChangePridePosResult}">
               <f:selectItems value="#{currentData.itemPosPride}"/>
           </h:selectOneMenu>

           <br></br>

           <h:outputText value="Proteins not identified in Pride:"/>
           <h:selectOneMenu id="itemNegPride"
                            rendered="#{currentData.renderedPrideNeg}">
                <f:selectItems value="#{currentData.itemNegPride}"/>
           </h:selectOneMenu>



Bean:
---------------------------------------------------------------------------------------------------
public void processValueChangePicrPosResult(ValueChangeEvent value) throws AbortProcessingException, IOException {

       String selectedValue = (String) value.getNewValue();
String uniProt_Url = "http://beta.uniprot.org/uniprot/?query=key:"; + selectedValue; FacesContext.getCurrentInstance().getExternalContext().redirect(uniProt_Url);
}

public void processValueChangePridePosResult(ValueChangeEvent value) throws AbortProcessingException, IOException {

       String selectedValue = (String) value.getNewValue();
String uniProt_Url = "http://beta.uniprot.org/uniprot/?query=key:"; + selectedValue; FacesContext.getCurrentInstance().getExternalContext().redirect(uniProt_Url);
 }


Any hints or suggestions?

Cheers!

Reply via email to