Hub Nexus
Mis à jour

AuteurPas encore d'auteurLa reprendre

Quelque chose à améliorer ? Proposez une modification.

Soutien

Motivation

In some instances you only want to add to the end of a list or delete from the end of a list. This program demonstrates how you can use the last() function to do this.

Screen Image

When you insert a new row, it will always be inserted at the end of the list. When you delete a row, it will also be removed from the end of the list.

Insert and delete from list

Sample Program

Repeat Demo

1
2
3

Value:

Insert new row

Delete last row

Discussion

Notice that the xf:insert uses the xf:action element to trigger on the DOM activate and the xf:delete uses the ev:event attribute to trigger the delete. This is because we need to include the xf:setvalue in the insert.

So, as a general rule, if you just need to use a single element in a trigger, you can use the ev:event attribute. But if you need to include several elements that all must be triggered you should wrap them in an an xf:action element.

Potential problem: when you have deleted all the nodes, the insert trigger does not work anymore. This is because the nodeset selection on the insert element is empty in that situation. If the nodeset selector is empty, the insert trigger has no meaning (see the first rule in 'rules for insert processing')

Where this page came from

This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Dans ces publicationsXForms

LanguesEnglish

Licence : CC BY-SA 4.0 · Adapté de en.wikibooks.org

1

0

0

0

Spinner Logo

commentaires

Spinner Logo
Version: 2CC0 1.0 — public domain
The runaway star that left the Tarantula Nebula
Version: 2CC0 1.0 — public domain
The Blackwell School, where segregation had no law behind it
Version: 2CC0 1.0 — public domain
The Eagle Nebula, seen in the infrared
Version: 2CC0 1.0 — public domain
The house where the Equal Rights Amendment was written
Version: 2CC0 1.0 — public domain
The Aleutians, the forgotten front of the Second World War
Version: 2CC0 1.0 — public domain
The Cosmic Cliffs are not cliffs