Re: Reference to documentation for implementing functions to be used in EL

2008-09-05 Thread Gary VanMatre

 -- Original message --
From: "Jacob Mathew" <[EMAIL PROTECTED]>
> I'm looking for documentation on implementing functions that can be
> used in EL in jsf pages. Maybe I'm missing something, but the best
> info I can find is that the a FunctionMapper object is used to resolve
> functions that show up in EL. But how can I define my own
> FunctionMapper? how do I set it? Can the default FunctionMapper be
> configured through an config file? I can't seem to find any info on
> this. Any reference will be much appreciated.
>

Using the EL functions in JSP is simpler than trying to use them in late bound 
EL in JSF.  First you need to create a static function and then register it in 
a TLD [3].  Next, add the namespace to the page [4].

For example:
https://svn.apache.org/viewvc/shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/el/MockFunctionMapper.java?view=markup
[2] 
https://svn.apache.org/viewvc/tomcat/jasper/tc6.0.x/src/share/org/apache/jasper/el/ELContextWrapper.java?view=markup
[3] 
  

   Returns a formated date using the specified pattern.

formatDate
demo.tfun.TagFunctions
java.lang.String formatDate(java.util.Date,
java.lang.String)

   tfun:formatDate( date , "MM/dd/")

  
[4] 
<%@ taglib uri="http://demo.tfun"; prefix="tfun"%>




 
> -Jacob



Re: [Trinidad] [Proposal] Tree "Expand All" handling

2008-08-21 Thread Gary VanMatre
+1 Sounds like a solid plan that could result in a significant performance boost

Gary 
 -- Original message --
From: "Kamran Kashanian" <[EMAIL PROTECTED]>
> There is some code in the Trinidad UIXTree which is intended to prevent the
> user from doing an unbounded "Expand All" on large trees (see
> UIXTree.broadcast() method. Specifically
> HierarchyUtils.__handleBroadcast()).
> 
> The code counts the number of newly expanded nodes and if it is > 100 then
> it counts the total number of nodes in the tree and if the total is also >
> 100, it prevents an expand all and only expands two levels.
> 
> There are several issues with this:
> 
> 1) This code is executed on every expand/collapse event and can be
> expensive. Counting 100 nodes in the RowKeySet and in the tree (see
> TableUtils._getSizeOfTree()) can force the model to do additional data
> fetches beyond what is currently displayed in the view port. Also the number
> 100 is completely arbitary.
> 
> 2) There is no way to for this code to know if the user did an "Expand All"
> or just did something to cause 100 nodes to expand. For example "Expand All
> Below", or just select 100 nodes and do "Expand" from a menu. In these cases
> the user will get unexpcted results (only two levels will expand)
> 
> 3) Preventing the user from doing an Expand All should really be part of
> application logic and has no place in the framework. Normally the
> application would display a warning and ask the user if they really want to
> do an expand all in response to a user action
> 
> 
> [Proposal]
> 
> I would like to propose that this code be removed from UIXTree. I will
> submit a patch if there are no strong objections.  This *is* a change in the
> Trinidad tree functionality, and I am not sure how it impacts current users.
> 
> 
> Thanks
> Kamran


--- Begin Message ---
There is some code in the Trinidad UIXTree which is intended to prevent the user from doing an unbounded "Expand All" on large trees (see UIXTree.broadcast() method. Specifically HierarchyUtils.__handleBroadcast()).
The code counts the number of newly expanded nodes and if it is > 100 then it counts the total number of nodes in the tree and if the total is also > 100, it prevents an expand all and only expands two levels.
There are several issues with this:1) This code is executed on every expand/collapse event and can be expensive. Counting 100 nodes in the RowKeySet and in the tree (see TableUtils._getSizeOfTree()) can force the model to do additional data fetches beyond what is currently displayed in the view port. Also the number 100 is completely arbitary.
2) There is no way to for this code to know if the user did an "Expand All" or just did something to cause 100 nodes to expand. For example "Expand All Below", or just select 100 nodes and do "Expand" from a menu. In these cases the user will get unexpcted results (only two levels will expand)
3) Preventing the user from doing an Expand All should really be part of application logic and has no place in the framework. Normally the application would display a warning and ask the user if they really want to do an expand all in response to a user action
[Proposal]  I would like to propose that this code be removed from UIXTree. I will submit a patch if there are no strong objections.  This *is* a change in the Trinidad tree functionality, and I am not sure how it impacts current users.
ThanksKamran
--- End Message ---


