Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Need Help in controllers and externals?
chandu1987
Hi All,
I am very new to livesite,never worked in interwoven technologies.i started my first project in this area.Now i got requirement like i will be having two sections in my component,one is input form with some text fields and second is result section.when user gives input values and submits the form it should call one controller then i m getting data from DB based on given inout values.
Then i have to display these results in the same componet in the result section.Anyone knows how to include my results into component result part after submitting the form?
I tried with two approaches but i didnot get what i expected.The below 2 approaches i tried.
1. I used one external object after calling the controller i including the result xml file into context through context.setparameters(HashParams)(it is depricated in 6.7.2).but i am not getting expected result.
2. In this i used same external but instead of setting my xml into context,i am getting HttpServletRequest through context.getRequest() and setting the xml doc into request the same i m getting in the external after submitting the page.here also i failed.
Anyone can please give some good solution for this problem.I am using TS 6.7.2 SP2,LS 3.1. Thanks in Advance.
Find more posts tagged with
Comments
AlexC
Please refer to the Developers Guide for examples of how to use externals and controllers. Calling context.setParameters is not a good thing to do (which is why it was deprecated), that method replaces the request map and can cause unexpected results.
The way to do this would be to return a Document from your external and use XSL to format it. Controllers are used to redirect users from page to page, is that part of your requirement?
chandu1987
Thanks Alex for your reply.I can use external to return document but my requirement is i have to show initially one input form to the user then whenever user submits the page after giving some input values i have to reload the same page with results in the same component below the input form.
In controller method i am returning null(here return type should be ForwardAction or its subtypes),so i will get results here from DB then the page will reload.so while reloading the page i have to send results to exteral then i can parse it through xsl part.
Pageredirection is not required for me,but i have to reload the page(for this i m returning null in controller method).Is there any other way to achieve this?
vpatel
Controllers can return null and in that case no redirection/page-refresh will happen but the key thing is that the controller would get executed. You can use combination of Controller / AJAX and get the behavior that you are after.