RE: Exception meaning

2006-09-22 Thread David Friedman
Did you forget to put your h:dataTable inside and f:view and/or h:form tags?
It looks like topic.jsp line 93 is about the start of the problem, at least
if I read the Stacktrace below it is the area to check.

Regards,
David

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 22, 2006 6:26 PM
To: users@myfaces.apache.org
Subject: Exception meaning



Hello

Waht is the meaning of the exception?

23:20:03,937 ERROR [[Faces Servlet]] Servlet.service() for servlet
Faces Servlet threw exception
javax.faces.FacesException: Component _idJsp6:0:_idJsp8 must be
embedded in an form
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.
dispatch(ServletExternalContextImpl.java:435)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
(JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.
java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke
(CustomPrincipalValve.java:54)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke
(SecurityAssociationValve.java:174)
at org.jboss.web.tomcat.security.JaccContextValve.invoke
(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:868)
at org.apache.coyote.http11.
Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException: Component _idJsp6:0:
_idJsp8 must be embedded in an form
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlLinkRendererBase.renderJavaScriptAnchorStart(HtmlLinkRendererBase.
java:209)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlLinkRendererBase.renderCommandLinkStart(HtmlLinkRendererBase.java:
175)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlLinkRendererBase.encodeBegin(HtmlLinkRendererBase.java:93)
at javax.faces.component.UIComponentBase.encodeBegin
(UIComponentBase.java:512)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
renderChild(RendererUtils.java:433)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
renderChildren(RendererUtils.java:419)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
renderChild(RendererUtils.java:440)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.renderColumnBody(HtmlTableRendererBase.java:
212)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.encodeColumnChild(HtmlTableRendererBase.java:
181)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:
167)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:100)
at javax.faces.component.UIComponentBase.encodeChildren
(UIComponentBase.java:524)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.
java:480)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:
361)
at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.
doEndTag(UIComponentBodyTagBase.java:54)
at org.apache.jsp.topic_jsp._jspx_meth_h_dataTable_0(org.apache.
jsp.topic_jsp:233)
at org.apache.jsp.topic_jsp._jspx_meth_f_view_0(org.apache.jsp.
topic_jsp:151)
at org.apache.jsp.topic_jsp._jspService(org.apache.jsp.topic_jsp:
93)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:
97)
at javax.servlet.ht

Exception meaning

2006-09-22 Thread [EMAIL PROTECTED]

Hello

Waht is the meaning of the exception?

23:20:03,937 ERROR [[Faces Servlet]] Servlet.service() for servlet 
Faces Servlet threw exception
javax.faces.FacesException: Component _idJsp6:0:_idJsp8 must be 
embedded in an form
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.
dispatch(ServletExternalContextImpl.java:435)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
(JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.
java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke
(CustomPrincipalValve.java:54)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke
(SecurityAssociationValve.java:174)
at org.jboss.web.tomcat.security.JaccContextValve.invoke
(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:868)
at org.apache.coyote.http11.
Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException: Component _idJsp6:0:
_idJsp8 must be embedded in an form
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlLinkRendererBase.renderJavaScriptAnchorStart(HtmlLinkRendererBase.
java:209)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlLinkRendererBase.renderCommandLinkStart(HtmlLinkRendererBase.java:
175)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlLinkRendererBase.encodeBegin(HtmlLinkRendererBase.java:93)
at javax.faces.component.UIComponentBase.encodeBegin
(UIComponentBase.java:512)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
renderChild(RendererUtils.java:433)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
renderChildren(RendererUtils.java:419)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.
renderChild(RendererUtils.java:440)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.renderColumnBody(HtmlTableRendererBase.java:
212)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.encodeColumnChild(HtmlTableRendererBase.java:
181)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:
167)
at org.apache.myfaces.shared_impl.renderkit.html.
HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:100)
at javax.faces.component.UIComponentBase.encodeChildren
(UIComponentBase.java:524)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.
java:480)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:
361)
at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.
doEndTag(UIComponentBodyTagBase.java:54)
at org.apache.jsp.topic_jsp._jspx_meth_h_dataTable_0(org.apache.
jsp.topic_jsp:233)
at org.apache.jsp.topic_jsp._jspx_meth_f_view_0(org.apache.jsp.
topic_jsp:151)
at org.apache.jsp.topic_jsp._jspService(org.apache.jsp.topic_jsp:
93)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:
97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.
java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:
264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catali

Re: Crystal renderer-type unsupported?

2006-09-22 Thread Jeff Bischoff
I finally found some time to take another look at this, and I figured 
out the problem in about 30 seconds. :P


Seems the Crystal component needs to be inside both an f:view tag and an 
h:form tag. Those had been accidentally omitted because this was a 
conversion from the Cyrstal pure-JSP viewer, which requires there to be 
nothing else on the page.


Unfortunately, I have immediately run into another problem with this 
component, regarding serialization. (Message thread "Omit component from 
serializeView()?")


In any case, Mike your comment did help a bit. It pointed me in the 
direction of looking for a configuration screwup, rather than thinking 
about incompatibilities. Thanks.


Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Mike Kienenberger wrote:

No, I'd say that it means that you've got it misconfigured somehow.

It's either missing a faces-config.xml entry or a view handler entry
or something.


On 9/14/06, Jeff Bischoff <[EMAIL PROTECTED]> wrote:

Can someone please confirm the meaning of this error message for me.
Does this mean that the Crystal Reports JSF componenets are incompatible
with the MyFaces renderer?

-
WARN  [HtmlRenderKitImpl] Unsupported component-family/renderer-type:
javax.faces.ViewRoot/CrystalReports.ViewerHtmlRenderer
-


I get that error when trying to view a page with the Crystal Reports
viewer tag. A blank page is displayed. There are several other similar
lines in the log, except they say "No Renderer found for component"...

My Page:

<%@ taglib
uri="http://www.businessobjects.com/jsf/crystalreportsviewers";
prefix="bocrv"%>




Thanks for any response!

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.












Omit component from serializeView()?

2006-09-22 Thread Jeff Bischoff
I have a 3rd-party JSF component on one of my pages. When the page is 
redisplayed, JSF tries to serialze the view. But, it throws an exception 
because the component has a class that prevents it from being 
serialized. Can I tell JSF not to serialize this component?


I am using server-side state saving.

The exception is like this:

2006-09-22 16:57:45,849 ERROR 
[org.apache.myfaces.application.jsp.JspStateManagerImpl] Exiting 
deserializeView - Could not deserialize state: 
com.crystaldecisions.reports.reportengineinterface.JPEReportSource; no 
valid constructor
java.io.InvalidClassException: 
com.crystaldecisions.reports.reportengineinterface.JPEReportSource; no 
valid constructor


Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.




Re: Re-render JSF page components

2006-09-22 Thread Jeff Bischoff

Kiran,

> Can the viewRoot be forced to be completely re-created

Wiki page [1] covers ways to force updated model values in input 
components. The first solution on that page involves forcing a new view 
root. It works well for forcing input components to refresh - maybe it 
can help with your problem too.


If this does help you, consider adding a note to the wiki that "this 
also is useful for..."


[1] http://wiki.apache.org/myfaces/ClearInputComponents

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

K. Johnson wrote:


My navigation bean is session scoped already? 
I'd like to somehow force the page to rebuild when it is refreshed? Can this be done? 
Can the viewRoot be forced to be completely re-created, so that the components will 'hide' on page refresh, if they have previously been displayed, and vice-versa? 


It seems like once the component is rendered it stays cached when I refresh the 
page



 ---Original Message---
 From: Mike Kienenberger <[EMAIL PROTECTED]>
 Subject: Re: Re-render JSF page components
 Sent: 22 Sep '06 05:28
 
 Navigation must be more than request-scoped for rendered to work.

 A quick test is to make that bean session-scoped.   Generally, a
 better fix is to use t:saveState
 value="#{navigation.tabNavigationAllowed}"
 I don't think the c tags will work since they only execute once on page build.
 
 
 On 9/21/06, K. Johnson <[EMAIL PROTECTED]> wrote:

 >
 > We are using facelets. i have have tried it a couple different ways, but 
here is a snippet with Jstl c:if and below it a snippet with rendered. When the 
page is first rendered the navbars display or hide correctly. When I come back to  
the page, even if the bean value is changed the components don't update:
 >
 >   
 >
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 >
 > 
 >
 >
 > 
 >
 >
 >  
 > 
 > 
 >
 >
 >
 > Thanks!
 >
 > >  ---Original Message---
 > >  From: Gert Vanthienen <[EMAIL PROTECTED]>
 > >  Subject: Re: Re-render JSF page components
 > >  Sent: 21 Sep '06 18:58
 > >
 > >  L.S.,
 > >
 > >  I have never encountered any problems when using the rendered attribute
 > >  for implementing this kind of behavior.Could you post a snippet of the
 > >  JSP page code you're using?
 > >
 > >  Regards,
 > >
 > >  Gert Vanthienen
 > >  [EMAIL PROTECTED]
 > >
 > >
 > >
 > >  K. Johnson wrote:
 > >  > I have some components on my JSF page that need to display or hide 
based on a bean boolean property.
 > >  >
 > >  > I have tried using the rendered attribute as well as jstlc:if and 
c:choose. My page displays properly the first time based on the condition, but if i go 
through a JSF lifecycle and return to the same page, even though the bean boolean value 
has changed, and displays correctly as a string, the previously rendered or hidden 
components don't update?
 > >  >
 > >  > Is there a trick to get this to work?
 > >  >
 > >  >
 > >  > Thank you!
 > >  >
 > >  >
 > >  >
 > >  >
 > >  >>---Original Message---
 > >  >>From: [EMAIL PROTECTED]
 > >  >>Subject: RE: Refresh JSF Page
 > >  >>Sent: 21 Sep '06 13:35
 > >  >>
 > >  >>
 > >  >>Thanks Jeff,
 > >  >>
 > >  >>I will try the option suggested by you.
 > >  >>Here are some more details about my requirement.
 > >  >>Every page of my application has header. Header contains Refresh button.
 > >  >>Selecting it, the page should fetch the data from back end.
 > >  >>
 > >  >>I foresee some problems with Refresh in JSF with the limited knowledge I
 > >  >>have in JSF.
 > >  >>- The page would have been displayed because of some actionlistener with
 > >  >>parameters.
 > >  >>Getting the parameters again (firing of that actionlistener) may not be
 > >  >>possible.
 > >  >>- the Browser URL may be that of previous page (Using 'redirect' in
 > >  >>faces-config may solve this. But I'm not sure about the implications of
 > >  >>it)
 > >  >>
 > >  >>I hope the trick would work for me.
 > >  >>
 > >  >>Regards,
 > >  >>Kiran
 > >  >>
 > >  >>-Original Message-
 > >  >>From: Jeff Bischoff [mailto:[EMAIL PROTECTED]
 > >  >>Sent: Thursday, September 21, 2006 12:07 AM
 > >  >>To: MyFaces Discussion
 > >  >>Subject: Re: Refresh JSF Page
 > >  >>
 > >  >>
 > >  >>Kiran,
 > >  >>
 > >  >>That's a pretty broad topic! If you could be more specific, you might
 > >  >>get more hints...
 > >  >>
 > >  >>See [1] for a neat trick to force updated model values in input
 > >  >>components.
 > >  >>
 > >  >>[1] http://wiki.apache.org/myfaces/ClearInputComponents
 > >  >>
 > >  >>Regards,
 > >  >>
 > >  >>Jeff Bischoff
 > >  >>Kenneth L Kurz & Associates, Inc.
 > >  >>
 > >  >>[EMAIL PROTECTED] wrote:
 > >  >>> Hi,
 > >  >>>
 > >  >>> I have to provi

Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

One last note, I said to custom render the UICommand, but that is not
needed, just set ting the onclick attribute is probably all that is
needed

On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:

I will give it a try later.
thanks,
Bill

 "Andrew Robinson"
   To
   "MyFaces Discussion"
 09/22/2006 12:40  
 PM cc

   Subject
 Please respond to Re: ajax4jsf + tree2?
 "MyFaces
Discussion"
 <[EMAIL PROTECTED]
 ache.org>






Another thought:

I kept looking at the API for A4J, and found a server side API that
will work for including the zones to refresh:

AjaxRendererUtils.addRegionsFromComponent(javax.faces.component.UIComponent
component, javax.faces.context.FacesContext context)

No the only thing you would need to do is cause A4J to post back via
AJAX when the UICommand object is clicked instead of using a stanard
post.

This looks doable via the method:
AjaxRendererUtils.buildOnClick(javax.faces.component.UIComponent
uiComponent, javax.faces.context.FacesContext facesContext)

So this new approach would be:

1) extend UITreeData
2) override getExpandControl() and return a custom UICommand that
renders itself. In that rendering, call the "buildOnClick" method
above to cause A4J to handle the post.
3) create an attribute on the extend UITreeData class called "reRender".
4) override toggleExpanded() and in that method, after calling the
super method, call "addRegionsFromComponent", passing "this" (without
the quotes of course) as the component.

Since I don't have A4J running, I can't test this, but I don't see why
it wouldn't work.

-Andrew


On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> These are good suggestion/ideas.  I've also had put some thoughts about
> similar approach before.  I've tried extending UITreeData, TreeNodeBase,
> etc.. encountered some unexpected behavior.  But ultimately, I pullback
on
> it.  Just want something simple and that wont requiring additional code.
I
> will definitely take a look at some of your suggestions and make it
better.
>
> -Bill
>
>
>  "Andrew Robinson"
>[EMAIL PROTECTED]>
To
>"MyFaces Discussion"
>  09/22/2006 12:04  
>  PM
cc
>
>
Subject
>  Please respond to Re: ajax4jsf + tree2?
>  "MyFaces
> Discussion"
>  <[EMAIL PROTECTED]
>  ache.org>
>
>
>
>
>
>
> That solution may not work. I just downloaded the last A4J release and
> UIAjaxCommandLink is not a UICommand:
>
> java.lang.Object
>   extended by javax.faces.component.UIComponent
>   extended by javax.faces.component.UIComponentBase
>   extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
>   extended by org.ajax4jsf.ajax.UIAjaxCommandLink
>
> That means that it would not be compatible with that API. However,
> with a little messy use of the decorator pattern, you could create a
> UICommand component that delegates all methods to an internal
> UIAjaxCommandLink class instance. This way the link that would be
> rendered to the HTML would be the AJAX one instead of the standard
> one. It wouldn't be the prettiest code, but it should function quite
> well. Since the command link would be the A4J one, you wouldn't have
> to do any more work. So the process would be:
>
> 1) extend UITreeData
> 2) override getExpandControl()
> 3) Create a decorator of UICommand that houses UIAjaxCommandLink
> 4) delegate all methods of the UICommand to the UIAjaxCommandLink for
> those methods that are requried (you may not have to decorate them
> all).
> 5) Register your new UITreeData in the faces config, and register the
> component in taglib.xml for facelets or create a TLD and tag file for
> JSP
>
> This should work assuming the decoration of UICommand to wrap a
> UIAjaxCommandLink doesn't present any unforseen issues.
>
> -Andrew
>
>
> On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > The way that AjaxAnywhere works is that it builds a Set of
> > "zones" during the processing of a request. JavaScript can start that
> > Set and then there is an API on the server
> > (AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
> > can use.
> >
> > So in my approach, I let aa.js submit normally (no zones on the
> > client), then I extend UITreeData & overload the toggleExpanded
> > function. In that function, I check the "ajaxZone" attribute of my
> > extended tree component and use that addZonesToRefresh method to make
> > my tree re-rendered
> >
> > If you look in the HtmlTreeRenderer class, you will see the following
> > in the server-side rendering:

where can I find the source of these two css files?

2006-09-22 Thread Thomas_Perry





I've seen these used for styleClasses but haven't found their source:  "
formLabels" and "formInputs"

Can anyone point me to them (sun? myfaces?)

Thanks in advance for your help
Tom



 
This message is intended for the recipient only and is not meant to be 
forwarded or distributed in any other format. This communication is for 
informational purposes only.  It is not intended as an offer or solicitation 
for the purchase or sale of any financial instrument, or security, or as an 
official confirmation of any transaction.  Putnam does not accept purchase or 
redemptions of securities, instructions, or authorizations that are sent via 
e-mail.   All market prices, data and other information are not warranted as to 
completeness or accuracy and are subject to change without notice.  Any 
comments or statements made herein do not necessarily reflect those of Putnam, 
LLC (DBA Putnam Investments) and its subsidiaries and affiliates.  If you are 
not the intended recipient of this e-mail, please delete the e-mail.


Re: ajax4jsf + tree2?

2006-09-22 Thread William Huang
I will give it a try later.
thanks,
Bill
   
 "Andrew Robinson" 
   To 
   "MyFaces Discussion"
 09/22/2006 12:40
 PM cc 
   
   Subject 
 Please respond to Re: ajax4jsf + tree2?   
 "MyFaces  
Discussion"
 <[EMAIL PROTECTED] 
 ache.org> 
   
   




Another thought:

I kept looking at the API for A4J, and found a server side API that
will work for including the zones to refresh:

AjaxRendererUtils.addRegionsFromComponent(javax.faces.component.UIComponent
component, javax.faces.context.FacesContext context)

No the only thing you would need to do is cause A4J to post back via
AJAX when the UICommand object is clicked instead of using a stanard
post.

This looks doable via the method:
AjaxRendererUtils.buildOnClick(javax.faces.component.UIComponent
uiComponent, javax.faces.context.FacesContext facesContext)

So this new approach would be:

1) extend UITreeData
2) override getExpandControl() and return a custom UICommand that
renders itself. In that rendering, call the "buildOnClick" method
above to cause A4J to handle the post.
3) create an attribute on the extend UITreeData class called "reRender".
4) override toggleExpanded() and in that method, after calling the
super method, call "addRegionsFromComponent", passing "this" (without
the quotes of course) as the component.

Since I don't have A4J running, I can't test this, but I don't see why
it wouldn't work.

-Andrew


On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> These are good suggestion/ideas.  I've also had put some thoughts about
> similar approach before.  I've tried extending UITreeData, TreeNodeBase,
> etc.. encountered some unexpected behavior.  But ultimately, I pullback
on
> it.  Just want something simple and that wont requiring additional code.
I
> will definitely take a look at some of your suggestions and make it
better.
>
> -Bill
>
>
>  "Andrew Robinson"
>[EMAIL PROTECTED]>
To
>"MyFaces Discussion"
>  09/22/2006 12:04  
>  PM
cc
>
>
Subject
>  Please respond to Re: ajax4jsf + tree2?
>  "MyFaces
> Discussion"
>  <[EMAIL PROTECTED]
>  ache.org>
>
>
>
>
>
>
> That solution may not work. I just downloaded the last A4J release and
> UIAjaxCommandLink is not a UICommand:
>
> java.lang.Object
>   extended by javax.faces.component.UIComponent
>   extended by javax.faces.component.UIComponentBase
>   extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
>   extended by org.ajax4jsf.ajax.UIAjaxCommandLink
>
> That means that it would not be compatible with that API. However,
> with a little messy use of the decorator pattern, you could create a
> UICommand component that delegates all methods to an internal
> UIAjaxCommandLink class instance. This way the link that would be
> rendered to the HTML would be the AJAX one instead of the standard
> one. It wouldn't be the prettiest code, but it should function quite
> well. Since the command link would be the A4J one, you wouldn't have
> to do any more work. So the process would be:
>
> 1) extend UITreeData
> 2) override getExpandControl()
> 3) Create a decorator of UICommand that houses UIAjaxCommandLink
> 4) delegate all methods of the UICommand to the UIAjaxCommandLink for
> those methods that are requried (you may not have to decorate them
> all).
> 5) Register your new UITreeData in the faces config, and register the
> component in taglib.xml for facelets or create a TLD and tag file for
> JSP
>
> This should work assuming the decoration of UICommand to wrap a
> UIAjaxCommandLink doesn't present any unforseen issues.
>
> -Andrew
>
>
> On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > The way that AjaxAnywhere works is that it builds a Set of
> > "zones" during the processing of a request. JavaScript can start that
> > Set and then there is an API on the server
> > (AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
> > can use.
> >
> > So in my approach, I let aa.js su

Re: Tomahawk 1.1.3 inputFileUpload solution

2006-09-22 Thread Wendy Smoak

On 9/22/06, JBuilderDoug <[EMAIL PROTECTED]> wrote:


I finally figured this out, so  I'm going to put an entire example in this
post.


If you have time, can you put your example on the wiki?

There is a page already (and I added a link to this thread):
  http://wiki.apache.org/myfaces/File_Upload

Thanks,
--
Wendy


sorting with t:saveState and t:dataTable

2006-09-22 Thread Appel, Jeremy
All,
I have been unable to get sorting to work when using t:saveState
and t:dataTable.  I am saving the entire backing bean(which contains the
ListDataModel that I am sorting on) via t:saveState.  I have looked
through the wikis and it looks like there is nothing to it.  Are there
any tricks that I am missing?

TIA,
Jeremy


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.


Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

Another thought:

I kept looking at the API for A4J, and found a server side API that
will work for including the zones to refresh:

AjaxRendererUtils.addRegionsFromComponent(javax.faces.component.UIComponent
component, javax.faces.context.FacesContext context)

No the only thing you would need to do is cause A4J to post back via
AJAX when the UICommand object is clicked instead of using a stanard
post.

This looks doable via the method:
AjaxRendererUtils.buildOnClick(javax.faces.component.UIComponent
uiComponent, javax.faces.context.FacesContext facesContext)

So this new approach would be:

1) extend UITreeData
2) override getExpandControl() and return a custom UICommand that
renders itself. In that rendering, call the "buildOnClick" method
above to cause A4J to handle the post.
3) create an attribute on the extend UITreeData class called "reRender".
4) override toggleExpanded() and in that method, after calling the
super method, call "addRegionsFromComponent", passing "this" (without
the quotes of course) as the component.

Since I don't have A4J running, I can't test this, but I don't see why
it wouldn't work.

-Andrew


On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:

These are good suggestion/ideas.  I've also had put some thoughts about
similar approach before.  I've tried extending UITreeData, TreeNodeBase,
etc.. encountered some unexpected behavior.  But ultimately, I pullback on
it.  Just want something simple and that wont requiring additional code.  I
will definitely take a look at some of your suggestions and make it better.

-Bill


 "Andrew Robinson"
   To
   "MyFaces Discussion"
 09/22/2006 12:04  
 PM cc

   Subject
 Please respond to Re: ajax4jsf + tree2?
 "MyFaces
Discussion"
 <[EMAIL PROTECTED]
 ache.org>






That solution may not work. I just downloaded the last A4J release and
UIAjaxCommandLink is not a UICommand:

java.lang.Object
  extended by javax.faces.component.UIComponent
  extended by javax.faces.component.UIComponentBase
  extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
  extended by org.ajax4jsf.ajax.UIAjaxCommandLink

That means that it would not be compatible with that API. However,
with a little messy use of the decorator pattern, you could create a
UICommand component that delegates all methods to an internal
UIAjaxCommandLink class instance. This way the link that would be
rendered to the HTML would be the AJAX one instead of the standard
one. It wouldn't be the prettiest code, but it should function quite
well. Since the command link would be the A4J one, you wouldn't have
to do any more work. So the process would be:

1) extend UITreeData
2) override getExpandControl()
3) Create a decorator of UICommand that houses UIAjaxCommandLink
4) delegate all methods of the UICommand to the UIAjaxCommandLink for
those methods that are requried (you may not have to decorate them
all).
5) Register your new UITreeData in the faces config, and register the
component in taglib.xml for facelets or create a TLD and tag file for
JSP

This should work assuming the decoration of UICommand to wrap a
UIAjaxCommandLink doesn't present any unforseen issues.

-Andrew


On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> The way that AjaxAnywhere works is that it builds a Set of
> "zones" during the processing of a request. JavaScript can start that
> Set and then there is an API on the server
> (AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
> can use.
>
> So in my approach, I let aa.js submit normally (no zones on the
> client), then I extend UITreeData & overload the toggleExpanded
> function. In that function, I check the "ajaxZone" attribute of my
> extended tree component and use that addZonesToRefresh method to make
> my tree re-rendered
>
> If you look in the HtmlTreeRenderer class, you will see the following
> in the server-side rendering:
>
> UICommand expandControl = tree.getExpandControl();
>
> This means, that if in your extended UITreeData class, you override
> the "getExpandControl()" method, you can return an A4J command link
> instead of the "standard" one. In there you also have access to the ID
> of the tree (since your code is the tree component), so setting the
> re-render attribute should be very easy.
>
> This way you can still use the built in navigation icons of the tree.
> If I get a chance, maybe I can play around with it sometime and create
> a new jsf-comp like the one I did for AA but for A4J. If this email is
> enough, please feel free to write a blog or the component yourself.
>
> -Andrew
>
>
>
>
> On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> > I dont quit

Re: ajax4jsf + tree2?

2006-09-22 Thread William Huang
These are good suggestion/ideas.  I've also had put some thoughts about
similar approach before.  I've tried extending UITreeData, TreeNodeBase,
etc.. encountered some unexpected behavior.  But ultimately, I pullback on
it.  Just want something simple and that wont requiring additional code.  I
will definitely take a look at some of your suggestions and make it better.

-Bill

   
 "Andrew Robinson" 
   To 
   "MyFaces Discussion"
 09/22/2006 12:04
 PM cc 
   
   Subject 
 Please respond to Re: ajax4jsf + tree2?   
 "MyFaces  
Discussion"
 <[EMAIL PROTECTED] 
 ache.org> 
   
   




That solution may not work. I just downloaded the last A4J release and
UIAjaxCommandLink is not a UICommand:

java.lang.Object
  extended by javax.faces.component.UIComponent
  extended by javax.faces.component.UIComponentBase
  extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
  extended by org.ajax4jsf.ajax.UIAjaxCommandLink

That means that it would not be compatible with that API. However,
with a little messy use of the decorator pattern, you could create a
UICommand component that delegates all methods to an internal
UIAjaxCommandLink class instance. This way the link that would be
rendered to the HTML would be the AJAX one instead of the standard
one. It wouldn't be the prettiest code, but it should function quite
well. Since the command link would be the A4J one, you wouldn't have
to do any more work. So the process would be:

1) extend UITreeData
2) override getExpandControl()
3) Create a decorator of UICommand that houses UIAjaxCommandLink
4) delegate all methods of the UICommand to the UIAjaxCommandLink for
those methods that are requried (you may not have to decorate them
all).
5) Register your new UITreeData in the faces config, and register the
component in taglib.xml for facelets or create a TLD and tag file for
JSP

This should work assuming the decoration of UICommand to wrap a
UIAjaxCommandLink doesn't present any unforseen issues.

-Andrew


On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> The way that AjaxAnywhere works is that it builds a Set of
> "zones" during the processing of a request. JavaScript can start that
> Set and then there is an API on the server
> (AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
> can use.
>
> So in my approach, I let aa.js submit normally (no zones on the
> client), then I extend UITreeData & overload the toggleExpanded
> function. In that function, I check the "ajaxZone" attribute of my
> extended tree component and use that addZonesToRefresh method to make
> my tree re-rendered
>
> If you look in the HtmlTreeRenderer class, you will see the following
> in the server-side rendering:
>
> UICommand expandControl = tree.getExpandControl();
>
> This means, that if in your extended UITreeData class, you override
> the "getExpandControl()" method, you can return an A4J command link
> instead of the "standard" one. In there you also have access to the ID
> of the tree (since your code is the tree component), so setting the
> re-render attribute should be very easy.
>
> This way you can still use the built in navigation icons of the tree.
> If I get a chance, maybe I can play around with it sometime and create
> a new jsf-comp like the one I did for AA but for A4J. If this email is
> enough, please feel free to write a blog or the component yourself.
>
> -Andrew
>
>
>
>
> On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> > I dont quite understand the first paragraph..
> >
> >  "Andrew Robinson"
> >   >  [EMAIL PROTECTED]>
To
> >"MyFaces Discussion"
> >  09/22/2006 11:31  
> >  AM
cc
> >
> >
Subject
> >  Please respond to Re: ajax4jsf + tree2?
> >  "MyFaces
> > Discussion"
> >  <[EMAIL PROTECTED]
> >  ache.org>
> >
> >
> >
> >
> >
> >
> > Doesn't A4J have a server-side API to tell it to include panels during
> > the process action phase? That is how I acco

RE: ajax4jsf + tree2?

2006-09-22 Thread Hagen, Nicholas
That is actually what I ended up doing (at least to a certain degree...see
below) to produce a working AJAX tree2 implementation.  However, I second
(from your next post) that the tree2 UITreeData component should be changed
to return UIComponent instead to allow any expandable component.  If the
tree really required an actionable component, it could test for whether the
returned component implements ActionSource and fail accordingly if it does
not.  However, I would just put the requirement on the user to ensure they
use an actionable component if they want to the tree to work properly.

My actual component ended up being something like:

class AjaxLink extends UICommand
{
public AjaxLink() {
// Does not require a renderer (delegates to Ajax renderer)
this.setRendererType(null);
}

public void encodeBegin(FacesContext)
{
// Create Command Link and copy children from here to there
UIComponent cmdLink = new HtmlAjaxCommandLink();
while (this.getChildren().size() > 0)

cmdLink.getChildren().add(this.getChildren().get(0));

// Add command link as a child of us so we render the cmd
link
this.getChildren().clear();
this.getChildren().add(commandLink);
super.encodeBegin(context);
}
}

Nick

-Original Message-
From: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 22, 2006 11:05 AM
To: MyFaces Discussion
Subject: Re: ajax4jsf + tree2?

That solution may not work. I just downloaded the last A4J release and
UIAjaxCommandLink is not a UICommand:

java.lang.Object
  extended by javax.faces.component.UIComponent
  extended by javax.faces.component.UIComponentBase
  extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
  extended by org.ajax4jsf.ajax.UIAjaxCommandLink

That means that it would not be compatible with that API. However,
with a little messy use of the decorator pattern, you could create a
UICommand component that delegates all methods to an internal
UIAjaxCommandLink class instance. This way the link that would be
rendered to the HTML would be the AJAX one instead of the standard
one. It wouldn't be the prettiest code, but it should function quite
well. Since the command link would be the A4J one, you wouldn't have
to do any more work. So the process would be:

1) extend UITreeData
2) override getExpandControl()
3) Create a decorator of UICommand that houses UIAjaxCommandLink
4) delegate all methods of the UICommand to the UIAjaxCommandLink for
those methods that are requried (you may not have to decorate them
all).
5) Register your new UITreeData in the faces config, and register the
component in taglib.xml for facelets or create a TLD and tag file for
JSP

This should work assuming the decoration of UICommand to wrap a
UIAjaxCommandLink doesn't present any unforseen issues.

-Andrew


On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> The way that AjaxAnywhere works is that it builds a Set of
> "zones" during the processing of a request. JavaScript can start that
> Set and then there is an API on the server
> (AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
> can use.
>
> So in my approach, I let aa.js submit normally (no zones on the
> client), then I extend UITreeData & overload the toggleExpanded
> function. In that function, I check the "ajaxZone" attribute of my
> extended tree component and use that addZonesToRefresh method to make
> my tree re-rendered
>
> If you look in the HtmlTreeRenderer class, you will see the following
> in the server-side rendering:
>
> UICommand expandControl = tree.getExpandControl();
>
> This means, that if in your extended UITreeData class, you override
> the "getExpandControl()" method, you can return an A4J command link
> instead of the "standard" one. In there you also have access to the ID
> of the tree (since your code is the tree component), so setting the
> re-render attribute should be very easy.
>
> This way you can still use the built in navigation icons of the tree.
> If I get a chance, maybe I can play around with it sometime and create
> a new jsf-comp like the one I did for AA but for A4J. If this email is
> enough, please feel free to write a blog or the component yourself.
>
> -Andrew
>
>
>
>
> On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> > I dont quite understand the first paragraph..
> >
> >  "Andrew Robinson"
> >   >  [EMAIL PROTECTED]>
To
> >"MyFaces Discussion"
> >  09/22/2006 11:31  
> >  AM
cc
> >
> >
Subject
> >  Please respond to Re: ajax4jsf + tree2?
> >  "MyFaces
> > Discussion"
> >  <[EMAIL PROTECTED]
> >  ache.org>
> >
> >
> >
> >
> >
> >
> > Doesn't A4J have a server-side API t

Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

BTW - instead of decorating UICommand, you could request a change of
the API of UITreeData:

Change HtmlTreeRenderer.java (1.1.3) line 577 from:
UICommand expandControl = tree.getExpandControl();
to:
UIComponent expandControl = tree.getExpandControl();

Change line 111 of UITreeData.java (1.1.3) from
public UICommand getExpandControl()
to:
public UIComponent getExpandControl()

The renderer doesn't do anything special for this component that would
require it to be a UIComamnd, the author just assumed that the
standard JSF component would be used to expand/collapse. If the author
accepts this patch, then you wouldn't have to decorate the UICommand
component.

On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:

That solution may not work. I just downloaded the last A4J release and
UIAjaxCommandLink is not a UICommand:

java.lang.Object
  extended by javax.faces.component.UIComponent
  extended by javax.faces.component.UIComponentBase
  extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
  extended by org.ajax4jsf.ajax.UIAjaxCommandLink

That means that it would not be compatible with that API. However,
with a little messy use of the decorator pattern, you could create a
UICommand component that delegates all methods to an internal
UIAjaxCommandLink class instance. This way the link that would be
rendered to the HTML would be the AJAX one instead of the standard
one. It wouldn't be the prettiest code, but it should function quite
well. Since the command link would be the A4J one, you wouldn't have
to do any more work. So the process would be:

1) extend UITreeData
2) override getExpandControl()
3) Create a decorator of UICommand that houses UIAjaxCommandLink
4) delegate all methods of the UICommand to the UIAjaxCommandLink for
those methods that are requried (you may not have to decorate them
all).
5) Register your new UITreeData in the faces config, and register the
component in taglib.xml for facelets or create a TLD and tag file for
JSP

This should work assuming the decoration of UICommand to wrap a
UIAjaxCommandLink doesn't present any unforseen issues.

-Andrew


On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> The way that AjaxAnywhere works is that it builds a Set of
> "zones" during the processing of a request. JavaScript can start that
> Set and then there is an API on the server
> (AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
> can use.
>
> So in my approach, I let aa.js submit normally (no zones on the
> client), then I extend UITreeData & overload the toggleExpanded
> function. In that function, I check the "ajaxZone" attribute of my
> extended tree component and use that addZonesToRefresh method to make
> my tree re-rendered
>
> If you look in the HtmlTreeRenderer class, you will see the following
> in the server-side rendering:
>
> UICommand expandControl = tree.getExpandControl();
>
> This means, that if in your extended UITreeData class, you override
> the "getExpandControl()" method, you can return an A4J command link
> instead of the "standard" one. In there you also have access to the ID
> of the tree (since your code is the tree component), so setting the
> re-render attribute should be very easy.
>
> This way you can still use the built in navigation icons of the tree.
> If I get a chance, maybe I can play around with it sometime and create
> a new jsf-comp like the one I did for AA but for A4J. If this email is
> enough, please feel free to write a blog or the component yourself.
>
> -Andrew
>
>
>
>
> On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> > I dont quite understand the first paragraph..
> >
> >  "Andrew Robinson"
> >   >  [EMAIL PROTECTED]> 
 To
> >"MyFaces Discussion"
> >  09/22/2006 11:31  
> >  AM cc
> >
> >Subject
> >  Please respond to Re: ajax4jsf + tree2?
> >  "MyFaces
> > Discussion"
> >  <[EMAIL PROTECTED]
> >  ache.org>
> >
> >
> >
> >
> >
> >
> > Doesn't A4J have a server-side API to tell it to include panels during
> > the process action phase? That is how I accomplish the AJAX with
> > AjaxAnywhere, I would be dissappointed with A4J if that server-side
> > Java API was not available.
> >
> > I tried to look into it at one time briefly, but the documentation for
> > A4J is quite horrible (actually there was none when I looked) in
> > reference to building custom AJAX components and how to leverage the
> > A4J API.
> >
> > On 9/21/06, William Huang <[EMAIL PROTECTED]> wrote:
> > > I use my own plus and minus image instead of hardcoding the tomahawk
> > > images.  Is also better to turn off the by adding attribute showLines=
> > > "false".   Also

Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

That solution may not work. I just downloaded the last A4J release and
UIAjaxCommandLink is not a UICommand:

java.lang.Object
 extended by javax.faces.component.UIComponent
 extended by javax.faces.component.UIComponentBase
 extended by org.ajax4jsf.framework.ajax.AjaxActionComponent
 extended by org.ajax4jsf.ajax.UIAjaxCommandLink

That means that it would not be compatible with that API. However,
with a little messy use of the decorator pattern, you could create a
UICommand component that delegates all methods to an internal
UIAjaxCommandLink class instance. This way the link that would be
rendered to the HTML would be the AJAX one instead of the standard
one. It wouldn't be the prettiest code, but it should function quite
well. Since the command link would be the A4J one, you wouldn't have
to do any more work. So the process would be:

1) extend UITreeData
2) override getExpandControl()
3) Create a decorator of UICommand that houses UIAjaxCommandLink
4) delegate all methods of the UICommand to the UIAjaxCommandLink for
those methods that are requried (you may not have to decorate them
all).
5) Register your new UITreeData in the faces config, and register the
component in taglib.xml for facelets or create a TLD and tag file for
JSP

This should work assuming the decoration of UICommand to wrap a
UIAjaxCommandLink doesn't present any unforseen issues.

-Andrew


On 9/22/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:

The way that AjaxAnywhere works is that it builds a Set of
"zones" during the processing of a request. JavaScript can start that
Set and then there is an API on the server
(AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
can use.

So in my approach, I let aa.js submit normally (no zones on the
client), then I extend UITreeData & overload the toggleExpanded
function. In that function, I check the "ajaxZone" attribute of my
extended tree component and use that addZonesToRefresh method to make
my tree re-rendered

If you look in the HtmlTreeRenderer class, you will see the following
in the server-side rendering:

UICommand expandControl = tree.getExpandControl();

This means, that if in your extended UITreeData class, you override
the "getExpandControl()" method, you can return an A4J command link
instead of the "standard" one. In there you also have access to the ID
of the tree (since your code is the tree component), so setting the
re-render attribute should be very easy.

This way you can still use the built in navigation icons of the tree.
If I get a chance, maybe I can play around with it sometime and create
a new jsf-comp like the one I did for AA but for A4J. If this email is
enough, please feel free to write a blog or the component yourself.

-Andrew




On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:
> I dont quite understand the first paragraph..
>
>  "Andrew Robinson"
>[EMAIL PROTECTED]>  
To
>"MyFaces Discussion"
>  09/22/2006 11:31  
>  AM cc
>
>Subject
>  Please respond to Re: ajax4jsf + tree2?
>  "MyFaces
> Discussion"
>  <[EMAIL PROTECTED]
>  ache.org>
>
>
>
>
>
>
> Doesn't A4J have a server-side API to tell it to include panels during
> the process action phase? That is how I accomplish the AJAX with
> AjaxAnywhere, I would be dissappointed with A4J if that server-side
> Java API was not available.
>
> I tried to look into it at one time briefly, but the documentation for
> A4J is quite horrible (actually there was none when I looked) in
> reference to building custom AJAX components and how to leverage the
> A4J API.
>
> On 9/21/06, William Huang <[EMAIL PROTECTED]> wrote:
> > I use my own plus and minus image instead of hardcoding the tomahawk
> > images.  Is also better to turn off the by adding attribute showLines=
> > "false".   Also I am not sure if reRender="tree".  I had to wrap the tree
> > with a  or 
> > and reRender="treePanel".  see below
> >
> >   >   showNav="false" clientSideToggle="false"
> >   showLines="false"
> >   varNodeToggler="t">
> >
> >
> >  
> > > rendered="#{!node.leaf}">
> >  
> >
> >  
> >
> >  
> >
> >
> > BTW, I will post my code to a blog soon..  I will send the link to this
> > mail list once I have time to finish it..
> >
> > Bill
> >
> >  Roger Keays
> >  <[EMAIL PROTECTED]
> >  havenue.com.au>
> To
> >  Sent by: news users@myfaces.apache.org
> >  <[EMAIL PROTECTED]
> cc
> >  rg>
> >
> Subject
> >

Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

The way that AjaxAnywhere works is that it builds a Set of
"zones" during the processing of a request. JavaScript can start that
Set and then there is an API on the server
(AAUtils.addZonesToRefresh(ServletRequest, String) method) that one
can use.

So in my approach, I let aa.js submit normally (no zones on the
client), then I extend UITreeData & overload the toggleExpanded
function. In that function, I check the "ajaxZone" attribute of my
extended tree component and use that addZonesToRefresh method to make
my tree re-rendered

If you look in the HtmlTreeRenderer class, you will see the following
in the server-side rendering:

UICommand expandControl = tree.getExpandControl();

This means, that if in your extended UITreeData class, you override
the "getExpandControl()" method, you can return an A4J command link
instead of the "standard" one. In there you also have access to the ID
of the tree (since your code is the tree component), so setting the
re-render attribute should be very easy.

This way you can still use the built in navigation icons of the tree.
If I get a chance, maybe I can play around with it sometime and create
a new jsf-comp like the one I did for AA but for A4J. If this email is
enough, please feel free to write a blog or the component yourself.

-Andrew




On 9/22/06, William Huang <[EMAIL PROTECTED]> wrote:

I dont quite understand the first paragraph..

 "Andrew Robinson"
   To
   "MyFaces Discussion"
 09/22/2006 11:31  
 AM cc

   Subject
 Please respond to Re: ajax4jsf + tree2?
 "MyFaces
Discussion"
 <[EMAIL PROTECTED]
 ache.org>






Doesn't A4J have a server-side API to tell it to include panels during
the process action phase? That is how I accomplish the AJAX with
AjaxAnywhere, I would be dissappointed with A4J if that server-side
Java API was not available.

I tried to look into it at one time briefly, but the documentation for
A4J is quite horrible (actually there was none when I looked) in
reference to building custom AJAX components and how to leverage the
A4J API.

On 9/21/06, William Huang <[EMAIL PROTECTED]> wrote:
> I use my own plus and minus image instead of hardcoding the tomahawk
> images.  Is also better to turn off the by adding attribute showLines=
> "false".   Also I am not sure if reRender="tree".  I had to wrap the tree
> with a  or 
> and reRender="treePanel".  see below
>
> showNav="false" clientSideToggle="false"
>   showLines="false"
>   varNodeToggler="t">
>
>
>  
> rendered="#{!node.leaf}">
>  
>
>  
>
>  
>
>
> BTW, I will post my code to a blog soon..  I will send the link to this
> mail list once I have time to finish it..
>
> Bill
>
>  Roger Keays
>  <[EMAIL PROTECTED]
>  havenue.com.au>
To
>  Sent by: news users@myfaces.apache.org
>  <[EMAIL PROTECTED]
cc
>  rg>
>
Subject
>Re: ajax4jsf + tree2?
>  09/21/2006 07:46
>  PM
>
>
>  Please respond to
>  "MyFaces
> Discussion"
>  <[EMAIL PROTECTED]
>  ache.org>
>
>
>
>
>
>
> Roger Keays wrote:
> > Hi Bill,
> >
> >> I had no problem with it, what kind of tree behavior are you looking
> for?
> >> lazy loading? ajax expend-collapse? clickable treenode that does ajax
> >> request? etc
> >
> > I'm looking for AJAX expand-collapse when the +/- icon is clicked. It
> > would be okay if the entire tree was refreshed, just not the entire
page!
>
> Okay, so the trick is to use showNav="false" and make your own
> navigation togglers with an a4j:commandLink. It works, but it is
> difficult to make the new links look just like the originals. I gave it
> a shot (see below), but it still looks pretty ugly.
>
> Perhaps a better solution would be a new tree2 attribute called
> 'a4jToggle', which when set to true puts in the magic a4j javascript
> (not sure exactly what that looks like) instead of the standard js.
>
>
> showNav="false" clientSideToggle="false"
>   varNodeToggler="t">
>
>
>  
> rendered="#{!node.leaf}">
>  
value="/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11588409/tree2.HtmlTreeRenderer/images/nav-#{t.nodeExpanded

>
> ? 'minus' : 'plus'}-line-middle.gif"
>  style="border: 0px;"/>
>
>
value="/faces/myFacesExtensionResour

Re: Dynamically generated command links

2006-09-22 Thread K. Johnson
Did you make sure the command links have unique component ids? 
Its hard to help your problem without a code snippet, but We generate 
commandLinks in our application that use actionListeners without any problems. 




>  ---Original Message---
>  From: John Holland <[EMAIL PROTECTED]>
>  Subject: Dynamically generated command links
>  Sent: 21 Sep '06 22:07
>  
>  I’m having a problem with some commandLinks that I am dynamically
>  generating with a backing bean binding.  It seems that whenever they are
>  generated the action / actionListener associated with them are not invoked
>  when clicked.  Is there something besides instantiating the
>  HtmlCommandLinks and setting the attributes that I need to do to get the
>  actions / actionListeners to work?
>  
>  
>  Thanks,
>  
>  John


Re: Re-render JSF page components

2006-09-22 Thread K. Johnson


My navigation bean is session scoped already? 
I'd like to somehow force the page to rebuild when it is refreshed? Can this be 
done? 
Can the viewRoot be forced to be completely re-created, so that the components 
will 'hide' on page refresh, if they have previously been displayed, and 
vice-versa? 

It seems like once the component is rendered it stays cached when I refresh the 
page


>  ---Original Message---
>  From: Mike Kienenberger <[EMAIL PROTECTED]>
>  Subject: Re: Re-render JSF page components
>  Sent: 22 Sep '06 05:28
>  
>  Navigation must be more than request-scoped for rendered to work.
>  A quick test is to make that bean session-scoped.   Generally, a
>  better fix is to use t:saveState
>  value="#{navigation.tabNavigationAllowed}"
>  I don't think the c tags will work since they only execute once on page 
> build.
>  
>  
>  On 9/21/06, K. Johnson <[EMAIL PROTECTED]> wrote:
>  >
>  > We are using facelets. i have have tried it a couple different ways, but 
> here is a snippet with Jstl c:if and below it a snippet with rendered. When 
> the page is first rendered the navbars display or hide correctly. When I come 
> back to  the page, even if the bean value is changed the components don't 
> update:
>  >
>  >   
>  >
>  > 
>  > 
>  > 
>  > 
>  > 
>  >  value="#{lbls.billingLabel}" actionListener="#{navigation.generalAction}" 
> action="#{navigation.getAction}" immediate="${immediate}" 
> id="#{lbls.billingAction}"  >
>  > 
>  > 
>  > 
>  > 
>  >  value="#{lbls.billingLabel}" actionListener="#{navigation.generalAction}" 
> action="#{navigation.getAction}" immediate="${immediate}" 
> id="#{lbls.billingAction}" >
>  > 
>  > 
>  > 
>  >
>  > 
>  >
>  >
>  > 
>  >
>  >
>  >   actionListener="{navigation.generalAction}" action="#{navigation.getAction}" 
> immediate="${immediate}" id="#{lbls.billingAction}">
>  > 
>  > 
>  >
>  >
>  >
>  > Thanks!
>  >
>  > >  ---Original Message---
>  > >  From: Gert Vanthienen <[EMAIL PROTECTED]>
>  > >  Subject: Re: Re-render JSF page components
>  > >  Sent: 21 Sep '06 18:58
>  > >
>  > >  L.S.,
>  > >
>  > >  I have never encountered any problems when using the rendered attribute
>  > >  for implementing this kind of behavior.Could you post a snippet of the
>  > >  JSP page code you're using?
>  > >
>  > >  Regards,
>  > >
>  > >  Gert Vanthienen
>  > >[EMAIL PROTECTED]
>  > >
>  > >
>  > >
>  > >  K. Johnson wrote:
>  > >  > I have some components on my JSF page that need to display or hide 
> based on a bean boolean property.
>  > >  >
>  > >  > I have tried using the rendered attribute as well as jstlc:if and 
> c:choose. My page displays properly the first time based on the condition, 
> but if i go through a JSF lifecycle and return to the same page, even though 
> the bean boolean value has changed, and displays correctly as a string, the 
> previously rendered or hidden components don't update?
>  > >  >
>  > >  > Is there a trick to get this to work?
>  > >  >
>  > >  >
>  > >  > Thank you!
>  > >  >
>  > >  >
>  > >  >
>  > >  >
>  > >  >>---Original Message---
>  > >  >>From: [EMAIL PROTECTED]
>  > >  >>Subject: RE: Refresh JSF Page
>  > >  >>Sent: 21 Sep '06 13:35
>  > >  >>
>  > >  >>
>  > >  >>Thanks Jeff,
>  > >  >>
>  > >  >>I will try the option suggested by you.
>  > >  >>Here are some more details about my requirement.
>  > >  >>Every page of my application has header. Header contains Refresh 
> button.
>  > >  >>Selecting it, the page should fetch the data from back end.
>  > >  >>
>  > >  >>I foresee some problems with Refresh in JSF with the limited 
> knowledge I
>  > >  >>have in JSF.
>  > >  >>- The page would have been displayed because of some actionlistener 
> with
>  > >  >>parameters.
>  > >  >>Getting the parameters again (firing of that actionlistener) may not 
> be
>  > >  >>possible.
>  > >  >>- the Browser URL may be that of previous page (Using 'redirect' in
>  > >  >>faces-config may solve this. But I'm not sure about the implications 
> of
>  > >  >>it)
>  > >  >>
>  > >  >>I hope the trick would work for me.
>  > >  >>
>  > >  >>Regards,
>  > >  >>Kiran
>  > >  >>
>  > >  >>-Original Message-
>  > >  >>From: Jeff Bischoff [mailto:[EMAIL PROTECTED]
>  > >  >>Sent: Thursday, September 21, 2006 12:07 AM
>  > >  >>To: MyFaces Discussion
>  > >  >>Subject: Re: Refresh JSF Page
>  > >  >>
>  > >  >>
>  > >  >>Kiran,
>  > >  >>
>  > >  >>That's a pretty broad topic! If you could be more specific, you might
>  > >  >>get more hints...
>  > >  >>
>  > >  >>See [1] for a neat trick to force updated model values in input
>  > >  >>components.
>  > >  >>
>  > >  >>[1] http://wiki.apache.org/myfaces/ClearI

Re: ajax4jsf + tree2?

2006-09-22 Thread William Huang
I dont quite understand the first paragraph..
   
 "Andrew Robinson" 
   To 
   "MyFaces Discussion"
 09/22/2006 11:31
 AM cc 
   
   Subject 
 Please respond to Re: ajax4jsf + tree2?   
 "MyFaces  
Discussion"
 <[EMAIL PROTECTED] 
 ache.org> 
   
   




Doesn't A4J have a server-side API to tell it to include panels during
the process action phase? That is how I accomplish the AJAX with
AjaxAnywhere, I would be dissappointed with A4J if that server-side
Java API was not available.

I tried to look into it at one time briefly, but the documentation for
A4J is quite horrible (actually there was none when I looked) in
reference to building custom AJAX components and how to leverage the
A4J API.

On 9/21/06, William Huang <[EMAIL PROTECTED]> wrote:
> I use my own plus and minus image instead of hardcoding the tomahawk
> images.  Is also better to turn off the by adding attribute showLines=
> "false".   Also I am not sure if reRender="tree".  I had to wrap the tree
> with a  or 
> and reRender="treePanel".  see below
>
> showNav="false" clientSideToggle="false"
>   showLines="false"
>   varNodeToggler="t">
>
>
>  
> rendered="#{!node.leaf}">
>  
>
>  
>
>  
>
>
> BTW, I will post my code to a blog soon..  I will send the link to this
> mail list once I have time to finish it..
>
> Bill
>
>  Roger Keays
>  <[EMAIL PROTECTED]
>  havenue.com.au>
To
>  Sent by: news users@myfaces.apache.org
>  <[EMAIL PROTECTED]
cc
>  rg>
>
Subject
>Re: ajax4jsf + tree2?
>  09/21/2006 07:46
>  PM
>
>
>  Please respond to
>  "MyFaces
> Discussion"
>  <[EMAIL PROTECTED]
>  ache.org>
>
>
>
>
>
>
> Roger Keays wrote:
> > Hi Bill,
> >
> >> I had no problem with it, what kind of tree behavior are you looking
> for?
> >> lazy loading? ajax expend-collapse? clickable treenode that does ajax
> >> request? etc
> >
> > I'm looking for AJAX expand-collapse when the +/- icon is clicked. It
> > would be okay if the entire tree was refreshed, just not the entire
page!
>
> Okay, so the trick is to use showNav="false" and make your own
> navigation togglers with an a4j:commandLink. It works, but it is
> difficult to make the new links look just like the originals. I gave it
> a shot (see below), but it still looks pretty ugly.
>
> Perhaps a better solution would be a new tree2 attribute called
> 'a4jToggle', which when set to true puts in the magic a4j javascript
> (not sure exactly what that looks like) instead of the standard js.
>
>
> showNav="false" clientSideToggle="false"
>   varNodeToggler="t">
>
>
>  
> rendered="#{!node.leaf}">
>  
value="/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11588409/tree2.HtmlTreeRenderer/images/nav-#{t.nodeExpanded

>
> ? 'minus' : 'plus'}-line-middle.gif"
>  style="border: 0px;"/>
>
>
value="/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11588409/tree2.HtmlTreeRenderer/images/line-middle.gif"