Re: Partial submit is not working on Weblogic 10

2008-08-12 Thread Gary VanMatre

 -- Original message --
From: "Matthias Wessendorf" <[EMAIL PROTECTED]>
> Gary,
> 
> can you tell us the issue # from the RI for that?
> I want to check with myfaces.
> 


My best guess was 507 [1] but I'm really not sure, as the current (1.2_09) is 5 
releases ahead.


[1] https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=507




> thx,
> Matthias
>

Gary
 
> On Mon, Aug 11, 2008 at 10:50 PM, Gary VanMatre <[EMAIL PROTECTED]> wrote:
> >
> >  -- Original message --
> > From: "Matthias Wessendorf" <[EMAIL PROTECTED]>
> >> On Mon, Sep 17, 2007 at 2:35 PM, mjdenham <[EMAIL PROTECTED]> wrote:
> >> >
> >> > I worked out that you need to enable the jstl 1.2 shared library in 
> Weblogic
> >> > 10 as it is not enabled by default.
> >> >
> >> > Now I get the following exception when redeploying the demo app:
> >> >
> >> > java.lang.IllegalStateException: strict servlet API: cannot call 
> getWriter()
> >> > after getOutputStream()
> >> >at
> >> >
> >> 
> weblogic.servlet.internal.ServletResponseImpl.getWriter(ServletResponseImpl.java
> >> :297)
> >> >at
> >> >
> >> 
> javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:122)
> >> >at
> >> >
> >> 
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerI
> >> mpl.java:317)
> >> >at
> >> >
> >> 
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45
> >> )
> >> >at
> >> >
> >> 
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewH
> >> andlerImpl.java:175)
> >> >Truncated. see log file for complete stacktrace
> >> >>
> >> >
> >> > Any ideas?
> >>
> >> This was fixed last week:
> >> https://issues.apache.org/jira/browse/TRINIDAD-1170
> >>
> >
> > Another issue that we have been seeing is that weblogic ships with JSF 
> > 1.2_03. 
> We've found that some large PPR request are truncated.  This bug was fix in 
> JSF 
> 1.2_04.  You are better off including JSF 1.2_07 in your web project if you 
> are 
> using the RI.
> >
> >
> >
> > Gary
> >
> >> >
> >> > Thanks
> >> >
> >> > Martin
> >> >
> >> >
> >> > Matthias Wessendorf-4 wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> On 9/17/07, mjdenham <[EMAIL PROTECTED]> wrote:
> >> >>>
> >> >>> I downloaded trinidad-demo-1.2.2 and tried to run it on Weblogic 10.
> >> >>>
> >> >>> First of all I received
> >> >>>java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
> >> >>> so I added jstl.jar from jakarta-taglibs-standard-1.1.2.zip
> >> >>
> >> >> Trinidad 1.2.x is designed to work with JSF 1.2 / JavaEE 5.
> >> >> So, the JSTL version 1.2 is provided by the container. Doesn't
> >> >> Weblogic 10 do so ?
> >> >>
> >> >>
> >> >>> Then the demo appeared to run without problems but nothing happens 
> >> >>> when I
> >> >>> click on any of the tabs on panelTabbed.jspx, navigationPane.jspx, or
> >> >>> panelAccordion.jspx.  It seems none of the partial submits work.
> >> >>
> >> >> just tested this:
> >> >>
> >> >>
> >> 
> http://example.irian.at/trinidad-demo-20070917/faces/components/panelTabbed.jspx
> >> >>
> >> >> works for me.
> >> >>
> >> >> do you get any infos in the log?
> >> >> I recommend to use firebug, to see if there is a partial submit, via
> >> >> XHR (XmlHttpRequest object)
> >> >>
> >> >> -Matthias
> >> >>
> >> >>>
> >> >>> The last tab on navigationPane.jspx with the title 'Component Guide' 
> >> >>> does
> >> >>> not do a partial submit and it works fine.  Also, interestingly, if I
> >> >>> click
> >> >>> on a tab and then hit Page-refresh the tab changes.
> >> >>>
> >> >>> Please help.  Thanks.
> >> >>>
> >> >>> Martin
> >> >>> --
> >> >>> View this message in context:
> >> >>>
> >> 
> http://www.nabble.com/Partial-submit-is-not-working-on-Weblogic-10-tf4465921.htm
> >> l#a12733657
> >> >>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >> --
> >> >> Matthias Wessendorf
> >> >>
> >> >> further stuff:
> >> >> blog: http://matthiaswessendorf.wordpress.com/
> >> >> mail: matzew-at-apache-dot-org
> >> >>
> >> >>
> >> >
> >> > --
> >> > View this message in context:
> >> 
> http://www.nabble.com/Partial-submit-is-not-working-on-Weblogic-10-tf4465921.htm
> >> l#a12734893
> >> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Matthias Wessendorf
> >>
> >> Need JSF and Web 2.0?
> >> http://code.google.com/p/facesgoodies
> >>
> >> further stuff:
> >> blog: http://matthiaswessendorf.wordpress.com/
> >> sessions: http://www.slideshare.net/mwessendorf
> >> mail: matzew-at-apache-dot-org
> >
> >
> 
> 
> 
> -- 
> Matthias Wessendorf
> 
> Need JSF and Web 2.0?
> http://code.google.com/p/facesgoodies
> 
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> mail: matzew-at-apache-dot-org


