forms allow multi-value fields to be populated with the content of a table in a topic

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

forms allow multi-value fields to be populated with the content of a table in a topic

Daniel Ajoy
Hello,

There is feature of forms that allows multi-value fields to be populated with the content of a table in a topic.

I'm talking about this:

http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics


How can I extract the items in that table if I create a form in VIEW mode?

I would need to produce something like:

<select>
<option> First Value </option>
<option> Second Value </option>
<option> Third Value </option>
<option> Fourth Value </option>
</select>

 From a topic that has this table:

| *Name* |
| First Value |
| Second Value |
| Third Value |
| Fourth Value |

Daniel


PS. It seems awkward that we have to duplicate the functionality that is already available in EDIT mode, when we want to fill out the form in VIEW mode.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: forms allow multi-value fields to be populated with the content of a table in a topic

Chris Hoefler
Errr...can you explain a bit more what you are trying to do? What do you mean create a form in VIEW mode? Are you trying to write an html form in your topic that is populated with values from a DataForm attached to the topic? Do you want this in a single topic or every topic with a DataForm attached to it?

On Fri, Jul 3, 2015 at 5:37 PM, Daniel Ajoy <[hidden email]> wrote:
Hello,

There is feature of forms that allows multi-value fields to be populated with the content of a table in a topic.

I'm talking about this:

http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics


How can I extract the items in that table if I create a form in VIEW mode?

I would need to produce something like:

<select>
<option> First Value </option>
<option> Second Value </option>
<option> Third Value </option>
<option> Fourth Value </option>
</select>

 From a topic that has this table:

| *Name* |
| First Value |
| Second Value |
| Third Value |
| Fourth Value |

Daniel


PS. It seems awkward that we have to duplicate the functionality that is already available in EDIT mode, when we want to fill out the form in VIEW mode.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss




------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: forms allow multi-value fields to be populated with the content of a table in a topic

Daniel Ajoy
In reply to this post by Daniel Ajoy
> Errr...can you explain a bit more what you are trying to do?

I'm trying to do something very similar to what is described in

http://foswiki.org/System/FAQAnApplicationWithWikiForm

"Create an HTML form for easy topic creation"

but I want to have "select" type fields in the form, and I want to populate those Select type fields with values from a table in a different topic like how it is described in

http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics

> What do you
> mean create a form in VIEW mode?

The part where it says: "Create an HTML form for easy topic creation"

in

http://foswiki.org/System/FAQAnApplicationWithWikiForm

the form would be functional in VIEW mode of my topic.


> Are you trying to write an html form in
> your topic that is populated with values from a DataForm attached to the
> topic?

Yes, but I want to have a Select type field that shows other options, taken from a table in another topic, like how it is done in:

http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics


> Do you want this in a single topic or every topic with a DataForm
> attached to it?

I want to put that form in a Template topic.


Daniel



> On Fri, Jul 3, 2015 at 5:37 PM, Daniel Ajoy <da.ajoy@...> wrote:
>
>> Hello,
>>
>> There is feature of forms that allows multi-value fields to be populated
>> with the content of a table in a topic.
>>
>> I'm talking about this:
>>
>>
>> http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics
>>
>>
>> How can I extract the items in that table if I create a form in VIEW mode?
>>
>> I would need to produce something like:
>>
>> <select>
>> <option> First Value </option>
>> <option> Second Value </option>
>> <option> Third Value </option>
>> <option> Fourth Value </option>
>> </select>
>>
>>  From a topic that has this table:
>>
>> | *Name* |
>> | First Value |
>> | Second Value |
>> | Third Value |
>> | Fourth Value |
>>
>> Daniel
>>
>>
>> PS. It seems awkward that we have to duplicate the functionality that is
>> already available in EDIT mode, when we want to fill out the form in VIEW
>> mode.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|

Re: forms allow multi-value fields to be populated with the content of a table in a topic

Chris Hoefler
Right, ok. So the reason I was asking is because you have several options.

1) You can hand code the html form using SEARCH in a single topic. This is an easy solution if you only need to do this for one or a handful of topics.

