Menu Items

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

Menu Items

Phani S
Hi,
    I have a file called menu.xhtml and each menu item has an attribute id. For each menu item i created a separate xhtml file. when ever i select an item the corresponding page should appear below the menu bar. How do i write the theme for performing this task. I tried xsl:include but it doesn't work.

i included the following code in my theme-plain.xsl

                <xhtml:table id="main" width="100%" border="0" cellpadding="0" cellspacing="0">
                    <xhtml:tr>
                        <xhtml:td colspan="2" >
                            <xhtml:div style="float: left">
                    <xsl:include href="oxf:/myProject/menu.xhtml" />
                            </xhtml:div>
                        </xhtml:td>
                    </xhtml:tr>
            <!-- Include Pages -->
                    <xhtml:tr>
                        <xhtml:td colspan="2" >
                            <xhtml:div style="float: left">
                    <xsl:include href="oxf:/myProject/dynamic.xhtml" />
                            </xhtml:div>
                        </xhtml:td>
                    </xhtml:tr>
                </xhtml:table>

dynamic.xhtml page should be depend on the item selected from the menu.

page-flow.xml looks like this.

<!-- defalut page -->
    <page path-info="/myProject/" view="newProject.xhtml"/>

    <page path-info="/myProject/newProject" view="newProject.xhtml"/>
    <page path-info="/myProject/openProject" view="openProject.xhtml"/>

i am stuck. help me.

--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Menu Items

Hank Ratzesberger
Hi Phani,

>     I have a file called menu.xhtml and each menu item has an attribute id.
> For each menu item i created a separate xhtml file. when ever i select an
> item the corresponding page should appear below the menu bar. How do i write
> the theme for performing this task. I tried xsl:include but it doesn't work.

The xsi:include element is not processed dynamically.  It is processed when
the file is read and validated.

I suspect you would need to write your own custom XBL component and that
would give you very precise control over the css styles, etc., when the
menu item is selected.

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide

There is also the xforms:case element.  It may be a way to get
started.

HTH,
Hank

>
> i included the following code in my theme-plain.xsl
>
>                 <xhtml:table id="main" width="100%" border="0"
> cellpadding="0" cellspacing="0">
>                     <xhtml:tr>
>                         <xhtml:td colspan="2" >
>                             <xhtml:div style="float: left">
>                     <xsl:include href="oxf:/myProject/menu.xhtml" />
>                             </xhtml:div>
>                         </xhtml:td>
>                     </xhtml:tr>
>             <!-- Include Pages -->
>                     <xhtml:tr>
>                         <xhtml:td colspan="2" >
>                             <xhtml:div style="float: left">
>                     <xsl:include href="oxf:/myProject/dynamic.xhtml" />
>                             </xhtml:div>
>                         </xhtml:td>
>                     </xhtml:tr>
>                 </xhtml:table>
>
> dynamic.xhtml page should be depend on the item selected from the menu.
>
> page-flow.xml looks like this.
>
> <!-- defalut page -->
>     <page path-info="/myProject/" view="newProject.xhtml"/>
>
>     <page path-info="/myProject/newProject" view="newProject.xhtml"/>
>     <page path-info="/myProject/openProject" view="openProject.xhtml"/>
>
> i am stuck. help me.
>
> --
> Phani. S
> M.Tech(Software Engineering)
> Motilal Nehru National Institute of Technology
> (+91) 9010093398
>



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Menu Items

Alessandro Vernet
Administrator
In reply to this post by Phani S
Phani,

Phani Sajja wrote
i included the following code in my theme-plain.xsl
This isn't something you can do in the theme stylesheet; it will need to be done before that, in the view. What happens when you select something in the menu? Does that take you to a different URL? If so, you would have a mapping in the page-flow.xml for that URL specifying the view to use for that page.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Menu Items

Phani S
Hi Alex,
          Can you give a sample for the view to combine menu and item, or tell me where I can look in the documentation for the help. Yes each item takes into a different URL.

Thanks.

On Wed, Jul 15, 2009 at 7:39 AM, Alessandro Vernet <[hidden email]> wrote:

Phani,


Phani Sajja wrote:
>
> i included the following code in my theme-plain.xsl
>

This isn't something you can do in the theme stylesheet; it will need to be
done before that, in the view. What happens when you select something in the
menu? Does that take you to a different URL? If so, you would have a mapping
in the page-flow.xml for that URL specifying the view to use for that page.

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Menu-Items-tp24459042p24490793.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Menu Items

Alessandro Vernet
Administrator
Phani,

Phani Sajja wrote
          Can you give a sample for the view to combine menu and item, or
tell me where I can look in the documentation for the help. Yes each item
takes into a different URL.
Could you clarify what you mean by "the view to combine menu and item"? I assume that your menu is always the same; so you can add to the page in the theme stylesheet. And the main content of the page going to be driven by the URL, which in turn can be driven by what the user clicked on in the menu.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Menu Items

Phani S
Alex,
          You are absolutely correct. That is what I want to do. I tried xforms:include in theme to include the menu.xhtml for each page, but it didnt work. could you tell me the steps I need to follow. Please help me.

thanks
Phani


Could you clarify what you mean by "the view to combine menu and item"? I
assume that your menu is always the same; so you can add to the page in the
theme stylesheet. And the main content of the page going to be driven by the
URL, which in turn can be driven by what the user clicked on in the menu.

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Menu-Items-tp24459042p24505421.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Menu Items

Alessandro Vernet
Administrator
Phani,

          You are absolutely correct. That is what I want to do. I tried
xforms:include in theme to include the menu.xhtml for each page, but it
didnt work. could you tell me the steps I need to follow. Please help me.


Try: <xi:include  href="your-file.xml" xxi:omit-xml-base="true"/>

And make sure you have the proper namespace declarations for:

      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Menu Items

Phani S
I included the statement 
 <xi:include href="oxf:/menu/menu.xhtml" xxi:omit-xml-base="true"/>
in theme-plain.xsl.
but it does not worked. 
Please find the attachment of application called menu.zip also the attachment of theme-plain.xsl. Please tell me wher I was wrong.
Try: <xi:include  href="your-file.xml" xxi:omit-xml-base="true"/>

And make sure you have the proper namespace declarations for:

     xmlns:xi="http://www.w3.org/2001/XInclude"
     xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Menu-Items-tp24459042p24526228.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws

menu.zip (3K) Download Attachment
theme-plain.xsl (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Menu Items

Alessandro Vernet
Administrator
Phani,

Phani Sajja wrote
I included the statement
 <xi:include href="oxf:/menu/menu.xhtml" xxi:omit-xml-base="true"/>
in theme-plain.xsl.
but it does not worked.
Please find the attachment of application called menu.zip also the
attachment of theme-plain.xsl. Please tell me wher I was wrong.
Since you include the menu.xhtml into your page, it shouldn't be a full XHTML file, but rather part of a page (in this case a <xhtml:div>). I changed your menu.xhtml to be: menu.xhtml. Also see your full app with this change: menu.zip.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Menu Items

Phani S
thank you very much Alex.

now it is working fine. I already asked about how do i assign events to menu item which brings the corresponding page for display.
thanks in advance.

On Sat, Jul 18, 2009 at 4:33 AM, Alessandro Vernet <[hidden email]> wrote:

Phani,


Phani Sajja wrote:
>
> I included the statement
>  <xi:include href="oxf:/menu/menu.xhtml" xxi:omit-xml-base="true"/>
> in theme-plain.xsl.
> but it does not worked.
> Please find the attachment of application called menu.zip also the
> attachment of theme-plain.xsl. Please tell me wher I was wrong.
>

Since you include the menu.xhtml into your page, it shouldn't be a full
XHTML file, but rather part of a page (in this case a <xhtml:div>). I
changed your menu.xhtml to be:
http://www.nabble.com/file/p24542922/menu.xhtml menu.xhtml . Also see your
full app with this change:  http://www.nabble.com/file/p24542922/menu.zip
menu.zip .

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Menu-Items-tp24459042p24542922.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Menu Items

Alessandro Vernet
Administrator
Phani,

Phani Sajja wrote
now it is working fine. I already asked about how do i assign events to menu
item which brings the corresponding page for display.
I am glad this worked. To know what has been selected in the menu, you put an event handler on xforms-value-changed inside the <xforms:select1> and do an <xforms:load> to take the browser to the page you want to load.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Menu Items

Phani S
Alex,
      I put the event like this

        <xforms:select1 ref="select1" appearance="xxforms:menu">
            <xforms:itemset nodeset="instance('items')//item">
                <xforms:label ref="@label"/>
                <xforms:value ref="@value"/>
            </xforms:itemset>
        <xforms:load ev:event="xforms-value-changed" value="if(.='New')" resource="/menu/new" show="replace"/>
        </xforms:select1>
for each item it is giving the page /menu/new. what might be wrong in it.

Phani.


I am glad this worked. To know what has been selected in the menu, you put
an event handler on xforms-value-changed inside the <xforms:select1> and do
an <xforms:load> to take the browser to the page you want to load.

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Menu-Items-tp24459042p24597339.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: Menu Items

Erik Bruchez
Administrator
Phani,

This is wrong:

value="if(.='New')"

There is no @value attribute on xforms:load. Try instead the @if
attribute, which allows for conditional execution of the action:

if=".= 'New'"

-Erik

On Wed, Jul 22, 2009 at 11:14 AM, Phani Sajja<[hidden email]> wrote:

> Alex,
>       I put the event like this
>
>         <xforms:select1 ref="select1" appearance="xxforms:menu">
>             <xforms:itemset nodeset="instance('items')//item">
>                 <xforms:label ref="@label"/>
>                 <xforms:value ref="@value"/>
>             </xforms:itemset>
>         <xforms:load ev:event="xforms-value-changed" value="if(.='New')"
> resource="/menu/new" show="replace"/>
>         </xforms:select1>
> for each item it is giving the page /menu/new. what might be wrong in it.
>
> Phani.
>
>>
>> I am glad this worked. To know what has been selected in the menu, you put
>> an event handler on xforms-value-changed inside the <xforms:select1> and
>> do
>> an <xforms:load> to take the browser to the page you want to load.
>>
>> Alex
>>
>> -----
>> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
>> Orbeon's Blog: http://www.orbeon.com/blog/
>> Personal Blog: http://avernet.blogspot.com/
>> Twitter - http://twitter.com/avernet
>> --
>> View this message in context:
>> http://www.nabble.com/Menu-Items-tp24459042p24597339.html
>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> 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
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>
>
>
> --
> Phani. S
> M.Tech(Software Engineering)
> Motilal Nehru National Institute of Technology
> (+91) 9010093398
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: Re: Menu Items

Phani S
thanks Erik and Alex for your help. Now I could be able to run my application fine.

On Tue, Jul 28, 2009 at 11:23 PM, Erik Bruchez <[hidden email]> wrote:
Phani,

This is wrong:

value="if(.='New')"

There is no @value attribute on xforms:load. Try instead the @if
attribute, which allows for conditional execution of the action:

if=".= 'New'"

-Erik

On Wed, Jul 22, 2009 at 11:14 AM, Phani Sajja<[hidden email]> wrote:
> Alex,
>       I put the event like this
>
>         <xforms:select1 ref="select1" appearance="xxforms:menu">
>             <xforms:itemset nodeset="instance('items')//item">
>                 <xforms:label ref="@label"/>
>                 <xforms:value ref="@value"/>
>             </xforms:itemset>
>         <xforms:load ev:event="xforms-value-changed" value="if(.='New')"
> resource="/menu/new" show="replace"/>
>         </xforms:select1>
> for each item it is giving the page /menu/new. what might be wrong in it.
>
> Phani.
>
>>
>> I am glad this worked. To know what has been selected in the menu, you put
>> an event handler on xforms-value-changed inside the <xforms:select1> and
>> do
>> an <xforms:load> to take the browser to the page you want to load.
>>
>> Alex
>>
>> -----
>> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
>> Orbeon's Blog: http://www.orbeon.com/blog/
>> Personal Blog: http://avernet.blogspot.com/
>> Twitter - http://twitter.com/avernet
>> --
>> View this message in context:
>> http://www.nabble.com/Menu-Items-tp24459042p24597339.html
>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> 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
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>
>
>
> --
> Phani. S
> M.Tech(Software Engineering)
> Motilal Nehru National Institute of Technology
> (+91) 9010093398
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
Phani. S
M.Tech(Software Engineering)
Motilal Nehru National Institute of Technology
(+91) 9010093398


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws