myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave <javao...@yahoo.com>
Subject Re: submitOnEvent callback
Date Sat, 02 Feb 2008 01:29:22 GMT
Hi Martin,
  I have filed a bug in MyFaces jira. 
   
  http://issues.apache.org/jira/browse/TOMAHAWK-1187
   
  I also suggest adding a onsubmit="javascript code" that can return true/false.
   
  Thanks.
  dave

Martin Marinschek <martin.marinschek@gmail.com> wrote:
  I have prepared a fix and will commit it, if someone (Dave?) provides
me with an issue-number ;)

regards,

Martin

On 2/1/08, Martin Marinschek wrote:
> Hi guys,
>
> the clue is that restoreState/saveState was implemented wrongly in
> submitOnEvent - another reason to get the component-generator up and
> running. This is the erronous code - it uses the getter to access the
> component-attributes (and will therefore store the return-value of the
> method as local value...)
>
> public Object saveState(FacesContext context)
> {
> return new Object[]
> {
> super.saveState(context),
> getFor(),
> getEvent(),
> getCallback()
> };
> }
>
> public void restoreState(FacesContext context, Object state)
> {
> Object[] states = (Object[]) state;
> super.restoreState(context, states[0]);
> forComponent = (String) states[1];
> event = (String) states[2];
> callback = (String) states[3];
> }
>
> On 2/1/08, Gerald Müllan wrote:
> > Hi Dave,
> >
> > don`t know why the method is not called, maybe Mario knows it.
> >
> > It`s not that nice, but you may also write:
> >
> > callback="mySpecialUserCallback"
> >
> > ..
> >
> > function mySpecialUserCallback(event, srcComponentId, clickComponentId)
> > {
> > return #{bean.submitOnChange};
> > }
> >
> > This should work without any problems;
> >
> > cheers,
> >
> > Gerald
> >
> > On Feb 1, 2008 11:53 AM, Dave wrote:
> > > the bean method return a string that is a javascript function name.
> > >
> > >
> > >
> > > Mario Ivankovits wrote:
> > > Hi!
> > > > callback="#{bean.callbackFunction}"
> > > The callback should point to a javascript function name instead of a
> > > bean method. callback is meant to be executed on the client.
> > >
> > > This javascript method then should allow you to return true/false, on
> > > false the click should not happen.
> > >
> > > Ciao,
> > > Mario
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > > Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
> >
> >
> >
> > --
> > 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
>


-- 

http://www.irian.at

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

Professional Support for Apache MyFaces


       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.
Mime
View raw message