T Ponraj

Greenhorn
+ Follow
since Nov 07, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by T Ponraj

Maneesh Godbole wrote:Really mentor someone. Then you wont feel the need to "impress the HR" as you would have really done it.



Thanks. What are responsibility of a Mentor. Is it something relate to helping team member for coding or design.

I have done this, cannot understand how can i co-relate this with mentoring.

Regards
12 years ago
Friends,

Can any one explain how to impress the HR or Interviewer for the beow question.

Tell me about your Mentoring experience or skill?
12 years ago
Hi,

I m trying for Edit functionality, I have passed id in to the action and got the value object from DB and I can print the value object in action class. but the values are not getting displayed in JSP.

I want to know my object is present in Value Stack. Can anyone help me, how to confirm this


2. I m passing value as querystring and I have the parameter name as variable(with set and get) in my action class. It is not populating the value. Dont know why? So i have used ServeletRequestAware Interface(with get and set), request object is null. So I used ServerActionContext.getRequest(), I m getting the request object.


Any idea, how to resolve the above two issues.

Regards

12 years ago
Got a answer:

One small mistake, it took two days to resolve.

var acridsDiv = document.getElementById("acrids"); should be

var acridsDiv = dojo.widget.byId('acrids');


Many thanks.



T Ponraj wrote:Here is my code

it is calling the action and alert is printing the querystring, but the querystring is not getting passed. If I append the querystring in sx:div href, it is getting passed.

function showDialog(tempControlId){

var acridsDiv = document.getElementById("acrids");
acridsDiv.href = '/SMS/problemrecord/SearchAcridAction.action?acridTypeIdAjax='+tempControlId;
alert(acridsDiv.href); //alert is printing the href
dojo.event.topic.publish("show_acrids");
dlg.show();
}



<sx:div id="acrids"
listenTopics="show_acrids" theme="ajax"
href="/SMS/problemrecord/SearchAcridAction.action"
showLoadingText="false"
>

</sx:div>



Please see the below URL and pasted content. I m exactly trying the same. But it is not calling the action.
http://struts.apache.org/2.0.11/docs/ajax-div-template.html

JavaScript Examples:

To further illustrate these concepts here is an example. Say you want to change the url of a div at runtime via javascript. Here is what you need to do:
What you will need to do is add a JS function that listens to a JS event that publishes the id from the select box that was selected. It will modify the URL for the div (adding the id so the correct data is obtained) and then bind() the AJAX div so it refreshes.

<saf:head theme="ajax" />

<script type="text/javascript">
function updateReports(id) {
var reportDiv= window['reportDivId'];
reportDiv.href = '/../reportListRemote.action?selectedId='+id;
reportDiv.refresh();
}
dojo.event.topic.getTopic("updateReportsListTopic").subscribe(null, "updateReports");
</script>

<form ... >
<saf:select .... onchange="javascript: dojo.event.topic.publish("updateReportsListTopic", this.value); " />

<saf:div id="reportDivId" theme="ajax" href="/.../reportListRemote.action" >
Loading reports...
</saf:div>
</form>

12 years ago
Here is my code

it is calling the action and alert is printing the querystring, but the querystring is not getting passed. If I append the querystring in sx:div href, it is getting passed.

function showDialog(tempControlId){

var acridsDiv = document.getElementById("acrids");
acridsDiv.href = '/SMS/problemrecord/SearchAcridAction.action?acridTypeIdAjax='+tempControlId;
alert(acridsDiv.href); //alert is printing the href
dojo.event.topic.publish("show_acrids");
dlg.show();
}



<sx:div id="acrids"
listenTopics="show_acrids" theme="ajax"
href="/SMS/problemrecord/SearchAcridAction.action"
showLoadingText="false"
>

</sx:div>



Please see the below URL and pasted content. I m exactly trying the same. But it is not calling the action.
http://struts.apache.org/2.0.11/docs/ajax-div-template.html

JavaScript Examples:

To further illustrate these concepts here is an example. Say you want to change the url of a div at runtime via javascript. Here is what you need to do:
What you will need to do is add a JS function that listens to a JS event that publishes the id from the select box that was selected. It will modify the URL for the div (adding the id so the correct data is obtained) and then bind() the AJAX div so it refreshes.

