Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2479

custom behavior makes form not to be submitted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0-alpha
    • 2.0.0
    • JSR-314
    • None

    Description

      Attaching a simple behavior to a h:commandbutton makes the form to no longer submit it.

      Java:

      package net.wessendorf;

      import javax.faces.component.behavior.ClientBehaviorBase;
      import javax.faces.component.behavior.ClientBehaviorContext;
      import javax.faces.component.behavior.FacesBehavior;

      @FacesBehavior("net.wessendorf.Confirm")
      public class ConfirmBehavior extends ClientBehaviorBase
      {

      @Override
      public String getScript(ClientBehaviorContext behaviorContext)

      { return "return confirm('Really')"; }

      }

      taglib.xml:
      <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
      version="2.0">

      <namespace>http://wessendorf.net/behavior</namespace>
      <tag>
      <tag-name>confirm</tag-name>
      <behavior>
      <behavior-id>net.wessendorf.Confirm</behavior-id>
      </behavior>
      </tag>
      </facelet-taglib>

      XHTML file:
      <h:commandButton value="click me">
      <wessi:confirm />
      </h:commandButton>

      Attachments

        Issue Links

          Activity

            People

              lu4242 Leonardo Uribe
              matzew Matthias Wessendorf
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: