Advice: Show/Hide in repeat

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

Advice: Show/Hide in repeat

Louis Ratzesberger-2
Hi List (that still needs a good moniker),

I am building a page by processing a atom-pub file.  Each entry has a  
summary and content nodes.  I want to make the summary visible and the  
content hidden until the user presses link, e.g., Read more...

The sections come from repeating through the atom:entry elements and  
directly outputing the html in the summary and content nodes.

It's now clear how I can create a control in this repeat that can  
change the visibility of the section.  The caret/title links in a Form  
Runner section would be ideal, but I can't see how to build that "on  
the fly."

I am thinking ... insert an element into an instance that holds the  
visibility .. but how do I reference a div that is created and given  
an id by xforms?

Thanks for you thoughts, or pointing me to the missing "XForms  
Cookbook" (it would be nice).

Cheers,
Louis (Hank) Ratzesberger

The repeat code:


<xf:repeat nodeset="xxforms:sort(instance('feed')/atom:entry,  
atom:published, 'text', 'descending')">

  <h3> <xf:output ref="atom:title"/> </h3>

  <xf:output class="wiki-item"
    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data',  
atom:summary/html:div, 'data'),'html')"
    mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>

<xf:output class="wiki-item"
    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data',  
atom:content/html:div, 'data'),'html')"
   mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>

</xf:repeat>


--
Hank Ratzesberger
[hidden email]



--
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: Advice: Show/Hide in repeat

Alessandro  Vernet
Administrator
Hank,

Would an xforms:switch work in this case? The benefit of the
xforms:switch is that you won't need create an additional place in
your instances to store, for each iteration of the repeat, whether you
want to show the detail on addition to the summary.

Alex

On Wednesday, August 4, 2010, Louis Ratzesberger <[hidden email]> wrote:

> Hi List (that still needs a good moniker),
>
> I am building a page by processing a atom-pub file.  Each entry has a summary and content nodes.  I want to make the summary visible and the content hidden until the user presses link, e.g., Read more...
>
> The sections come from repeating through the atom:entry elements and directly outputing the html in the summary and content nodes.
>
> It's now clear how I can create a control in this repeat that can change the visibility of the section.  The caret/title links in a Form Runner section would be ideal, but I can't see how to build that "on the fly."
>
> I am thinking ... insert an element into an instance that holds the visibility .. but how do I reference a div that is created and given an id by xforms?
>
> Thanks for you thoughts, or pointing me to the missing "XForms Cookbook" (it would be nice).
>
> Cheers,
> Louis (Hank) Ratzesberger
>
> The repeat code:
>
>
> <xf:repeat nodeset="xxforms:sort(instance('feed')/atom:entry, atom:published, 'text', 'descending')">
>
>  <h3> <xf:output ref="atom:title"/> </h3>
>
>  <xf:output class="wiki-item"
>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data', atom:summary/html:div, 'data'),'html')"
>    mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>
> <xf:output class="wiki-item"
>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data', atom:content/html:div, 'data'),'html')"
>   mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>
> </xf:repeat>
>
>
> --
> Hank Ratzesberger
> [hidden email]
>
>
--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Advice: Show/Hide in repeat

Alessandro  Vernet
Administrator
In reply to this post by Louis Ratzesberger-2
Hank,

Would an xforms:switch work in this case? The benefit of the
xforms:switch is that you won't need create an additional place in
your instances to store, for each iteration of the repeat, whether you
want to show the detail on addition to the summary.

Alex

On Wednesday, August 4, 2010, Louis Ratzesberger <[hidden email]> wrote:

> Hi List (that still needs a good moniker),
>
> I am building a page by processing a atom-pub file.  Each entry has a summary and content nodes.  I want to make the summary visible and the content hidden until the user presses link, e.g., Read more...
>
> The sections come from repeating through the atom:entry elements and directly outputing the html in the summary and content nodes.
>
> It's now clear how I can create a control in this repeat that can change the visibility of the section.  The caret/title links in a Form Runner section would be ideal, but I can't see how to build that "on the fly."
>
> I am thinking ... insert an element into an instance that holds the visibility .. but how do I reference a div that is created and given an id by xforms?
>
> Thanks for you thoughts, or pointing me to the missing "XForms Cookbook" (it would be nice).
>
> Cheers,
> Louis (Hank) Ratzesberger
>
> The repeat code:
>
>
> <xf:repeat nodeset="xxforms:sort(instance('feed')/atom:entry, atom:published, 'text', 'descending')">
>
>  <h3> <xf:output ref="atom:title"/> </h3>
>
>  <xf:output class="wiki-item"
>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data', atom:summary/html:div, 'data'),'html')"
>    mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>
> <xf:output class="wiki-item"
>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data', atom:content/html:div, 'data'),'html')"
>   mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>
> </xf:repeat>
>
>
> --
> Hank Ratzesberger
> [hidden email]
>
>
--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Advice: Show/Hide in repeat

Hank Ratzesberger-2
In reply to this post by Alessandro Vernet
Hi Alex,

Can I create the switch within a repeat loop?  And how would I know  
the id of the case, concatenate a name with position() ? Also, I would  
not be switching between cases, only making a section visible or not.

If it looked just like Form Runner sections, that would be great.  I  
just need to understand how that can be done withing a repeat loop at  
run time, with the content being created from an output element.

I'll let you know if I figure something out.

Best,
Hank

Quoting Alessandro Vernet <[hidden email]>:

> Hank,
>
> Would an xforms:switch work in this case? The benefit of the
> xforms:switch is that you won't need create an additional place in
> your instances to store, for each iteration of the repeat, whether you
> want to show the detail on addition to the summary.
>
> Alex
>
> On Wednesday, August 4, 2010, Louis Ratzesberger <[hidden email]> wrote:
>> Hi List (that still needs a good moniker),
>>
>> I am building a page by processing a atom-pub file.  Each entry has  
>> a summary and content nodes.  I want to make the summary visible  
>> and the content hidden until the user presses link, e.g., Read  
>> more...
>>
>> The sections come from repeating through the atom:entry elements  
>> and directly outputing the html in the summary and content nodes.
>>
>> It's now clear how I can create a control in this repeat that can  
>> change the visibility of the section.  The caret/title links in a  
>> Form Runner section would be ideal, but I can't see how to build  
>> that "on the fly."
>>
>> I am thinking ... insert an element into an instance that holds the  
>> visibility .. but how do I reference a div that is created and  
>> given an id by xforms?
>>
>> Thanks for you thoughts, or pointing me to the missing "XForms  
>> Cookbook" (it would be nice).
>>
>> Cheers,
>> Louis (Hank) Ratzesberger
>>
>> The repeat code:
>>
>>
>> <xf:repeat nodeset="xxforms:sort(instance('feed')/atom:entry,  
>> atom:published, 'text', 'descending')">
>>
>>  <h3> <xf:output ref="atom:title"/> </h3>
>>
>>  <xf:output class="wiki-item"
>>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl',  
>> 'data', atom:summary/html:div, 'data'),'html')"
>>    mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>>
>> <xf:output class="wiki-item"
>>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl',  
>> 'data', atom:content/html:div, 'data'),'html')"
>>   mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>>
>> </xf:repeat>
>>
>>
>> --
>> Hank Ratzesberger
>> [hidden email]
>>
>>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise -
> http://www.orbeon.com/
> My Twitter: http://twitter.com/avernet
>


--
Hank Ratzesberger
[hidden email]



--
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: Advice: Show/Hide in repeat

Alessandro  Vernet
Administrator
Hi Hank,

Yes, you can use a switch inside a repeat. When you do a toggle, it
will toggle the switch in the repeat iteration which is the "current"
iteration (i.e. the iteration from which you are doing the toggle).
And if you only what to show/hide a section, create two cases: one
<xforms:case id="detail">Some interesting content here</xforms:case>
and one <xforms:case id="nothing-to-see-here"/>. To hide the detail,
switch to the 'nothing-to-see-here' case. Does this make sense?

Alex

On Thursday, August 5, 2010, Louis Ratzesberger <[hidden email]> wrote:

> Hi Alex,
>
> Can I create the switch within a repeat loop?  And how would I know the id of the case, concatenate a name with position() ? Also, I would not be switching between cases, only making a section visible or not.
>
> If it looked just like Form Runner sections, that would be great.  I just need to understand how that can be done withing a repeat loop at run time, with the content being created from an output element.
>
> I'll let you know if I figure something out.
>
> Best,
> Hank
>
> Quoting Alessandro Vernet <[hidden email]>:
>
>
> Hank,
>
> Would an xforms:switch work in this case? The benefit of the
> xforms:switch is that you won't need create an additional place in
> your instances to store, for each iteration of the repeat, whether you
> want to show the detail on addition to the summary.
>
> Alex
>
> On Wednesday, August 4, 2010, Louis Ratzesberger <[hidden email]> wrote:
>
> Hi List (that still needs a good moniker),
>
> I am building a page by processing a atom-pub file.  Each entry has a summary and content nodes.  I want to make the summary visible and the content hidden until the user presses link, e.g., Read more...
>
> The sections come from repeating through the atom:entry elements and directly outputing the html in the summary and content nodes.
>
> It's now clear how I can create a control in this repeat that can change the visibility of the section.  The caret/title links in a Form Runner section would be ideal, but I can't see how to build that "on the fly."
>
> I am thinking ... insert an element into an instance that holds the visibility .. but how do I reference a div that is created and given an id by xforms?
>
> Thanks for you thoughts, or pointing me to the missing "XForms Cookbook" (it would be nice).
>
> Cheers,
> Louis (Hank) Ratzesberger
>
> The repeat code:
>
>
> <xf:repeat nodeset="xxforms:sort(instance('feed')/atom:entry, atom:published, 'text', 'descending')">
>
>  <h3> <xf:output ref="atom:title"/> </h3>
>
>  <xf:output class="wiki-item"
>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data', atom:summary/html:div, 'data'),'html')"
>    mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>
> <xf:output class="wiki-item"
>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl', 'data', atom:content/html:div, 'data'),'html')"
>   mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>
> </xf:repeat>
>
>
> --
> Hank Ratzesberger
> [hidden email]
>
>
>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise -
> http://www.orbeon.com/
> My Twitter: http://twitter.com/avernet
>
>
>
>
>
> --
> Hank Ratzesberger
> [hidden email]
>
>
--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Advice: Show/Hide in repeat

Hank Ratzesberger-2
Hi Alex,

Thanks. It seems so obvious now.... back to code bicycle...

--Hank


Quoting Alessandro Vernet <[hidden email]>:

> Hi Hank,
>
> Yes, you can use a switch inside a repeat. When you do a toggle, it
> will toggle the switch in the repeat iteration which is the "current"
> iteration (i.e. the iteration from which you are doing the toggle).
> And if you only what to show/hide a section, create two cases: one
> <xforms:case id="detail">Some interesting content here</xforms:case>
> and one <xforms:case id="nothing-to-see-here"/>. To hide the detail,
> switch to the 'nothing-to-see-here' case. Does this make sense?
>
> Alex
>
> On Thursday, August 5, 2010, Louis Ratzesberger <[hidden email]> wrote:
>> Hi Alex,
>>
>> Can I create the switch within a repeat loop?  And how would I know  
>> the id of the case, concatenate a name with position() ? Also, I  
>> would not be switching between cases, only making a section visible  
>> or not.
>>
>> If it looked just like Form Runner sections, that would be great.  
>>  I just need to understand how that can be done withing a repeat  
>> loop at run time, with the content being created from an output  
>> element.
>>
>> I'll let you know if I figure something out.
>>
>> Best,
>> Hank
>>
>> Quoting Alessandro Vernet <[hidden email]>:
>>
>>
>> Hank,
>>
>> Would an xforms:switch work in this case? The benefit of the
>> xforms:switch is that you won't need create an additional place in
>> your instances to store, for each iteration of the repeat, whether you
>> want to show the detail on addition to the summary.
>>
>> Alex
>>
>> On Wednesday, August 4, 2010, Louis Ratzesberger  
>> <[hidden email]> wrote:
>>
>> Hi List (that still needs a good moniker),
>>
>> I am building a page by processing a atom-pub file.  Each entry has  
>> a summary and content nodes.  I want to make the summary visible  
>> and the content hidden until the user presses link, e.g., Read  
>> more...
>>
>> The sections come from repeating through the atom:entry elements  
>> and directly outputing the html in the summary and content nodes.
>>
>> It's now clear how I can create a control in this repeat that can  
>> change the visibility of the section.  The caret/title links in a  
>> Form Runner section would be ideal, but I can't see how to build  
>> that "on the fly."
>>
>> I am thinking ... insert an element into an instance that holds the  
>> visibility .. but how do I reference a div that is created and  
>> given an id by xforms?
>>
>> Thanks for you thoughts, or pointing me to the missing "XForms  
>> Cookbook" (it would be nice).
>>
>> Cheers,
>> Louis (Hank) Ratzesberger
>>
>> The repeat code:
>>
>>
>> <xf:repeat nodeset="xxforms:sort(instance('feed')/atom:entry,  
>> atom:published, 'text', 'descending')">
>>
>>  <h3> <xf:output ref="atom:title"/> </h3>
>>
>>  <xf:output class="wiki-item"
>>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl',  
>> 'data', atom:summary/html:div, 'data'),'html')"
>>    mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>>
>> <xf:output class="wiki-item"
>>    value="xxforms:serialize(xxforms:call-xpl('oxf:/wiki.xpl',  
>> 'data', atom:content/html:div, 'data'),'html')"
>>   mediatype="text/html"  xmlns:html="http://www.w3.org/1999/xhtml"/>
>>
>> </xf:repeat>
>>
>>
>> --
>> Hank Ratzesberger
>> [hidden email]
>>
>>
>>
>>
>> --
>> Orbeon Forms - Web forms, open-source, for the Enterprise -
>> http://www.orbeon.com/
>> My Twitter: http://twitter.com/avernet
>>
>>
>>
>>
>>
>> --
>> Hank Ratzesberger
>> [hidden email]
>>
>>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise -
> http://www.orbeon.com/
> My Twitter: http://twitter.com/avernet
>


--
Hank Ratzesberger
[hidden email]



--
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