Re: [Dev] Carbon UI Programming - how to generate a input dialog with a drop down

2014-03-30 Thread Chanaka Jayasena
You can use show a popup message using CARBON.showPopupDialog method.

Try the following..

function doReRouteMessages(){ jQuery.ajax({
url:"path_to_ajaxprocessor.jsp", data:{key1:"val1",key2:"val2"},
type:"POST", success:function(data){ //Let's say data is something like the
following string data = "queue1#queue2"; data = data.split("#"); var
selectElement = ''; for(var i=0;i'+data[i]+''; }
selectElement+=''; CARBON.showPopupDialog(selectElement,"Select a
queue",200,true, function(){ var selectedQueue =
jQuery('#allQueues').val(); alert("you have selected " + selectedQueue);
//Do the rest of the the stuff you want to do with the UI here } ); } }); }

Note: I am using jQuery instead of usual $ syntax, because of the conflict
between jQuery and Prototype. Also I am assuming that
"path_to_ajaxprocessor.jsp"
is returning a sting in the given format in the code. I have hard coded it
in there, but you can remove that line when you are getting an actual
response.

I have just written this method, but haven't tested it. But this should
work :)

thanks,
Chanaka







On Sun, Mar 30, 2014 at 9:31 PM, Hasitha Hiranya  wrote:

> Hi,
>
> I need to do following.
>
> I have a button In UI like below (which is inside a table)
>
>
>   class="icon-link"
>   onclick="doReRouteMessages()">ReRoute
>
>
> then doReRouteMessages() method there should do this.
>
> *1. make a popup with a drop down in it.*
> *2. drop down should show available queues in the system. I can get them
> from calling a stub method.*
> *3. once user select a queue from drop down and click ok in the pop-up I
> should return to  doReRouteMessages() method with the selected queueName.*
>
> Then doroute method will call a ajax processor to move the selected
> messages to the selected queue from the dropdown.
>
> What I am not clear is how to do the bold parts. Please help.
>
> Thanks.
>
>
>
> --
> *Hasitha Abeykoon*
> Software Engineer; WSO2, Inc.; http://wso2.com
> *cell:* *+94 719363063*
> *blog: **abeykoon.blogspot.com* 
>
>


-- 
Chanaka Jayasena
Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
email: chan...@wso2.com; cell: +94 77 785 5565
blog: http://chanaka3d.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Carbon UI Programming - how to generate a input dialog with a drop down

2014-03-30 Thread Hasitha Hiranya
Hi,

I need to do following.

I have a button In UI like below (which is inside a table)

   
   ReRoute
   

then doReRouteMessages() method there should do this.

*1. make a popup with a drop down in it.*
*2. drop down should show available queues in the system. I can get them
from calling a stub method.*
*3. once user select a queue from drop down and click ok in the pop-up I
should return to  doReRouteMessages() method with the selected queueName.*

Then doroute method will call a ajax processor to move the selected
messages to the selected queue from the dropdown.

What I am not clear is how to do the bold parts. Please help.

Thanks.



-- 
*Hasitha Abeykoon*
Software Engineer; WSO2, Inc.; http://wso2.com
*cell:* *+94 719363063*
*blog: **abeykoon.blogspot.com* 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev