<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Interactive embedded forms</title>
	<atom:link href="http://redotheoffice.com/?feed=rss2&#038;p=42" rel="self" type="application/rss+xml" />
	<link>http://redotheoffice.com/?p=42</link>
	<description>bringing web 2.0 to the office</description>
	<pubDate>Wed, 08 Sep 2010 13:51:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: barış</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-1216</link>
		<dc:creator>barış</dc:creator>
		<pubDate>Thu, 22 Apr 2010 12:53:21 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-1216</guid>
		<description>&lt;p&gt;wonderful! thanks a lot.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>wonderful! thanks a lot.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Tanha</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-1193</link>
		<dc:creator>Tanha</dc:creator>
		<pubDate>Thu, 04 Mar 2010 17:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-1193</guid>
		<description>&lt;p&gt;I did find the propel equivalent, BUT when clicking the insert button nothing happen:&lt;/p&gt;

&lt;p&gt;$author-&#62;addBook(new Book());&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I did find the propel equivalent, BUT when clicking the insert button nothing happen:</p>

<p>$author-&gt;addBook(new Book());</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Tanha</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-1192</link>
		<dc:creator>Tanha</dc:creator>
		<pubDate>Thu, 04 Mar 2010 15:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-1192</guid>
		<description>&lt;p&gt;What is the equivalent of the following piece of code to Propel:&lt;/p&gt;

&lt;p&gt;$author['Books'][] = new Book();&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What is the equivalent of the following piece of code to Propel:</p>

<p>$author['Books'][] = new Book();</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Johannes</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-1081</link>
		<dc:creator>Johannes</dc:creator>
		<pubDate>Sat, 16 Jan 2010 16:59:12 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-1081</guid>
		<description>&lt;p&gt;Hi,
is it possible that the image tags don't work in IE8? Implemented your solution, which is perfect, but in IE nothing really happens, when I click on one of the images. 
Also there a no values transfered.&lt;/p&gt;

&lt;p&gt;Did anyone else experience something like that?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,
is it possible that the image tags don&#8217;t work in IE8? Implemented your solution, which is perfect, but in IE nothing really happens, when I click on one of the images. 
Also there a no values transfered.</p>

<p>Did anyone else experience something like that?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Poussain</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-959</link>
		<dc:creator>Poussain</dc:creator>
		<pubDate>Tue, 24 Nov 2009 12:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-959</guid>
		<description>&lt;p&gt;Hi folks !
Good news : i found out how to get at least one first "book" (i am doing this for articles for newsletters).
So you just override the "save" method of your 'Author' class :&lt;/p&gt;

&lt;p&gt;public function save(Doctrine_Connection $conn = null)
{&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$new = $this-&#62;isNew();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//You need to keep the state because when the parent::save() method will be called, it will not be new anymore.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$answer = parent::save($conn);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//Now you save it, and you keep the answer to return it after&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if ($new)
    {

        $book = new Book();
        $book-&#62;setAuthorId($this-&#62;getId());
        $book-&#62;save();  
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//If this was new, you create a new book and save it
        }&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;return $answer;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//And you return the answer for symfony to perform it's job.
}&lt;/p&gt;

&lt;p&gt;Comments : this is still not perfect : you have an empty book by default, you still can delete it but then you will have to add one manually.
But when you create an author, it's because you have at least one book he wrote no ?&lt;/p&gt;

&lt;p&gt;Hope this will help you, i took some time to find out how to do this (and now I realise i forgot something in my model...)&lt;/p&gt;

&lt;p&gt;Bye&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi folks !
Good news : i found out how to get at least one first &#8220;book&#8221; (i am doing this for articles for newsletters).
So you just override the &#8220;save&#8221; method of your &#8216;Author&#8217; class :</p>

<p>public function save(Doctrine_Connection $conn = null)
{</p>

<pre><code>$new = $this-&gt;isNew();
</code></pre>

<p>//You need to keep the state because when the parent::save() method will be called, it will not be new anymore.</p>

<pre><code>$answer = parent::save($conn);
</code></pre>

<p>//Now you save it, and you keep the answer to return it after</p>

<pre><code>if ($new)
    {

        $book = new Book();
        $book-&gt;setAuthorId($this-&gt;getId());
        $book-&gt;save();  
</code></pre>

<p>//If this was new, you create a new book and save it
        }</p>

<pre><code>return $answer;
</code></pre>

<p>//And you return the answer for symfony to perform it&#8217;s job.
}</p>

<p>Comments : this is still not perfect : you have an empty book by default, you still can delete it but then you will have to add one manually.
But when you create an author, it&#8217;s because you have at least one book he wrote no ?</p>