Re: Partial submit is not working on Weblogic 10

2008-08-11 Thread Gary VanMatre

 -- Original message --
From: "Matthias Wessendorf" <[EMAIL PROTECTED]>
> On Mon, Sep 17, 2007 at 2:35 PM, mjdenham <[EMAIL PROTECTED]> wrote:
> >
> > I worked out that you need to enable the jstl 1.2 shared library in Weblogic
> > 10 as it is not enabled by default.
> >
> > Now I get the following exception when redeploying the demo app:
> >
> > java.lang.IllegalStateException: strict servlet API: cannot call getWriter()
> > after getOutputStream()
> >at
> > 
> weblogic.servlet.internal.ServletResponseImpl.getWriter(ServletResponseImpl.java
> :297)
> >at
> > 
> javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:122)
> >at
> > 
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerI
> mpl.java:317)
> >at
> > 
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45
> )
> >at
> > 
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewH
> andlerImpl.java:175)
> >Truncated. see log file for complete stacktrace
> >>
> >
> > Any ideas?
> 
> This was fixed last week:
> https://issues.apache.org/jira/browse/TRINIDAD-1170
>

Another issue that we have been seeing is that weblogic ships with JSF 1.2_03. 
We've found that some large PPR request are truncated.  This bug was fix in JSF 
1.2_04.  You are better off including JSF 1.2_07 in your web project if you are 
using the RI.



Gary

> >
> > Thanks
> >
> > Martin
> >
> >
> > Matthias Wessendorf-4 wrote:
> >>
> >> Hi,
> >>
> >> On 9/17/07, mjdenham <[EMAIL PROTECTED]> wrote:
> >>>
> >>> I downloaded trinidad-demo-1.2.2 and tried to run it on Weblogic 10.
> >>>
> >>> First of all I received
> >>>java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
> >>> so I added jstl.jar from jakarta-taglibs-standard-1.1.2.zip
> >>
> >> Trinidad 1.2.x is designed to work with JSF 1.2 / JavaEE 5.
> >> So, the JSTL version 1.2 is provided by the container. Doesn't
> >> Weblogic 10 do so ?
> >>
> >>
> >>> Then the demo appeared to run without problems but nothing happens when I
> >>> click on any of the tabs on panelTabbed.jspx, navigationPane.jspx, or
> >>> panelAccordion.jspx.  It seems none of the partial submits work.
> >>
> >> just tested this:
> >>
> >> 
> http://example.irian.at/trinidad-demo-20070917/faces/components/panelTabbed.jspx
> >>
> >> works for me.
> >>
> >> do you get any infos in the log?
> >> I recommend to use firebug, to see if there is a partial submit, via
> >> XHR (XmlHttpRequest object)
> >>
> >> -Matthias
> >>
> >>>
> >>> The last tab on navigationPane.jspx with the title 'Component Guide' does
> >>> not do a partial submit and it works fine.  Also, interestingly, if I
> >>> click
> >>> on a tab and then hit Page-refresh the tab changes.
> >>>
> >>> Please help.  Thanks.
> >>>
> >>> Martin
> >>> --
> >>> View this message in context:
> >>> 
> http://www.nabble.com/Partial-submit-is-not-working-on-Weblogic-10-tf4465921.htm
> l#a12733657
> >>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>>
> >>>
> >>
> >>
> >> --
> >> Matthias Wessendorf
> >>
> >> further stuff:
> >> blog: http://matthiaswessendorf.wordpress.com/
> >> mail: matzew-at-apache-dot-org
> >>
> >>
> >
> > --
> > View this message in context: 
> http://www.nabble.com/Partial-submit-is-not-working-on-Weblogic-10-tf4465921.htm
> l#a12734893
> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >
> >
> 
> 
> 
> -- 
> Matthias Wessendorf
> 
> Need JSF and Web 2.0?
> http://code.google.com/p/facesgoodies
> 
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> mail: matzew-at-apache-dot-org



Re: v:commonsValidator maxlength

2008-08-07 Thread Gary VanMatre

 -- Original message --
From: PutoDemonio <[EMAIL PROTECTED]>
> 
> I'm searching info about how to use v:commonsValidator, something more than
> check a required field or an email, but I don't find anything.
> 
> Where can I find something like documentation, and not just a little
> example, always the same "required field" example!!
> 
> I'm trying to validate the maxlength of a textArea, and I try something like
> this:
> 
>  value="#{subsystemForm.subsystem.description}" required="true"
> maxlength="1500">
>  arg="#{text['subsystem.description']}" />
>  arg="#{text['subsystem.description']}"/>
> 
> 
> But I think that I have to set the maxlength value in some parameter in
> v:commonsValidator node...
> 
> Please, help! This must be too easy to loose so much time!!!

There are a few examples in the shale usecases app [1]. 

The shale commons validator was an attempt to add client JavaScript validation 
to JSF components.  Unfortunately,  JSF doesn't really give good framework 
support for rich client validators that are not coupled to a JSF component 
library.  The common validator doesn't work with component libraries like 
tomahawk and trinidad because the extension points in shale override extension 
points in these libraries.  I had hoped that JSF 2.0 would address the issue 
but it doesn't look as it will.  You are best to stick to validators provided 
by the component library you are using.  


[1] 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-usecases/src/main/webapp/validator/test.jsp?view=markup



> -- 
> View this message in context: 
> http://www.nabble.com/v%3AcommonsValidator-maxlength-tp18867067p18867067.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 



RE: [Trinidad] polling problem with dialogs

2008-06-06 Thread Gary VanMatre
You might try bumping up the token cache.


   
org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS
   500

 
Gary

