eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
163 stars 111 forks source link

Cannot Attach Ajax Behavior To Html5 Elements #2633

Closed ren-zhijun-oracle closed 11 years ago

ren-zhijun-oracle commented 11 years ago

HTML5 passthrough elements such as

are created as UIPanel components. This prevents a page author fromn attahcing Ajax behavior. For example, currently, this cannot be done:

FieldSet2

The component that must be created is HtmlPanelGrid.

Implementation note: Currently we have:

public final class PassThroughElementLibrary extends AbstractTagLibrary {

public final static String Namespace = "http://java.sun.com/jsf";

public final static PassThroughElementLibrary Instance = new PassThroughElementLibrary();

public PassThroughElementLibrary()

{ super(Namespace); this.addComponent("element", "javax.faces.Panel", "javax.faces.passthrough.Element", PassThroughElementComponentHandler.class); }

}

See spec issue: http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1151

Affected Versions

[2.2.0-m06]

ren-zhijun-oracle commented 6 years ago
ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented Reported by rogerk

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented @edburns said: We resolved in the Mojarra Engineering meeting to make a new concrete impl private component with

component-type: javax.faces.Panel with renderer-type: javax.faces.passthrough.Element

This new component must be a ClientBehaviorHolder.

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented @edburns said: RK> SECTION: Modified Files RK> ---------------------------- RK> M jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/PassThroughElementComponentHandler.java RK> ---- Override hook method createComponent to create an instance of the PassthroughElement

I think we have some code in com.sun.faces.Util that deals with ClassLoaders and you should be using that to create classes, or at least use the ClassLoader you get from that to pass to Class.forName(). In any case, I'm pretty sure just straight-up Class.forName() is not a good idea. Most of the other usages of Class.forName() in mojarra pass the ClassLoader argument.

RK> ---- component class. RK> M jsf-ri/src/main/java/com/sun/faces/renderkit/html_basic/PassthroughRenderer.java RK> ---- call RenderKitUtils.renderPassThruAttributes so that Ajax behavior markup is enabled. RK> M test/agnostic/renderKit/passthrough/src/main/webapp/fieldset.xhtml RK> M test/agnostic/renderKit/passthrough/src/main/webapp/label.xhtml RK> ---- Test pages

RK> A jsf-ri/src/main/java/com/sun/faces/component/PassthroughElement.java RK> ---- Component used for pass through elements. RK> A test/agnostic/renderKit/passthrough/src/test/java/com/sun/faces/test/agnostic/renderKit/passthrough/Issue2629IT.java RK> ---- Test case driver.

Otherwise looks good. r=edburns. I'm going to take the liberty to forward this changebundle to Frank Caputo who wrote most of the passthrough element feature so he has a chance to review it.

Ed

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented rogerk said: Committed to trunk:

Adding jsf-ri/src/main/java/com/sun/faces/component/PassthroughElement.java Sending jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/PassThroughElementComponentHandler.java Sending jsf-ri/src/main/java/com/sun/faces/renderkit/html_basic/PassthroughRenderer.java Sending test/agnostic/renderKit/passthrough/src/main/webapp/fieldset.xhtml Sending test/agnostic/renderKit/passthrough/src/main/webapp/label.xhtml Adding test/agnostic/renderKit/passthrough/src/test/java/com/sun/faces/test/agnostic/renderKit/passthrough/Issue2629IT.java Transmitting file data ...... Committed revision 11290.

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented rogerk said: Committed.

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented Parent-Task: JAVASERVERFACES-2512

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented Was assigned to rogerk

ren-zhijun-oracle commented 7 years ago

@javaserverfaces Commented This issue was imported from java.net JIRA JAVASERVERFACES-2629

ren-zhijun-oracle commented 11 years ago

@javaserverfaces Commented Marked as fixed on Thursday, December 20th 2012, 12:44:06 pm