Decision of xforms:select/select1 appearance's value

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Decision of xforms:select/select1 appearance's value

Spenser Kao

Can xforms:select or xforms:select1’s attribute appearance’s value be decided at run-time? Or it has to be hard coded?

 

I intend to make dropdown list’s appearance purely instance data dependent; therefore I configure the appearance in the model instance, and leave the decision until run-time just as excerpted below. But I found that whatever appearance types I configured in the model instance, including full, compact and xxforms;autocomplete, the real appearance result is all the same: minimal.

 

None of example codes or in the tutorial is doing this way, is there any unwritten restriction on this regard?

 

Regards,

 

Spenser

 

**** Start of Example Code ****

<xhtml:head>

    <xhtml:title>Application Details</xhtml:title>

        <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">

            <xforms:instance id="signup">           

    <person ui:signup-trigger="">

                    <application-type ui:is-dropdown="true" ui:appearance="full" ui:label="Application type*"/>

                </person>

           </xforms:instance>

        <xforms:model>

</xhtml:head>

<xhtml:body>

    <xforms:group ref="@ui:is-dropdown">

        <xforms:select ref=".." appearance=”xxforms:evaluate(../@ui:appearance)”>

            <xforms:itemset nodeset="instance('enumerations')/application-types/type">

                <xforms:label ref="label"/>

                <xforms:value ref="@value"/>                                                 

            </xforms:itemset>

        </xforms:select>

    </xforms:group>

</xhtml:body>

 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Decision of xforms:select/select1 appearance's value

Erik Bruchez
Administrator
Spenser,

 > Can xforms:select or xforms:select1$(Bs (Battribute
appearance$(Bs (Bvalue
 > be decided at run-time? Or it has to be hard coded?

As per the XForms spec, the @appearance attribute is a static value
that is evaluated only once.

 > I intend to make dropdown list$(Bs (Bappearance purely instance data
 > dependent; therefore I configure the appearance in the model
 > instance, and leave the decision until run-time just as excerpted
 > below. But I found that whatever appearance types I configured in
 > the model instance, including full, compact and
 > xxforms;autocomplete, the real appearance result is all the same:
 > minimal.

 > None of example codes or in the tutorial is doing this way, is there
 > any unwritten restriction on this regard?

No, it's clearly spec'ed out in XForms!

What you could do is bind several xforms:select1 controls to the same
node, with the same itemset, but with different appearances, and then
decide which one to show using relevance.

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Decision of xforms:select/select1 appearance's value

Spenser Kao
Hi Erik,

Thanks for the tips. Please see the workable version below. As you can see,
it generically handles the combination of full/minimal appearance +
single/multiple selection. Should be easily scaled up to cover appearance
types compact and xxforms:autocomplete. It also generalizes the ref feed to
itemset.

There should be only scenario to make such effort worthy is when there are
plenty of dropdown lists to be produced.

Regards,

Spenser

<xhtml:head>
  <xhtml:title>Application Details</xhtml:title>
    <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
      <xforms:instance id="signup">          
        <app-details ui:signup-trigger="">
          <application-type ui:is-dropdown="true"
ui:appearance="full-multiple"
ui:source="instance('enumerations')/application-types/type"
ui:label="Application type*"/>
          <card-type ui:is-dropdown="true" ui:appearance="full-single"
ui:source="instance('enumerations')/card-types/type" ui:label="Credit card
type*"/>          
        </app-details>
     </xforms:instance>
    <xforms:model>
</xhtml:head>
<xhtml:body>
    <!-- show those dropdown list with appearance full and single selection
-->
    <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
'full-single']">
     <xforms:select1 ref="." appearance="full" >
     <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
        <xforms:label ref="label"/>
        <xforms:value ref="@value"/>                            
     </xforms:itemset>
     </xforms:select1>  
    </xforms:group>

    <!-- show those dropdown list with appearance full and multiple
selection -->
    <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
'full-multiple']">
     <xforms:select ref="." appearance="full" >
     <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
        <xforms:label ref="label"/>
        <xforms:value ref="@value"/>                            
     </xforms:itemset>
     </xforms:select>  
    </xforms:group>
                                       
    <!-- show those dropdown list with appearance minimal and single
selection -->                                        
    <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
'minimal-single']">
     <xforms:select1 ref="." appearance="minimal" >
     <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
        <xforms:label ref="label"/>
        <xforms:value ref="@value"/>                            
     </xforms:itemset>
     </xforms:select1>  
    </xforms:group>
                                                                   
    <!-- show those dropdown list with appearance minimal and multiple
selection -->                                        
    <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
'minimal-multiple']">
     <xforms:select ref="." appearance="minimal" >
     <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
        <xforms:label ref="label"/>
        <xforms:value ref="@value"/>                            
     </xforms:itemset>
     </xforms:select>  
    </xforms:group>
</xhtml:body>

Regards,
 
Spenser
-----Original Message-----
From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
Sent: Friday, 20 October 2006 10:21 PM
To: [hidden email]
Subject: Re: [ops-users] Decision of xforms:select/select1 appearance's
value

Spenser,

 > Can xforms:select or xforms:select1$(Bs (Battribute
appearance$(Bs (Bvalue
 > be decided at run-time? Or it has to be hard coded?

As per the XForms spec, the @appearance attribute is a static value
that is evaluated only once.

 > I intend to make dropdown list$(Bs (Bappearance purely instance data
 > dependent; therefore I configure the appearance in the model
 > instance, and leave the decision until run-time just as excerpted
 > below. But I found that whatever appearance types I configured in
 > the model instance, including full, compact and
 > xxforms;autocomplete, the real appearance result is all the same:
 > minimal.

 > None of example codes or in the tutorial is doing this way, is there
 > any unwritten restriction on this regard?

No, it's clearly spec'ed out in XForms!

What you could do is bind several xforms:select1 controls to the same
node, with the same itemset, but with different appearances, and then
decide which one to show using relevance.

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Decision of xforms:select/select1 appearance's value

Erik Bruchez
Administrator
Spenser,

Thanks for sharing this tip :-)

-Erik

Spenser Kao wrote:

> Hi Erik,
>
> Thanks for the tips. Please see the workable version below. As you can see,
> it generically handles the combination of full/minimal appearance +
> single/multiple selection. Should be easily scaled up to cover appearance
> types compact and xxforms:autocomplete. It also generalizes the ref feed to
> itemset.
>
> There should be only scenario to make such effort worthy is when there are
> plenty of dropdown lists to be produced.
>
> Regards,
>
> Spenser
>
> <xhtml:head>
>   <xhtml:title>Application Details</xhtml:title>
>     <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
>       <xforms:instance id="signup">          
>         <app-details ui:signup-trigger="">
>           <application-type ui:is-dropdown="true"
> ui:appearance="full-multiple"
> ui:source="instance('enumerations')/application-types/type"
> ui:label="Application type*"/>
>           <card-type ui:is-dropdown="true" ui:appearance="full-single"
> ui:source="instance('enumerations')/card-types/type" ui:label="Credit card
> type*"/>          
>         </app-details>
>      </xforms:instance>
>     <xforms:model>
> </xhtml:head>
> <xhtml:body>
>     <!-- show those dropdown list with appearance full and single selection
> -->
>     <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
> 'full-single']">
>      <xforms:select1 ref="." appearance="full" >
>      <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
>         <xforms:label ref="label"/>
>         <xforms:value ref="@value"/>                            
>      </xforms:itemset>
>      </xforms:select1>  
>     </xforms:group>
>
>     <!-- show those dropdown list with appearance full and multiple
> selection -->
>     <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
> 'full-multiple']">
>      <xforms:select ref="." appearance="full" >
>      <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
>         <xforms:label ref="label"/>
>         <xforms:value ref="@value"/>                            
>      </xforms:itemset>
>      </xforms:select>  
>     </xforms:group>
>                                        
>     <!-- show those dropdown list with appearance minimal and single
> selection -->                                        
>     <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
> 'minimal-single']">
>      <xforms:select1 ref="." appearance="minimal" >
>      <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
>         <xforms:label ref="label"/>
>         <xforms:value ref="@value"/>                            
>      </xforms:itemset>
>      </xforms:select1>  
>     </xforms:group>
>                                                                    
>     <!-- show those dropdown list with appearance minimal and multiple
> selection -->                                        
>     <xforms:group ref=".[@ui:is-dropdown = 'true' and @ui:appearance =
> 'minimal-multiple']">
>      <xforms:select ref="." appearance="minimal" >
>      <xforms:itemset nodeset="xxforms:evaluate(@ui:source)">
>         <xforms:label ref="label"/>
>         <xforms:value ref="@value"/>                            
>      </xforms:itemset>
>      </xforms:select>  
>     </xforms:group>
> </xhtml:body>
>
> Regards,
>  
> Spenser
> -----Original Message-----
> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
> Sent: Friday, 20 October 2006 10:21 PM
> To: [hidden email]
> Subject: Re: [ops-users] Decision of xforms:select/select1 appearance's
> value
>
> Spenser,
>
>  > Can xforms:select or xforms:select1$(Bs (Battribute
> appearance$(Bs (Bvalue
>  > be decided at run-time? Or it has to be hard coded?
>
> As per the XForms spec, the @appearance attribute is a static value
> that is evaluated only once.
>
>  > I intend to make dropdown list$(Bs (Bappearance purely instance data
>  > dependent; therefore I configure the appearance in the model
>  > instance, and leave the decision until run-time just as excerpted
>  > below. But I found that whatever appearance types I configured in
>  > the model instance, including full, compact and
>  > xxforms;autocomplete, the real appearance result is all the same:
>  > minimal.
>
>  > None of example codes or in the tutorial is doing this way, is there
>  > any unwritten restriction on this regard?
>
> No, it's clearly spec'ed out in XForms!
>
> What you could do is bind several xforms:select1 controls to the same
> node, with the same itemset, but with different appearances, and then
> decide which one to show using relevance.
>
> -Erik
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws