<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [resolved] tmsbox, tjava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243955#M30267</link>
    <description>Hi Sabrina,&lt;BR /&gt;Thanks for you reply. It's work.&lt;BR /&gt;best regards&lt;BR /&gt;Fab</description>
    <pubDate>Fri, 14 Sep 2012 16:27:44 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2012-09-14T16:27:44Z</dc:date>
    <item>
      <title>[resolved] tmsbox, tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243951#M30263</link>
      <description>HI,&lt;BR /&gt;I use a tmsgbox : question (TOS 4.2.3)  link (onComponentOK) to tjava component . I want to say what's value the OK and Cancel buttons return.&lt;BR /&gt;I want to test what's button the user click, in the tjava component.&lt;BR /&gt;This is the code i use in tjava component :&lt;BR /&gt;String result=(String)globalMap.get("tMsgBox_1_RESULT");&lt;BR /&gt;if(result.equals("0")){ //You have clicked on 'Yes' button&lt;BR /&gt;globalMap.put("continues", true);&lt;BR /&gt;}&lt;BR /&gt;if(result.equals("1")){ //You have clicked on 'NO' button&lt;BR /&gt;globalMap.put("continues", false);&lt;BR /&gt;}&lt;BR /&gt;but it don't work.&lt;BR /&gt;Best regards</description>
      <pubDate>Thu, 13 Sep 2012 20:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243951#M30263</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2012-09-13T20:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmsbox, tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243952#M30264</link>
      <description>I have no idea whats wrong with your code. For me it works perfectly!</description>
      <pubDate>Fri, 14 Sep 2012 02:23:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243952#M30264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-14T02:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmsbox, tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243953#M30265</link>
      <description>If you're using the Question option for tMsgBox then (String)globalMap.get("tMsgBox_1_RESULT") contains the user input but is null if they click Cancel.
&lt;BR /&gt;For all the other tMsgBox options, (String)globalMap.get("tMsgBox_1_RESULT") contains the number of the button clicked, starting from zero left-to-right.</description>
      <pubDate>Fri, 14 Sep 2012 03:20:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243953#M30265</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2012-09-14T03:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmsbox, tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243954#M30266</link>
      <description>Hi, Fab972
&lt;BR /&gt;Thanks for your attention on Talend. From your code:
&lt;PRE&gt;String result=(String)globalMap.get("tMsgBox_1_RESULT");&lt;BR /&gt;if(result.equals("0")){ //You have clicked on 'Yes' button&lt;BR /&gt;globalMap.put("continues", true);&lt;BR /&gt;}&lt;BR /&gt;if(result.equals("1")){ //You have clicked on 'NO' button&lt;BR /&gt;globalMap.put("continues", false);&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;You will get three results:
&lt;BR /&gt;1. If the user typing answer?such as ?i am Fab972?, click ok, the value of (String)globalMap.get("tMsgBox_1_RESULT") is "i am Fab972",
&lt;BR /&gt;2. if the user don't input any answer, click directly OK button, the value of (String)globalMap.get("tMsgBox_1_RESULT") is "" //it is an empty string
&lt;BR /&gt; 3. if the user click Cancel button, the value of (String)globalMap.get("tMsgBox_1_RESULT") is null
&lt;BR /&gt;So, the return value of (String)globalMap.get("tMsgBox_1_RESULT") is not 1 or 0, the returned value are the three cases as above. 
&lt;BR /&gt;For testing, you can use print the return value on the console using this code:
&lt;BR /&gt;
&lt;PRE&gt;System.out.println((String)globalMap.get("tMsgBox_1_RESULT") );&lt;/PRE&gt;
&lt;BR /&gt;. And you can change the code to :
&lt;BR /&gt;
&lt;PRE&gt;if(result==null){ //You have clicked on 'Cancel' button&lt;BR /&gt;globalMap.put("continues", false);&lt;BR /&gt;}else{&lt;BR /&gt; //You have clicked on 'Yes' button&lt;BR /&gt;globalMap.put("continues", true);&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;Hope it will help you!
&lt;BR /&gt;Best Regards
&lt;BR /&gt;Sabrina</description>
      <pubDate>Fri, 14 Sep 2012 03:33:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243954#M30266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-14T03:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmsbox, tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243955#M30267</link>
      <description>Hi Sabrina,&lt;BR /&gt;Thanks for you reply. It's work.&lt;BR /&gt;best regards&lt;BR /&gt;Fab</description>
      <pubDate>Fri, 14 Sep 2012 16:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmsbox-tjava/m-p/2243955#M30267</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2012-09-14T16:27:44Z</dc:date>
    </item>
  </channel>
</rss>

