Need help setting link to Task UI

Hello,

I’ve managed to build a Portlet similar to the “Task List Management Results”. But now I want to insert a link element which - when clicked - opens the corresponding Task UI (like in the “original” Task List Management View).

What do I have to do to get this link?

I’ve attached a screenshot for additional explaination.

I’m looking forward to your answers :slight_smile:

Best regards
Stefan

Hello Stefan,

You can use Async Command Link, Command Link or basic navigation link as per your requirement for the mentioned scenario. You need to write the server side action which need to be executed upon the click event of link, also using Task API you need to get the related task information that you wanted corresponding to the Task ID link you clicked.

Hope this will help !!!

Hi Prateek,

thanks for your help. I now have a fully functional link :slight_smile:
The next problem ist:
How can I set the target of this link that it opens in the right side of the same page (see the attachement below).
Can I use the same portlet? do I have to create a new page?

Thanks again for your help! :slight_smile:

Best regards
Stefan

Hi Stefan,

You can create a new portlet and render that portlet upon the click of your link.
In order to position it in the right side of your screen you need to write a custom java script function and in that function you need to define the position of your portlet in cordinates (like x,y), where you need to get it displayed upon your screen (right or left).

Hope this might help you !!! :slight_smile:

Hi Prateek,

thanks for your help. Right now I’m not sure how to accomplish this. Can you give me a link to a similar case or a little tutorial? Unfortunately I didn’t find anything by myself.
Do I really need a portlet in which I have to render the Task UI? I was hoping I could tell the command link to render on the same page. Hope my sentence makes any sense… :slight_smile:

Best regards
Stefan

Hello Stefan,

What I understand so far from your scenario that, you need not to redirect your Task management screen to the newly created screen, you just need to open the new screen in from of your Task Management portlet like a popup for that purpose you can use the below javascript-

window.open(url+"?width=50,height=100");

where url - will be your new portlet
width and height to dimension purpose.

This is the only thing that strike my mind at present worth trying it…hope this might help !!! :slight_smile:

Hi Prateek,

many thanks for the quick response :slight_smile:

Well a Popup sounds awesome! Now the absolute beginner question (sorry for that): Where do I have to use the javascript code exactly? :slight_smile:

So now I have my Task Management Portlet. Next I have to create a new Portlet (let’s call it PresentationPortlet). In the portlet itsself I don’t have to put any magic. After saving I have to publish the new portlet and insert it to my user-page (on the right side).
After that I have to edit my Task Management UI and (my guess) put the code

window.open(PresentationPortlet+"?width=50,height=100");

somewhere in the Properties Tab of my Commandlink - maybe under ‘Expert/Target’?

Thanks for your patience an your help! :slight_smile:

Best regards
Stefan

Hi Stefan,

You need to put the javascript code on the click event of link (from where you need this new portlet to be rendered).

So in this case, In your Task management portlet, you have link (as taskID in your first screenshot of this post), on the click event of that link you need to write this javascript and also you need to call the server side action to get the task details related to your task using task APIs.

Hope this will make your approach more clear !!

Hi Prateek,

thanks again! I’ll think about your tips and try to make things work. If I’ve further questions, I’ll let you know.
:slight_smile:

Best regards
Stefan

Hi Prateek,

unfortunately I couldn’t do the server side action part. I guess I have to create a new action in the new portlet which calls the link click action in my Task Management Implementation?
I got a little confused reading the part ‘task details’. I don’t want to present the task details but the generated Task UI (which is accessible through a link which is part of the task details).

I also tried, using a ‘Portlet Include’, ‘Portlet Embed’, ‘Frame’ and ‘Include HTML’ in the new Portlet. All elements did get the Task URL as Input but the best result (with the frame element) was a whole Page presenting the Task UI. For further explaination I made a little mockup which shows how the three portlets should be arranged.

I’m really sorry should I cause you any headaches but I think we’re on the verge of solving this issue.
Please don’t give up on me :slight_smile:

Thank you for your help and best regards!
Stefan

Hi Stefan,

As far I understood from the screenshot you provide (please correct me if I am wrong), you need to copy the TaskURL and open it in a new window?
For that I think instead of using the text or label you can use a link to display the TaskURL in a table and upon the click of that URL you can get it open is a new window, in order to get the taskURL you can use the .getValue() property in javascript to get the url and then using window.open() command you can open it in a new window.

I hope this is what you are looking for !! :slight_smile:

Hi Prateek,

sry for the late answer. I’ll upload some more screenshots to make everything a little bit clearer. :slight_smile:
Right now it works the following way.
I have my own Version of Task Management View. This view also provides the Task URL for every task. I use a basic link which generates a link to the view of a task. Right now a click on this link opens the Task UI in a new windows (screen01.png)
For the future I want, that when I click on such a link the task UI opens on the right side of the same page (screen02.png). For now I try to use a frame element on the right side of this page. But there I have the following that it’s a complete frame (it’s rendering the whole page insteat of just the TaskView)

To sum it up screen01.png shows my current situation, screen02.png how I want it to be and screen03.png is what I maybe could get to work right now. So screen03.png is pretty close to my desired solution but I don’t want the whole page (like the header for example, or the "powered by software ag).

I hope this makes my situation clear. Thank you very much for your patience - I really appreciate this! :slight_smile:

Best regards
Stefan



In the target property of your link use _blank. that should work for displaying in new page.
for display in a side frame have a hideable panel on the side which hides according to a certain variable’s value and then change that value on the click of the link so that you frame can appear when you click.
alternatively
you can also include the task view portlet in your portlet which has the table then on click of link you can pass parameters to your portlet which then renders the UI on right side.
hope this helps.

Hi Stefan,

For this you can try passing “&shell=shell.blank” along with your url this should work.

Hi,
thanks for your replies. :slight_smile:

@Anjni Gupta:

  • the target option _blank does work but for me this is only fallback solution, if I’m not able to get the other ones working.
  • I never worked with hideable panels. Can you give me a link to a tutorial in which the usage is explained in more details?
  • Including the task view is not a good solution for my case because right now in my task management implementation I have three different Tasks. So I must include every TaskUI Portlet could be a little messy - but thanks for the idea. For a single TaskUI Portlet I would’ve been a great solution :slight_smile:

@Prateek Bhatnagar:
Thank you for this option. It really works :slight_smile: Where did you find this magic option?

Unfortunately im struggeling with rendering the frame Element. I was able to extract the Task URL and wire it to the portlet on the right side. But in the TaskURL the basepath is missing (/6E5C6171-5BF6-611C-C39F-E2A191AF74A7.task.app.details.page?wmp14382.requestID=0.036589361345350735&wmp14382.taskID=22279). In order to make the IFrame render the side, I have to put http://localhost:8585 in front of this link. Therefore I managed to append the submitted URL. But then the IFrame won’t render anything. :frowning:
EDIT
It works! I don’t know why because the only thing I added was “&shell=shell.blank”… but who cares :slight_smile:
I try to describe how I’ve done it:

  • In the Task Management Portlet and the TaskViewUI Portlet I’ve added a new property called myTaskURL.
  • Then I build a new Action which reads the TaskURL generated for each Task presended by my Task Management Portlet and binds it to the property variable myTaskURL.
  • After that I make a doubleclick on the property variable myTaskURL -> the Java Classfile for my portlet opens.
  • The function public String getMyTaskURL() is selectet but in order to include the basepath of the URL I have to switch to the public String setMyTaskURL(String myTaskURL) function.
  • There I simply add the line “myTaskURL = “http://localhost:8585” + myTaskURL + “&shell=shell.blank”;”

I know… it’s a very static aproach but for now I’m happy. Maybe there is a more generic way… Im looking forward to implement this later :slight_smile: If you guys have anything in mind feel free to share it with me - if you like :slight_smile:
Thank you for your patience and your awesome help! :smiley:
END OF EDIT

Does anyone have a clue what I can change do make the IFrame render the page?

Thank you and best regards! :slight_smile:
Stefan