Hidden button in jsp doesn't work
Hi SDN.
In jsp (jspdynpage) I would like to get to the server after showing a "Confirm" dialog box.
I have tried with a hidden button like this:
<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<hbj:form id="myFormId" >
<%
String setShowFlag = null;
%>
<SPAN STYLE="visibility: hidden">
<hbj:button id='showFlag'
text=""
onClick="setShowFlagFalse"
jsObjectNeeded="true">
<% setShowFlag = myContext.getParamIdForComponent(showFlag); %>
</hbj:button>
</SPAN>
<Script language="JavaScript">
var agree=confirm("Move to incoming");
if (agree) {
do something }
else {
document.all.<%=setShowFlag%>.click();
</Script>
</hbj:form>
</hbj:page>
</hbj:content>
Do anyone know why this doesn't work?
Thanks in advance
Peter
Hi Peter,
Sorry i am not able to understand what u want to say.If u give some more details it will be useful.
If i understand u correctly u want the button to be hidden initially and visible after some contidion becomes true right?
If yes call a javascript function as soon as ur condition becomes true and inside that function make the span visible by writting the following code.
document.getElementById('id of span').style.visibility='visible';
Dont forget to give an id to span. it is necessary.
U can use span itself no need of going for div
If my view is wrong tell me detaily what is ur ultimate aim?
Regards,
Tamil K
Message was edited by:
Tamil Venthan
Similar Messages
-
Parsing in Weblogic/jsp doesn't work; application-mode (command-line) works
Hello-
Parsing my XML file in Weblogic/jsp doesn't work, whereas it works
in application-mode... (albeit on two different machines)
Here are the parameters:
server1:
weblogic 6.0
win2k server
jre1.3
my personal machine:
***no weblogic***
win2k server
jre1.3
When I run my code as an application (command-line style) on my machine,
parsing in my xml file works fine, and I can do a root.toString() and it
dumps out the entire xml file, as desired.
However, running my code inside weblogic (on server1) in JSP, parsing in
my file and doing a root.toString() results in the following: [dmui: null]
(where dmui is my root)
(even though i'm running it on two different machines, i'm positive its the
same code (the servers share a mapped drive)...
So, I think its probably because I'm using a different parser, as
specified by weblogic? There are no exceptions being thrown. Here's my
(abbreviated) code, which is called either command line style or in a JSP:
// Imports
import org.w3c.dom.*;
import org.w3c.dom.Document;
import javax.xml.parsers.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
mDocument = docBuilder.parse (inFile);
myRoot.toString()
-END
Doing a System.getProperty("javax.xml.parsers.DocumentBuilderFactory")
results in:
server1 (weblogic/jsp):
"weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
my machine (application-mode):
null
Does anyone have any ideas about how to get this work? Do I try to set it
up so that they both use the same parser? Do I change the Weblogic parser?
If so, to what? And how?
Am I even close?
Any help would be appreciated..
Thanks, Clint
"[email protected]" <[email protected]> wrote in message
news:[email protected]...
No problem, glad you got it worked out :)
~Ryan U.
Jennifer wrote in message <[email protected]>...
I completely missed setting the property(:-o), foolish mistake. That wasit. Thanks.
"j.upton" <[email protected]> wrote:
Jennifer,
Personally I would get rid of import com.sun.xml.parser.* and use xerces
which comes with WLS 6.0 now, unless like I said earlier you have a need
to
use the sun parser :) Try something like this with your code --I've put
things to watch for as comments in the code.
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.w3c.dom.*;
import java.io.FileInputStream;
public class BasicDOM {
public BasicDOM (String xmlFile) {
try{
FileInputStream inStream;
Document document;
/*You must specify a parser for jaxp. You can in a simple view
think
of this as being analogous to a driver used by JDBC or JNDI. If you are
using this in the context of a servlet or JSP and have set an XML
registry
with the console this happens automatically. You can also invoke it in
the
context of an application on the command line using the -D switch. */
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
>>>
"weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
// create a document factory
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// specify validating or non-validating parser
dbf.setValidating(true);
// obtain a factory
DocumentBuilder db = dbf.newDocumentBuilder();
// create a document from the factory
inStream = new FileInputStream(xmlFile);
document = db.parse(inStream);
}//try
catch (Exception e)
System.out.println("Unexpected exception reading document!"
+e);
System.exit (0);
}//catch
}//BasicDom
// Main Method
public static void main (String[] args) {
if (args.length < 1)
System.exit(1); file://or you can be more verbose
new BasicDOM(args[0]);
}//class
=============================================
That will give you a basic DOM you can manipulate and parse it fromthere.
BTW this code
compiled and ran on WLS 6.0 under Windows 2000.
Let me know if this helped or you still are having trouble.
~Ryan U.
"Jennifer" <[email protected]> wrote in message
news:[email protected]...
Actually I included com.sun.xml.parser.* as one last febble attempt toget
it working.
And as for source code, I included the code. If I just put that oneline
of code
in, including the imports, it fails giving me an error listed above inthe
subject
line. Here is the code again:
package examples.xml.http;
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.*;
import java.util.*;
import java.net.*;
import org.xml.sax.*;
import java.io.*;
public class BasicDOM {
static Document document;
public BasicDOM (String xmlFile) {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
} catch (FactoryConfigurationError e){
System.err.println(e.getException());
e.printStackTrace();
// Main Method
public static void main (String[] args) {
BasicDOM basicDOM = new BasicDOM (args[0]);Hi, Rob
Does it work in WL9.2?
It seems I do it exactly as the explained at http://edocs.bea.com/wls/docs81/programming/classloading.html - and it fails :o(.
I try to run my app.ear with WL9.2 There are 2 components in it: webapp and mdb. The webapp/WEB-INF contains weblogic.xml:
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
Mdb is expected to run in the same mode, i.e. to prefer the webapp/WEB-INF/*.jar over the parent Weblogic classloader. To do so I add the weblogic-application.xml to the app.ear!/META-INF:
<weblogic-application>
<classloader-structure>
<module-ref>
<!-- reminder: this webapp contains
prefer-web-inf-classes -->
<module-uri>webapp</module-uri>
</module-ref>
<classloader-structure>
<module-ref>
<module-uri>mdb.jar</module-uri>
</module-ref>
</classloader-structure>
</classloader-structure>
</weblogic-application>
Now, when classloader-structure specified, both webabb and mdb prefer the weblogic root loader as if prefer-web-inf-classes not defined at all. -
I installed Oracle Portal Early Adoptor edition to Windows 2000. I noticed that the Oracle HTTP server has Apache/Jserv. The servlet sample works, however the JSP doesn't work. There aren't any documentation about JSP. Do I have to install a 3rd party JSP web server such as JRUN to run JSP? Thanks.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sir Gawin:
I installed Oracle Portal Early Adoptor edition to Windows 2000. I noticed that the Oracle HTTP server has Apache/Jserv. The servlet sample works, however the JSP doesn't work. There aren't any documentation about JSP. Do I have to install a 3rd party JSP web server such as JRUN to run JSP? Thanks.<HR></BLOCKQUOTE>
I would also be interested in this answer.I had test site running on a win2000 server with Apache/Jserv until I installed WebDB. Now I can connect via a web browser to the default WebDB site but the Apache HTTP sevices refuse to start up giving an error message 1069( or something like that). WebDB is configired to a different port( not 80)than Apache http
null -
My Ipod Froze And It Froze On Pandora And I Can Hear Pandora But I Click The Home Button And It Doesn't Work? Help Me
Try this:
1. Close all apps in the Task Bar. Double-click the Home button and hold apps down for a second or two. Tap the minus sign to close app.
2. Hold the Sleep and Home button down until you see the Apple Logo. -
Macintosh: Adobe Muse; Formular Widget: Send button in Firefox doesn't work (Mac, PC). Works in Safari (Mac) IE (PC). What's happening?
URL Test: News
Greetings from cold Switzerland....
BeatI believe you have resolved this , as I tested on my end and the submit button worked fine.
Thanks,
Sanjit -
Viewing document (blob) in JSP doesn't work
I am currently supporting an application which talks to an Oracle 11gR1 database using several application servers. Our application is working on the following application servers:
- Apache Tomcat 5 and 6
- Oracle Application Server 10gR3
- WebLogic (configuration 1)
We have an second server which has WebLogic (configuration 2); however, we cannot get the JSP to display on that server. The same WAR file has been deployed to all four application servers, yet only the WebLogic Server configuration 2 doesn't work.
WebLogic Server (configuration 2) appears to work (doesn't give an error message); however, the web-page tries to show a document (which appears to be a copy/representation of the existing HTML web page - i.e. a form filter screen). Any insight into the possible problem?
The code we are using is shown below:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
String fileIdString = request.getParameter("fileIdString");
try {
// Get the File to send to the client
int fileId = Integer.parseInt(fileIdString);
CustomFile file = fileService.loadFileById(fileId);
if (file == null) {
log.error("The fileId (" + fileId + ") could not be found - DNE.");
int lastDot = file.getFilename().lastIndexOf('.');
String fileExtension = (lastDot!=-1 ? file.getFilename().substring(lastDot) : "" );
FileType fileType = fileService.loadByFileExtension(fileExtension);
if (fileType == null) {
log.error("The system could not find the file extension (" + fileExtension + ").");
// Setup the response header so a file can be streamed to the client
response.setHeader("Content-disposition", "attachment; filename=" + file.getFilename());
response.setContentLength((int) file.getFile().length());
response.setContentType(fileType.getWebContent());
// Break the file down into its bytes so it can be streamed
ServletOutputStream outputStream = response.getOutputStream();
InputStream inputStream = file.getFile().getBinaryStream();
byte[] buffer = new byte[2048];
int bytesRead = inputStream.read(buffer);
while (bytesRead >= 0) {
if (bytesRead > 0) {
outputStream.write(buffer, 0, bytesRead);
bytesRead = inputStream.read(buffer);
// Garbage collection
outputStream.flush();
outputStream.close();
inputStream.close();
return null;
} catch (Exception exception) {
log.error(exception.getMessage());
return mapping.findForward("failure");
We had a siimilar issue with some displaying RTF documents and the solution was to remove ALL whitespace characters in the JSP (which seemed to work). I don't see how we can remove the whitespace in the above ActionServlet code.
Thanks in advance for the help!Hi Peter,
Sorry i am not able to understand what u want to say.If u give some more details it will be useful.
If i understand u correctly u want the button to be hidden initially and visible after some contidion becomes true right?
If yes call a javascript function as soon as ur condition becomes true and inside that function make the span visible by writting the following code.
document.getElementById('id of span').style.visibility='visible';
Dont forget to give an id to span. it is necessary.
U can use span itself no need of going for div
If my view is wrong tell me detaily what is ur ultimate aim?
Regards,
Tamil K
Message was edited by:
Tamil Venthan -
I can't download music from my PC to my new iphone4 because the devices button in itunes is grey and can't be slected. Where do I go from here?
Maverickred wrote:
Thanks, but i'm not sure that i set up find my iphone.
Well, any easy way to find out is to do as I suggested, login to iCloud.com & try to locate the phone. Have you bothered to try that?
If that doesn't work, you'll have to let your battery run out, then try recovery mode. -
Why passing string from applet to jsp doesn't work?
Hi,all:
I have a application requires applet to get client side info, then pass this "info"--string to the JSP.
Applet code:
try{
URL url = new URL(getCodeBase(),"test.jsp?
java.version=1.2.2&java.vendor=Sun);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type", "application/octet-stream");
conn.connect();
} catch (Exception e) {
System.out.println("The error is at URL:"+e.getMessage());
My jsp code is:
<%
String java_version=request.getParameter("java.version");
String java_vendor=request.getParameter("java.vendor");
%>
However, it doesn't work. Could anybody help me figure out?
Thanks in advance.
PaulRequest Jsp with
test.jsp?URLEncoder.encode("java.version")=URLEncoder.encode("java.version.value")&URLEncoder.encode("java.vendor")=
URLEncoder.encode("java.vendor.value") -
Button on video doesn't work on iPad
Hey there I have a button on top of a video but it doesn't work on an iPad which has the video controls enabled on it.
It works on desktops though.
Is there something I'm missing?
Thanks in advance.Hi,
I also experienced the same problem. It's a typical IOS behaviour.
I quote:
"The problem is that the HTML5 video element on iOS seems to hijack the click events in the areas (of the elements layered on top) that are contained in the bounding box of the video element. If the bounding box is made smaller with scale(0.01) or the bounding box is pushed off the screen with translateX(-2560px), no element areas are directly above the video element and the click events will get fired."
See here: http://stackoverflow.com/questions/8325311/controls-overlay-for-video-on-iphone-ipad
Or here http://www.frontendfan.com/overlay-on-top-of-html5-video-tag/
Good luck!
Kind regards,
Lester. -
Hi,
I have create a button which I would like to display in my PDF.
Below you will see the settings I've used:
The problem I'm having is that the button doesn't work. Nothing happens when I open my PDF and click on it.
Upon exporting I have select to include Bookmarks, Hyperlinks, Non-Printing Objects, Visble Guides and Baseline Grids. The Interactive Elements settings are set to: Inlcude Appearance.
Does anyone know why this is not working?
Thanks in advance.
ThomasWilli, you're my hero of the day.
Thanks buddy. -
Video button in camera doesn't work
After upgrading to iOS7 the video function no longer works. The button for video is there in the camera app but pressing it doesn't start the video recording. I've rebooted the iPad and force closed the app but it still doesn't work.
Thanks Diavonex, I needed to swipe from left to right now it works.
-
Home button and volume doesn't work
My iphone 4 home button and the volume doesn't work. Have Besy Buy black tie protection plan but they want me to be without my phone for almost a month to repair. I can't do that. What can I do to fix myself?
You don't.
If you are under warranty, you can bring it to tha Apple Store and have them look at it. -
Back button on iMac doesn't work
The back button doesn't work. When I try to return to previous page Safari quits. Same on Firefox. HELP
I did that but it didn't make any difference. Any other ideas?
-
Microphone button in calendar doesn't work
Microphone button in calendar doesn't work
Can you press and hold the Home button a bit longer and use Siri?
You can make an appointment without opening the Calendar app.
Check your
Settings > General > Siri >
Siri: ON?
Language: English
Voice Feedback: Always
My Info: Yourself as in your Contacts
Settings > General > Restrictions
Is Restrictions: OFF?
Is Siri: ON? -
How do I turn off my phone with a broken lock button and screen doesn't work?
my lock button broke a few months ago and I've been getting along fine without it due to assistive touch. Now, my screen won't work at all.. I can't slide it to open it, can't slide to power off .. only thing I can do is slide down the today thing at the top and slide it back up .. I can get siri to bring me to my password screen but I can't type it in .. any ideas on how to turn off or restart my phone seeing as I can't slide to power off? This happened over night so my phone is at 94% as of right now and I don't want to wait for it to die because that will take forever ..
Honestly the hard really right now to say what you can do. How long have you had the device? If it's under a year you can take it to apple store and they can switch it out for free. If it's over a year then it would be at a paid cost cause they can't fix that issue.
Hope this helps.
Maybe you are looking for
-
Scenario: NW 6.5 SP5 ZfD 6.5 SP2 Issue: I have a server running ZfD imaging and wks import/removal. This server runs ZfD 6.5 SP2. Now I also need to install Inventory services from my product CD. But installing ZfD Inventory services from the product
-
Transfer songs on ipod to a new itunes
I have new computer as old one stolen. Trying to get songs of my ipod onto new itunes or new songs onto ipod. It says allready synced with another itunes. Please help
-
I have an ipod touch 64gb. Lately, I discovered an error message on the lockscreen that says "Runtime Error Info.plist not found". What is this, will it effect my ipod, how does it effect my ipod and how do I correct the error? (I see the error messa
-
Firefox Keeps Logging Me Out of All Websites I Visit.
Firefox automatically logs me out dozens of times per day out of websites I visit regularly. I have manually removed all cookies and cookies are enabled. And no, I do not have the clear history when Firefox closes box checked.
-
Problem in merging java script and java code
hi, i want to merge java and javascript code but it is giving some surprising results. this is my code: <script language = "javascript"> <% String query_result= "1"; String buttontype=""; buttontype=(String)session.getAttribute("buttontype"); query_r