LzNodes don't interact with the focus, so it seems that the right entry 
point is LzView. I think you'd just want to add a function to view that 
returns true.

As for building the sources, it is kind of a pain but I know people have
done it. The good news is that you're not going to be messing with the
compiler, so you can use buildlfc. This is the best starting point I know
of:
http://wiki.openlaszlo.org/Build_Instructions

Here's a bit on buildlfc:
http://wiki.openlaszlo.org/How_to_Build#Incremental_build

Your bravery will blaze a trail for the legions that will follow.

A

On Jan 12, William Krick wrote:

> I think the code in LzFocus.as LzFocus.setFocus() would look something like
> this...
> 
>     if ( !this.csel.shouldYieldFocus() )
>       return;
> 
> Then all focusable views would need to have a default shouldYieldFocus()
> method that simply returns true and that the user can override to return
> false if conditions aren't met.  I'm not sure where this would go.  LzNode?
> LzView?  basecomponent?
> 
> The problem is that I'm not that familiar with the internal workings of the
> whole laszlo architecture so I'm not sure how best to shoehorn this in
> without breaking things.
> 
> I haven't tackled building the source yet. That looks pretty daunting.
> 
> 
> 
> -----Original Message-----
> From: Jim Grandy [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 11, 2006 6:09 PM
> To: William Krick
> Cc: [email protected]
> Subject: Re: [Laszlo-user] laszlo needs a shouldYieldFocus() method
> 
> 
> Sounds like a relatively straightforward addition, and I agree we
> need something like that.
> 
> You've already pretty much written the RFC in your email, and the
> change would be small. Could you at minimum write up a JIRA bug?
> Contributing the change would also be fantastic, and ensure that it
> happened on your timeframe. (I'd start looking in LzFocus.as, in
> LzFocus.setFocus(), perhaps just after the line that sets
> __LZsfrunning to true.)
> 
> jim
> 
> On Jan 11, 2006, at 2:28 PM, William Krick wrote:
> 
> > We're trying to develop a fairly sophisticated application in laszlo.
> >
> > One of the most difficult and frustrating parts is validating user
> > input and
> > this may cause us to give up on laszlo entirely.
> >
> > We really need the ability to stop a focus change if the contents
> > of a field
> > is invalid.
> >
> > In Java, this problem was solved by giving each component a
> > shouldYieldFocus() method.
> >
> > The way this works, when any other component wants to take focus,
> > either by
> > user action via keyboard or mouse, or programmatically, the focus
> > system has
> > to call the current focus owner's shouldYieldFocus() method first.
> > This
> > method by default just always returns true.  However, you can
> > override the
> > method with your own implementation that can return false if certain
> > conditions aren't met.  Returning false prevents the focus system from
> > moving focus to the new component.
> >
> > Laszlo really needs something similar in order for it to be viable for
> > "real" applications.  Otherwise we might as well just go back to
> > HTML forms
> > and do all our validation server-side.
> >
> >
> >
> > _______________________________________________
> > Laszlo-user mailing list
> > [email protected]
> > http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> 
> 
> 
> _______________________________________________
> Laszlo-user mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> 
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to