-- Original message --
From: "Perkins, Nate-P63196" <[EMAIL PROTECTED]>
> Pinging this thread.  I'd appreciate a response, if I don't receive any
> I suppose I will submit a JIRA for this issue.
>  
> 
> Nate Perkins 
> General Dynamics C4 Systems 
> 
> This email message is for the sole use of the intended recipient(s) and
> may contain GDC4S 
>  confidential or privileged information. Any unauthorized review, use,
> disclosure or distribution 
>  is prohibited. If you are not an intended recipient, please contact the
> sender by reply email and 
>  destroy all copies of the original message. 
> 
>  
> 
> 
> 
> From: Perkins, Nate-P63196 [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 05, 2008 9:27 AM
> To: users@myfaces.apache.org
> Subject: [Trinidad] polling problem with dialogs
> 
> 
> 
> I'm using 1.0.3 and I have 2 pages which both use the tr:poll on a main
> page and which both launch dialogs of some sort.  The first page uses
> the 'normal' dialog setup of using an 'dialog:*' action and using a
> LaunchEvent to populate the pageflow scope with any data I need.  The
> second page programmatically calls launchDialog().  
> 
> In the first page, if I leave the dialog open and allow the tr:poll to
> update the main page and then attempt to perform an action on the dialog
> I get a NullPointerException.  If I take the same steps with the second
> page it works with no problems.  Is this a known bug or is there a
> recommended solution?  Would an upgrade fix this?
> 
> Here's the exception: 
> Caused by: java.lang.NullPointerException
> at
> org.apache.myfaces.trinidadinternal.context.PageFlowScopeMap.discard(Pag
> eFlowScopeMap.java:341)
> at
> org.apache.myfaces.trinidadinternal.context.PageFlowScopeProviderImpl.po
> pPageFlowScope(PageFlowScopeProviderImpl.java:106)
> at
> org.apache.myfaces.trinidadinternal.context.RequestContextImpl.returnFro
> mDialog(RequestContextImpl.java:125)
> at
> com.gdc4s.muos.nms.planning.chainofcmd.backing.ManageNodeBb.cancel(Manag
> eNodeBb.java:281)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
> ... 37 more 
> 
> Nate Perkins 
> General Dynamics C4 Systems 
> 
> 


--- Begin Message ---
Title: [Trinidad] polling problem with dialogs



Pinging this thread.  I'd appreciate a response, if I 
don't receive any I suppose I will submit a JIRA for this 
issue.
 
Nate Perkins General Dynamics C4 Systems 

This email message is for the 
sole use of the intended recipient(s) and may contain GDC4S 
 confidential or privileged 
information. Any unauthorized review, use, disclosure or 
distribution  is prohibited. If you are not an intended recipient, please contact 
the sender by reply email and  destroy all copies of the original 
message. 
 


From: Perkins, Nate-P63196 
[mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 9:27 
AMTo: users@myfaces.apache.orgSubject: [Trinidad] polling 
problem with dialogs

I'm using 1.0.3 and I have 2 pages which both use the 
tr:poll on a main page and which both launch dialogs of some sort.  The 
first page uses the 'normal' dialog setup of using an 'dialog:*' action and 
using a LaunchEvent to populate the pageflow scope with any data I need.  
The second page programmatically calls launchDialog().  
In the first page, if I leave the dialog open and 
allow the tr:poll to update the main page and then attempt to perform an action 
on the dialog I get a NullPointerException.  If I take the same steps with 
the second page it works with no problems.  Is this a known bug or is there 
a recommended solution?  Would an upgrade fix this?
Here's the exception: Caused by: 
java.lang.NullPointerExceptionat 
org.apache.myfaces.trinidadinternal.context.PageFlowScopeMap.discard(PageFlowScopeMap.java:341)at 
org.apache.myfaces.trinidadinternal.context.PageFlowScopeProviderImpl.popPageFlowScope(PageFlowScopeProviderImpl.java:106)at 
org.apache.myfaces.trinidadinternal.context.RequestContextImpl.returnFromDialog(RequestContextImpl.java:125)at 
com.gdc4s.muos.nms.planning.chainofcmd.backing.ManageNodeBb.cancel(ManageNodeBb.java:281)at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at 
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at 
java.lang.reflect.Method.invoke(Unknown Source)at 
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)... 37 
more 
Nate Perkins General Dynamics C4 Systems 
--- End Message ---


Re: Can a JSF page be in database?

2008-04-11 Thread Gary VanMatre
From: Dave <[EMAIL PROTECTED]>
> The servlet container should have a "PageLocator" layer that makes JSP page 
> location transparent to upper layer, so that JSP can be in filesystem, 
> database 
> or internet.
>

The an issue here is that it breaks the deployment model for an enterprise 
application.  Versioning a DB is not as easy as installing an ear.  

But, you'd think it would be possible to plug in a JCR like jackrabbit.  I 
don't known how that would work.  You might ask on apache jackrabbit.

Oracle has a product called DMS that hooks into the OC4J jsp engine some how.  
I want to say that it provides it's own class loader that manages all XML 
files. 

I've played with this idea in Shale Clay but didn't have a real world use case 
for it and didn't take it any further.


Gary
   
> Jason King <[EMAIL PROTECTED]> wrote:
>   Theoretically you could, but then you'd have to write it to the 
> filesystem and recompile. It would make for a very slow system.
> Dave wrote:
> > Hi,
> > 
> > Normally JSF pages are package in a war file. Is it possbile to put a 
> > JSF page in database, and loaded dynamically and rendered? What I 
> > like to achieve is layout design that can be dynamically added.
> > 
> > Thanks for any idea.
> > Dave
> >
> > __
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> 
> 
> 
>  __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- Begin Message ---
The servlet container should have a "PageLocator" layer that makes JSP page location transparent to upper layer, so that JSP can be in filesystem, database or internet.  Jason King <[EMAIL PROTECTED]> wrote:  Theoretically you could, but then you'd have to write it to the filesystem and recompile. It would make for a very slow system.Dave wrote:> Hi,> > Normally JSF pages are package in a war file. Is it possbile to put a > JSF page in database, and loaded dynamically and rendered? What I > like to achieve is layout design that can be dynamically added.> > Thanks for any idea.> Dave>> __> Do You Yahoo!?> Tired of spam? Yahoo! Mail has the best spam protection around>
 http://mail.yahoo.com> __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com --- End Message ---


Re: Is it possible for JSF h:commandButton to execute MethodBinding and JavaScript

2008-01-25 Thread Gary VanMatre
You might give shale remoting a look[1].  I have not tried to use it with 
Trinidad but all I think you would need is the shale-core and shale-remoting 
jars.

[1] http://shale.apache.org/shale-remoting/index.html

Gary

-- Original message -- 
From: bansi <[EMAIL PROTECTED]> 

> 
> Thanks Andrew/David 
> I am able to do both but it doesnt happen in sequence as expected. 
> As David correctly said "It's alwasy javascript onclick, followed by an http 
> method call" 
> But i wanna do Method Binding first then Javascript OnClick. 
> Any pointers/suggestions will be highly appreciated 
> Here is the snippet which does both 
> > onmousedown="createPopUp('contactLookup','find')" 
> onclick="return false" image="/images/contacts.gif" border="0" alt="Click 
> here to Manage Contacts" 
> actionListener="#{contactBean.getFormVariables}"> 
> 
> 
> 
> 
> 
> The reason i wanna do Method Binding first is i am passing parameters based 
> on which dataTable in popup xhtml should be rendered 
> 
> 
> David Delbecq-2 wrote: 
> > 
> > Javascript = Client side 
> > ActionListeners / Actions = Server Side 
> > 
> > So, answer is "no", you can't synchronize a javascript with a server 
> > code. It's alwasy javascript onclick, followed by an http method call 
> > (which will trigger all JSF stuffs) 
> > bansi a écrit : 
> >> I have a requirement where i wanna execute both Method Binding and 
> >> JavaScript 
> >> Code at the same time using JSF h:commandButton. 
> >> 
> >> The Javascript will open a popup while MethodBinding will set the values 
> >> in 
> >> Backing Bean 
> >> 
> >> Here is the snippet 
> >> > >> immediate="true" 
> >> onmousedown="createPopUp('contactLookup','find')" 
> >> onclick="return false" image="/images/contacts.gif" border="0" 
> >> alt="Click here to Manage Contacts" 
> >> actionListener="#{contactBean.getFormVariables}"> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> Any pointers/suggestions will be highly appreciated 
> >> 
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Is-it-possible-for-JSF-h%3AcommandButton-to-execute-Method
>  
> Binding-and-JavaScript-tp15072394p15093039.html 
> Sent from the MyFaces - Users mailing list archive at Nabble.com. 
> 

Re: [Trnidad] Is there a way to use Trinidad API to load Resources for our Custom Components?

2008-01-23 Thread Gary VanMatre


>From: "Andrew Robinson" <[EMAIL PROTECTED]> 
>Looks like something dying to be in the WIKI Gary :)
>

