on 08-09-2005 2:48 PM
Hi all,
I want an application which has various links and on clicking the links they should open html pages on the same window. can anyone please let me know how this can be achieved.
Thanks in advance
Srikant
Hi,
Use IFrame UiElement and set the source attribute to a contextattibute.
Change the value of the context attrib on selection.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anil
I have mapped the context attribute to the IFrame element, but i have to map that context attribute to something which calls the static file.
I'm not able to understand:
1. how do I call the static file
2.how to change the value of context attribute onSelection.
Can you be more specific.
Thanks in advance
Srikant
Hi,
Doesnt my answer address this issue. Have a look at it again !
Use fileooutputstream and write the file in a location .Lets say the file name is abc.html
Now go the IFrameUI and give the source as abc.html.
P.S . In this case the file should be placed under the mimes/components/ur componentpackage name folder
See this code ..
File f = new File"temp
webdynpro
web
local
<proj name>
Components
?<proj comp folder>
abc.html");
try {
FileOutputStream fo = new FileOutputStream(f);
fo.write(wdContext.currentContextElement().getFileData());
fo.close();
}
catch (Exception e) { wdComponentAPI.getMessageManager().reportWarning(""+e.getCause());
}
Regards
Bharathwaj
Message was edited by: Bharathwaj R.Code Snippet added
hi Bharatwaj
well i have included the file in the project folder, but the code snippet which u have mentioned.
"fo.write(wdContext.currentContextElement.getFileData())"
write() function is only applicable for the integer types and not string type.
Any suggestions on that.
Thanks in advance
Srikant
hi Bharathwaj
i give bird's view of my application:
___________________________ ________________________
<u>Click to link</u> | -> | Html displayed |
__________________________ | _______________________ |
well you have the link which has to be clicked and the html page gets displayd on same window.
Now,Using IFrame Element:
1. I have included the created HTML file in the project folders
2."<b><i>Get the value form context attribute and then write it to file<i><b>"
now how do u resolve this issue as i'm not able to display data after the code in the IFrame UI Element
3. Given the file name as source to IFrame UI Element
Now, Using LinkToURL Element:
I had linked the location of file with context attribute, yet i'm unable to do display the file still.
Is this problem resolvable?
Thanks in advance
Srikant
Hi,
I have used the methods:
1. Link to Action and the IFrame -> The Result was the html file I was able to display in the same window.
2. Link to URL -> The Result was html file opened in different window.
3.IFrame and attaching the file in project -> it was resulted in html file getting dispalyed in IFrame.
Now if I want to extend the functionality for PDF or word document. Is the logic same.
Any thoughts on this.
Thanks in Advance
Srikant
Hi Venkat,
You have to create HTTP Alias first and then give that url in the reference of linkToUrl either at runtime or design time.
There is a weblog on how to create http alias the link is as below.
/people/renjith.andrews/blog/2005/03/31/creating-an-http-alias-in-was
Regards,
Jaydeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please try this.
FileWriter writer= new FileWriter("FileName");
BufferedWriter mfWriter = new BufferedWriter(writer);
mfWriter .write("");
regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please place the file under "\src\mimes\Components\<Componentpackagename>\.html
Regards, Anilkumar
Message was edited by: Anilkumar Vippagunta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
You can use linkToUrl UI element. In the reference property give the path of html file you want to open. You can do this at the design time or through mapping an attribute of string type to the reference property and setting that atribute at runtime.
Hope this helps.
Regards,
Jaydeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jaydeep
The linkToURL UI Element i have mapped the attribute to string type and then set the attribute at runtime.
my code snippet is -->
<i>target = "the path of the file on my comp";
wdContext.currentContextElement().setTargetURL(target);</i>
targetURL is the attribute.
it is not opening the link.
Can u tell me where i'm going wrong?
also i would like to know how do you add the HTML file in the project folder? as i'm not able to add that file in mimes/...
Can some one help me on this?
Thanks in advance
Srikant
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.