Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

suresh midde

Greenhorn
+ Follow
since Aug 22, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 suresh midde

Hi,

I am using jsf of the following implementation, which I have found under META-INF of jsf-ibm.jar. From this how can I make out version of jsf whether 1.1 or 2 ?

Specification-Title: Java Server Faces
Implementation-Title: JSF Widget Library (JWL) - Base
Implementation-Version: JWL v3_1_5
Implementation-Vendor: IBM
Build-Version: 20100201_1250
Build-Date: February 1 2010

I have a datatable and data rows inside the table. I am trying to edit a particular row using a h:commandLink with an ajax call.

I see that the entire page is still refreshing inspite of adding ajax behaviour, where only the particular datatable which has been embedded inside panelgroup alone has to be refreshed. Gone through some forums, which say that onclick is not supported for some versions of jsf. If it is the same case with me, is there any alternative to achieve this onclick which triggers ajax call.


I have given code snippet below.

<h:form>

<hx:dataTableEx>

<h:panelGroup id="group1">



<hx:columnEx width="3%">
<f:facet name="header">
<h:outputText styleClass="outputTextGridColumnHeader" value=""></h:outputText>
</f:facet>

<h:commandLink styleClass="commandLink" type="submit" immediate="true"
action="#{custommap.editRow}" id="editMap">

<div align="center"><h:graphicImage value="#{msg.imgUpdate}"
width="16" height="16" styleClass="graphicImage"
alt="#{msg.labelUpdate}"></h:graphicImage></div>
<f:param value="#{varcusMapDetailsList.crMapEntId}" name="editId"
id="param1"></f:param>
<hx:behavior event="onclick" id="behavior3" targetAction="group1" behaviorAction="get"></hx:behavior>
</h:commandLink>
</hx:columnEx>

</hx:dataTableEx>

</h:panelGroup>

<hx:ajaxRefreshSubmit id="ajaxRefreshRequest1" target="group1"></hx:ajaxRefreshSubmit>


</h:form>

Regards
Suresh Midde
10 years ago
JSF
Hi,

I am planning to take Test 000-833: Object Oriented Analysis and Design - Part 1 (Analysis) and Test 000-834: Object Oriented Analysis and Design - Part 2 (Design) . Can someone share the study guide / links for the preparation of these tests. Sorry, for posting it in this section of the forum as I dint find a suitable section

Regards
Suresh Midde
Hi Nitin,

Thanks for the reply. I tried replacing the html hidden with the struts hidden in the profile.jsp , but it didnt solve my problem. And I have come up with adding another hidden parameter in the editUser.jsp, which has the value of the earlier hidden parameter

profile.jsp
----------------

<input type="hidden" name ="fromProfilePage" id="fromProfilePage" value="true"/> or <s:hidden name="fromProfilePage" value="true"/>


and in


editUser.jsp
---------------------

<s:hidden name="fromProfilePage" >

This works even failing with the validation, which brings me the first block of components. But I am not finding any reason for this working.

Regards
Suresh Midde
10 years ago
Hi ,

I am using struts 2.0.14 . I have a hidden parameter that is being passed from a page profile.jsp , which hits an action and navigates to the other page "editUser.jsp", where I am trying to display a few buttons based on the hidden parameter value from the previous page.


profile.jsp
-----------------
<input type="hidden" name ="fromProfilePage" id="fromProfilePage" value="true"/>

UserAction.java
------------------
I have created a variable and its setter and getter methods in the action class.

private String fromProfilePage = "false";
public String getFromProfilePage() {
return fromProfilePage;
}

public void setFromProfilePage(String fromProfilePage) {
this.fromProfilePage = fromProfilePage;
}

And the following code inside a method that handles the previous page request,

String fromProfile = getServletRequest().getParameter("fromProfilePage");

if ((null != fromProfile) && (!("".equals(fromProfile)))) {
fromProfilePage = fromProfile;
}


editUser.jsp
--------------
<s:if test="%{fromProfilePage == 'true'}">
Hello from profile page...
<s:submit ondblclick="return false;" action="editProfileChanges" key="label.save" cssClass="btn"/>
<s:submit ondblclick="return false;" action="populateProfiles" key="label.cancel" cssClass="btn"/>
</s:if>
<s:else>
<s:submit ondblclick="return false;" action="addUser" key="label.save" cssClass="btn"/>
<s:submit ondblclick="return false;" action="populateUser" key="label.cancel" cssClass="btn"/>
</s:else>




For validation , I am using validations xml files
The above thing works fine, if all required fields are entered from the page. But if one of the mandatory fields are not passed, I get the error messages onto the same page, but I am losing fromProfilePage value, which shows the other block now.........


Is there any way to retain fromProfilePage even after the validation ?

Regards
Suresh Midde
10 years ago
Hi,

I would like to know the difference between way of setting instance variable in the clases ClassA, ClassB, assuming that these classes are in the same package as Base class. I heard that its a bad way of encapsulation




Regards
Suresh Midde

[Edit - added code tags - MB]
10 years ago
Hi ,



class Plant {
private String name;
public Plant(String name) { this.name = name; }
public String getName() { return name; }
public Plant() {
Plant("fern");
}
}
public class Tree extends Plant{
public void growFruit() {}
public void dropLeaves() {}
}


The above program generates a compiler error
"Tree.java:6: cannot find symbol
symbol : method Plant(java.lang.String)
location: class Plant
Plant("fern");
^
1 error"



I dont understand, what might be the reason of this error, as I am invoking the overloaded constructor from another constructor. And if the above line is modified as this("fern") it works.

What is the difference between these two invocations ?

Regards
Suresh Midde
Hi,

I am trying to get the current iterated value inside the iterator tag. Is there any possibility to get the current iteration value ( I mean counter) and the size of the list.?

<s:iterator value="surveyList">
</s:iterator>

Regards
Suresh Midde

10 years ago
Hi ,

I was given a procedure which expects one value and retrieves me the list of columns which may vary depending upon the input parameter

CREATE PROCEDURE [FLX].[GETANS]
@ques VARCHAR(200) AS
BEGIN

// some code that creates a temp table which has the dynamic cols
create table #temp1(


SELECT * FROM #temp1
END


When I execute this procedure from db2, it is fetching me the records. I would like to invoke this stored procedure from java. How can I retrieve the output columns of the procedure from java as the columns may vary some times.

Regards
Suresh Midde
Hi,

This was fixed.

<s:textfield name="lp1" cssStyle="width:30px;" title="%{phaseId}" >

Regards
Suresh Midde
10 years ago
Hi

I need to set title for the s:textfield component.

<s:textfield name="lp2" readonly="true" cssStyle="width:30px;" title='<s:property value="phaseId" />' / >

I am unable to get the evaluated value in the title.I tried replacing single quotes with double quotes, and even tried escape attribute but there is no luck.

Some one help me.

Regards
Suresh Midde
10 years ago
Hi ,

Any clues on it ??


Regards
Suresh Midde
10 years ago
Hi,

How to pass <s:property value="surveyTableVO.surveyId" />
as an argument to a javascript method confirmsave() in the following tag <s:a href="#" onclick="confirmsave();" >

Regards
Suresh Midde

10 years ago
Hi,

I am using <s:a> tag with two actions.
I need to call javascript related action where i am submitting the form to a SaveAnswers action and later href related action in a sequence.

Right now, the method calls are happening not in sequence. i.e., in between the first method call , the second call is getting started.
So is there any way, that we can restrict the call order..

Btw, onclick or href which takes the precedence of invocation ?


<s:url id="url" action="getQuestionsForParticularPhase">
<s:param name="surveyId">
<s:property value="surveyTableVO.surveyId" />
</s:param>
</s:url>
<s:a href="%{url}" onclick="confirmsave();" ><s:property value="phaseDescription" />
</s:a>

function confirmsave(){
if(frm_questionnaire.answerChanged.value=="true"){
if(confirm('Do you want to save the answers ?')){
frm_questionnaire.action="saveAnswers.action";
frm_questionnaire.submit();
}
}
}

Regards
Suresh Midde
10 years ago
Hi Debraj,

Thanks , it is working
10 years ago
Hi

I am facing a problem in accessing the session attribute in my jsp page.

<%

String role = (String)session.getAttribute("currentRole");
out.println(role);
%>

currentRole contain string values 1 set in session

<s:if test='session.getAttribute("currentRole")=="1"'>
<jsp:include page="superadminmenu.jsp"></jsp:include>
</s:if>

trying the above condition is not working .


Also searching through some forums, tried to set this session value in s:set like
<s:set name="technologyName" value='(String)session.getAttribute("currentRole")'/>

Unable to get the <s:property value="%{#technologyName}" /> when i tried to print.

And by the way, when is the symbols %{#} , %{} and # used.

Regards
Suresh Midde

10 years ago