Not a bad idea.  I'll see what I can do.

>-Andrew
>

Gary

On Jan 23, 2008 10:28 AM, Gary VanMatre <[EMAIL PROTECTED]> wrote:

>From: Samba <[EMAIL PROTECTED]> 

>Hi all,
>  I'm building a couple of custom components based on trinidad core, more like 
> adding some 
>enhancements...
>
> I would like to know if Trinidad expose any API  to be used by Coustom 
> components to load our 
>own JavaScript, CSS , and Images. 
>

You can plug in a custom script loaders into a web application that already 
uses trinidad.  Trinidad uses a resource servlet.  At startup, the resource 
servlet scanns the class path for 
META-INF/services/resources/{url-pattern}.resources.  These files define 
resource loaders. 

Steps:
1) Create a trinidad resource loader by extending RegexResourceLoader.


/**
 * This is a composite resource loader that hooks into the 
 * ResourceServlet.  
 * 
 *   <servlet>
 *   <servlet-name>resources</servlet-name> 
 *   <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet
 *</servlet-class>
 * </servlet>
 * 
 *
 * It is registered by placing a text file under 
 * the "/META-INF/servlets/resources" folder.  The name of the file must
 * begin with the url folder prefix registered in the web deployment
 * descriptor (web.xml) and the suffix should be ".resources".  
 *
 * 
 *
 *  resources/acme/*
 *
 * 
 *
 * The folder prefix needs to correspond to the formulation of various 
 * web resources. 
 * 
 * 
 *  #{facesContext.externalContext.requestContextPath}/acme/images/folder.gif}
 * 
 * 
 * 
 * 
 */
