Java & Acces: pass boolean values
Ok I'm totally new at this so the following text will hopefully be understandable. I hope you guys can give me a hand over here.
The case:
I'm making a java function that has to create a new user of my database. This user is supposed to get a name, a password and can have 4 functions (Administrator, Author, Reader, Coreader).
To identify the 4 functions i used a checkbox in my database. So when the box is checked the person is a Admin/author/... Now I was wondering how i can use Java (using a query) to set these values checked or non-checked.
I thought I'd use booleans, however, my compiler says there is a General Error (all the names of the columns are right, so that's not the deal, my database is working properly and such, ...)
So here's my code:
(note that i used these marks ' ' here for the booleans, i tried all kinds of things such as dropping them, using them, ... it doesn't seem the problem...)
public void addNewUser(String username, String password, boolean admin, boolean author, boolean reader, boolean coreader)
String query1 = "UPDATE user SET username = '" + username + "' AND password = '"
+ password + "' AND administrator = '" + admin + "' AND author ='" + author
+ "' AND reader ='" + reader + "' AND coreader ='" + coreader + "'";
try
stmt = global.createStatement();
stmt.executeUpdate(query1);
global.showMessage("The new user, " + username + ", has been added successfuly", "Succesfuly added");
catch(Exception e)
global.showError("An error has occured while connecting to the database" + e.toString(), "SQL Error");
finally
global.closeConnection();
Hope you guys can help. Thanks a lot!
It's possible to do this; it's just that your SQL syntax is completely wrong. An SQL UPDATE statement looks as follows:
UPDATE table SET column1 = value1, column2 = value2, column3 = value3 WHERE expression
You're using 'AND' instead of commas, which is the first thing that goes wrong. The second thing that goes wrong is that you're building the SQL statement from bits of string and values. This is a habit that many novice programmers use, and open the door wide for SQL injection attacks. I you do this sort of thing on a web site, you could end up with your customers' credit card details being exposed.
But because you're just passing the boolean values into the string, they get expanded to a string value, hence TRUE or FALSE. However, because they are string literals, they should be surrounded by single quotes.
This brings us to the third problem: you're using an UPDATE statement to insert a new record. Use an INSERT statement instead.
It would be better to use a PreparedStatement. In this case, your code would look as follows:
PreparedStatement stmt =
global.prepareStatement( "INSERT INTO user " +
"( username, password, administrator, author, reader, coreader ) " +
"VALUES ( ?, ?, ?, ?, ?, ? )" );
stmt.setString( 1, username );
stmt.setString( 2, password );
stmt.setBoolean( 3, admin );
stmt.setBoolean( 4, author );
stmt.setBoolean( 5, reader );
stmt.setBoolean( 6, coreader );I have no idea whether this will work: I don't know Access, and booleans are not a standard feature of SQL. I also don't know whether Microsoft have created their own flavour of SQL, as they are wont to do with any standard.
All in all, though, you have to really work on your SQL. Three major mistakes in such a simple piece of code means that you don't understand SQL syntax. You may copy and paste this for your assignment, but unless you understand what you're actually doing, you're going to run into trouble again very soon.
- Peter
Similar Messages
-
Java is pass by value or pass by refrence
Can any one explain whetherjava is pass by value or pass by refrence.
Everything in Java is passed "by value". Everything.
Pass-by-value
- When an argument is passed to a function, the invoked function gets a copy of the original value.
- The local variable inside the method declaration is not connected to the caller's argument; any changes made to the values of the local variables inside the body of the method will have no effect on the values of the arguments in the method call.
- If the copied value in the local variable happens to be a reference (or "pointer") to an object, the variable can be used to modify the object to which the reference points.
Some people will say incorrectly that objects are passed "by reference." In programming language design, the term pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value. If the function modifies its parameter, the value in the calling code will be changed because the argument and parameter use the same slot in memory.... The Java programming language does not pass objects by reference; it passes object references by value. Because two copies of the same reference refer to the same actual object, changes made through one reference variable are visible through the other. There is exactly one parameter passing mode -- pass by value -- and that helps keep things simple.
-- James Gosling, et al., The Java Programming Language, 4th Edition
[Pass-by-Value Please (Cup Size continued)|http://www.javaranch.com/campfire/StoryPassBy.jsp] -
Hi,
Currently I am using VB .NET to pass a boolean to a DLL... i've tried this with Strings and did not have a problem... but when i want to pass booleans over, i got a 'System.EntryPointNotFoundException' error ...
i suspect the problem lies with LabVIEW not accepting boolean as 'True' or 'False', or '1' or '0'... or am i wrong?? any help is greatly appreciated ...
attached is a simple code... hope i did it correctly...
Best Regards,
JQ
LV 8.0 user...
Attachments:
display.zip 66 KBJQ wrote:
thanks tst and dave... i think this may be the problem ...
In LabVIEW, a Boolean is one byte. In Microsoft Visual Basic, a Boolean is two bytes. In Microsoft Visual Basic, if you declare variables as Booleans, the memory becomes corrupted or overwritten. Instead, you must declare each variable as one byte. The Booleans are passed by ref because they are set up as pointers to values.
quoted from: http://zone.ni.com/devzone/cda/tut/p/id/3188#toc1
although this is VB... but i think VB and VB .NET should be using the same data type.. if i succeed i'll inform you guys again... thanks a lot for the help...
And in Win32 API a BOOL is 32 bit. It's amazing how even Microsoft can not decide what is best.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Is it possible in java to pass reference of object in Java?
Hello,
I'm relativily new to Java but I have "solid" knowledge in C+ and C# .NET+.
Is it possible in java to pass reference of object in Java? I read some articles about weakreferences, softreferences, etc. but it seems that it's not what I'm looking for.
Here is a little piece of code I wrote:
package Software;
import java.util.Random;
* @author Rodrigue
public class RandomText
private Random rand = new Random();
private Thread t;
private String rText = "Rodrigue";
public RandomText()
t = new Thread()
@Override
public void run()
try
while(true)
UpdateText();
sleep(100);
catch(InterruptedException ex)
t.start();
private void UpdateText()
int i = rand.nextInt();
synchronized (rText)
rText = String.valueOf(i);
public String GetText()
return rText;
}It's just a class which start a thread. This class updates a text with a random integer 10 times per second.
I would like to get a reference on the String rText (like in C++ ;) yes I know, I must think in Java :D). So, like that, I could get one time the reference, thanks to the GetText function, and update the text when my application will repaint. Otherwise, I always have to call the GetText method ... which is slow, no?
Are objects passed by reference in java? Or, my string is duplicated each time?
Thank you very much in advance!
RodriguedisturbedRod wrote:
Ok, "Everything in Java is passed by value. Objects, however, are never passed at all.". Reference of object is passed by value too.
But, how to solve my problem in Java_? I have an object which is continually modified in a thread. From an another side, this object is continually repainted in a form.I'm not sure I totally understand your problem. If you pass a reference to an object, then both the caller and the method point to the same object. Changing the internal state of the object (e.g. by calling a setter method) through one reference will be observed through both references, since they both point to the same object.
No, calling a method is not particularly slow. Especially if it's just a simple getter method that returns the value of a member variable.
If this is happening in a multithreaded context, you'll have to use proper synchronization to ensure that each thread sees the others' changes. -
How can I pass a value that is selected in a dropDownlist into a java metho
My explanation is below and heres my jsp and javascript code:
<form action="" method="post" enctype="multipart/form-data" name="form1">
<table width="90%" cellpadding="0" cellspacing="0" class="tblProperties">
<tr class="trBackColor"><td class="tdLayoutTwo"> </td></tr>
<tr class="trLayout">
<td class="tdLayout" align="right">Student Name: </td>
<td width="316">
<select name="studentID" id="studentID">
<option value="0" selected>Select...</option>
<%=frmStudent.createList(appStudent.getStudentID())%>
</select>
</td>
</tr>
<input class="inputForm" type="submit" onClick="setValues(form1)" name="Submit" value="Continue">
</td>
</tr>
</table>
</form>Javascript code...
function setValues(frm) {
var stuID = frm.studentID.value;
<%=appForm.setStudentID(stuID)%>
}I need to pass a selected value from the Form Dropdown into a java setMethod() in my jsp page. But I can't seem to figure out how? I used the "setValue" javascript funtion as shown above, that passes the value from Javascript to jsp on a onClick event, but it doesn't work. I did some research on the internet and have learnt that I cannot pass values from Javascript to jsp.
Is there any other method, may be after I hit the submit button? I need to pass the selected value from a student dropdown list to a jsp setMethod(). So for example if I select, Jon from a Dropdown list which has a ID = 5, then I need to pass 5 to the java method.
Any Clues?
Thankshi zub786,
you have to do following things:
1) Get the value of the selected index using javascript methods on selection of student ID.
2) Use hidden tag and pass that index to value of the hidden parameter.
3) Use that parameter in your next Jsp where you want that id.
I hope this info might help u.
Leozeo -
How to Pass Click Value to DB using Java
How to Pass Click Value to DB using Java and display tat
clicked value row data in flex
i have created connection with Sql Server using java and drew
pie chart from values fetched from XML file created by Java
wat i need is when i click pie chart region (widget) i should
display a alert by giving value of particular widget name and Value
from Database and display in Flex AlertUse AddResource to add Javascript in your BackingBean Code and pass the value to your javascript code.
JSCookMenu and other dynamic adding of javascript to a JSF-JSP page is done using AddResource.... -
How to passing lowercase values to RFC/BAPI using webdynpro for JAVA
Hi Exerts,
When we sending values to RFC/BAPI through webdynpro (JAVA), the values are sent in capital (uppercase) letters to ECC.
So if we fill xxxx, it is send like XXXX. Why? and how to avoid this?
Thanks in advance,
JoeriHi,
There could be two possibility if you are storing this value in ABAP table.
1. You are entering value in UPPERCASE in your webdynpro application.
2. The data stored in ABAP table, converts value in small to upper case.
1. Can you tell me how you are passing this value, is user entering value in some input field which is binded to some context and this value are you passing to RFC/BAPI...???
Or else before passing value to RFC/BAPI you can use toLowerCase string function and the npass this value to RFC/BAPI
e.g String name = wdContext().currentContextelement().getName().toLowercase();
Now pass this name to RFC/BAPI is should go as lowercase only..
This is from webdynpro java side..
2. If you are storing this value in ABAP table, check the domain/type of variable in ABAP table for which you are storing the value. Ask ABAPper, so that this value are stored in small case letter.
There is one tick in domain which you need to remove so that it stores in lower case. I dont have exact information but you can consult this with ABAPer.
Hope this information helps guy ..!!!!
Regards,
Jigar -
Pass a value to a class that extends AbstractTableModel
Hi
I have a problem with a table model that I cannot find a way of overcoming.
I have created a class called MyTableModel that extends AbstractTableModel.
MyTableModel creates and uses another class that I have defined in order to retrieve records from a database, MyTableModel fills the table with these records.
However, I wish to alter my class in order to provide an int parameter that will act as a �where� value in the classes sql query.
The problem is this, I cannot work out how to pass a value into MyTableModel. I have tried creating a simple constructor in order to pass the value but it doesn�t work.
My code is shown below:
import BusinessObjects.JobItemClass;
import DBCommunication.*;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;
public class MyJobItemTableModel extends AbstractTableModel
public MyJobItemTableModel(int j)
jobNo = j;
int jobNo;
JobAllItems jobItems = new JobAllItems(jobNo);
ArrayList items = jobItems.getItems();
String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };
int c = items.size();
Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
Object table[][] = new Object[c][4];
public void fillTable()
if(c > 0)
for (int i = 0; i < c; i = i + 1)
this.setValueAt(((JobItemClass) items.get(i)).getItemNumber(), i, 0);
this.setValueAt(((JobItemClass) items.get(i)).getDescription(), i, 1);
this.setValueAt(((JobItemClass) items.get(i)).getCostPerItem(), i, 2);
this.setValueAt(((JobItemClass) items.get(i)).getQuantity(), i, 3);
public void setJobNo(int s)
jobNo = s;
public int getColumnCount()
if(c > 0)
return table[0].length;
else
return 0;
public int getRowCount()
return table.length;
public Object getValueAt(int r, int c)
return table[r][c];
public String getColumnName(int column)
return columnName[column];
public Class getColumnClass(int c)
return columnType[c];
public boolean isCellEditable(int r, int c)
return false;
public void setValueAt(Object aValue, int r, int c)
table[r][c] = aValue;
}Any advice will be appreciated.
Many Thanks
GByour JobAllItems is created before constructor code is run (since it is initialized in class member declaration)
use something like
public MyJobItemTableModel(int j)
jobNo = j;
items = (new JobAllItems(jobNo)).getItems();
c = items.size();
table = new Object[c][4];
int jobNo;
ArrayList items;
String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };
int c;
Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
Object table[][] ;instead of
public MyJobItemTableModel(int j)
jobNo = j;
int jobNo;
JobAllItems jobItems = new JobAllItems(jobNo);
ArrayList items = jobItems.getItems();
String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };
int c = items.size();
Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
Object table[][] = new Object[c][4]; -
Passing boolean parameters to Oracle
Hello there everyone.
I have just started to work with Oracle stored procedures. I
have written a procedure that takes a boolean value as one of its
input parameters, but I cannot find out how to get Coldfusion to
pass the value in correctly. If I execute the procedure within the
Oracle client itself it works OK but CF always gives the error
"PLS-00306: wrong number or types of arguments in call to
'PROC_TEST' ORA-06550: line 1, column 7: PL/SQL: Statement
ignored", no matter how I try to pass my boolean value. I have
tried to use all combinations of CF_SQL_BIT and CF_SQL_INTEGER and
"1" and "true" and "TRUE" in the <cfprocparam> tag, but none
of them are working. I guess I could change the code to use an
integer instead, but using a boolean for this example makes the
most sense.
If anyone has any ideas, that would be great.
Regards
Barry.Hi Phil thanks for replying!
I continued searching Google and came up with the same
conclusion you mention. Here are a couple of links:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#34_05
http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/java.920/a96654/tips.htm #1005343
What a strange situation to be in. On one hand they say that
"booleans" can't be used outside of PL/SQL, but what ARE stored
procedures if not PL/SQL? Musing about this does not move us
forward though I think.
I will change my boolean parameter to be something more SQL
(without the PL!) friendly.
Thanks for getting back to me.
Barry -
Can java class return boolean and print to page ?
Hello all
i trying to understand simple concept in jsp/servlets
i like to build class that has method that returns boolean value , but also
print string to jsp page i have this :
public class Env {
public static boolean getName(){
out.println("test") \\ this print doesn't work what does?
return true;
} thanksHello and thanks for the fast reply , one thing i can't do (application reason)
is to pass parameter to the method , i need to find some solution .
i tried to do :
public class Env {
public static boolean getName() throws IOException{
javax.servlet.http.HttpServletResponse res = null;
java.io.PrintWriter out = res.getWriter();
out.println("test!!!");
out.close();
return true;
}but with no luck im geting this error :
java.lang.NullPointerException
org.eclipse.wtp.sample.envtest.Env.getName(Env.java:11)
org.apache.jsp.test_jsp._jspService(test_jsp.java:54)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
is there any way to do it witout passing param?
thanks -
In the textbook, it says that boolean-methods are:
public Boolean equals(DemoSpecies otherObject)
return ((name.equalsIgnoreCase(otherObject.name))
&&(population==otherObject.population);
&&(growthRate==otherObject.growthRate);
}But it also says that these are also boolean-method:
Species s1 = new Species(), s2 = new Species();
<Some code to set the values of s1 and s2.>
boolean areEqual;
areEqual = s1.equals(s2);
<Some more code.>
if (areEqual)
System.out.println("They are equal.")
else
System.out.println("They are not equal.")Which one is a boolean valued method? Are they both the same thing? If I want to test an inequality between class variable name and a variable (such as numberOfStudents), which one would I use?
Thanks in advance.I'm still not sure what the question is... I guess autoboxing might be confusing you... autoboxing automagically transmutes a parameter from it's fundamental type to it's wrapper-class equivalent... which allows you to write code which treats Boolean and boolean as equivalent, except for those nasty nulls.
For example, the code:
package forums;
class AutoBoxTesterator
public static void main(String[] args) {
int i = 1;
System.out.println("i="+method1(i));
Integer jj = 2;
System.out.println("jj="+method2(jj));
Integer kk = null;
System.out.println("kk="+method1(kk));
try {
System.out.println("kk="+method2(kk));
} catch (NullPointerException e) {
System.out.print("method1(null) caused: ");
e.printStackTrace();
boolean b = method3();
System.out.println("b="+b);
private static String method1(Integer ii) {
return ""+ii;
private static String method2(int j) {
return ""+j;
private static Boolean method3() {
return true;
}produces:
i=1
jj=2
kk=null
method2(null) caused: java.lang.NullPointerException
at forums.AutoBoxTesterator.main(AutoBoxTesterator.java:16)
b=trueThe above code behaves this way because:
1. int i is "auto-boxed" into Integer ii as it's passed to method1.
2. Integer jj is "auto-unboxed" into int j as it's passed to method2.
3. Integer kk remains unmodified as it's passed to method1.
4. Integer kk throws a runtime NullPointerException when we attempt to unbox null to pass it to method2.
5. In method3() "true" is auto-boxed to a Boolean (ie method3's declared return type), which is them immediately unboxed back to a raw boolean to be stored in b; Again this will cause a NPE if method3 happens to return null.
So what does that mean?... Well it means that as of 1.6 you can be pretty fast and loose with "wrapper vs fundamendal types", so long as you're mindful of null's. -
How to Pass Parameter/Value to the second page????
Hi,
I am trying to display same popup window when I click on ADD,UPDATE and VIEW buttons. I don’t have any problem in displaying the popup when I click on ADD and UPDATE button but with VIEW button I wanted to display the popup at read only mode. In order to do that I have created a bean with session scope and set a ‘SetActionListener‘on VIEW button and set ‘from’ property to true and ‘to’ property to "#{IndividualSummaryDetails.readOnlyAddress}". I could not pass the value of readOnlyAddress to the popup. How can I pass the value of readOnlyAddress to the popup?
This value becomes true when I click on view button. If I pass that value to the popup then I can set the read only property of the fields on the popup with that value. So that the fields become read only.
Here is my View button
<af:commandButton text="#{CoreProperties['Global.commandButton.View']}"
windowHeight="450" windowWidth="600"
useWindow="true"
action="dialog:FromIndividualSummaryDetailsToAddress"
id="justView">
<af:setActionListener from="#{true}"
to="#{IndividualSummaryDetails.readOnlyAddress}"/>
Here is my Bean
public class IndividualSummaryDetails {
private Boolean readOnlyAddress;
public IndividualSummaryDetails() {
readOnlyAddress = true;
public Boolean isReadOnlyAddress() {
return readOnlyAddress;
public void setReadOnlyAddress(Boolean readOnlyAddress) {
this.readOnlyAddress = readOnlyAddress;
This value becomes true when I click on view button. If I pass that value to the popup then I can set the read only property of the fields on the popup with that value. So that the fields become read only.
Message was edited by:
V.PirabaWe need to use portlet events for sending parameters across different pages.
Following documents can give you insight on this :
1. http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/PRIMER.PORTLET.PARAMETERS.EVENTS.HTML
2. http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/ARTICLES/DESIGNING.PAGES.USING.PDKJAVA.SAMPLE.EVENT.WEB.PROVIDER.HTML
-AMJAD. -
Passing multiple values to the QUERY BDOC parameter?
hi All,
Below is my Query BDOC Anchor Before Query Execute even handler... I'm trying to pass multiple values to the bq.Z_PartnerFunction query parameter... i.e.
PARTNER_FCT in( '00000012','ZDIVMGR','ZAREADR')
is it possible without creating new Query Bdoc ?
====================================
Private Sub aempchoicewinTCWSearchTAnchor_beforeQueryExecute(ByRef bq As BusinessQuery, ByRef cancel As Boolean)
If Not bq Is Nothing Then
If sWcDummy = "Yes" Then
bq.WcDummy = sWcDummy
End If
bq.Z_PartnerFunction = "00000012"
If ctrlZ_Territory.Value <> "" Then
bq.PRNB_TerrID = "*" & ctrlZ_Territory.Value
End If
End If
End Sub
================================
Thanks in advance
HetalHi,
it looks that you already enhanced the query BDoc because you have a new query parameter bq.Z_PartnerFunction, right?
To which BDoc parameter is this BQ parameter mapped? And how looks the related where clause?
For a single filter normally a "=" operator is used. Therefore your example with "in" won't work.
If these three partner functions are fixed then you might hardcoded them directly in the where clause (supposed the BDoc is not used somewhere else where you don't want to have this filter).
Or you might add 3 new BDoc parameters, add 3 new where clauses using a disjunction for them (and using an embracing bracket). In this case always all these 3 BQ parameters need to be filled (or all stay empty) to avoid a SQL syntax error.
Regards,
Wolfhard -
Passing variant values in job_submit FM
Hi Guys,
I am running a report in background using job_submit FM.
Currently I am using Get and Set parameters to pass selection screen values.
But these values are not effective when run in background.
If variant is an option, how to populate the variant from selection screen values.
ThanksHi,
U follow the given code. If u have taken varinat as parameter then ok.
other wise u have to pass rs_create_varaint* function module in the program.
DATA : v_jobhead LIKE tbtcjob.
DATA : v_jobcount LIKE tbtcjob-jobcount.
DATA : v_eventparm LIKE tbtcjob-eventparm.
DATA : v_flg_released TYPE c.
DATA: e_error.
DATA: running LIKE tbtcv-run.
TYPES: esp1_boolean LIKE boole-boole.
CONSTANTS: esp1_false TYPE esp1_boolean VALUE ' ',
esp1_true TYPE esp1_boolean VALUE 'X'.
CONSTANTS: true TYPE boolean VALUE esp1_true,
false TYPE boolean VALUE esp1_false.
PARAMETERS: v_jobnam LIKE tbtcjob-jobname,
v_report LIKE sy-repid,
v_varian LIKE raldb-variant,
v_uname LIKE sy-uname.
START-OF-SELECTION.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = v_jobnam
IMPORTING
jobcount = v_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
e_error = true.
ELSE.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = v_uname
jobcount = v_jobcount
jobname = v_jobnam
report = v_report
variant = v_varian
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
IF sy-subrc <> 0.
e_error = true.
ELSE.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = v_jobcount
jobname = v_jobnam
strtimmed = 'X'
IMPORTING
job_was_released = v_flg_released
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
e_error = true.
ELSE.
DO.
CALL FUNCTION 'SHOW_JOBSTATE'
EXPORTING
jobcount = v_jobcount
jobname = v_jobnam
EXCEPTIONS
jobcount_missing = 1
jobname_missing = 2
job_notex = 3
OTHERS = 4.
IF sy-subrc <> 0.
e_error = true.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF running = space.
exit.
endif.
enddo.
endif.
endif.
endif.
Regards,
Naveen M. -
How can I pass a value into a page fragment?
How can I pass a value into a page fragment?
I am implementing four search screens. And the only thing different about them will be their backing bean.
So I’d like to do something like have four pages, each which retrieves its appropriate backing bean, sets that bean to a variable, and then includes a page fragment which contains the generic search page code (which will make use of that variable).
The code in the four pages would be something like this:
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<c:set var="searchPageBackingBean"
value="#{pageFlowScope.employeeSearchPageBean}"
scope="page"/>
<jsp:include page="./SearchPageBody.jsff"/>
</jsp:root>
At this point, what I’m seeing is that the fragment page, SearchPageBody.jsff, has no visibility of the searchPageBackingBean variable, either referencing it as #{pageFlowScope.searchPageBackingBean} or just #{searchPageBackingBean}The following will work, assuming you are needing to access a managed bean:
Put this in the parent page:
<c:set var="nameOfSearchPageBackingBean"
value="employeeSearchPageBean"
scope="request"/>
Put this in the child, SearchPageBody.jsff:
<c:set var="searchPageBean"
value="#{pageFlowScope[nameOfSearchPageBackingBean]}"
scope="page"/>
Maybe you are looking for
-
Download Bloomberg data to SAP
Dear all, at a customer we want to download energy prices from specific companies from Bloomberg and compare it with the prices they agreed upon with these companies. My question is, what's the best way to get this data from Bloomberg on any given ti
-
How do I download a movie in another language?
I would like to access movies on iTunes in the Russian language--specifically kids movies. How do I do that?
-
Buying New Phone but Contract can't yet what are my options???
Okay I dropped my phone in some water and had to find a replacement it is a razor but being it was given to me there are issues with it... The phone changes settings on its own and I can't access VM called Verizon and they can't help with changing it
-
In our application , we have a env file by the application name i.e. sun2.env. In the webutil.config file we have the envfile=sun2.env. My question is All the configuration for deafult.env file recommend in the webutil.doc provided with the webutil d
-
IPF8100 won't print after installing Mac driver 3.04
just installed the new Mac driver for my Canon ipf8100 printer (it's driver 3.04). Now when I print a job it spools for a while, then says "cannot find destination. Please check printers power connection". But if I just open the printer utility itsel