tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <rahul.akol...@gmail.com>
Subject Re: RDC taglib technical question
Date Thu, 10 Nov 2005 22:04:53 GMT
On 11/10/05, Vance Vagell <vance.vagell@audiumcorp.com> wrote:
> Hello,
>
> I notice that only the mortgage and creditCardInfo RDCs accept the
> "subdialog" attribute, which allows the developer to force the RDC to
> work as a subdialog (which includes a VoiceXML <return> element).
> However, the usState RDC does not.  It seems that only composite (i.e.
> non-atomic) RDCs include this attribute.
<snip/>

True, I'll add that to my TODO list -- needs an afternoon of work on
my part -- I'll take a stab at adding the subdialog functionality to
atomic RDCs over this weekend. Will ping this thread when its in
place.


> How can I call the usState RDC
> and force it to work as a subdialog?  I am attempting to wrap it for use
> in another application, so it needs to be called as a subdialog and then
> return back.
>
<snap/>

Having said that, the subdialog functionality is fairly easy to
emulate externally (with respect to the dialog component) if the RDC
returns a String (which usState does, so the following solution is
applicable to this particular usecase). Here is the snippet (...
stands for other tag attributes as necessary):

<rdc:task ... >

     <!-- The usState RDC that you need to call as a subdialog -->
     <rdc:usState id="state" ... />

     <c:if test="${not empty state}">
       <!-- When done, grab the value and return to caller -->
       <block>
         <var name="state" expr="'${state}'"/>
         <return namelist="state"/>
       </block>
     </c:if>

</rdc:task>

In the parent dialog (the app thats calling the above JSP as a
subdialog), you can retrieve the two letter US state abbreviation by
calling getValue() on the deserialized ECMAScript object, like so:

<!-- src attribute points to JSP hosting above snippet -->
<subdialog name="stateSubdialog" src="...">
    <filled>
        <script src="${pageContext.request.contextPath}/.grammar/return.js"/>
        <!-- deserialize -->
        <var name="stateVal"
expr="deserializeReturnValue(stateSubdialog.state)"/>
        <prompt>
         <!-- call getValue() to obtain two letter US state abbreviation -->
          The state is <value expr="stateVal.getValue()"/>
        </prompt>
    </filled>
</subdialog>

Please let me know if you have other questions,
-Rahul


> It is called just fine now, I go through the prompting and confirmation,
> but control is never returned to the calling app.
>
> Thanks for your help,
> Vance
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message