This is the MyViewController#createList method (it is a slightly changed Rolodex#createTabs method):
public void createList(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object displayElementRoot) { List beans = null; try { beans = ServiceLocatorBean.getInstance ().getBeanService().getAll(); } catch (BeanException e) { e.printStackTrace(); } ComponentBean root = (ComponentBean) displayElementRoot; root.setComponentType("javax.faces.HtmlPanelGroup"); root.addChild(createVerbatimMetadata("<ul id=\"menu\">", context)); for (int i = 0; i < beans.size(); i++) { Hetero item = (Hetero) beans.get(i); root.addChild(createVerbatimMetadata("<li id=\"", context)); root.addChild(createVerbatimMetadata("\">", context)); root.addChild(createCommandLinkMetadata(item, context)); root.addChild(createVerbatimMetadata("</li>", context)); } root.addChild(createVerbatimMetadata("</ul>", context)); } After this method executes, I have a list of commandLinks on the html page. The action attribute of each commandLink points to the same jsp-page (they all have .jsp extensions not .html) with optional parameters, like beanId. I can see the javascript attached to every commandLink which looks like this: ......... <a href="#" onclick="clear_linkDummyForm();document.forms['linkDummyForm'].elements['linkDummyForm:_link_hidden_'].value='tabs:_id4';document.forms['linkDummyForm'].elements['id'].value='5878';if(document.forms['linkDummyForm'].onsubmit){var result=document.forms['linkDummyForm'].onsubmit(); if( (typeof result == 'undefined') || result ) {document.forms['linkDummyForm'].submit();}}else{document.forms['linkDummyForm'].submit();}return false;" id="tabs:_id4">Project AAA</a> </body> <form id="linkDummyForm" name="linkDummyForm" style="display:inline" method="post" action="/theatre/newindex.jsf"> <input type="hidden" name="jsf_sequence" value="4" /> <input type="hidden" name="linkDummyForm:_link_hidden_" /> <input type="hidden" name="id" /> <script type="text/javascript"> <!-- function clear_linkDummyForm() { var f = document.forms['linkDummyForm']; f.elements['linkDummyForm:_link_hidden_'].value=''; f.elements['id'].value=''; f.target=''; } clear_linkDummyForm(); //--> </script></form> </html> When I talk about pure jsf context, I mean the commandLinks produced by jsf jsp tags in the jsp page. They all have the same attributes (action etc), and they all work (submit to the page in "action" attribute, which then renders perfectly). When I click on the link produced by clay - I get the raw createProject.jsp text in the source code of the rendered html page. Thanks for looking into this. Z On 1/25/06, Gary VanMatre <[EMAIL PROTECTED]> wrote: > > >From: xzuma <[EMAIL PROTECTED]> > > > > Thanks for quick reply, Gary. I should have been more verbose, however, > I > > thought this behaviour (printing raw jsp instead of html) was a very > simple > > simptom of a simple problem. > > Well, does you jsp file name end with a .jsp suffix or .html suffix? > > > I am putting a clay component into a working JSF application (I need to > be > > able to assemble a page dynamically from several components instead of > > including jsp's and such). This is the snippet of this jsp page > > ...... > > <%@ include file="createProject.jsp"%> > > ...... > > <clay:clay id="tabs" jsfid="RUNTIME" shapeValidator="#{ > myViewController.createList}" managedBeanName="myViewController"/> > > ...... > > > > > > In createList method I am populating an HtmlPanelGroup with the > commandLink > > children. Every commandLink in this page has an action attribute > pointing to > > this very jsp page and a number of parameters identifying a bean (from > the > > list) I need to display instead of the list. That bean display, btw, is > > handled by the included page createProject.jsp. So I have no navigation, > the > > beans I need to display have been properly instantiated when accessed in > a a > > pure jsf context (using jsf commandLink elements with the same > parameters), > > so I assume that all of the mappings in web.xml etc are OK. > > > > Well, the commandLink component will require navigation rules in the > face-config.xml. The commandLink invokes a form post using > javascript. The > outputLink is like your standard html anchored link. > > The clay shapeValidator property is a validator style of method bind. The > objects > returned are not JSF components but beans used to create JSF > components. I'm > not sure I follow the part about commandLink elements instantiated in a > jsf context. > > Could you provide a sample of the createList method. > > > Thanks. > > > > Z. > > Gary > > > > > On 1/25/06, Gary VanMatre wrote: > > > > > > >From: xzuma > > > > > > > > Hello, > > > > > > > > I just started implementing my shale-clay application (looking at > > > rolodex > > > > example) and upon creating a command link in my view controller, > > > > > > Do you mean that you have an action method in the view controller? Or, > > > are you binding a JSF control to an instance in your view controller? > If > > > you are using action binding, your clay html template might look like > > > options 1 or 2: > > > > > > 1) Next Page > > > 2) Next Page > > > > > > There are eleven implicitly mapped HTML elements to JSF components. > The > > > first option show an implied binding of a submit button with a jsf > command > > > link. > > > > > > The action in your view controller might look like this: > > > public String next() { > > > return "next"; > > > } > > > > > > >I can see > > > > the link on the html page, but when I click it, the next page is > blank > > > and > > > > the source code shows only the jsp code of one of the subviews of > the > > > target > > > > jsp page. > > > > > > It sounds like your navigation rules are correct in your > faces-config.xml. > > > Are you sure you are seeing html from the target page? Can you access > > > the target page directly from the browser /examples/targetpage.faces? > > > > > > What are the mappings for the faces servlet in the web.xml? > > > > > > >I am not familiar with the phases in shale that much, so I think > > > > it is a very simple issue, which will require only a moment of > > > > somebody-more-experienced-than-I's attention. > > > > > > Shale doesn't add any phases to the standard JSF lifecycle. It adds > > > callback > > > events extending the standard lifecycle that are fired on the > > > ViewController > > > associated with the page. > > > > > > Are you familiar with JavaServer Faces? Shale is built on top of JSF. > > > Knowing about vanilla JSF will help understand Shale. > > > > > > > > > > > > > > Thanks. > > > > > > > > Zuma > > > > > > > > > > Gary > > > > > >