<p>Hope this will help you, i took some time to find out how to do this (and now I realise i forgot something in my model&#8230;)</p>

<p>Bye</p>]]></content:encoded>
	</item>
	<item>
		<title>By: How to Embed AJAX(!) Forms in Symfony 1.2 Admin Generator &#171; PHP Developer</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-958</link>
		<dc:creator>How to Embed AJAX(!) Forms in Symfony 1.2 Admin Generator &#171; PHP Developer</dc:creator>
		<pubDate>Sun, 22 Nov 2009 11:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-958</guid>
		<description>&lt;p&gt;[...] How to Embed Forms in Symfony 1.2 Admin Generator Interactive embedded forms [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] How to Embed Forms in Symfony 1.2 Admin Generator Interactive embedded forms [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: bambinoelkilo</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-957</link>
		<dc:creator>bambinoelkilo</dc:creator>
		<pubDate>Tue, 17 Nov 2009 05:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-957</guid>
		<description>&lt;p&gt;I would like to see my new solution for this problem:&lt;/p&gt;

&lt;p&gt;class AuthorForm extends BaseAuthorForm
{
  public function configure()
  {
    $books = $this-&#62;getObject()-&#62;getBooks();&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if(count($books) == 0){
    $book_new = new Book();
    $book_new-&#62;setAuthor($this-&#62;getObject());
    $bookForm = new BookForm($book_new);
    unset($bookForm['author_id']);
    $this-&#62;embedForm('book', $bookForm);
}

foreach ($this-&#62;object['Books'] as $index=&#62;$book)
{
  $fieldName = 'book'.$book['id'];

  $form = new BookForm($book);
  unset($form['author_id']);
  $this-&#62;embedForm($fieldName, $form);

  $label = '&#60;input type="image" src="/images/delete.gif" name="submit" value="delete_'.$book['id'].'"&#62;';
  if (count($this-&#62;object['Books']) -1 == $index)
  {
    // this is the last book
    $label.= '&#60;input type="image" src="/images/add.gif" name="submit" value="insert"&#62;';
  }
  else
  {
    $label.= '&#60;img src="/images/empty.gif"&#62;';
  }
  $label.= ' Book '.($index+1);

  $this-&#62;widgetSchema-&#62;setLabel($fieldName, $label);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}
}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I would like to see my new solution for this problem:</p>

<p>class AuthorForm extends BaseAuthorForm
{
  public function configure()
  {
    $books = $this-&gt;getObject()-&gt;getBooks();</p>

<pre><code>if(count($books) == 0){
    $book_new = new Book();
    $book_new-&gt;setAuthor($this-&gt;getObject());
    $bookForm = new BookForm($book_new);
    unset($bookForm['author_id']);
    $this-&gt;embedForm('book', $bookForm);
}

foreach ($this-&gt;object['Books'] as $index=&gt;$book)
{
  $fieldName = 'book'.$book['id'];

  $form = new BookForm($book);
  unset($form['author_id']);
  $this-&gt;embedForm($fieldName, $form);

  $label = '&lt;input type="image" src="/images/delete.gif" name="submit" value="delete_'.$book['id'].'"&gt;';
  if (count($this-&gt;object['Books']) -1 == $index)
  {
    // this is the last book
    $label.= '&lt;input type="image" src="/images/add.gif" name="submit" value="insert"&gt;';
  }
  else
  {
    $label.= '&lt;img src="/images/empty.gif"&gt;';
  }
  $label.= ' Book '.($index+1);

  $this-&gt;widgetSchema-&gt;setLabel($fieldName, $label);
}
</code></pre>

<p>}
}</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mac Curty</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-953</link>
		<dc:creator>Mac Curty</dc:creator>
		<pubDate>Tue, 20 Oct 2009 14:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-953</guid>
		<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I made something quite similar, but when I modify some values in an embedded form and click on "save", it doesn't modify the values in my database.&lt;/p&gt;

&lt;p&gt;Is it normal ? :o&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,</p>

<p>I made something quite similar, but when I modify some values in an embedded form and click on &#8220;save&#8221;, it doesn&#8217;t modify the values in my database.</p>

<p>Is it normal ? <img src='http://redotheoffice.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis Gearon</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-947</link>
		<dc:creator>Dennis Gearon</dc:creator>
		<pubDate>Thu, 08 Oct 2009 04:13:43 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-947</guid>
		<description>&lt;p&gt;It erased my code. {{{}}}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It erased my code. {{{}}}</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis Gearon</title>
		<link>http://redotheoffice.com/?p=42&cpage=1#comment-946</link>
		<dc:creator>Dennis Gearon</dc:creator>
		<pubDate>Thu, 08 Oct 2009 04:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://redotheoffice.com/?p=42#comment-946</guid>
		<description>&lt;p&gt;PS, 'swapping out strict formatting' and substituting in the  block  is what does it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>PS, &#8217;swapping out strict formatting&#8217; and substituting in the  block  is what does it.</p>]]></content:encoded>
	</item>
</channel>
</rss>
