That doesn't sound like incorrect behavior to me - the form doesn't know what, if anything, you want preloaded in subsequent template instances. Unfortunately, I don't know of any solution to this problem, assuming the preloading/setting of default values has to be done programatically.

-Yaron


On Thu, Jul 23, 2009 at 1:44 PM, Brian Osborne <bosborne11@verizon.net> wrote:
Yaron,

Hmm. Spoke a bit too soon. If I allow multiple instances of the template in the form what happens is that the first instance is correctly preloaded by my function (registered with the sfEditFormPreloadText hook). But the second (or third or ...) instance is not, it's blank. The second instance is created by the "Add another" button, of course.

This is SF version 1.5.4.

Your thoughts?

Thanks again,

Brian O.


On Jul 20, 2009, at 9:01 PM, Brian Osborne wrote:

Yaron,

Yes, that does work! Very nice.

Thanks once again,

Brian O.


On Jul 20, 2009, at 7:59 PM, Yaron Koren wrote:

Hi,

From what I remember, this doesn't just cover free text - it preloads the entire page, and then the form displays it accordingly. If you want the value to show up in a form field, it would presumably have to be within a correctly-name field within a template call.

-Yaron

On Mon, Jul 20, 2009 at 6:36 PM, Brian Osborne <bosborne11@verizon.net> wrote:
SMW users,

I'm playing with Semantic Forms, specifically "Preloading data" using the sfEditFormPreloadText hook. Here's the relevant line from the documentation:

  • Finally, you can create your own custom handling, using the 'sfEditFormPreloadText' hook. If another extension calls this hook, it can preload data however it wants. The function registered with this hook should have a header like "function-name(&$page_contents, $page_title, $form_title)".

I made a little extension, put the function in it, registered the function, it works. But the string returned by my function ends up in the "Free text" field. Is this what this is supposed to do? From the name of the hook I suppose the answer is 'yes'.

Actually, a better question: is there any way I can put data into some other specific field, not the "Free text" field?

Thanks again,

Brian O.




------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user