2 Replies Latest reply on Apr 9, 2009 6:36 AM by Arbi Sookazian

    combobox + inputTextBox rerendering problem

    martin vich Newbie

      I would like to have inputTextArea with content which will be according to choosen item in combobox. My problem is that selectedText is not setted from combobox, so thre is nothing in inputTextArea :(

      TextLoader bean :

      public class TextLoader implements TextLoaderLocalIF, Serializable {
        private List<Text> texts = new ArrayList<Text>(0);
        private Text selectedText = new Text(); //do not want null pointer exception
      and getters/setters

      Text entity :

      public class Text {
      String name;
      String content;

      Form :

      <h:form id="textForm">
      <h:selectOneMenu value="#{textLoader.selectedText}">
        <s:selectItems value="#{texts}" var="selected" label="#{selected.name}" />
        <a:support event="onchange" reRender="textForm"/>
      <h:inputTextarea rows="10" cols="50" id="textContent" value="#{textLoader.selectedText.content}" />
      <a:commandButton action="#{textLoader.modify(textLoader.selectedText)}" value="Save text"/>