Quantcast

Automatically ticking parent checkboxes in tree input type ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Automatically ticking parent checkboxes in tree input type ?

mbenard
 Dear all,

let a tree input type be :

{{{field|Family|input type=tree|structure=*Family1
**SubFamily11
**SubFamily12
*Family2
**SubFamily21
**SubFamily22
...etc.
}}}

I'd like that when a user ticks Subfamily11 , the parent Family1 gets automatically ticked.

Is it possible ?

The idead behind this is when I run a query to get the objects with property Family==Family1 , I retrieve the Objects with Family==Family1 or SubFamily 11, Subfamily12, etc.

Thnaks for your inputs

Salutations,
 
Michel Bénard
----------------------------- Disclaimer ------------------------------
--- Ce message ainsi que les éventuelles pièces jointes constituent une
correspondance privée et confidentielle à l'attention exclusive du
destinataire désigné ci-dessus. Si vous n'êtes pas le destinataire du
présent message ou une personne susceptible de pouvoir le lui délivrer,
il vous est signifié que toute divulgation, distribution ou copie,
totale ou partielle, sur un quelconque support de cette transmission
est strictement interdite. Si vous avez recu ce message par erreur,
nous vous remercions d'en informer l'expéditeur par téléphone ou de lui
retourner le présent message, puis d'effacer immédiatement ce message
de votre systeme. Tout message électronique est susceptible
d'altération. Le "groupement des Mousquetaires" décline toute
responsabilité au titre de ce message s'il a été altéré, déformé ou
falsifié.---
--- This e-mail and any attachments is a confidential correspondence
intended only for use of the individual or entity named above. If you
are not the intended recipient or the agent responsible for delivering
the message to the intended recipient, you are hereby notified that any
disclosure, distribution or copying, either whole or partial, in any
medium of this communication is strictly prohibited. If you have
received this communication by mistake, please notify the sender by
phone or by replying this message, and then delete this message from
your system. E-mails are susceptible of alteration. The
"Mousquetaires' group" shall not therefore be liable for the message
if altered, changed or falsified.---
-----------------------------------------------------------------------

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically ticking parent checkboxes in tree input type ?

Yaron Koren-2
Hi Michel,

There's no way to do that within the "tree" input, unfortunately. By
coincidence, this summer I will be co-mentoring a Google Summer of Code
project (the accepted projects were just announced today) to add
hierarchy-type querying to the Cargo extension, so that if you query for
something like " Family WITHIN 'Family1' ", you will get all pages that
have a value of Family1, SubFamily 11, Subfamily12, etc. It will presumably
be done by the end of this summmer.

If you're not using Cargo, though (or can't wait that long), I can think of
two other options:

- If you're using SMW, you can make a category for each of those values,
and construct a category tree that way. Instead of having a "Family"
property, you would just tag each page with the relevant category or
categories, again using the PF "tree" input (which can take a "top
category=" parameter). Then use SMW's category querying, which is recursive.

- Just manually query on each sub-value, with a lot of ORs in each #ask
query.

-Yaron

On Thu, May 4, 2017 at 11:38 AM, <[hidden email]> wrote:

>  Dear all,
>
> let a tree input type be :
>
> {{{field|Family|input type=tree|structure=*Family1
> **SubFamily11
> **SubFamily12
> *Family2
> **SubFamily21
> **SubFamily22
> ...etc.
> }}}
>
> I'd like that when a user ticks Subfamily11 , the parent Family1 gets
> automatically ticked.
>
> Is it possible ?
>
> The idead behind this is when I run a query to get the objects with
> property Family==Family1 , I retrieve the Objects with Family==Family1 or
> SubFamily 11, Subfamily12, etc.
>
> Thnaks for your inputs
>
> Salutations,
>
> Michel Bénard
> ----------------------------- Disclaimer ------------------------------
> --- Ce message ainsi que les éventuelles pièces jointes constituent une
> correspondance privée et confidentielle à l'attention exclusive du
> destinataire désigné ci-dessus. Si vous n'êtes pas le destinataire du
> présent message ou une personne susceptible de pouvoir le lui délivrer,
> il vous est signifié que toute divulgation, distribution ou copie,
> totale ou partielle, sur un quelconque support de cette transmission
> est strictement interdite. Si vous avez recu ce message par erreur,
> nous vous remercions d'en informer l'expéditeur par téléphone ou de lui
> retourner le présent message, puis d'effacer immédiatement ce message
> de votre systeme. Tout message électronique est susceptible
> d'altération. Le "groupement des Mousquetaires" décline toute
> responsabilité au titre de ce message s'il a été altéré, déformé ou
> falsifié.---
> --- This e-mail and any attachments is a confidential correspondence
> intended only for use of the individual or entity named above. If you
> are not the intended recipient or the agent responsible for delivering
> the message to the intended recipient, you are hereby notified that any
> disclosure, distribution or copying, either whole or partial, in any
> medium of this communication is strictly prohibited. If you have
> received this communication by mistake, please notify the sender by
> phone or by replying this message, and then delete this message from
> your system. E-mails are susceptible of alteration. The
> "Mousquetaires' group" shall not therefore be liable for the message
> if altered, changed or falsified.---
> -----------------------------------------------------------------------
>
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Automatically ticking parent checkboxes in tree input type ?

mbenard
Thank you Yaron for the tips.

So I'll stick with my python scripts for the time being.

For those interested, here is how I do it :
Each family is stored in a page (Family 1, Family1.1, ... ) and has a
semantic property "parent"  ( Family 1 : has parent  = None , Family1.1 :
has parent  = Family 1 and so on) , each belong to the category "Family"
my python script :
scans all pages from Category "Family" and constructs a tree structure
based on the "has parent" property -> : Family1 o--- Family11 , etc
then scans all pages using the "has family" property, compares to the tree
structure , and add the missing parents to the pages





Salutations,

Michel Bénard
Urbaniste
DOSI Groupement des Mousquetaires
Montrouge/France




De :    Yaron Koren <[hidden email]>
A :     [hidden email]
Cc :    Semantic MediaWiki users <[hidden email]>
Date :  04/05/2017 19:36
Objet : Re: [Semediawiki-user] Automatically ticking parent checkboxes in
tree input type ?
Envoyé par :    [hidden email]



Hi Michel,

There's no way to do that within the "tree" input, unfortunately. By
coincidence, this summer I will be co-mentoring a Google Summer of Code
project (the accepted projects were just announced today) to add
hierarchy-type querying to the Cargo extension, so that if you query for
something like " Family WITHIN 'Family1' ", you will get all pages that
have a value of Family1, SubFamily 11, Subfamily12, etc. It will
presumably be done by the end of this summmer.

If you're not using Cargo, though (or can't wait that long), I can think
of two other options:

- If you're using SMW, you can make a category for each of those values,
and construct a category tree that way. Instead of having a "Family"
property, you would just tag each page with the relevant category or
categories, again using the PF "tree" input (which can take a "top
category=" parameter). Then use SMW's category querying, which is
recursive.

- Just manually query on each sub-value, with a lot of ORs in each #ask
query.

-Yaron

On Thu, May 4, 2017 at 11:38 AM, <[hidden email]> wrote:
 Dear all,

let a tree input type be :

{{{field|Family|input type=tree|structure=*Family1
**SubFamily11
**SubFamily12
*Family2
**SubFamily21
**SubFamily22
...etc.
}}}

I'd like that when a user ticks Subfamily11 , the parent Family1 gets
automatically ticked.

Is it possible ?

The idead behind this is when I run a query to get the objects with
property Family==Family1 , I retrieve the Objects with Family==Family1 or
SubFamily 11, Subfamily12, etc.

Thnaks for your inputs

Salutations,

Michel Bénard
----------------------------- Disclaimer ------------------------------
--- Ce message ainsi que les éventuelles pièces jointes constituent une
correspondance privée et confidentielle à l'attention exclusive du
destinataire désigné ci-dessus. Si vous n'êtes pas le destinataire du
présent message ou une personne susceptible de pouvoir le lui délivrer,
il vous est signifié que toute divulgation, distribution ou copie,
totale ou partielle, sur un quelconque support de cette transmission
est strictement interdite. Si vous avez recu ce message par erreur,
nous vous remercions d'en informer l'expéditeur par téléphone ou de lui
retourner le présent message, puis d'effacer immédiatement ce message
de votre systeme. Tout message électronique est susceptible
d'altération. Le "groupement des Mousquetaires" décline toute
responsabilité au titre de ce message s'il a été altéré, déformé ou
falsifié.---
--- This e-mail and any attachments is a confidential correspondence
intended only for use of the individual or entity named above. If you
are not the intended recipient or the agent responsible for delivering
the message to the intended recipient, you are hereby notified that any
disclosure, distribution or copying, either whole or partial, in any
medium of this communication is strictly prohibited. If you have
received this communication by mistake, please notify the sender by
phone or by replying this message, and then delete this message from
your system. E-mails are susceptible of alteration. The
"Mousquetaires' group" shall not therefore be liable for the message
if altered, changed or falsified.---
-----------------------------------------------------------------------




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...