<saf:head theme="ajax" />

<script type="text/javascript">
function updateReports(id) {
var reportDiv= window['reportDivId'];
reportDiv.href = '/../reportListRemote.action?selectedId='+id;
reportDiv.refresh();
}
dojo.event.topic.getTopic("updateReportsListTopic").subscribe(null, "updateReports");
</script>

<form ... >
<saf:select .... onchange="javascript: dojo.event.topic.publish("updateReportsListTopic", this.value); " />

<saf:div id="reportDivId" theme="ajax" href="/.../reportListRemote.action" >
Loading reports...
</saf:div>
</form>

12 years ago
Ok,

Here is the different Mechanism,

I have got a sx:div

I want to change the div href using java script, I have tried it for two days and could not find it.



I have sx:div and In my javascript

div.href="firstaction?target=1";

alert prints the div object and proper href value

but it is not calling the action.

if I use href diectly in sx:div then it is working. Please help me.


12 years ago
Hi,

How to user javascript varibale as querystring in s:url

Eg:

method1(){
acridsDiv.href ='<s:url id="acrid_url" action="SearchAcridAction?acridTypeIdAjax='+tempControlId+'" namespace="/problemrecord"></s:url>';
}

I want to pass querystring into the action so 'tempControlId' variable is javascript variable. I have been trying for last two days and get not find it.

Help would be really appreciated.

Regards
12 years ago
Thanks for the help, I m still struggling bcos I m new to Struts.

Here is my code.

<s:url id="acrid_url" action="SearchAcridAction" namespace="/problemrecord">
<s:param name="acridTypeIdAjax" value="1">'
</s:param> </s:url>




Javascript
var contorlName=<<method parameter which is coming from my Jsp Onclickevent>>;

How do I set my controlName variable in to <s:param value attribute. So that it pass this param to my action class.

var jsVar = <s:property value="#foo"/>';




David Newton wrote:...

12 years ago
Hi David, Many thanks for the help.

Could you please provide me the sample code to use it.

I have tried it, but could not get achive it.
12 years ago
hi All,

I m struggling to set javascript variable in s:param value attribute

Here is my code

java script variable.

var contorlName=1;

acridsDiv = document.getElementById("acrids");
acridsDiv.href ='<s:url id="acrid_url" action="SearchAcridAction" namespace="/problemrecord">' +
'<s:param name="acridTypeIdAjax" value="1">' +
'</s:param> </s:url>';

I want to set controlName varibale in to value attribute, Tried with ' and "" , any help would be appreciated.



Regards
12 years ago
Hi All,

I m using <sx:tabbedpanel and displaying two tabs,

Say Assumptions and Constraints, I m using iterator to display this tabs.

By default each tab will display 3 text field So user can enter assumptions and constraints.


I m using iterator to display the textfields also

When it complets Assumption Tab, it creates textfield list[0].textfield ,list[1].textfield,list[2].textfield

When it comes to Constatint tab again list[0].textfield ,list[1].textfield,list[2].textfield.

Anyone can tell me, how do I make it as list[3].textfiled,list[4].textfiled,list[5].textfiled,.

I dont know how to change #status.index to userdefined value

It really helps, so that I can populate the list in my action class.






>
12 years ago
Dear Friends,

Can anyone one guide me, best way load the masterdata in application using struts2.

I know using Servlet and load on startup can be used to perform this activity. I m using Struts2 + Spring + Hibernate. I want to load the master data in the application context...

Any help would be appreciated.


Regards
Tponraj
12 years ago
Dear All

I m learning Spring and Maven2. There is a sample application called Spring Pizza in Spring in Action 2 Book, I have deployed thry Maven Cargo to Tomcat application.

Now I could see the application in Tomcat Manager. Tried some URL to access the application like home.htm.

How do i access the application. Tried google and Spring in Action 2 book, could not find it.
Dear Sidharth,

I m learning Spring and Hiberate, Your sample code looks like very easy to understand, can you please post send me your src to understand SpringMVC and Hibernate
100% Agree with Ben Souther, Normally Logger object will be created as instance veriable as we dont do any modification on it.
13 years ago