2) You can code the html form into a VIEW_TEMPLATE so that any topic created that uses that template will have that form. This is useful when the SEARCH is coded in such a way as to be dynamic (ex: uses a formfield value in the topic or something in the topic text as the query/regex for the SEARCH which is used to populate the select). To do this easily, have a look at AutoTemplatePlugin to understand the rules by which VIEW_TEMPLATES are searched for given topics. There is a lot of flexibility in how to use it.

3) You can use RENDERFOREDIT from FlexFormPlugin to render any given formfield (or all of them) corresponding to a DataForm definition in a topic. For example, if your select field is defined with certain options in a DataForm topic, you can render that form in a different topic using %RENDERFOREDIT{form="DataForm" fields="field1, field2, etc"}%. This is a very flexible option that allows you to redefine the DataForm at some future date and not have to go back and re-update all of your forms. Very nice, but not always necessary. It can be a bit confusing, though, if you have a topic that uses RENDERFOREDIT, to grab a DataForm, which defines a SEARCH, which is dependent on some content in the topic that the form is being rendered for.

So when you say,
> Are you trying to write an html form in
> your topic that is populated with values from a DataForm attached to the
> topic?

Yes, but I want to have a Select type field that shows other options, taken from a table in another topic, like how it is done in:

That is where I have to ask again: are you generating a single form for a single topic, or do you want a form in several topics? And, if the latter: do you want the same SEARCH generating the same set of options for each form, or do you want different sets of options depending on some context? And, if the latter: what is that context? Is it all completely dynamic (ex: user creates a topic with arbitrary table data, then goes to a topic with an html form which has an option to select his topic table to generate the options used to create a third topic), or does it all come from a set of predefined DataForm definitions, or is it somewhere in-between?

The usual way to use DataForms is to attach structured data to your topics. Think of an address book where each topic is a person, and attached to each topic is a form that defines first name, last name, phone, email, etc, for that person. You can customize various templates to control how things are displayed/edited, but all of the data in each topic is consistently defined by the DataForm attached to that topic. If this is not what you intend and you just want to create some html forms to generate topics, then DataForms might not be the best solution; a good set of VIEW/EDIT templates might serve you better.

On Mon, Jul 6, 2015 at 11:14 AM, Daniel Ajoy <[hidden email]> wrote:
> Errr...can you explain a bit more what you are trying to do?

I'm trying to do something very similar to what is described in

http://foswiki.org/System/FAQAnApplicationWithWikiForm

"Create an HTML form for easy topic creation"

but I want to have "select" type fields in the form, and I want to populate those Select type fields with values from a table in a different topic like how it is described in

http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics

> What do you
> mean create a form in VIEW mode?

The part where it says: "Create an HTML form for easy topic creation"

in

http://foswiki.org/System/FAQAnApplicationWithWikiForm

the form would be functional in VIEW mode of my topic.


> Are you trying to write an html form in
> your topic that is populated with values from a DataForm attached to the
> topic?

Yes, but I want to have a Select type field that shows other options, taken from a table in another topic, like how it is done in:

http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics


> Do you want this in a single topic or every topic with a DataForm
> attached to it?

I want to put that form in a Template topic.


Daniel



> On Fri, Jul 3, 2015 at 5:37 PM, Daniel Ajoy <da.ajoy@...> wrote:
>
>> Hello,
>>
>> There is feature of forms that allows multi-value fields to be populated
>> with the content of a table in a topic.
>>
>> I'm talking about this:
>>
>>
>> http://foswiki.org/System/DataForms#How_to_retrieve_values_from_other_topics
>>
>>
>> How can I extract the items in that table if I create a form in VIEW mode?
>>
>> I would need to produce something like:
>>
>> <select>
>> <option> First Value </option>
>> <option> Second Value </option>
>> <option> Third Value </option>
>> <option> Fourth Value </option>
>> </select>
>>
>>  From a topic that has this table:
>>
>> | *Name* |
>> | First Value |
>> | Second Value |
>> | Third Value |
>> | Fourth Value |
>>
>> Daniel
>>
>>
>> PS. It seems awkward that we have to duplicate the functionality that is
>> already available in EDIT mode, when we want to fill out the form in VIEW
>> mode.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss



--
Chris Hoefler, PhD
Postdoctoral Research Associate
Straight Lab
Texas A&M University
2128 TAMU
College Station, TX 77843-2128

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss