on 06-19-2007 5:28 AM
In HTML, you can create hyperlink.
Example:
Click <b>
<a href="http://www.google.com">
</b>here<b>
</a>
</b> to go to Google.
How to do this in WebDynpro JAVA?
Try the above way but fail.
It does not treat <b>
<a href>
</b> as hyperlink. It just treat it as string.
All Expertise here, Please advice.
Thank You.
Hi YuChoong,
In WebDynPro is not like JSP or HTML.
For that one you insert LinkTOURL UI element in your view.
1)Insert LinkTOURL UI element to your view
2)Create context attribute in view Context.
3)Bind LinkTOURL UI element with context attribute and Give title in text property
4)In the init() method of view implement following code
wdContext.currentContextElement().setTest("http://www.sdn.sap.com");
<b>Context Attribute Name is test</b>
This will work
Rgds
-SS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yu
I am not sure.This may work or not!!!!
I've inserted couple of html tags below and after the link.
Try with that one and let me know
IIWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText
+ "<html><body><a href='http://www.google.com'> "
+ dialogText2 + "</a></body></html>",
controllerInfo.findInEventHandlers("Ok"),
"Ok");
Rgds
SS
Hi,
You can find a similar tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%20binary%20cache.pdf">here</a>.
Regards,
Satyajit.
Hi YuChoong,
Pls refer to Page 8 and 9 for creating external windows.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/dialog%20boxes%20in%20web%20dynpro%20applications.pdf">Sample Tutorial</a>
Regards,
Alka.
Hi,
Hi,
The confirmation dialog is a Inbuilt functionality of Webdypro.Yo cannot add UI elements to it.Only buttons are added that too dynamically depending on the choice provided.
Instead you can do it otherway.
Let the name of view from which the popUp has to intiated be "MainView" with action "OpenPopUp"
1.Create a new window say "ConfirmWindow"
2.Create a view say "ConfirmView" under window ConfirmWindow.
3.Set the view layout as GridLayout with colcount = 1
3.Add a Group UI element to view ConfirmView.
4.set the group's property as below
"design" to sapcolor and layout to Gridlayout with colcount =2 (colcount depends on the UI elements you want to add. in the present case it will look like <text> <hyperlink>)
5.To set a title of the pop up set the appropriate value of the property "text" of UI element Group_header under group.
6.Now add a textview and LinkToURL UI elements to Group.
7.Now set the "text" property of textview to the value that you wanted to see as dialogtext
8.Set the "text" and "reference" property of the LinkToURL to "<text you would like to see>" and URL repectively.
9.Create a button say "Ok" mapped to a action onActionOK under group with colspan = 2 and halign = center.
10. Create a context node say "PopUp"(cardinality 1..1) in the component controller and a attribute say WindowInstance of type com.sap.tc.webdynpro.services.session.api.IWDWindow (java native type).Map this attribute to both the views.
10.In OpenPopUP action of MainView
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI
.getComponentInfo()
.findInWindows("ConfirmWindow");
//create the ConfirmWindow
IWDWindow window = wdComponentAPI.getWindowManager()
.createModalWindow( windowInfo, true);
//set the WindowPosition on the screen
window.setWindowPosition(300, 150);
//and show the window
window.show();
// Save WindowInstance in Context
wdContext.currentPopupElement().setWindowInstance(window);
11.inside onActionOK in the ConfirmView
IWDWindow window = wdContext.currentPopUpElement().getWindowInstance();
window.destroyInstance();
Note : In this scenario we are opening a view will be opened as a popUp.
In the view you can click on the link and the URL will be opened in a new window.
But on click of the hyperlink the popup will not be closed.
If you click on the OK button the popup will be closed.
Message was edited by:
Shriram Kabra
Hi,
U can use either button or LinkToAction UI element
First u have to create outbound plug in interfaceview
1)Open the node WebDynpro → Web Dynpro Components → <ComponentName> → Component Interface → Interface Views in that click <interfacename> interface view .
2) Select the Plugs tab in the Plugs area.
3)Choose New next to the outbound plug table.create new outbound plug.for example,Name GotoUrl, and choose Type Exit Plug.
4)Select the new outbound plug GotoUrl and choose New next to the parameter table.taEnter the name Url datatype as STRING.
5)Open the view in the View Designer and select the Properties tab. Choose Add next to the Required Controllers table and add the <interface name>InterfaceView
Place 1 button and check,
onActionButton write this code
{
wdThis.wdGetSampleInterfaceViewController().wdFirePlugGotoUrl(
"http://www.google.com");
}
In Below Application this concept used refer page no.20 and 29
Regards,
Suresh.T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi YuChoong,
For creating <b>Hyperlink</b> there is a UI element called as LinktoURL in Web Dynpro.
You have to use <b>TEXT and REFERENCE</b> properties to set the display text
and URL for the link respectively.
Hope it helps.
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alka,
Thanks for the quick response.
Actually created messages in a dialog box. In here, there's URL provided. And want user click on it, bring to that page.
Here is the source code looks like. Would like to make dialogText2 string as hyperlink.
IIWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText
+ "<a href='http://www.google.com'> "
+ dialogText2 + "</a>",
controllerInfo.findInEventHandlers("Ok"),
"Ok");
dialog.open();
Please advice.
Thank you.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.