public class AcmeResourceLoader
  extends RegexResourceLoader 
{
  public AcmeResourceLoader()
  {
// any resource in "/acme/" with the following suffixes will be
// loaded from the base folder of "META-INF".
// The servlet pattern match "/acme/*" should exist under "META-INF". 
// For example URL : context-root/acme/images/type1.gif
//   map to: META-INF/acme/images/type1.gif
register("(/.*\\.(jpg|gif|png|jpeg))", 
 new ClassLoaderResourceLoader("META-INF")); 
// associate pattern match on the "/acme/all-acme.js" to deliver
// all JS files bundled by the AcmeScriptsResourceLoader
register("(/.*all-acme.js)", 
 new AcmeScriptsResourceLoader("/acme/all- acme.js"));
  }

  /**
   * Aggregates all JavaScript files into a single stream identified
   * by a single URI.  All JavaScripts for the acme custom component library
   * will be delivered using a single script include. 
   * 
   * 
   *  <script type="text/javascript" 
   *   scr="#{facesContext.externalContext.requestContextPath}/acme/all-acme.js"
   *   />
   *  
   * 
   *  -- or --
   *  
   *   <trh:script source="/acme/all-acme.js"/>
   *  
   * 
   */
  public static class AcmeScriptsResourceLoader 
extends AggregatingResourceLoader
  {
/**
 * The URI used to identify all of the JavaScripts that will be 
 * included using a single URI.
 * 
 * @param scriptsURI the URI relative to "/acme/*" 
 */
public AcmeScriptsResourceLoader(String scriptsURI)
{
  // pass the base folder and list of script files.  
  // the script files have to be within the classpath
  super(scriptsURI, _LIBRARIES, new ClassLoaderResourceLoader());
  this.setSeparator(AcmeScriptsResourceLoader._NEWLINE_SEPARATOR);
}
/**
 * List of all JavaScript files to include.  The Peer JS
 * file should always be registered last for a component
 * grouping if the peeer is registered with the component
 * in the peer JS file. 
 */
static private final String[] _LIBRARIES =
{ "oracle/adfdemo/acme/js/component/AcmeTagPane.js", 
  "oracle/adfdemo/acme/js/event/AcmeTagSelectEvent.js", 
  "oracle/adfdemo/acme/js/component/AcmeTagPanePeer.js" }; 
/**
 * The separator to use in between streams.
 */
static private final String _NEWLINE_SEPARATOR = "\n";
  }

}  


