<br><br><div><span class="gmail_quote">On 10/15/07, <b class="gmail_sendername">Steve H</b> &lt;<a href="mailto:s_t_e_v_e_h@hotmail.com">s_t_e_v_e_h@hotmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>I asked a specific question regarding not being able to get the form submit data/vars via the Dispatcher&#39;s get().&nbsp;&nbsp;Can I conclude from what you are saying, as that I will be able to er, get() the vars only so long as I have an action declared specifically for the form in that fragment?
</blockquote><div><br>Well, if an input is part of an action, then the only place you can get to it easily is from that action&#39;s take_action() handler using the argument_value() accessor.<br><br>If you set the value using &quot;defaults&quot; on a region or using &quot;args&quot; (which is used to modify the defaults) on a button or link that modifies a region, then you can use get() to read it directly since that&#39;s what those parameters are for.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">One thing I noticed as I poked around at it was that if I&#39;d specified a var as a default arg, then I&#39;d be able to get() it... otherwise not... so it became awfully confusing as to what specific circumstances vars will be available for get()&#39;ing. (er, can those circumstances be easily described?)
</blockquote><div><br>Basically, use&nbsp; an action when reading in a form and use get() for links with GET-style/region-fragment parameters. It&#39;s really more complicated than that, but I&#39;d recommend trying to keep it simple and work your way up. Talking with Jesse about what&#39;s required to get a book put together for Jifty has revealed that there are a lot of layers to Jifty (more than I knew about). It&#39;s best to try and take on a piece at a time.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Ok, so is this indicating that 1) I define an action in the Dispatcher rather than needing a separate .../Action/search-
<a href="http://frobs.pm">frobs.pm</a><br>and 2) that following the new_action, I could have used get(&#39;name_contains&#39;)?</blockquote><div><br>No. I was suggesting the use of the built-in search actions that Jifty will automatically build for you as soon as you declare a model. At which point, you shouldn&#39;t need to get(&#39;name_contains&#39;) because the Action will process the form and generate a result set you can then render. 
<br><br>However, if you need to make a decision on the basis of the action&#39;s outcome, you could define an action that passes that information back via Jifty::Result:<br><br>package App::Action::MyAction;<br># param schema and such...
<br><br>sub take_action {<br>my $self = shift;<br>my $name_contains = $self-&gt;argument_value(&#39;name_contains&#39;);<br># do something useful...<br>$self-&gt;result-&gt;message(&#39;Successfully did something useful.&#39;);
<br>$self-&gt;result-&gt;content( name_contains =&gt; $name_contains );<br>}<br><br>In this case, if you&#39;d instantiated the action with a particular moniker (I use &quot;my-action-moniker&quot; here), you could perform:
<br><br>on &#39;*&#39; =&gt; run {<br>my $name_contains = Jifty-&gt;web-&gt;response-&gt;result(&#39;my-action-moniker&#39;)-&gt;content(&#39;name_contains&#39;);<br># make a decision regarding $name_contains<br>};<br><br>
Btw, all new_action() does is instantiate an existing action package (which may be one automatically generated for your model). It doesn&#39;t actually declare an action class.<br><br>Cheers,<br>Andrew<br></div></div><br>