Re: WOBuilder JSImageFlyover cannot be a submit button
Re: WOBuilder JSImageFlyover cannot be a submit button
- Subject: Re: WOBuilder JSImageFlyover cannot be a submit button
- From: email@hidden
- Date: Tue, 14 Oct 2003 11:53:35 CDT
- Priority: 3 (Normal)
[demime could not interpret encoding binary - treating as plain text]
I think the most important point to remember is that WO is just creating
HTML for the user, in the end. It's easy to forget this in WO, becuase
often you don't actually need to know what the HTML is doing. But this is
a case where you do.
The JSImageFlyover is creating an HTML IMG tag wrapped in an HTML A tag.
One problem you've run into is that the JSImageFlyover doesn't let you
set width, height and alt on the IMG tag that it's producing. This is
sort of a lack of feature in the JSImageFlyover. The solution is to
either to:
1) write your own component that does what JSImageFlyover does. Once you
understand the HTML that needs to be generated, this is not that hard to
do. or
2) Modify the source of JSImageFlyover. Apple does conveniently give you
the source code. It shouldn't be too hard to add support for
width/height/alt bindings to the existing JSImageFlyover, such that they
are added to the internal IMG tag. [I believe the problem with the
existing JSImageFlyover is that it adds these attributes to the A tag,
where they don't mean anything.] You can find the source inside the
JavaWOExtensions project, which is located on a Windows machine at
$NEXT_ROOT/Developer/Examples/JavaWebObjects/Source/. Once you open the
project, you need to look in the "Javascript" subproject for the
JSImageFlyover component. Not sure where this is installed on OSX.
You could modify the source to support the height/width/alt, and save it
under a new name, include it in one of your projects and frameworks, and
use that new component. It's possible some other developer has already
done this and will share it (is there something in Project Wonder?).
Now, the problem of the JSImageFlyover not functioning as a form submit,
is a different problem. Again, it requires an understanding of the HTML
being generated, and the HTML you want to generate. An IMG tag wrapped
in an A tag is not a form submit button, it's just a link, which is a
different thing in HTML. The built in WOImageButton component will
output a graphical submit button for you. [This component does not show
up in the pallete, you need to click the "*" button to add any arbitrary
component, and then type in "WOSubmitButton".] However, the
WOSubmitButton doesn't support a 'flyover' image. Is it possible to have
a graphical form submit button with a flyover, using HTML/Javascript?
I'm actually not sure, I've never done it. If it is possible, and you
want this, you need to again, write your own component which produces
this HTML. Again, the JSImageFlyover source may be a useful starting
point, although you want to produce different HTML tags. The source to
WOSubmitButton is NOT provided to us.
Understanding what HTML code you want generated is the first step.
Getting your WO app to generate that HTML code is the next. If built-in
WO components don't exist to generate exactly the HTML code you need, you
can still implement it yourself using the building blocks WO gives you.
Either as a re-useable component of your own (ideally), or in a pinch,
just as code within a page component that will output the HTML you want.
[WOGenericContainer and WOGenericElement can be used to output any
arbitrary HTML code, for instance].
Hope this helps clarify some things for you,
--Jonathan
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.