2)  Create a simple registration file 
(META-INF/services/resources/acme.resources) in the jar or web project 
containing the fully qualifed path to the resource loader.


oracle.adfdemo.acme.faces.resource.AcmeResourceLoader


3) Add the resource servlet mappings to your web deployment descriptor 
(web.xml).



  resources
   /acme/*



4) Include the script in the jsp page.


 
 
  



>Any help in this regard is highly appreciated,
>Thanking you all,
>Samba

Gary

Re: [Trnidad] Is there a way to use Trinidad API to load Resources for our Custom Components?

2008-01-23 Thread Gary VanMatre
>From: Samba <[EMAIL PROTECTED]> 
>Hi all,
>  I'm building a couple of custom components based on trinidad core, more like 
> adding some 
>enhancements...
>
> I would like to know if Trinidad expose any API  to be used by Coustom 
> components to load our 
>own JavaScript, CSS , and Images. 
>

You can plug in a custom script loaders into a web application that already 
uses trinidad.  Trinidad uses a resource servlet.  At startup, the resource 
servlet scanns the class path for 
META-INF/services/resources/{url-pattern}.resources.  These files define 
resource loaders.

Steps:
1) Create a trinidad resource loader by extending RegexResourceLoader.


/**
 * This is a composite resource loader that hooks into the 
 * ResourceServlet.  
 * 
 *   
 *   resources
 *   org.apache.myfaces.trinidad.webapp.ResourceServlet
 *
 * 
 * 
 *
 * It is registered by placing a text file under
 * the "/META-INF/servlets/resources" folder.  The name of the file must
 * begin with the url folder prefix registered in the web deployment
 * descriptor (web.xml) and the suffix should be ".resources".  
 *
 * 
 *
 *  resources
 *  /acme/*
 *
 * 
 *
 * The folder prefix needs to correspond to the formulation of various 
 * web resources.
 * 
 * 
 *  #{facesContext.externalContext.requestContextPath}/acme/images/folder.gif}
 * 
 * 
 * 
 * 
 */
public class AcmeResourceLoader
  extends RegexResourceLoader
{
  public AcmeResourceLoader()
  {
// any resource in "/acme/" with the following suffixes will be
// loaded from the base folder of "META-INF".
// The servlet pattern match "/acme/*" should exist under "META-INF".
// For example URL : context-root/acme/images/type1.gif
//   map to: META-INF/acme/images/type1.gif
register("(/.*\\.(jpg|gif|png|jpeg))", 
 new ClassLoaderResourceLoader("META-INF"));
// associate pattern match on the "/acme/all-acme.js" to deliver
// all JS files bundled by the AcmeScriptsResourceLoader
register("(/.*all-acme.js)", 
 new AcmeScriptsResourceLoader("/acme/all-acme.js"));
  }

  /**
   * Aggregates all JavaScript files into a single stream identified
   * by a single URI.  All JavaScripts for the acme custom component library
   * will be delivered using a single script include.
   * 
   * 
   *