0

i have another strange JSF problem here... I don´t really know why, but what ever i try to do, i have one out of two problems. Either the action method inside my popupPanel is not (means never) called or it is called, but the value from my selectBox is (always) null. Can´t figure out, what the problem is, but it seems to me, like it´s a XHTML property problem.

Already tried to put the popupPanel outside my h:form (helped me at some other locations...), i also tried to put it outside and put another form into my popup. Beyond that i was trying to change the attachment to parent/form and i changed the execute of the commandButton inside my popup to form/form-id/popuppanel-id and i guess there were some more things i did... but nothing helped. The Bean is session scoped and i am using Richface 4.0 Final if it does matter at all.

What ever, the XHTML looks like this:

    <rich:popupPanel
  header="#{label['edit.title']} #{mandateAction.ccService.mandateList[mandateAction.currentIndex].id}"
  id="addExternalSystem"
  onmaskclick="#{rich:component('addExternalSystem')}.hide()"
  domElementAttachment="form" autosized="true" layout="block">
    <h:panelGrid columns="2">
      <h:outputText value="#{label['login.username']}" />
      <h:inputText
        value="#{mandateAction.newExternalSystem.username}" />

      <h:outputText value="#{label['login.password']}" />
      <h:inputSecret
        value="#{mandateAction.newExternalSystem.password}" />

      <h:outputText value="#{label['mandate.externalSystem']}" />
      <h:selectOneMenu
        value="#{mandateAction.newExternalSystem.externalSystem}">
        <f:selectItems
          value="#{creditcardConfigurationService.externalSystems}"
          itemLabel="#{system.name}" itemValue="#{system}"
          var="system" />
        <f:converter binding="#{externalSystemConverter}" />
      </h:selectOneMenu>
      ....
                <a4j:commandButton value="#{label['insert.save']}"
        action="#{mandateAction.insertNewSystem}"
        render="mandate_table" execute="@form"
        oncomplete="if (#{facesContext.maximumSeverity==null}) {#{rich:component('addExternalSystem')}.hide();}" />
user1502353
  • 99
  • 1
  • 10
  • So it's random when the action is called and when the value is submitted? Is it possible that there are some validation or converter errors? – user1983983 Jul 22 '13 at 09:30
  • there are no validation/converter errors. And no, it´s not really random. For example, if i put the popup into my h:form tag, then the action is called, but the selectbox-value is null. If i put it outside, then the action is not called, but the value is correct. and so on – user1502353 Jul 22 '13 at 09:33
  • It's most likely a cross of two things, one of which you've Identified: Your popup panel must contain (or be contained in) a ``. The second suspect is your bean scope. What scope is `mandateAction`? – kolossus Jul 22 '13 at 22:16
  • The popupPanel is contained in a tag or at least it was one of my test cases. The bean scope is defined as @SessionScoped – user1502353 Jul 23 '13 at 06:10

1 Answers1

0

If your page have any of the required fields kept as empty the submit from the popup panel will not work. In that case include the popup panel inside a form and domElementAttachment="form" , and perform the submit.

sk85
  • 407
  • 4
  • 17
  • There are no empty fields at all :) I tried with putting the PopupPanel back into the tag and changing the domElementAttachment back to form. I am sure, that i already tried that, so it wasn´t working. But then i realized, that i could change the execute value from my to the PopupPanel-ID.... and then it finally worked, as it should. – user1502353 Jul 23 '13 at 06:25