Re: Context menus in XForms

Hi Allan,

A context menu would be something like help/hint where you do something 
to get the list of actions preferable the context menu is merged with 
the menu from the parent element, e.g. if a parent group has a context 
menu itself.

To me it seems difficult to use select1/select as menus because they are 
as you say data bound. It seem more natural that a menu is composed of 
something which is UI specific.

I had an interesting chat with Roland Merrick from IBM and he suggested 
the following construction:
<xf:input>
  <xf:label>Label</xf:label>
  <xf:action appearance="context">
    <xf:trigger>
      <xf:label>Menu Item 1</xf:label>
    </xf:trigger>
    ...
    <xf:action appearance="context">
      <xf:label>Sub Menu</xf:label>
      <xf:trigger>
        <xf:label>Menu Item 2</xf:label>
      </xf:trigger>
  </xf:action>
</xf:input>

The idea of the appearance="context" is my own, but the idea was that if 
an action block used in this way it would simply be a styling issue 
(which could just as well come from CSS) to show the context menu 
(except that it also has some semantic meaning in the case where it 
should be merged into the parent's context menu).

Best regards,
David

Allan Beaufour wrote:
> On 3/14/06, David Landwehr <david.landwehr@solidapp.com> wrote:
>   
>> I would like to provide a functionality of context menus in my XForms
>> processor for MIDP, but I'm having difficulties to see how the abstract
>> controls in XForms will let me do this.
>>     
>
> I have not thought much about this, so excuse my 10km viewpoint :)
>
>   
>> To expand on my use case
>> consider the following example:
>> <xforms:input ref="email">
>>   <xforms:label>Email:</xforms:label>
>>   <xforms:contextmenu>
>>     <xforms:label>Options</xforms:label>
>>     <xforms:contextmenu>
>>       <xforms:label>Send</xforms:label>
>>       <xforms:trigger>
>>         <xforms:label>via bluetooth</xforms:label>
>>         <xforms:submit send="via-bluetooth"/>
>>   </close all elements>
>>
>> So when you give focus to the input (or right click in the input field
>> in a browser) a context  menu is available which has the structure
>>   Send -> via bluetooth
>>
>> In the above example I just use the contextmenu element and the trigger
>> element for illustration purposes. I have no idea how to express this in
>> XForms in a standardized way and was wondering if anyone had a good
>> suggestion?
>>     
>
> The first thought that occurred to me was that a menu is a select1.
> You want to select one item. But then again, it is data bound and
> keeping the menu choice in data is a bit "weird". You could just @ref
> /dev/null though. So with the right UA interpretation of
> appearance="contextmenu" that could work. The problem is how to
> "attach it to a control though...
>
> But is a contextmenu something like hint and help? Something that can
> be triggered on a control. Then we should have something like you
> propose above. Is that how you envisioned it to work?
>
> --
> ... Allan
>
>   


-- 
--------------------------------------------
David Landwehr (david.landwehr@solidapp.com)
Chief Executive Officer, SolidApp
Web: http://www.solidapp.com
Office: +45 48268212
Mobile: +45 24275518
--------------------------------------------

Received on Wednesday, 15 March 2006 10:30:18 UTC