cancel
Showing results for 
Search instead for 
Did you mean: 

Scenario i would have...possible?

dave984
Champ in-the-making
Champ in-the-making
Hi all,
i would make the following thing in the Alfresco Repository:

- considering you are in a folder with some images inside: add a new button on the right side(under edit metadata)
- pushing the button will open a new view/window/popup in which you can see: the image itself, a combobox, a button
- the combobox values are retieved from a webservice using GET method
- the button will make a POST to the same webservice

Is it possible? Can you advice me some guidelines?!
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
Alfresco share use YUI components so you need to build your solution around that only.
for button you could use YAHOO.widget.Button()
For adding event I think
Alfresco.util.createYUIButton(p_scope, p_name, p_onclick, p_obj, p_oElement)

then associate event with that.
Which will call the webscript in turn for you onclick of button.

dave984
Champ in-the-making
Champ in-the-making
thank you for your answer!what about the GET/POST call to the web service?
i've read also in this forum it's not simple…

mitpatoliya
Star Collaborator
Star Collaborator
you  can do that easily
something like this

<script type="text/javascript">    function getjson(this,site){      var scriptURL = "/alfresco/service/extension/abc";      alert(scriptURL);      YAHOO.util.Connect.asyncRequest("GET", scriptURL,          {             success: handleInfo,            failure: handleErrorYahoo         },          null);            }   function handleInfo(response) { alert(response.responseText);  var x=response.responseText;   location.href='data:application/download,'+ encodeURIComponent(x);}</script>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
Welcome to the new Hyland Connect. Get started or submit feedback.