Win a copy of Rust Web Development this week in the Other Languages forum!

Gajendra Tomer

Ranch Hand
+ Follow
since Sep 22, 2008
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gajendra Tomer



Hello Eveyone,

Method Override happens at runtime,we all know, then why do we really need annotation "@Override" to tell compiler that sub-class is overriding method of super-class ?

Thanks in advance.
Gajendra
8 years ago
Hi There,

Can we say that following expression:

String output="str1"+"str2"+"str3"+"str4"+"str5"+2

Is equivalent to once compiled by javac:

String output=new StringBuffer("str1").append("str2").append("str3").append("str4").append("str5").append("2") .toString() ?

Thanks,
Gajendra
9 years ago
Hi Paul & Bear!

I noticed this(that the wrong function is getting called) while debugging javascript code in "Firebug".

When I changed the name of those identical functions then it started working fine.

Code for your reference:
-------------------------


SNIPPET1:

JSP1(having identical function:"function1()") is having following snippet:
--------------------------------------

Note that function:"selectSomethingID();" mentioned above invokes JSP2(having identical function:"function1()").

Also, JSP1 is having following code snippet from where it invokes "function1()":


SNIPPET2:



So, what happens if we click button 1st which is given in SNIPPET1 then it invokes function:"function1()" of JSP2...that's ok....but just after that....if panel(refer SNIPPET2) invokes function:"function1()" of JSP1 then it doesn't get invoked rather function:"function1()" of JSP2 is invoked.

This I noticed in Firebug.

I hope now you will be clear with the problem scenario.

Gajendra

Code may complicate the issue description...ok let me rephrase it in a simplified way.

Say we have 2 JSPs...JSP1 & JSP2 and having identical javascript functions with identical code...say the name of that function is "function1()".

Now what's happening that when we call "function1()" of both JSPs one after another then IE8 get goofed up and call "function1()" of JSP1 instead of JSP2.

Tomar

Hi There !

Use Case Description:
------------------------
I have a report as JSP and in this JSP I have one "Select Job" button and few dropdowns into the "Filter" section of this report.

When user clicks on "Select Job" button a popup window of "Job List" opens from where user can filter desired "Job" over which he/she wants to generate report.

Problem Description:
-----------------------
In order to capture selected filters I have defined Javascript function: "captureDropDownSelectedValues(filters)" not only in report JSP but also in "Job List" JSP which appears in popup window .

Please note that the name and prototype of "captureDropDownSelectedValues(filters)" is same in both JSPs.

Now issue here is that when I click "Select Job" button in report JSP & configures filters there then it shows me "Job List" JSP perfectly fine and captures filters properly but the same is not happening in report JSP...I mean when I set filters in report JSP and click "Generate Report" then in order to capture report filter values I am expecting that browser should call report's "captureDropDownSelectedValues(filters)" function whereas browser is calling "captureDropDownSelectedValues(filters)" function of "Job List" JSP page...I verified this in "Firebug".

Any idea why is so?

Gajendra
Hi There!

Here is another flavour of the CR/LF issue.

CODE:
---------

String str1=new String("Dear First Name ,Last Name, \n\nThe process has started.");
ByteArrayOutputStream bos1 = new ByteArrayOutputStream();
String result=null;


//CONTENTS OF "NewFile.txt" FILE IS GIVEN IN THE FOLLOWING LINE :
//"Dear First Name ,Last Name, \n\nThe process has started."

File myFile = new File("NewFile.txt");

try{
FileInputStream fis= new FileInputStream(myFile);
byte[] buffer = new byte[50 * 1024];
int i=0;

while ( (i = fis.read(buffer)) != -1 ) {
bos.write(buffer,0,i);
}

result=new String(bos.toByteArray());

System.out.println(result);//----------------------------------- (LINE-1)

}catch(Exception e)
{
System.out.println("Exception:"+e);
}

EXPECTED RESULT:
--------------------------

I am expecting that "println" method at (LINE-1) should display following:

Dear First Name ,Last Name,

The process has started


REALITY:
-----------
Dear First Name ,Last Name, \n\nThe process has started.

MY CONCERN:
-----------------

WHY SO?

Regards,
Gajendra
Thanks Jan & Alan for this assistance.

Alan! as suggested by you I had reformatted str1 and inserted it into DB through PreparedStatement but I got same outcome.

I believe Jan is right and that we have proved through your suggestion.

Cheers,
Gajendra
Hello Everyone!

I trying to insert following text into Oracle through "PreparedStatement":

String str1="This is dummy text'||char(13)||char10' End Of Text";

I am expected that char(13) should be replace with "Carriage Return" & char(10) should be replaced with "Line Feed" in the final string which is going into DB TABLE.

but rather above text as it is going into table....whereas same thing is happening with simple "Statement".

Could anyone suggest something?

Regards,
Gajendra
I read out your entire response and used the same to fix the issue in my project already but want to fix it through z-index.

That's because I have written the <Div> hide/show code at numerous locations, which is not good for the sake of maintainability.

Hence want to configure z-index dynamically and keep life of everyone easy.

Sounds logical?

Gajendra

Chris Baron wrote:What are you trying to do?



Hi Chris !

I have created following "div" hierarchy:

<DIV id="divTabFrame">
<DIV id="child1">Child1</DIV>
<DIV id="child2">Child2</DIV>
<DIV id="child3">Child3</DIV>
<DIV id="child4">Child4</DIV>
</DIV>

If you notice in the details of my original question,<DIV id="child4">Child4</DIV> is having highest z-index order i.e. "4".

Hence I am expecting <DIV id="child4">Child4</DIV> ontop of other divs having lesser z-index value.

But it's not happening in IE7 , specifically.

Problem scenario cleared ?

Thanks,
Gajendra
Hi !

Am I not clear with my question?

Regards,
Gajendra
Hi All !

Having following tag in body:

<div id="divTabFrame" style="position:absolute; font-size: 14pt; color: #FFFFFF; background-color: #FFFFFF;"></div>

Further, I have 4 buttons, named as:

1)Create DIV1, with STYLE=position:absolute; width:" + FrameWidth + "px; height:" + FrameHeight + "px;z-index:1"
2)Create DIV2, with STYLE=position:absolute; width:" + FrameWidth + "px; height:" + FrameHeight + "px;z-index:2"
3)Create DIV3, with STYLE=position:absolute; width:" + FrameWidth + "px; height:" + FrameHeight + "px;z-index:3"
4)Create DIV4, with STYLE=position:absolute; width:" + FrameWidth + "px; height:" + FrameHeight + "px;z-index:4"

These buttons are suppose to create following <DIV> hierarchy using method: "divTabFrameObj.appendChild(newdiv);" :

<DIV id="divTabFrame">
<DIV id="child1">Child1</DIV>
<DIV id="child2">Child2</DIV>
<DIV id="child3">Child3</DIV>
<DIV id="child4">Child4</DIV>
</DIV>

What I expect here, <DIV> with id="child4" , must appear in front but it's not happening in IE7, whereas same code is running fine in IE8 & Firefox 3.x.

Can anyone help me here please ?

Help will be highly appreciated.

Cheers,
Gajendra

Hi All !

We have a requirement to copy text from TextArea1 & paste it into TextArea2 with the help of 2 push buttons: "Copy" & "Paste", instead of using "CTRL+C" & "CTRL+V" key combinations.

We have done it in IE 7 & 8 but we are not able to make it done in Mozilla Firefox 3.6 browser.

Please help in this regard.

Thanks in advance.

Gajendra Singh Tomar

Thanks David for this wonderful information eventhough this aspect of JavaScript looks funny to me.

Have A Great Day !

Gajendra Singh Tomar
Respected Sir !

I am feeling remorsed for my unintentional fault.

Will take care of this in future.

Thanks for the cool and calm guidance.

Have A Nice Day !
Gajendra Singh Tomar