* fh.getParam question
Re: fh.getParam question
The version I attached yesterday evening (too) late is not 100%. Will fix it this morning and send it for testing. Sorry.
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: fh.getParam question
No problem, Joop. I will wait.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
Re: fh.getParam question
This is the one that works. 
As always ... all suggestions for improvement are welcome.
As always ... all suggestions for improvement are welcome.
- Attachments
-
Change source template.fh_lua- (2.41 KiB) Downloaded 80 times
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: fh.getParam question
Joop, that seems to work well.
Do you envisage that it will be used on sources which have already had their template fields populated? If so, the old template data is thrown away when the template is changed. Have you considered perhaps presenting the old data and/or Text from Source and the new empty fields so that users can cut and paste the data into new fields if relevant? It would be a more complex interface, of course, and you may not wish to do it. If you don't do it, a warning to users about data loss might be appropriate.
(By the way, I still have on my to-do list looking at the plugin you wrote "Convert generic source to template")
Do you envisage that it will be used on sources which have already had their template fields populated? If so, the old template data is thrown away when the template is changed. Have you considered perhaps presenting the old data and/or Text from Source and the new empty fields so that users can cut and paste the data into new fields if relevant? It would be a more complex interface, of course, and you may not wish to do it. If you don't do it, a warning to users about data loss might be appropriate.
(By the way, I still have on my to-do list looking at the plugin you wrote "Convert generic source to template")
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
Re: fh.getParam question
Helen, thanks for testing.
I used it on sources with their template fields populated and the data was not thrown away but kind of hidden. I then used the source records overview and from there had access to all data to cut/paste it. The best proof that data is not thrown away is by changing a record to a new (very different template) and then change it back again. Should be unchanged.
You're right however that this is quite cumbersome, but the alternative of building a more elaborate user interface seemed a lot of work and involving iup (and I really don't like to go down that road
). Indeed before publishing it in the store I planned to include a warning about how to handle data from fields missing in the target template.
If you have ideas about how the mapping of old template to new template fields can be done with fh.getParam, I'd be glad to incorporate it.
About the Convert Generic to Templated plugin... let me update that one with a usable user interface and I'll share that one here to test it.
I used it on sources with their template fields populated and the data was not thrown away but kind of hidden. I then used the source records overview and from there had access to all data to cut/paste it. The best proof that data is not thrown away is by changing a record to a new (very different template) and then change it back again. Should be unchanged.
You're right however that this is quite cumbersome, but the alternative of building a more elaborate user interface seemed a lot of work and involving iup (and I really don't like to go down that road
If you have ideas about how the mapping of old template to new template fields can be done with fh.getParam, I'd be glad to incorporate it.
About the Convert Generic to Templated plugin... let me update that one with a usable user interface and I'll share that one here to test it.
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: fh.getParam question
I was wondering about something simple, using a single multiline text field in getParam to display the old values
e.g. field label: text (which would either be the text value or a text representation of a link) and a number of fields for the new template (which could be generated dynamically as getParam is data table driven). Users could cut and paste from the old values to the new... For each source, you'd pop-up a tailored getparam dialog, and save the results when the users had tinkered...
A more sophisticated approach would look for fields with similar types/names e.g. TX-ADDRESS and repopulate them automatically but that's further than I'd envisage going.
re the multiline field, there's a parameter for string fields:
lines: makes the field multiline and with a height of the number given for the lines value (1.9 #99)
Thanks.About the Convert Generic to Templated plugin... let me update that one with a usable user interface and I'll share that one here to test it.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history