Greyed out section headers within a pop-up menu?

I’m trying to add a touch of class to some pop-up menus by including greyed-out, non-selectable section headers. See the “Go to action…” menu at www.freewayactions.com to see what I mean. Does anyone know how to do this? I can’t seem to find any info on it. Many thanks!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The exact tag is an optgroup, but I don’t know how Tim added it to
his site. Knowing him, it probably involved the use of an Action. If
I were going to write such a thing to use in Freeway, I would
probably force you to use a special character like an underscore as
the first letter of the option label or value, and then key off of
that to create the groups.

Here’s the example from the w3schools site:

<select>
<optgroup label="Swedish Cars">
<option value ="volvo">Volvo</option>
<option value ="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value ="mercedes">Mercedes</option>
<option value ="audi">Audi</option>
</optgroup>
</select>

http://www.w3schools.com/tags/tag_optgroup.asp

So if I had written such an Action, you would lay this menu out in
Freeway like this:

_Swedish Cars
Volvo
Saab
_German Cars
Mercedes
Audi

and then the Action would create the groups out of the underscored
elements.

Perhaps Tim has already written something for this. If not, I’ll take
a whack at it.

Walter

On Jun 24, 2008, at 8:30 AM, derekzinger wrote:

I’m trying to add a touch of class to some pop-up menus by
including greyed-out, non-selectable section headers. See the “Go
to action…” menu at www.freewayactions.com to see what I mean.
Does anyone know how to do this? I can’t seem to find any info on
it. Many thanks!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for the explanation, Walter. Using what you’ve said, and my recent discovery of the Source Code Snooper action, I’ve made those changes directly to the source code. There was so little involved that even my feeble knowledge of coding was enough to figure it out!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Apologies for the late reply on this. The jump menu at FreewayActions.com is created dynamically using a PHP include based on the available actions and their associated groups. I did create an action to do this back n FW 3 although I haven’t used it for a while. I’ll see if I can dig it out from my archive and if it still works.
Regards,
Tim.

On 24 Jun 2008, at 07:09, Walter Lee Davis wrote:

The exact tag is an optgroup, but I don’t know how Tim added it to
his site. Knowing him, it probably involved the use of an Action. If
I were going to write such a thing to use in Freeway, I would
probably force you to use a special character like an underscore as
the first letter of the option label or value, and then key off of
that to create the groups.

Here’s the example from the w3schools site:

Volvo Saab Mercedes Audi

<http://www.w3schools.com/tags/tag_optgroup.asp>

So if I had written such an Action, you would lay this menu out in
Freeway like this:

_Swedish Cars
Volvo
Saab
_German Cars
Mercedes
Audi

and then the Action would create the groups out of the underscored
elements.

Perhaps Tim has already written something for this. If not, I’ll take
a whack at it.

Walter

On Jun 24, 2008, at 8:30 AM, derekzinger wrote:

I’m trying to add a touch of class to some pop-up menus by
including greyed-out, non-selectable section headers. See the “Go
to action…” menu at www.freewayactions.com to see what I mean.
Does anyone know how to do this? I can’t seem to find any info on
it. Many thanks!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

FreewayActions.com - Freeware and shareware actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com

Thanks, Tim. Would love to see the action if you manage to dig it up.
Regards
Derek


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well I ended up rewriting the action as the original version allowed you to nest the option groups which causes the code to fail validation. The action code also needed a bit of a spruce up so I took Walter’s suggestion and simply made the action look for menu/list choices that start with an underscore.
So for example:
Choice:_Swedish Cars
Value: anything (or nothing) - the value is ignored
For the moment the action code is up on Pastie.org at;
http://pastie.org/224593
If you have any problems with it just shout and I’ll take a closer look.
Regards,
Tim.

On 29 Jun 2008, at 11:22, derekzinger wrote:

Thanks, Tim. Would love to see the action if you manage to dig it up.

FreewayActions.com - Freeware and shareware actions for Freeway Express & Pro.

Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com

http://www.freewayactions.com

Great!. Thanks a million, Tim.

Regards
Derek


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for that Tim

How is it used?

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ll try and get a page up on FreewayActions.com later this week but for now
here’s a quick overview of the action and how to use it;

  1. Add a standard menu/list to your page using the Menu/List menu item from the
    Insert menu.
  2. The inspector palette for the item allows you to set both Choice and Value
    entries for each item in the menu/list.
  3. Add as many items as you need and then start adding the section names. You
    can do this by adding an underscore to the start of the Choice entry. The Value
    field is ignored and can be left blank.
    For example:
    Choice:_Fruit
    Value: (blank)
  4. Finally add the action to the menu/list by selecting the action name from the
    Item/Actions menu item.
    When the page is published the action loops through the menu/list options
    looking for the underscore markers and uses the data to construct the option
    groups.
    Things to watch out for;
    Using the Freeway interface it is possible to make an entry that is going to be
    converted into an option group label a default value for the menu/list. Because
    the action destroys these items the default setting also gets destroyed. As such
    you should avoid setting the default status to anything starting with an
    underscore.
    If there is anything here that doesn’t make sense just ask.
    Regards,
    Tim.

Quoting DeltaDave email@hidden:

Thanks for that Tim
How is it used?

Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Tim got it working on a Menu/List item - Can it be used anywhere else?

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Where did you have in mind? :slight_smile:
The action adds option groups to the menu/list options and AFAIK these are the
only places these can be legitimately used.
There are a few things like this that Freeway doesn’t handle that I’d like to
see added to Freeway Pro at some point in the future.
Fieldsets and Legends are two others
(http://www.w3.org/TR/html401/interact/forms.html#h-17.10).
Although the action does the job you have to know how it works and it really is
a bit of a hack at the end of the day.
Regards,
Tim.

Quoting DeltaDave email@hidden:

Thanks Tim got it working on a Menu/List item - Can it be used anywhere else?
David

Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Nowhere specific - I was just thinking that there must be other places that would benefit from this sort of effect, that of not allowing selection.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, the not allowing selecting part is incidental to the role that
this tag plays. It’s meant semantically as a category header for the
elements that follow it.

If you want a form field to be unselectable, you can add
disabled=“disabled” to it. I imagine that this would apply to a
select option, but Freeway doesn’t offer you the chance to add that
tag to an option, you would need to use Source Code Snooper for that.

Walter

On Jun 30, 2008, at 7:49 PM, DeltaDave wrote:

Nowhere specific - I was just thinking that there must be other
places that would benefit from this sort of effect, that of not
allowing selection.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options