>
>rendered="#{node.leaf}" style="border: 0px;"/>
>
>  
>
>  
>
>
> >
> > One other thing though.. I see lots of references to AJAX lazy loading.
> > What is that supposed to mean? AFAICT tree2 supports lazy loading out
of
> > the box, and it has nothing to do with AJAX. Just set
> > clientSideToggle="false".
> >
> > Cheers,
> >
> > Roger
> >
> >>
> >> Hi there,
> >>
> >> Does anybody have experience integrating ajax4jsf with MyFaces' tree2
> >> component? I can't see anything in ajax4jsf that will work out of the
> >> box (a4j:support, a4j:region and a4j:form don't do the trick).
> >>

Re: how to access a managed bean from a button action listener ?

2006-09-22 Thread K. Johnson

You can also use: 
FacesContext facesContext = FacesContext.getCurrentInstance();
MyBean myBean = (MyBean) 
FacesContext.getApplication().createValueBinding("{MyBeanAliasUsedInFacesConfig}");

This accesses the managedBean in context. 

>  ---Original Message---
>  From: Alexandre Jaquet <[EMAIL PROTECTED]>
>  Subject: Re: how to access a managed bean from a button action listener ?
>  Sent: 22 Sep '06 06:33
>  
>  actionListener="#{session.actionToExecute}"
>  
>  in your managed bean create
>  
>  public void actionToExecute(ValueChangeEvent event) {
>  //String value = ( String) event.getNewValue();
>  }
>  Legolas Woodland wrote:
>  > Hi
>  > thank you for reading my post
>  > how i can access a managed bean from a button action listener ?
>  > for example i have a managed bean named session and its scope is session
>  > , i used it to store user details until he/she logout
>  > and when he/she pressed the logout button i need to change some of that
>  > managed bean property ,
>  > can you please tell me how i can do it ?
>  > I also need it for time that user press the login button.
>  > thanks
>  >
>  >  
>  
>  


Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

Doesn't A4J have a server-side API to tell it to include panels during
the process action phase? That is how I accomplish the AJAX with
AjaxAnywhere, I would be dissappointed with A4J if that server-side
Java API was not available.

I tried to look into it at one time briefly, but the documentation for
A4J is quite horrible (actually there was none when I looked) in
reference to building custom AJAX components and how to leverage the
A4J API.

On 9/21/06, William Huang <[EMAIL PROTECTED]> wrote:

I use my own plus and minus image instead of hardcoding the tomahawk
images.  Is also better to turn off the by adding attribute showLines=
"false".   Also I am not sure if reRender="tree".  I had to wrap the tree
with a  or 
and reRender="treePanel".  see below

 

   
 
   
 
   
 
   
 


BTW, I will post my code to a blog soon..  I will send the link to this
mail list once I have time to finish it..

Bill

 Roger Keays
 <[EMAIL PROTECTED]
 havenue.com.au>To
 Sent by: news users@myfaces.apache.org
 <[EMAIL PROTECTED]  cc
 rg>
   Subject
   Re: ajax4jsf + tree2?
 09/21/2006 07:46
 PM


 Please respond to
 "MyFaces
Discussion"
 <[EMAIL PROTECTED]
 ache.org>






Roger Keays wrote:
> Hi Bill,
>
>> I had no problem with it, what kind of tree behavior are you looking
for?
>> lazy loading? ajax expend-collapse? clickable treenode that does ajax
>> request? etc
>
> I'm looking for AJAX expand-collapse when the +/- icon is clicked. It
> would be okay if the entire tree was refreshed, just not the entire page!

Okay, so the trick is to use showNav="false" and make your own
navigation togglers with an a4j:commandLink. It works, but it is
difficult to make the new links look just like the originals. I gave it
a shot (see below), but it still looks pretty ugly.

Perhaps a better solution would be a new tree2 attribute called
'a4jToggle', which when set to true puts in the magic a4j javascript
(not sure exactly what that looks like) instead of the standard js.


 

   
 
   
 
   
   
   
 
   
 


>
> One other thing though.. I see lots of references to AJAX lazy loading.
> What is that supposed to mean? AFAICT tree2 supports lazy loading out of
> the box, and it has nothing to do with AJAX. Just set
> clientSideToggle="false".
>
> Cheers,
>
> Roger
>
>>
>> Hi there,
>>
>> Does anybody have experience integrating ajax4jsf with MyFaces' tree2
>> component? I can't see anything in ajax4jsf that will work out of the
>> box (a4j:support, a4j:region and a4j:form don't do the trick).
>>
>> Cheers,
>>
>> Roger
>
>


--

Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: [EMAIL PROTECTED]



Disclaimer: This electronic mail and any attachments are confidential and may 
be privileged. If you are not the intended recipient, please notify the sender 
immediately by replying to this email, and destroy all copies of this email and 
any attachments. Thank you.




Re: ajax4jsf + tree2?

2006-09-22 Thread Andrew Robinson

That is not true. Lazy loading means that child nodes are created when
the parent is expanded and not until then. If you create the whole
tree model all at once, you are fully loaded, regardless of when the
nodes are rendered. Lazy loading refers to model creating, not
rendering time.

As for AJAX, in AjaxAnywhere, just put a zone around the tree and when
the nodes are expanded/collapsed, just add the zone to the list to
refresh. As for Ajax4jsf, I think (I haven't had a chance to use it
yet) just wrap a panel around the tree, then add that panel to the
re-render list when a node is expanded or collapsed.

On 9/21/06, Roger Keays <[EMAIL PROTECTED]> wrote:

Hi Bill,

> I had no problem with it, what kind of tree behavior are you looking for?
> lazy loading? ajax expend-collapse? clickable treenode that does ajax
> request? etc

I'm looking for AJAX expand-collapse when the +/- icon is clicked. It
would be okay if the entire tree was refreshed, just not the entire page!

One other thing though.. I see lots of references to AJAX lazy loading.
What is that supposed to mean? AFAICT tree2 supports lazy loading out of
the box, and it has nothing to do with AJAX. Just set
clientSideToggle="false".

Cheers,

Roger

>
> Hi there,
>
> Does anybody have experience integrating ajax4jsf with MyFaces' tree2
> component? I can't see anything in ajax4jsf that will work out of the
> box (a4j:support, a4j:region and a4j:form don't do the trick).
>
> Cheers,
>
> Roger


--

Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: [EMAIL PROTECTED]





Tomahawk 1.1.3 inputFileUpload solution

2006-09-22 Thread JBuilderDoug

I finally figured this out, so  I'm going to put an entire example in this
post.  I'm using Tomahawk 1.1.3 with RI JSF created in Borland's JBuilder. 
I've created a .war file from borland and deployed it under Tomcat 5.5 so it
should be Borland independent.  The problems I was having previously were in
trying to deploy Tomahawk on a old JSF project. I'm pretty sure I'm safe in
saying you must use JSP 2.0 and Servlet 2.4 as a minimum.

inputFileUpload/Tomahawk specific elements are bold/italic

In the backing bean WelcomeBean.java, I only read the uploaded file into a
byte [].  In my personal application, I simply insert the byte [] into an
Oracle BLOB.  You may need to write it to a file.  I'll assume you know how
to do that.

I think that's pretty much it.  If you have any questions please respond to
this post.  I'll receive an e-mail and try to help.  If you want to know how
to implement Tomahawk 1.1.3 into Borland's JBuilder, I can help with that
also I believe.

Doug

Required libraries for this minimal project

commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-fileupload.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
standard.jar
tomahawk-1.1.3.jar

index.jsp




index







Welcome.jsp

<[EMAIL PROTECTED] uri="http://java.sun.com/jsf/html"; prefix="h"%>
<[EMAIL PROTECTED] uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t" %>


index


GoHurst Welcome

  






  




WelcomeBean.java

package tomahawkfileupload;

import java.io.File;
import java.io.InputStream;
import javax.servlet.http.HttpSession;
import javax.faces.context.FacesContext;
import org.apache.myfaces.custom.fileupload.UploadedFile;

public class WelcomeBean
{
private UploadedFile theFile;

public UploadedFile getTheFile() {
  return theFile;
}

public void setTheFile (UploadedFile theFile) {
  this.theFile = theFile;
}

public String fmWelcome()
{
FacesContext context = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession)
context.getExternalContext().getSession(false);
try {
  InputStream stream = theFile.getInputStream();
  long fSize = theFile.getSize();
  byte [] buffer = new byte[(int)fSize];
  stream.read(buffer, 0, (int)fSize);
  stream.close();
} catch (Exception ioe) {
   ioe.printStackTrace(); 
}
return "success";
}
}


web.xml


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4">
  TomaModule
  
Faces Servlet
javax.faces.webapp.FacesServlet
1
  
  
Faces Servlet
*.faces
  
  
MyFacesExtensionsFilter
   
org.apache.myfaces.webapp.filter.ExtensionsFilter

  maxFileSize
  20m

  
  
MyFacesExtensionsFilter
Faces Servlet
  
  
MyFacesExtensionsFilter
/faces/myFacesExtensionResource/*
  



faces-config.xml


http://java.sun.com/dtd/web-facesconfig_1_1.dtd";>
http://java.sun.com/JSF/Configuration";>
  
WelcomeBean
tomahawkfileupload.WelcomeBean
session
  

  
*

  #{WelcomeBean.fmWelcome}
  success
  /Welcome.jsp


  #{WelcomeBean.fmBicycle}
  bypass
  /Welcome.jsp

  


-- 
View this message in context: 
http://www.nabble.com/Tomahawk-1.1.3-inputFileUpload-solution-tf2318350.html#a6449010
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Navigation with dynamic URLs

2006-09-22 Thread born
Hi everybody,

I'm stuck. I have found the following URL
http://wiki.apache.org/myfaces/Custom_Navigation_Handler. The last part
(/view.jsp?objectId=#{view.objectId}) would solve my problem, but unfortunately
it doesn't work. MyFaces render this to the URL
http://localhost:8080/productPage.jsf?product_id=#{product.jsf

This is my navigation rule

*

order
/productPage.jsf?product_id=#{product.manufacturerPartNr}




Does anybody know how I can get this example running on my environment?

Thanks a lot
Steffen



Re: Two dataList in same page

2006-09-22 Thread Mike Kienenberger

If the data is never going to change put it in application scope.

If the data is going to change, then you don't want to be doing it this way.

But if you want to be stubborn, write a phase-listener that happens
right before restore_view.

On 9/22/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:

I read some more pages, as well the one in the MyFaces 
wiki(http://wiki.apache.org/myfaces/FAQ#MissingInAction) and finally understood 
why there is no way around t:saveState.

So, stays the problem why dataList doesn't get updated. My action is called fine, which 
in turn updates the data to be fetched by the dataList. How can I force the dataList to 
"refetch" the data instead keep the old one saved in the state?
I tried [1] but it didn't work. Google as well didn't show me up something.

[1] http://wiki.apache.org/myfaces/ClearInputComponents


Mike Kienenberger schrieb:
> Backing data lists for UIComponents must persist to the next request.
> You can persist just the list instead of the entire bean.  That's
> generally how I do it.
>
> There's also a preserveTableModel attribute for t:dataTable that does
> something similar, but I don't use it -- I'd rather have the control
> that t:saveState gives me.
>
> On 9/21/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:
>> I stumbled over an interesting hint from Jeff Bischoff in the maillist:
>>
>>> Re: Refresh JSF Page
>>>
>>> That's a pretty broad topic! If you could be more specific, you might
>>> get more hints...
>>>
>>> See [1] for a neat trick to force updated model values in input components.
>>>
>>> [1] http://wiki.apache.org/myfaces/ClearInputComponents
>> I fear, that I'm forced to save the state (t:saveState) of CategoryBean just 
to force an update of it programmatically in the action method CategoryBean:select(). 
But it can't be that way. I'm sure I passed something and there is a neat, straight 
forward solution.
>>
>> Beside the clear descriptions of Mike why my problem persists, does anyone 
have an idea how to solve that puzzle?
>>
>> Patrick
>>
>> Mike Kienenberger schrieb:
>>> Is #{subscriptionCategoryBean.subscriptions} request-scoped?  If so,
>>> try using t:saveState to persist it across a page, or change it to
>>> session-scoped, or use some other persisting mechanism.
>>>
>>>
>>> On 9/15/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:
 Hi,

 I don't like the prosa form and so:
 * Tomcat 5.5.17
 * MyFaces 1.1.3
 * Tomahawk 1.1.3
 * Page with two dataList; subscriptionCategories and subscriptions
 * Links of subscriptionCategories work fine
 * Links of subscriptions don't work at all; action doesn't get called
 * Using dataTable for subscriptions doesn't work either
 * Put each list in a separate form doesn't work either
 * "Test" link (between the two lists) works as expected; action gets 
called, navigation to other page
 * Static values in "Test" link and subscriptions only for testing purposes

 Any ideas? Thanks

 Patrick

 Page snippet:
 
 
 
 >>> jsfc="t:dataList"
 layout="unorderedList"
 value="#{portalBean.subscriptionCategories}"
 var="subscriptionCategory">
 
 
 #{subscriptionCategory.name}
 
 
 
 
 
 Test
 
 
 >>> jsfc="t:dataList"
 layout="unorderedList"
 value="#{subscriptionCategoryBean.subscriptions}"
 var="subscription">
 
 
 #{subscription.title}
 
 
 
 


>>
>




Re: tree2 client side

2006-09-22 Thread William Huang
do you mean it works if clientSideToggle="true" and it doesnt work if
clientSideToggle="false"?
   
 "Pfau, Oliver"
 <[EMAIL PROTECTED] 
 ens.com>   To 
   "MyFaces Discussion"
 09/22/2006 07:28
 AM cc 
   
   Subject 
 Please respond to tree2 client side   
 "MyFaces  
Discussion"
 <[EMAIL PROTECTED] 
 ache.org> 
   
   




Hi,

when I set clientSideToggle of tree2 to true, the action of a
commandlink pddata.pdClicked will not executed. With clientSideToggle it
works. What's wrong ? Using myFaces 1.1.4 and Tomahawk 1.1.3.







 

 

 

 



Thanks,
Oliver

Disclaimer: This electronic mail and any attachments are confidential and may 
be privileged. If you are not the intended recipient, please notify the sender 
immediately by replying to this email, and destroy all copies of this email and 
any attachments. Thank you.



Re: Two dataList in same page

2006-09-22 Thread Patrick Dreyer

I read some more pages, as well the one in the MyFaces 
wiki(http://wiki.apache.org/myfaces/FAQ#MissingInAction) and finally understood 
why there is no way around t:saveState.

So, stays the problem why dataList doesn't get updated. My action is called fine, which 
in turn updates the data to be fetched by the dataList. How can I force the dataList to 
"refetch" the data instead keep the old one saved in the state?
I tried [1] but it didn't work. Google as well didn't show me up something.

[1] http://wiki.apache.org/myfaces/ClearInputComponents


Mike Kienenberger schrieb:

Backing data lists for UIComponents must persist to the next request.
You can persist just the list instead of the entire bean.  That's
generally how I do it.

There's also a preserveTableModel attribute for t:dataTable that does
something similar, but I don't use it -- I'd rather have the control
that t:saveState gives me.

On 9/21/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:

I stumbled over an interesting hint from Jeff Bischoff in the maillist:


Re: Refresh JSF Page

That's a pretty broad topic! If you could be more specific, you might
get more hints...

See [1] for a neat trick to force updated model values in input components.

[1] http://wiki.apache.org/myfaces/ClearInputComponents

I fear, that I'm forced to save the state (t:saveState) of CategoryBean just to 
force an update of it programmatically in the action method 
CategoryBean:select(). But it can't be that way. I'm sure I passed something 
and there is a neat, straight forward solution.

Beside the clear descriptions of Mike why my problem persists, does anyone have 
an idea how to solve that puzzle?

Patrick

Mike Kienenberger schrieb:

Is #{subscriptionCategoryBean.subscriptions} request-scoped?  If so,
try using t:saveState to persist it across a page, or change it to
session-scoped, or use some other persisting mechanism.


On 9/15/06, Patrick Dreyer <[EMAIL PROTECTED]> wrote:

Hi,

I don't like the prosa form and so:
* Tomcat 5.5.17
* MyFaces 1.1.3
* Tomahawk 1.1.3
* Page with two dataList; subscriptionCategories and subscriptions
* Links of subscriptionCategories work fine
* Links of subscriptions don't work at all; action doesn't get called
* Using dataTable for subscriptions doesn't work either
* Put each list in a separate form doesn't work either
* "Test" link (between the two lists) works as expected; action gets called, 
navigation to other page
* Static values in "Test" link and subscriptions only for testing purposes

Any ideas? Thanks

Patrick

Page snippet:






#{subscriptionCategory.name}





Test





#{subscription.title}














Re: tomahawk 1.1.3

2006-09-22 Thread JBuilderDoug

PROBLEM PRETTY MUCH SOLVED!!!

The primary thing I was doing wrong was that I was trying to implement
MyFaces and Tomahawk into an older project and it was using the JSP 1.1
specification instead of 2.0.

I created a new project in Borland's JBuilder and specified JSP 2.0.  I
initially used RI JSF provided by Borland, then substituted MyFaces and
Tomahawk.  There were a few .tld file issues after the substitution, but
after that all went pretty much as layed out on the myfaces.apache website.

I didn't need any additional entries in my faces-config.xml file and only
the filter entry specified by myfaces.apache in my web.xml file.

Of course, the  
> Has ANYONE been able to get tomahawk 1.1.3 inputFileUpload to work
> properly?  I've tried in both JBuilder and JDeveloper without success.
> 
> Here's what I've tried:
> 
> 1) Configured libraries for tomahawk-1.1.3.jar and Framework for the t:
> taglib (The JBuilder IDE recognizes/displays the t: taglab elements so
> does Oracle's JDeveloper)
> 2) Included this .jar with my project
> 3) Made the .jsp  4) Included in the .jsp
> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t" %>
> 5) Entered the 
> 6) in my backing bean 
>   a) import org.apache.myfaces.custom.fileupload.UploadedFile;
>   b) UploadedFile theFile
>   c) get and set methods for the File.
> 7) Placed the ExtensionsFilter in my web.xml file.
> 
> 
> MyFacesExtensionsFilter
> org.apache.myfaces.webapp.filter.ExtensionsFilter
> 
> maxFileSize
> 20m
> Set the size limit for uploaded files.
> Format: 10 - 10 bytes
> 10k - 10 KB
> 10m - 10 MB
> 1g - 1 GB
> 
> 
> 
> 
> 
> 
> MyFacesExtensionsFilter
> 
> Faces Servlet
> 
> 
> 
> 
> MyFacesExtensionsFilter
> /faces/myFacesExtensionResource/*
> 
> 
> It all compiles and runs fine but when my page comes up and I enter a file
> [Browse] and submit the form
> 
> NoClassDefFoundError
> 
> org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance()...
> org.apache.myfaces.webapp.filter.ExtensionsFilder.doFilter
> 
> I'm not getting any complaints from the IDE for syntax and there are no
> errors in the build, but it appears that I'm not able to instantiate the
> filter... at least that's what I'm reading from above.
> 

-- 
View this message in context: 
http://www.nabble.com/tomahawk-1.1.3-tf2307269.html#a6447637
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Tag reference sheet for Tomahawk 1.1.3 is not correct?

2006-09-22 Thread Rønnevik , Eivind



Hi 
all!
 
If I go to the tag 
reference sheet for Tomahawk and select dataScroller (http://myfaces.apache.org/tomahawk/tagreference.html#dataScroller), 
it says that the dataScroller has an onclick and an ondblclick 
attribute.
 
However, from my jsp 
I don't get these attributes displayed when getting the different attributes for 
that component.
 
The reference sheet 
is for tomahawk 1.1.3 which is the version I use as well.
 
Are there different 
versions of the tomahawk-1.1.3.jar out there, do I need to get a nightly build 
or something, or can anybody explain this? :) 
 
The images used in 
the facets have an onclick attribute, but I cannot handle the paginator if 
somebody click one of the page-numbers..
 
I also found this 
former post (http://www.mail-archive.com/users@myfaces.apache.org/msg25044.html) 
where it seems like a patch has been created to solve this issue, but how to use 
this then?
 
 
 
:)
 
Regards,
 
Eivind
 
 


Re: Authorization via view-handler

2006-09-22 Thread janw

Hi Patrick,

thanks for the hints and the links.

Unless I use redirect in a navigation rule, in a filter I don't get the
destination of the request, but the source.
example: login.jsp => start.jsp
When performing the login, the information I have when filtering the
login-request is the URL of login.jsp.
But useful for me is only the requested resource. In a PhaseListener I could
access the requested view-id:

public void beforePhase(PhaseEvent phaseEvent) {
  String viewId =
phaseEvent.getFacesContext().getViewRoot().getViewId();

Then I can easily distinguish if a protected resource is requested or not.
I'll try it, though coupling the authorization to the framework.

Regards,
Jan
-- 
View this message in context: 
http://www.nabble.com/Authorization-via-view-handler-tf2316361.html#a6447570
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Tree2 and Ajax4JSF Integration for Ajax Lazy Loading

2006-09-22 Thread William Huang
I havent look into DynaFaces because is still in its very early stage.  If
you found it works, that's good, you should post the solution with
DynaFaces here so other users can use it..  I will definitely look into
DynaFaces once it becomes more mature.

Thanks,

Bill
   
 Roger Keays   
 <[EMAIL PROTECTED] 
 havenue.com.au>To 
 Sent by: news users@myfaces.apache.org
 <[EMAIL PROTECTED]  cc 
 rg>   
   Subject 
   Re: Tree2 and Ajax4JSF Integration  
 09/22/2006 05:26  for Ajax Lazy Loading   
 AM
   
   
 Please respond to 
 "MyFaces  
Discussion"
 <[EMAIL PROTECTED] 
 ache.org> 
   
   




Hey Bill,

Nice Blog :)

I've got another solution under the belt using DynaFaces which doesn't
require any customization of the navigation components. Unfortunately,
DynaFaces defect #13
(https://jsf-extensions.dev.java.net/issues/show_bug.cgi?id=13) has to
be fixed before it is readily usable.

DynaFaces seems to be a very clean and efficient implementation of AJAX
for JSF.

Roger

William Huang wrote:
> There were a few postings in this mail list inquiring about tomahawk
tree2
> and ajax.  I posted a simple example in my blog
>
http://jroller.com/page/plainoldweblog?entry=use_tomahawk_tree2_and_ajax4jsf

>
> Is not a great example but is a nice start I guess.  Also my first blog
as
> well
>
> feel free to put comments on it.
>
> Thanks,
>
> William Huang
> Product Development Team
> IntraLinks, Inc.
>
> Disclaimer: This electronic mail and any attachments are confidential and
may be privileged. If you are not the intended recipient, please notify the
sender immediately by replying to this email, and destroy all copies of
this email and any attachments. Thank you.
>
>


--

Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: [EMAIL PROTECTED]



Disclaimer: This electronic mail and any attachments are confidential and may 
be privileged. If you are not the intended recipient, please notify the sender 
immediately by replying to this email, and destroy all copies of this email and 
any attachments. Thank you.



RE: Run-time component generation

2006-09-22 Thread John Holland
I'm trying to do something similar using ajax4jsf.  The issue I'm having
is that my a4j:commandLinks aren't invoking their actions or
actionListeners when clicked.  The components themselves look fine and
render accordingly though.  I'm guessing that I'm missing some
initialization that needs to be taken care of when I programmatically
create the commandLinks but I'm just not sure what that is.  If you
could give me any hints on how to accomplish this (before I spend hours
figuring it out) I would be very grateful.

-John

-Original Message-
From: Aleksei Valikov [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 12, 2006 2:50 AM
To: MyFaces Discussion
Subject: Re: Run-time component generation

Hi.

> Aleksei,
> This is very interesting what you've done.
 > The source code would definitely be more enlightening.

As far as I understood my management, we won't be releaseing it open
source. But 
of course I can share parts of the code.

 > How do you do these expanding/contracting panels?

They are actually not substracting/contracting. It's dynamic
adding/removing of 
children.

That's how it works. [+] and [-] buttons are AjaxCommandLinks with
normal images 
inside of them (see ajax4jsf library for the ajax components). They have
bound 
action handlers which know "their" panels.

When the link is clicked, ajax4jsf sends the request to the server and
action 
handler is invoked. The action handler (let's take [+] for instance)
then knows 
that he has to add new controls to his panel. These new controls are
built in 
the runtime and after that added to the corresponding panel.

The [+] AjaxCommandLink has its reRender attribute set to its panel id.
So after 
the action handler is invoked on the server side, the panel just gets 
re-rendered within the page and it showes new controls after that.

AJAX with ajax4jsf has actually minimal impact on the processing.
ajax4jsf is 
really very non-intrusive. I can change all AjaxCommandLinks back to 
HtmlCommandLinks and it will work just as well - with the exception that
the 
whole page will be reloaded on each button click.

The "tricky" part here is component creation. Well, it's also not
tricky. You 
just have to do what tags do - instantiate the components, add
value/method 
bindings, add children components or facets. Not too complex.

I am currently trying to extract business non-specific and non-critical
things 
into an open-source hifaces.dev.java.net project.

Bye.
/lexi


Re: Authorization via view-handler

2006-09-22 Thread Rogerio Pereira
I created a PhaseListener for this purpose.2006/9/22, Patrick Dreyer <[EMAIL PROTECTED]>:
Sorry, forgot about the MyFaces wiki...Just found the page about "Access FacesContext from Servlet" http://wiki.apache.org/myfaces/AccessFacesContextFromServlet
Patrick Dreyer schrieb:> Hi Jan>> Don't do authentication/authorization through a ViewHandler, use a servlet filter instead.> Citation from JavaWorld (
http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html):>>> * Use a base backing bean: This solution is simple. However, it ties the backing beans to a specific inheritance hierarchy.>> * Use a JSF ViewHandler decorator: This way, the security logic is tightly coupled with a specific Web tier technology.
>> * Use a servlet filter: A JSF application is no different from other Java-based Web applications. It makes a filter the best place >   to handle authentication checking. This way, the authentication logic is decoupled from the Web application.
>> Additionally, by using a ServletFilter the configuration keeps in web.xml and it's a snap to force SSL for example.>> There is an interesting article about page authorization in JSF on 
http://jdj.sys-con.com/read/250254.htm>> We generally put secured page in different directories (user role dependent) and close the whole directory with a security constraint.>> I'm pretty sure, you'd like to store authentication/authorization information in a JSF backing bean, thus you'll ask yourself: "How to access backing beans in a servlet filter?" A quick google search ("access jsf backing bean from servlet filter") showed up a very good hit at the first place (
http://www.thoughtsabout.net/blog/archives/33.html).>> Patrick>> janw schrieb:>> Hello, I'd like to use a ViewHandler for authorization.
>> I use tiles, so I have already a Viewhandler defined in my application>> (JspTilesViewHandlerImpl).>> How can I integrate these two view-handlers? I think I cannot define a>> second view-handler.
 I know there are frameworks like SecurityFilter, Acegi, but I need only a>> very simple auth mechanism. Regards,>> Jan>>
-- Yours truly (Atenciosamente),Rogério (_rogerio_)http://faces.eti.br


Re: Authorization via view-handler

2006-09-22 Thread Patrick Dreyer

Sorry, forgot about the MyFaces wiki...
Just found the page about "Access FacesContext from Servlet" 
http://wiki.apache.org/myfaces/AccessFacesContextFromServlet

Patrick Dreyer schrieb:

Hi Jan

Don't do authentication/authorization through a ViewHandler, use a servlet 
filter instead.
Citation from JavaWorld 
(http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html):


* Use a base backing bean: This solution is simple. However, it ties the 
backing beans to a specific inheritance hierarchy.
* Use a JSF ViewHandler decorator: This way, the security logic is tightly 
coupled with a specific Web tier technology.
* Use a servlet filter: A JSF application is no different from other Java-based Web applications. It makes a filter the best place >   to handle authentication checking. This way, the authentication logic is decoupled from the Web application. 


Additionally, by using a ServletFilter the configuration keeps in web.xml and 
it's a snap to force SSL for example.

There is an interesting article about page authorization in JSF on 
http://jdj.sys-con.com/read/250254.htm

We generally put secured page in different directories (user role dependent) and close the whole directory with a security constraint. 


I'm pretty sure, you'd like to store authentication/authorization information in a JSF backing 
bean, thus you'll ask yourself: "How to access backing beans in a servlet filter?" A 
quick google search ("access jsf backing bean from servlet filter") showed up a very good 
hit at the first place (http://www.thoughtsabout.net/blog/archives/33.html).

Patrick

janw schrieb:

Hello,

I'd like to use a ViewHandler for authorization.
I use tiles, so I have already a Viewhandler defined in my application
(JspTilesViewHandlerImpl).
How can I integrate these two view-handlers? I think I cannot define a
second view-handler.

I know there are frameworks like SecurityFilter, Acegi, but I need only a
very simple auth mechanism.

Regards,
Jan







Re: How to access input texts values from a button action method ?

2006-09-22 Thread Volker Weber

Hi,
if you know the id of the element:

FacesContext.getCurrentInstance().getViewRoot().findComponent();

Regards
  Volker


2006/9/22, Legolas Woodland <[EMAIL PROTECTED]>:

Hi
Thank you for reading my post
how i can access the web page elements value (for example in login page
to username and password)
from the button action method ?

I do not want to use binding  the page elements with the backing bean
that my action method is inside it.

is there any other way ?

thanks



Re: t:panelTabbedPane and t:dataScroller: links work only on the first p

2006-09-22 Thread András Piros

Hi Mike,

sorry to inform you, it does not work with the tomahawk 1.1.5 snapshot from
22-Sep-2006 04:50.

:andras


Mike Kienenberger wrote:
> 
> There were some changes made with javascript and links on Sat Jul 15
> 09:24:06 2006 to improve compatibility with the JSF RI.
> 
> You might try a 1.1.5 snapshot and see if the problem is already fixed.
> 
> 
> On 9/22/06, András Piros <[EMAIL PROTECTED]> wrote:
>>
>> Hi folks,
>>
>> I'm using MyFaces Tomahawk 1.1.3 and Sun's RI 1.2 together in an
>> enterprise app under Sun's GlassFish appserver.
>>
>> If I have a t:dataTable, which has a t:dataScroller, my h:commandLinks
>> inside t:dataTable work just fine, on the first page, and on every other
>> page of the dataTable:
>> [image: t:panelTabbedPane and t:dataScroller: links work only on the
>> first
>> page] [image: t:panelTabbedPane and t:dataScroller: links work only on
>> the
>> first page]
>>
>> So far, so good. But, if I generate a t:dataTable on every tab of a
>> t:panelTabbedPane (I must generate them in the backing bean
>> programmatically, because I don't even know in advance how much tabs I
>> have...), and generate a t:dataScroller for every t:dataTable inside my
>> panelTabbedPane, my h:commandLinks are working only on the first page of
>> every table, they are actually not working on the subsequent pages:
>> [image: t:panelTabbedPane and t:dataScroller: links work only on the
>> first
>> page] [image: t:panelTabbedPane and t:dataScroller: links work only on
>> the
>> first page]
>>
>> On the subsequent pages, nevertheless, a HTTP POST is done on the form
>> (every component is inside a single form), but funnily, neither the
>> commandLink's action, nor its actionListener methods are called. Instead
>> of
>> the link working, the dataScroller just jumps back to the first page on
>> the
>> actual tab.
>>
>> Any ideas? Your replies are highly appreciated!
>>
>> enjoy,
>>
>> :andras
>>
>> JSF code:
>>  > bgcolor="#EBEEF8" width="90%" cellspacing="1"
>> styleClass="tabbedPane" align="center"
>> activeTabStyleClass="activeTab"
>> inactiveTabStyleClass="inactiveTab"
>> disabledTabStyleClass="disabledTab"
>> activeSubStyleClass="activeSub"
>> inactiveSubStyleClass="inactiveSub"
>> tabContentStyleClass="tabContent" />
>>
>> Java code:
>>  public class InfoObjectTabbedPaneBean {
>>
>> ...
>>
>> public HtmlPanelTabbedPane getTabbedPane() {
>> if (this.htmlPanelTabbedPane == null) {
>> Application app = FacesContext.getCurrentInstance
>> ().getApplication();
>>
>> // tabbedpane
>> this.htmlPanelTabbedPane
>>  = (HtmlPanelTabbedPane)app.createComponent(
>> HtmlPanelTabbedPane.COMPONENT_TYPE);
>> }
>> updateTabbedPane(this.htmlPanelTabbedPane);
>> return this.htmlPanelTabbedPane;
>> }
>>
>> public void setTabbedPane(HtmlPanelTabbedPane tabbedPane){
>> updateTabbedPane(tabbedPane);
>> this.htmlPanelTabbedPane = tabbedPane;
>> }
>>
>> public void updateTabbedPane(HtmlPanelTabbedPane hptp) {
>> Application app = FacesContext.getCurrentInstance
>> ().getApplication();
>> ValueExpression valueExpressionOfId;
>> ValueExpression valueExpressionOfType;
>> int cntTabs = 0;
>>
>> // Reset
>> hptp.getChildren().clear();
>> for (...) {
>>
>> // Get data from EJBs...
>>
>> // tab i
>> UIPanel tab = (HtmlPanelTab)app.createComponent(
>> HtmlPanelTab.COMPONENT_TYPE);
>> tab.setId("panelTab" + cntTabs);
>> tab.getAttributes().put("label", actInfoObjectTypeName);
>> hptp.getChildren().add(tab);
>>
>> // datatable
>> HtmlDataTable myHdt = new HtmlDataTable();
>> myHdt.setId("hdtId" + cntTabs);
>> myHdt.setVar("hdtVar" + cntTabs);
>> myHdt.setRows(10);
>> myHdt.setBorder(0);
>> myHdt.setCellpadding("5");
>> myHdt.setCellspacing("0");
>> myHdt.setHeaderClass("columnheader");
>> myHdt.setRowClasses("oddrow, evenrow");
>> UIData hdt = myHdt;
>> tab.getChildren().add(hdt);
>>
>> // Data scroller for actual HtmlDataTable
>> HtmlDataScroller scroller = new HtmlDataScroller();
>> scroller.setPaginator(true);
>> scroller.setPaginatorActiveColumnClass("evenrow");
>> scroller.setPaginatorColumnClass("oddrow");
>> scroller.setPaginatorMaxPages(10);
>> scroller.setId("SCROLLER_" + "hdtId" + cntTabs);
>> scroller.setFor("hdtId" + cntTabs);
>> scroller.setFastStep(10);
>> scroller.setPageIndexVar("pageIndex");
>

Re: Authorization via view-handler

2006-09-22 Thread Patrick Dreyer

Hi Jan

Don't do authentication/authorization through a ViewHandler, use a servlet 
filter instead.
Citation from JavaWorld 
(http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html):


* Use a base backing bean: This solution is simple. However, it ties the 
backing beans to a specific inheritance hierarchy.
* Use a JSF ViewHandler decorator: This way, the security logic is tightly 
coupled with a specific Web tier technology.
* Use a servlet filter: A JSF application is no different from other Java-based Web applications. It makes a filter the best place >   to handle authentication checking. This way, the authentication logic is decoupled from the Web application. 


Additionally, by using a ServletFilter the configuration keeps in web.xml and 
it's a snap to force SSL for example.

There is an interesting article about page authorization in JSF on 
http://jdj.sys-con.com/read/250254.htm

We generally put secured page in different directories (user role dependent) and close the whole directory with a security constraint. 


I'm pretty sure, you'd like to store authentication/authorization information in a JSF backing 
bean, thus you'll ask yourself: "How to access backing beans in a servlet filter?" A 
quick google search ("access jsf backing bean from servlet filter") showed up a very good 
hit at the first place (http://www.thoughtsabout.net/blog/archives/33.html).

Patrick

janw schrieb:

Hello,

I'd like to use a ViewHandler for authorization.
I use tiles, so I have already a Viewhandler defined in my application
(JspTilesViewHandlerImpl).
How can I integrate these two view-handlers? I think I cannot define a
second view-handler.

I know there are frameworks like SecurityFilter, Acegi, but I need only a
very simple auth mechanism.

Regards,
Jan




How to access input texts values from a button action method ?

2006-09-22 Thread Legolas Woodland
Hi
Thank you for reading my post
how i can access the web page elements value (for example in login page
to username and password)
from the button action method ?

I do not want to use binding  the page elements with the backing bean
that my action method is inside it.

is there any other way ?

thanks


tree2 client side

2006-09-22 Thread Pfau, Oliver
Hi,

when I set clientSideToggle of tree2 to true, the action of a
commandlink pddata.pdClicked will not executed. With clientSideToggle it
works. What's wrong ? Using myFaces 1.1.4 and Tomahawk 1.1.3.



 













Thanks,
Oliver


Fwd: selectOneMenu and a4j:support

2006-09-22 Thread Aneesha Govil
Can anyone help with this please? It would be great is someone can guide me on how to make this work. It ties with the selectOneMenu problem I posted earlier.Thanks,Aneesha-- Forwarded message --
From: Aneesha Govil <[EMAIL PROTECTED]>Date: Sep 22, 2006 2:55 PMSubject: selectOneMenu and a4j:support
To: [EMAIL PROTECTED]Hi all,I am using selectOneMenu to create a drop down, on change of the dropdown I need to display a dynamic table. When the page first loads, I do not want to display the table.
In my jsp, I have used the following code:


  
    

        

        id="tabledata"        value="#{ajaxtableform.myList}" 

        var="myItem"        binding="#{ajaxtableform.myDynamicDataTable

}"   />The form bean is as follows:

public class TableForm {    private List tables = null;

    private String selectedTable = null;    

    private GenericTable[] myRecords;    private String[] headers; 
    private HtmlDataTable myDynamicDataTable;

    private List myList;    

    public String getSelectedTable() {        return selectedTable;

    }    public void setSelectedTable(String selectedTable) {
        this.selectedTable = selectedTable;

    }    public List getTables() {

        if (tables == null) {            tables = new ArrayList();
            tables.add(new SelectItem("1", "Table 1"));

            tables.add(new SelectItem("2", "Table 2"));

        }        return tables;

    }        public GenericTable tableToDisplay() {
// Getting a Null pointer exception here

        if (selectedTable.equals("1")) {            return new InventoryItem();
        }        else if (
selectedTable.equals("2")) {            return new SecondInventoryItem();

        }        else return null;

    }    

    public GenericTable[] getMyRecords() {    return myRecords;

    }    public HtmlDataTable getMyDynamicDataTable() {
    if (FacesContext.getCurrentInstance().getRenderResponse()) {

    loadMyList(); // Reload to get most recent data.    populateMyDataTable();
    }    return myDynamicDataTable;
    }

    private void loadMyList() {    

    headers = tableToDisplay().getHeaders();    

    myRecords = (selectedTable.equals("1")) ? AjaxTableDataBean.getCarInventory() : AjaxTableDataBean.getSecondInventory();

    myList = new ArrayList();    for (int i = 0; i < myRecords.length; i++) {

        myList.add(Arrays.asList(myRecords[i].getRow()));    }
    }

    private void populateMyDataTable() {        myDynamicDataTable = new HtmlDataTable();

    // Any rows?    if (myList != null && myList.size

() > 0) {    // Set columns.

    for (int i = 0; i < headers.length; i++) {    

    // Set header (optional).    UIOutput header = new UIOutput();
    header.setValue(headers[i]);

    // Set output.    UIOutput output = new UIOutput();
    ValueBinding myItem = 

    FacesContext    .getCurrentInstance()

    .getApplication()    .createValueBinding("#{myItem[" + i + "]}");
    output.setValueBinding("value", myItem);

    // Set column.

    UIColumn column = new UIColumn();    column.setHeader(header);

    column.getChildren().add(output);    

    // Add column.

    myDynamicDataTable.getChildren().add(column);    }

    }    }

    public List getMyList() {

        return myList;    }

    public void setMyList(List myList) {        this.myList = myList;
    }}

Note that the default selectedTable is null and it still tries to load the table. Due to this I get the following error:Caused by: javax.faces.el.EvaluationException

: Exception getting value of property myDynamicDataTable of base of type : demo.ajaxutils.TableFormCaused by: java.lang.NullPointerException

    at demo.ajaxutils.TableForm.tableToDisplay(TableForm.java:42)

    at demo.ajaxutils.TableForm.loadMyList(TableForm.java:66)    at 
demo.ajaxutils.TableForm.getMyDynamicDataTable(TableForm.java:58)    ... 56 moreI want the page to be displayed without trying to render the table the first time. On change of the drop down it should be rendered. Please help me how can I do this. I am using MyFaces.
Thanks.



selectOneMenu queries

2006-09-22 Thread Aneesha Govil
Hi,I have some questions about the selectOneMenu. In my work on this so far, if I set the value attribute as:
and if my selectedTable property of the form bean is set to a present value in the tableform class, the change on the UI is not reflected in the class. It always works with the same value. If I set the default value to null, it works. Why is this so? 
I am facing a problem with this behaviour. If I don't set a default value, I get a null pointer exception in some functions that are called when the page first loads. If I set it to a default value, the component is not refreshed. (I am doing this using ajax4jsf). Is there supposed to be any other way to make this work?
Thanks,Aneesha


Re: Using without StartupServletContextListener because getting"basenull" Error

2006-09-22 Thread NABA

Thanks a lot...
It works... :-)





Mike Kienenberger schrieb:

On 9/20/06, NABA <[EMAIL PROTECTED]> wrote:

Hi...
My environment:
Eclipse 3.2
Tomcat 5.5.17
jsf-impl-1.2
tomahawk-1.1.3
servlet: 2.4
1. I attached the web.xml to this mail.

I would like use Myfaces-Tomahawk and the Sun RI.
Problem:
When I build a tree () without using :
- org.apache.myfaces.webapp.StartupServletContextListener
you can see the tree, but it is not possible to collapse or expand it.
This Listener is a part of  Myfaces-impl.jar.
When I put the Myfaces-impl-1.3.jar in my project, I get a "base null"
error.
I think that it is a problem to use the Sun RI (jsf-impl) and
myfaces-impl in the same application.
My questions are:
+ Can I use the  without this listener?


Not sure.   See below.



- Is there any possibilities to use this listener without the
myfaces-impl?


I'm guessing it's not provided as part of tomahawk, and that you
probably don't need it.



+ Is it a problem to use jsf-impl and myfaces-impl in the same project??


Yes.   Not allowed.


+ contains the web.xml any errors?? what can be a reason for this 
problem?


Yes, it has errors.  Yes, it could be the cause of the problem.
You have the extensions filter mapped five times instead of two.

Delete the one for *.faces
Delete the one for /faces/*
Keep the one for Faces Servlet
Keep the one for 
/faces/myFacesExtensionResource/*

Delete the one for *.jsf

Move the servlet-name one after the myFacesExtensionResource one.






Re: t:panelTabbedPane and t:dataScroller: links work only on the first page

2006-09-22 Thread Mike Kienenberger
There were some changes made with _javascript_ and links on Sat Jul 15 09:24:06 2006 to improve compatibility with the JSF RI.You might try a 1.1.5 snapshot and see if the problem is already fixed.
On 9/22/06, András Piros <[EMAIL PROTECTED]> wrote:

Hi folks,

I'm using MyFaces Tomahawk 1.1.3 and Sun's RI 1.2 together in an enterprise app under Sun's GlassFish appserver.

If I have a t:dataTable, which has a t:dataScroller, my h:commandLinks inside t:dataTable work just fine, on the first page, and on every other page of the dataTable:




So far, so good. But, if I generate a t:dataTable on every tab of a t:panelTabbedPane (I must generate them in the backing bean programmatically, because I don't even know in advance how much tabs I have...), and generate a t:dataScroller for every t:dataTable inside my panelTabbedPane, my h:commandLinks are working only on the first page of every table, they are actually not working on the subsequent pages:





On the subsequent pages, nevertheless, a HTTP POST is done on the form (every component is inside a single form), but funnily, neither the commandLink's action, nor its actionListener methods are called. Instead of the link working, the dataScroller just jumps back to the first page on the actual tab.


Any ideas? Your replies are highly appreciated!

enjoy,

:andras

JSF code:


bgcolor="#EBEEF8" width="90%" cellspacing="1"
styleClass="tabbedPane" align="center"
activeTabStyleClass="activeTab"
inactiveTabStyleClass="inactiveTab"
disabledTabStyleClass="disabledTab"
activeSubStyleClass="activeSub"
inactiveSubStyleClass="inactiveSub"
tabContentStyleClass="tabContent" />


Java code:

public class InfoObjectTabbedPaneBean {

...

public HtmlPanelTabbedPane getTabbedPane() {
if (this.htmlPanelTabbedPane == null) {
Application app = FacesContext.getCurrentInstance().getApplication();

// tabbedpane
this.htmlPanelTabbedPane = (HtmlPanelTabbedPane)app.createComponent(HtmlPanelTabbedPane.COMPONENT_TYPE);
}
updateTabbedPane(this.htmlPanelTabbedPane);
return this.htmlPanelTabbedPane;
} 

public void setTabbedPane(HtmlPanelTabbedPane tabbedPane){
updateTabbedPane(tabbedPane);
this.htmlPanelTabbedPane = tabbedPane;
}

public void updateTabbedPane(HtmlPanelTabbedPane hptp) {
Application app = FacesContext.getCurrentInstance().getApplication();
ValueExpression valueExpressionOfId;
ValueExpression valueExpressionOfType;
int cntTabs = 0;

// Reset
hptp.getChildren().clear();
for (...) {

// Get data from EJBs...

// tab i
UIPanel tab = (HtmlPanelTab)app.createComponent(HtmlPanelTab.COMPONENT_TYPE);
tab.setId("panelTab" + cntTabs);
tab.getAttributes().put("label", actInfoObjectTypeName);
hptp.getChildren().add(tab);

// datatable
HtmlDataTable myHdt = new HtmlDataTable();
myHdt.setId("hdtId" + cntTabs);
myHdt.setVar("hdtVar" + cntTabs);
myHdt.setRows(10);
myHdt.setBorder(0);
myHdt.setCellpadding("5");
myHdt.setCellspacing("0");
myHdt.setHeaderClass("columnheader");
myHdt.setRowClasses("oddrow, evenrow");
UIData hdt = myHdt;
tab.getChildren().add(hdt);

// Data scroller for actual HtmlDataTable
HtmlDataScroller scroller = new HtmlDataScroller();
scroller.setPaginator(true);
scroller.setPaginatorActiveColumnClass("evenrow");
scroller.setPaginatorColumnClass("oddrow");
scroller.setPaginatorMaxPages(10);
scroller.setId("SCROLLER_" + "hdtId" + cntTabs);
scroller.setFor("hdtId" + cntTabs);
scroller.setFastStep(10);
scroller.setPageIndexVar("pageIndex");
scroller.setPageCountVar("pageCount");
// First
HtmlGraphicImage imageFirst = new HtmlGraphicImage();
imageFirst.setUrl("/images/first.gif");
imageFirst.setAlt("First");
imageFirst.setStyleClass("imagelink");
scroller.setFirst(imageFirst);
// Last
HtmlGraphicImage imageLast = new HtmlGraphicImage();
imageLast.setUrl("/images/last.gif");
imageLast.setAlt("First");
imageLast.setStyleClass("imagelink");
scroller.setLast(imageLast);
// Previous
HtmlGraphicImage imagePrevious = new HtmlGraphicImage();
imagePrevious.setUrl("/images/prev.gif");
imag

Re: Tree2 and Ajax4JSF Integration for Ajax Lazy Loading

2006-09-22 Thread Roger Keays


Hey Bill,

Nice Blog :)

I've got another solution under the belt using DynaFaces which doesn't 
require any customization of the navigation components. Unfortunately, 
DynaFaces defect #13 
(https://jsf-extensions.dev.java.net/issues/show_bug.cgi?id=13) has to 
be fixed before it is readily usable.


DynaFaces seems to be a very clean and efficient implementation of AJAX 
for JSF.


Roger

William Huang wrote:

There were a few postings in this mail list inquiring about tomahawk tree2
and ajax.  I posted a simple example in my blog
http://jroller.com/page/plainoldweblog?entry=use_tomahawk_tree2_and_ajax4jsf

Is not a great example but is a nice start I guess.  Also my first blog as
well

feel free to put comments on it.

Thanks,

William Huang
Product Development Team
IntraLinks, Inc.

Disclaimer: This electronic mail and any attachments are confidential and may 
be privileged. If you are not the intended recipient, please notify the sender 
immediately by replying to this email, and destroy all copies of this email and 
any attachments. Thank you.





--

Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: [EMAIL PROTECTED]




t:panelTabbedPane and t:dataScroller: links work only on the first page

2006-09-22 Thread András Piros

Hi folks,

I'm using MyFaces Tomahawk 1.1.3 and Sun's RI 1.2 together in an enterprise app under Sun's GlassFish appserver.

If I have a t:dataTable, which has a t:dataScroller, my h:commandLinks inside t:dataTable work just fine, on the first page, and on every other page of the dataTable:




So far, so good. But, if I generate a t:dataTable on every tab of a t:panelTabbedPane (I must generate them in the backing bean programmatically, because I don't even know in advance how much tabs I have...), and generate a t:dataScroller for every t:dataTable inside my panelTabbedPane, my h:commandLinks are working only on the first page of every table, they are actually not working on the subsequent pages:




On the subsequent pages, nevertheless, a HTTP POST is done on the form (every component is inside a single form), but funnily, neither the commandLink's action, nor its actionListener methods are called. Instead of the link working, the dataScroller just jumps back to the first page on the actual tab.

Any ideas? Your replies are highly appreciated!

enjoy,

:andras

JSF code:


bgcolor="#EBEEF8" width="90%" cellspacing="1"
styleClass="tabbedPane" align="center"
activeTabStyleClass="activeTab"
inactiveTabStyleClass="inactiveTab"
disabledTabStyleClass="disabledTab"
activeSubStyleClass="activeSub"
inactiveSubStyleClass="inactiveSub"
tabContentStyleClass="tabContent" />


Java code:

public class InfoObjectTabbedPaneBean {

...

public HtmlPanelTabbedPane getTabbedPane() {
if (this.htmlPanelTabbedPane == null) {
Application app = FacesContext.getCurrentInstance().getApplication();

// tabbedpane
this.htmlPanelTabbedPane = (HtmlPanelTabbedPane)app.createComponent(HtmlPanelTabbedPane.COMPONENT_TYPE);
}
updateTabbedPane(this.htmlPanelTabbedPane);
return this.htmlPanelTabbedPane;
} 

public void setTabbedPane(HtmlPanelTabbedPane tabbedPane){
updateTabbedPane(tabbedPane);
this.htmlPanelTabbedPane = tabbedPane;
}

public void updateTabbedPane(HtmlPanelTabbedPane hptp) {
Application app = FacesContext.getCurrentInstance().getApplication();
ValueExpression valueExpressionOfId;
ValueExpression valueExpressionOfType;
int cntTabs = 0;

// Reset
hptp.getChildren().clear();
for (...) {

// Get data from EJBs...

// tab i
UIPanel tab = (HtmlPanelTab)app.createComponent(HtmlPanelTab.COMPONENT_TYPE);
tab.setId("panelTab" + cntTabs);
tab.getAttributes().put("label", actInfoObjectTypeName);
hptp.getChildren().add(tab);

// datatable
HtmlDataTable myHdt = new HtmlDataTable();
myHdt.setId("hdtId" + cntTabs);
myHdt.setVar("hdtVar" + cntTabs);
myHdt.setRows(10);
myHdt.setBorder(0);
myHdt.setCellpadding("5");
myHdt.setCellspacing("0");
myHdt.setHeaderClass("columnheader");
myHdt.setRowClasses("oddrow, evenrow");
UIData hdt = myHdt;
tab.getChildren().add(hdt);

// Data scroller for actual HtmlDataTable
HtmlDataScroller scroller = new HtmlDataScroller();
scroller.setPaginator(true);
scroller.setPaginatorActiveColumnClass("evenrow");
scroller.setPaginatorColumnClass("oddrow");
scroller.setPaginatorMaxPages(10);
scroller.setId("SCROLLER_" + "hdtId" + cntTabs);
scroller.setFor("hdtId" + cntTabs);
scroller.setFastStep(10);
scroller.setPageIndexVar("pageIndex");
scroller.setPageCountVar("pageCount");
// First
HtmlGraphicImage imageFirst = new HtmlGraphicImage();
imageFirst.setUrl("/images/first.gif");
imageFirst.setAlt("First");
imageFirst.setStyleClass("imagelink");
scroller.setFirst(imageFirst);
// Last
HtmlGraphicImage imageLast = new HtmlGraphicImage();
imageLast.setUrl("/images/last.gif");
imageLast.setAlt("First");
imageLast.setStyleClass("imagelink");
scroller.setLast(imageLast);
// Previous
HtmlGraphicImage imagePrevious = new HtmlGraphicImage();
imagePrevious.setUrl("/images/prev.gif");
imagePrevious.setAlt("Previous");
imagePrevious.setStyleClass("imagelink");
scroller.setPrevious(imagePrevious);
// Next
HtmlGraphicImage imageNext = new HtmlGraphicImage();
imageNext.setUrl("/ima

Re: Using Tobago dynamically from servlet ??

2006-09-22 Thread Volker Weber

Hi Peter,

please still comunicate over the list.

You can create the component tree programatically in your java code.

In my example our application should create the UIPanel and content
dynamically in invokeApplicationPhase.

I currently don't know links to examples or howtos, and no time to search.

But you ma took a look at the tobago tx tag classes e.g.

org.apache.myfaces.tobago.taglib.extension.InExtensionTag source

the :

Hi Volker,

I am a little unsure of your answer. The body of the content Panel,
is a method call executed at run-time. The result must be some HTML/JavaScript 
code inserted into the page, correct ?
But rather then generate HTML, I'd prefer to generate Tobago components, to be 
within the same paradigm. But these would need to be compiled ... ?

Or is there another way to generate the component tree ?

Thanks,

Peter



>Hi Peter,
>
>you don't need to generate a jsp, you just need to create the
>component tree and map it
>via binding into a skeleton jsp.
>
>e.g.:
>
>
>  
>
>  
>
>  
><%-- left side navagation --%>
>  
>
>
>  
><%-- content filled by application --%>
>  
>
>
>
>
>with this your application has full control over the contentPanels content.
>
>Regards
>Volker
>
>
>2006/9/22, Peter Rabing <[EMAIL PROTECTED]>:
>> Hi,
>>
>> I'd like to create a web page whose structure and layout is determined by my 
back-end db. I.e. the layout and structure is highly dynamic in response to user 
input and the state of the back-end. Imagine a workflow machine whose masks can be 
defined by an administrator and whose steps are determined by a rule engine.
>>
>> I still would like to use the benefits of Tobago such as 
internationalization, java script handling etc.
>>
>> I thought about generating a jsp and compile it on the fly, though my guess 
is that this doesn't give me a very good performance ...
>>
>> Do you have any other ideas ??
>>
>> Thanks,
>>
>> Peter
>> --
>> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
>> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>>
>
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



Re: Using Tobago dynamically from servlet ??

2006-09-22 Thread Peter Rabing
Hi Volker,

I am a little unsure of your answer. The body of the content Panel,
is a method call executed at run-time. The result must be some HTML/JavaScript 
code inserted into the page, correct ?
But rather then generate HTML, I'd prefer to generate Tobago components, to be 
within the same paradigm. But these would need to be compiled ... ?

Or is there another way to generate the component tree ?

Thanks,

Peter



>Hi Peter,
>
>you don't need to generate a jsp, you just need to create the
>component tree and map it
>via binding into a skeleton jsp.
>
>e.g.:
>
>
>  
>
>  
>
>  
><%-- left side navagation --%>
>  
>
>
>  
><%-- content filled by application --%>
>  
>
>
>
>
>with this your application has full control over the contentPanels content.
>
>Regards
>Volker
>
>
>2006/9/22, Peter Rabing <[EMAIL PROTECTED]>:
>> Hi,
>>
>> I'd like to create a web page whose structure and layout is determined by my 
>> back-end db. I.e. the layout and structure is highly dynamic in response to 
>> user input and the state of the back-end. Imagine a workflow machine whose 
>> masks can be defined by an administrator and whose steps are determined by a 
>> rule engine.
>>
>> I still would like to use the benefits of Tobago such as 
>> internationalization, java script handling etc.
>>
>> I thought about generating a jsp and compile it on the fly, though my guess 
>> is that this doesn't give me a very good performance ...
>>
>> Do you have any other ideas ??
>>
>> Thanks,
>>
>> Peter
-- 
NEU: GMX DSL Sofort-Start-Set - blitzschnell ins Internet!
Echte DSL-Flatrate ab 0,- Euro* http://www.gmx.net/de/go/dsl


Re: Errors on page

2006-09-22 Thread Martin Marinschek

Do me a favour and check if you have forms embedded in a form. That's
disallowed in HTML, and might be the reason for this!

regards,

Martin

On 9/22/06, Martin Marinschek <[EMAIL PROTECTED]> wrote:

The javascript looks good to me. What's your html-header?

regards,

Martin

On 9/22/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Supposedly Myfaces Core 1.1.4 and Tomahawk 1.1.3 are compatible.   But
> maybe we missed something.
>
> I'm using Core 1.1.4 and Tomahawk 1.1.5-snapshot (Aug 18th) myself.
>
> Wait a little bit and see if someone more knowledgeable about
> javascript comes online to help you.   I'm pretty useless when it
> comes to javascript errors.
>
> On 9/22/06, Dave <[EMAIL PROTECTED]> wrote:
> > I have already removed MyFaces libs coming with JBoss. But it did not solve
> > the issue.
> >
> > In FireFox javascipt console:
> >
> > Error: Error in parsing value for property 'cursor'.  Declaration dropped.
> > Source File:
> > 
http://localhost:8080/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11589087/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.css
> > Line: 40
> >  .myFaces_panelTabbedPane_disabledHeaderCell label{ cursor:
> > normal; background-color: silver; }
> >
> >
> > Error: f has no properties
> > Source File: http://localhost:8080/foo.faces
> > Line: 148
> >
> >  > action="/foo.faces"
> > enctype="application/x-www-form-urlencoded"
> > class="standard"> > name="foo:bar:aform:_idJsp147" type="text" value="" /> > id="foo:bar:aform:search" name="foo:bar:aform:search" type="submit"
> > value="Search"
> > 
onclick="clear_foo_3Abar_3Aaform();if(window.getScrolling!=undefined){document.forms['foo:bar:aform'].elements['autoScroll'].value=getScrolling();}"
> > />
> > 
> >  > name="foo:bar:aform:_link_hidden_" /> > type="text/javascript">
> >
> > --
> > The 2nd error message says f has no properties. The form does not have
> > "target" property, but I am not sure whether that is what it means.
> >
> > MyFaces and Tomahawk, which combination is tested to be compatible?
> >
> > Thanks for help.
> >
> >
> > Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > I haven't tried that particular combination of MyFaces Core and
> > Tomahawk, but it's possible that there's a javascript incompatibility
> > between them. It may also be that you've simply got the extensions
> > filter configuration wrong. The easiest thing to do would be to
> > check to see what javascript errors firefox is showing.
> >
> > On 9/22/06, Dave wrote:
> > > I did not add my own JavaScript code. All JavaScript code are generated by
> > > MyFaces. Anyone saw the same error message on IE status bar?
> > >
> > > Thanks!
> > >
> > > Mike Kienenberger wrote:
> > > I'd guess javascript errors. Firefox has a separate console window
> > > that will display them.
> > > Don't remember how it's done for IE.
> > >
> > > On 9/22/06, Dave wrote:
> > > > I saw "Errors on Page" message on IE status bar after showing a MyFaces
> > > > page, but I did not see the error message on FireFox. The page seems
> > > working
> > > > well, but users does not like the error message on the status bar.
> > > >
> > > > Is there a way to debug it? What might be the cause?
> > > >
> > > > I am using MyFaces 1.1.4 and Tomahawk 1.1.3 on JBoss AS 4.0.4CR2.
> > > >
> > > > Thanks for help.
> > > >
> > > > 
> > > > All-new Yahoo! Mail - Fire up a more powerful email and get things done
> > > > faster.
> > > >
> > > >
> > >
> > >
> > >
> > > 
> > > All-new Yahoo! Mail - Fire up a more powerful email and get things done
> > > faster.
> > >
> > >
> >
> >
> >
> >  
> > Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates
> > starting at 1¢/min.
> >
> >
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces




--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Re: Accessing JSP action var attribute from normal JSP expression or action

2006-09-22 Thread Mike Kienenberger

On 8/23/06, Daniel Kröger <[EMAIL PROTECTED]> wrote:

I'm a bit confused since the description of the var attribute for the
dataTable action says it's the request scope variable that holds the
current row object.

But the following exemplary code doesn't work anyway:


   
 
 ${child.name}
   


So is there any other way to access the current var attribute from a
normal JSP expression or action?


 will work.  If it's not working,
it's probably because #{children} is wrong or empty.  Generally, it''s
#{bean.list} so what you have there looks a little odd.

${child.name} will not work.   $ searches the
jsp scope, not the JSF scope.   I think this scope is only used when
the page is compiled, but I don't use JSP.


Re: how to access a managed bean from a button action listener ?

2006-09-22 Thread Craig McClanahan
On 9/21/06, Legolas Woodland <[EMAIL PROTECTED]> wrote:
Hithank you for reading my posthow i can access a managed bean from a button action listener ?for example i have a managed bean named session and its scope is session, i used it to store user details until he/she logout
and when he/she pressed the logout button i need to change some of thatmanaged bean property ,can you please tell me how i can do it ?I also need it for time that user press the login button.thanks
From within an action listener, you can access a session scoped value named "foo" in a couple of different ways:(1) Use the session attributes map in external context:FacesContext context = 
FacesContext.getCurrentInstance();Map sessionAttributesMap = context.getExternalContext().getSessionMap();FooBean value = (FooBean) sessionAttributesMap.get("foo");*** NOTE:  This approach does not trigger managed bean
 creation if the bean does not already exist.(2) Use the managed bean mechanism programmatically:FacesContext context = FacesContext.getCurrentInstance();FooBean value = (FooBean)  context.getApplication
().getVariableResolver().resolveVariable("foo");This will use the same managed beans creation logic that JSF uses when resolving expressions, so it will cause the bean to be created if needed.If you're using Shale[1], by the way, there is a convenience method called getBean() in the abstract base class for view controllers that hides the grungy detail for you.
Craig[1] http://shale.apache.org/


Re: Errors on page

2006-09-22 Thread Martin Marinschek

The javascript looks good to me. What's your html-header?

regards,

Martin

On 9/22/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:

Supposedly Myfaces Core 1.1.4 and Tomahawk 1.1.3 are compatible.   But
maybe we missed something.

I'm using Core 1.1.4 and Tomahawk 1.1.5-snapshot (Aug 18th) myself.

Wait a little bit and see if someone more knowledgeable about
javascript comes online to help you.   I'm pretty useless when it
comes to javascript errors.

On 9/22/06, Dave <[EMAIL PROTECTED]> wrote:
> I have already removed MyFaces libs coming with JBoss. But it did not solve
> the issue.
>
> In FireFox javascipt console:
>
> Error: Error in parsing value for property 'cursor'.  Declaration dropped.
> Source File:
> 
http://localhost:8080/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11589087/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.css
> Line: 40
>  .myFaces_panelTabbedPane_disabledHeaderCell label{ cursor:
> normal; background-color: silver; }
>
>
> Error: f has no properties
> Source File: http://localhost:8080/foo.faces
> Line: 148
>
>  action="/foo.faces"
> enctype="application/x-www-form-urlencoded"
> class="standard"> name="foo:bar:aform:_idJsp147" type="text" value="" /> id="foo:bar:aform:search" name="foo:bar:aform:search" type="submit"
> value="Search"
> 
onclick="clear_foo_3Abar_3Aaform();if(window.getScrolling!=undefined){document.forms['foo:bar:aform'].elements['autoScroll'].value=getScrolling();}"
> />
> 
>  name="foo:bar:aform:_link_hidden_" /> type="text/javascript">
>
> --
> The 2nd error message says f has no properties. The form does not have
> "target" property, but I am not sure whether that is what it means.
>
> MyFaces and Tomahawk, which combination is tested to be compatible?
>
> Thanks for help.
>
>
> Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> I haven't tried that particular combination of MyFaces Core and
> Tomahawk, but it's possible that there's a javascript incompatibility
> between them. It may also be that you've simply got the extensions
> filter configuration wrong. The easiest thing to do would be to
> check to see what javascript errors firefox is showing.
>
> On 9/22/06, Dave wrote:
> > I did not add my own JavaScript code. All JavaScript code are generated by
> > MyFaces. Anyone saw the same error message on IE status bar?
> >
> > Thanks!
> >
> > Mike Kienenberger wrote:
> > I'd guess javascript errors. Firefox has a separate console window
> > that will display them.
> > Don't remember how it's done for IE.
> >
> > On 9/22/06, Dave wrote:
> > > I saw "Errors on Page" message on IE status bar after showing a MyFaces
> > > page, but I did not see the error message on FireFox. The page seems
> > working
> > > well, but users does not like the error message on the status bar.
> > >
> > > Is there a way to debug it? What might be the cause?
> > >
> > > I am using MyFaces 1.1.4 and Tomahawk 1.1.3 on JBoss AS 4.0.4CR2.
> > >
> > > Thanks for help.
> > >
> > > 
> > > All-new Yahoo! Mail - Fire up a more powerful email and get things done
> > > faster.
> > >
> > >
> >
> >
> >
> > 
> > All-new Yahoo! Mail - Fire up a more powerful email and get things done
> > faster.
> >
> >
>
>
>
>  
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates
> starting at 1¢/min.
>
>




--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Re: Errors on page

2006-09-22 Thread Mike Kienenberger

Supposedly Myfaces Core 1.1.4 and Tomahawk 1.1.3 are compatible.   But
maybe we missed something.

I'm using Core 1.1.4 and Tomahawk 1.1.5-snapshot (Aug 18th) myself.

Wait a little bit and see if someone more knowledgeable about
javascript comes online to help you.   I'm pretty useless when it
comes to javascript errors.

On 9/22/06, Dave <[EMAIL PROTECTED]> wrote:

I have already removed MyFaces libs coming with JBoss. But it did not solve
the issue.

In FireFox javascipt console:

Error: Error in parsing value for property 'cursor'.  Declaration dropped.
Source File:
http://localhost:8080/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11589087/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.css
Line: 40
 .myFaces_panelTabbedPane_disabledHeaderCell label{ cursor:
normal; background-color: silver; }


Error: f has no properties
Source File: http://localhost:8080/foo.faces
Line: 148





--
The 2nd error message says f has no properties. The form does not have
"target" property, but I am not sure whether that is what it means.

MyFaces and Tomahawk, which combination is tested to be compatible?

Thanks for help.


Mike Kienenberger <[EMAIL PROTECTED]> wrote:
I haven't tried that particular combination of MyFaces Core and
Tomahawk, but it's possible that there's a javascript incompatibility
between them. It may also be that you've simply got the extensions
filter configuration wrong. The easiest thing to do would be to
check to see what javascript errors firefox is showing.

On 9/22/06, Dave wrote:
> I did not add my own JavaScript code. All JavaScript code are generated by
> MyFaces. Anyone saw the same error message on IE status bar?
>
> Thanks!
>
> Mike Kienenberger wrote:
> I'd guess javascript errors. Firefox has a separate console window
> that will display them.
> Don't remember how it's done for IE.
>
> On 9/22/06, Dave wrote:
> > I saw "Errors on Page" message on IE status bar after showing a MyFaces
> > page, but I did not see the error message on FireFox. The page seems
> working
> > well, but users does not like the error message on the status bar.
> >
> > Is there a way to debug it? What might be the cause?
> >
> > I am using MyFaces 1.1.4 and Tomahawk 1.1.3 on JBoss AS 4.0.4CR2.
> >
> > Thanks for help.
> >
> > 
> > All-new Yahoo! Mail - Fire up a more powerful email and get things done
> > faster.
> >
> >
>
>
>
> 
> All-new Yahoo! Mail - Fire up a more powerful email and get things done
> faster.
>
>



 
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates
starting at 1¢/min.




Re: Errors on page

2006-09-22 Thread Dave
I have already removed MyFaces libs coming with JBoss. But it did not solve the issue.     In FireFox javascipt console:     Error: Error in parsing value for property 'cursor'.  Declaration dropped.Source File: http://localhost:8080/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11589087/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.cssLine: 40   .myFaces_panelTabbedPane_disabledHeaderCell label{   cursor: normal;   background-color: silver;  }     Error: f has no propertiesSource File: http://localhost:8080/foo.facesLine: 148