[jboss-user] [JBoss Seam] - accessing facelet's source tag attributes

amashtakov do-not-reply at jboss.com
Tue Sep 25 05:14:41 EDT 2007


Hi,

After reading a bit about facelets source tags I decided to develop
a small component to display prod. catalog:

This is a facelet taglib snippet:

	
		<tag-name>pc</tag-name>
		../test/page2.xhtml
	

This is a snippet from page2.xhtml:

<ui:component binding="#{pcBrowseTree.me}"
      xmlns="http://www.w3.org/1999/xhtml">

	
		<h2>#{title}</h2>
		
                 ...
		
	
</ui:component>


And this is a tag usage snippet:

        <t:pc name="Browse for products" parent_id="14" />


I'm trying to access parent_id property from pcBrowseTree bean, but with 
no success:

	FacesContext fctx = FacesContext.getCurrentInstance();
	Application app = fctx.getApplication();
	VariableResolver vr = app.getVariableResolver();
	log.debug(" - getVariableResolver(): " + vr);
	log.debug(" - variable resolved to: " + vr.resolveVariable(fctx, "parent_id"));

The last line outputs null. In case if I replace "parent_id" to 
"facesContext" the variable is resolved.

Is any way to access source tag's attributes from Java bean ?

Thank you in advance,
/Alexander





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088307#4088307

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088307



More information about the jboss-user mailing list