How to call the form bean value on jsp withthe help of jstl tag
hi
all friends
i am working in struts & i use jstl tag in jsp. i have one problem rise is how to call the form bean value in jsp page by using jstl tag.
i now how to retrive the value through jsp:logic
eg. <logic:empty name="userListForm" property="users">
NO USER FOUND
</logic:empty>
see * userListForm mean formbaen name.
* users means collection object.
so how can i write above e.g in jstl
You use the jstl core:if or core:choose combined with the EL:
<c:if test="${empty users.userListForm}">
NO USERS FOUND
</c:if>I suggest you lookup the jsp expression language (EL) using google, it's very powerful.
Similar Messages
-
How to populate the form bean object for multiselect box in struts
hi, i am using two multi select boxes,one to populate the data by getting from the data base and another to fill the items selected from the first select box to store the values in the database..i need the information (how to declare the select boxes and how to write the form bean getters and setters for this one.) regarding this..
http://forum.java.sun.com/thread.jspa?threadID=5147813&messageID=9553925#9553925
-
How to pass the FORM Fields value by Form Personalization
Hi ALL,
I want to pass form filds values in to procedure. I am calling this procedure through form personalization of that form..... But it's not accepting any form field's value there... when i am passing hardcoded vales procedure is executing fine...
can any one suggest what to do???
i tried with these syntax
TEST_EMP_FP(:ADDR.ADDRESS_ID,'ABC')
TEST_EMP_FP(${item.ADDR.ADDRESS_ID.value},'ABC')
Regards
RaviHi,
Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transact5ions screen, The invoice number should be defaulted in the report parameter).
Regards,,
Anil. -
How to clear the Managed Bean Values prior to load a JSF page
Hello.
I have a jsf page that contains fields that need to be cleared BEFORE the page is loaded.
My managed bean where the fields are linked (I�m using the value attribute) is in the SESSION scope because I need to control they values across a popup window and if I use request scope, my vectors that load objects like dataTable are cleared when I post the form.
My question is :
How I CLEAR all the values in the managed bean BEFORE the page is loaded ???
In the WebForms (Microsoft .NET) I have an method on the codebehind called Page_Load where I put my initialization code for my page.
Thanks in advance.
Rog�rioRog�rio,
You can do this with a PhaseListener. Just regiser a new listener for the RESTORE_VIEW phase, and implement the beforePhase method; you can do this in the backing bean's constructor, or somewhere elase. This is pretty much the same as the Page_Load event handler in .NET.
Kito D. Mann
Author, JSF in Action
http://www.jsfcentral.com - JSF news, info, and FAQ
Hello.
I have a jsf page that contains fields that need to be
cleared BEFORE the page is loaded.
My managed bean where the fields are linked (I�m using
the value attribute) is in the SESSION scope because I
need to control they values across a popup window and
if I use request scope, my vectors that load objects
like dataTable are cleared when I post the form.
My question is :
How I CLEAR all the values in the managed bean BEFORE
the page is loaded ???
In the WebForms (Microsoft .NET) I have an method on
the codebehind called Page_Load where I put my
initialization code for my page.
Thanks in advance.
Rog�rio -
How to call the backing bean method through javascript by closing window?
Hi all,
What I want to do is:
I open a new page by clicking <t:commanLink.../> from the first page. Then I close the new page. By closing the new page I will call a function in the backing bean such as myBean.doSomething() to do something. Such like:
<body onUnload=jsFunction()..../>
...So far I understand, I should write following code
in my second page:
<html>
<head>
<script type="txet/javascript">
function jsFunction()
{>
ocument.forms[0].action="#{myBean.doSomething}";
document.forms[0].submit();
</scrip>
</head>
<body onunload="jsFunction()">
<ui:composition>
<h:form id="myForm">
<t:commandLink id="myLink" immediate="true"
action="#{myBean.doSomething}"
value=""></t:commandLink>
</h:form>
</ui:composition>
Is that right? I am not sure if I've the javascript
in the right position.I am sorry! That solution will not work. My Bad.
You can try this.
1) Have a invisible command button on your first page with the action attribute set to "#{myBean.doSomething}" as below
<t:commandButton style="width:0px;height:0px" id="myButton" immediate="true"
action="#{myBean.doSomething}"
value=""></t:commandButton>2) Your JS onunload method on the second page should look like
<script type="txet/javascript">
function jsFunction()
var buttonObject= window.parent.document.getElementById("formname:myButton");
buttonObject.click(); // This would help in submitting the first page
// to submit to the needed action method
</script>Karthik -
How to Supply the form field values to a pdf form when loading it
I am working on a web site project using Asp.net where the user has to fill in a PDF eform in acrobat reader. Then when he clicks on submit it returns to my asp.net app and the PDF form supplies the values back to my asp.net app. So my asp.net app has the values that were filled in the PDF form and can save those values and work with them...
OK.
What I need to know is when I am in my asp.net app, and the user wants to go back and reopen the same form, from my asp.net app..... then how do I pass back the values that were saved back to the PDF form??
I know if I had a way to pass the values to the PDF form in some way then in the Doc.open or doc.load event of the form I could easily write a little javascript to plug in the values in the PDF form fields.
but how do I pass those values from my asp.net app to my PDF form???
thanksThanks bcweed for all the info. I fixed my problem, it had something to do with LiveCycle Designer. If I just use Acrobat to add the form fields, then the FDF works fine. As to your situation with the SavToBuf, that happens to be the method that I am using, so I will just post my code here, and maybe you can pick out what is different from yours. The Response.BinaryWrite(FDFin.FDFSaveToBuf)is at the bottom.
Sql = "SELECT * FROM Invoices" & WHERE
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Db_Conn_Str
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql, Conn, adOpenStatic, adLockReadOnly, adCmdText
If Not Rs.EOF Then
End If
Set FdfAcX = Server.CreateObject("FdfApp.FdfApp")
Set outputFDF = FdfAcX.FDFCreate
'VendorID = VendorName = VendorNum = InvoiceDate = PreparedBy = ""
Gross = 0
For I=0 To Rs.RecordCount-1
If InStr(VendorID,Rs.Fields("VendorID")) = 0 Then
VendorID = VendorID & Rs.Fields("VendorID") & ", "
End If
If InStr(VendorName,Rs.Fields("VendorName")) = 0 Then
VendorName = VendorName & Rs.Fields("VendorName") & ", "
End If
If InStr(InvoiceNum,Rs.Fields("InvoiceNumber")) = 0 Then
InvoiceNum = InvoiceNum & Rs.Fields("InvoiceNumber") & ", "
End If
If InStr(InvoiceDate,Rs.Fields("InvoiceDate")) = 0 Then
InvoiceDate = InvoiceDate & Rs.Fields("InvoiceDate") & ", "
End If
If InStr(PreparedBy,Rs.Fields("PreparedBy")) = 0 Then
PreparedBy = PreparedBy & Rs.Fields("PreparedBy") & ", "
End If
Rs.MoveNext
Next
Rs.MoveFirst
outputFDF.FDFSetValue "VendorID",VendorID,False
outputFDF.FDFSetValue "VendorName",VendorName,False
outputFDF.FDFSetValue "InvoiceNum",InvoiceNum,False
outputFDF.FDFSetValue "InvoiceDate",InvoiceDate,False
outputFDF.FDFSetValue "PreparedBy",PreparedBy,False
For I=0 To Rs.RecordCount-1
outputFDF.FDFSetValue ("Line."&I), Rs.Fields("Amount")&"", False
outputFDF.FDFSetValue ("Company."&I), Rs.Fields("Company")&"", False
outputFDF.FDFSetValue ("GL."&I), Rs.Fields("GL")&"", False
outputFDF.FDFSetValue ("CC."&I), Rs.Fields("CostCenter")&"", False
outputFDF.FDFSetValue ("DocNum."&I), Rs.Fields("DocNumber")&"", False
Gross = CCur(Gross) + CCur(Rs.Fields("Amount"))
Rs.MoveNext
Next
outputFDF.FDFSetValue "Gross", Gross, False
Rs.Close
Set Rs = Nothing
Sql = "UPDATE Invoices SET DatePrinted = '" & Now() & "'" & WHERE
Conn.Execute Sql
Conn.Close
Set Conn = Nothing
outputFDF.FDFSetValue "PrintDate", Date(), False
outputFDF.FDFSetFile "http://admin/invoices/pdf/InvoiceAuthorization.pdf"
Response.ContentType = "application/vnd.fdf"
Response.BinaryWrite outputFDF.FDFSaveToBuf
outputFDF.FDFClose
%> -
How to call fn form within a procedure? - pl help
Hello
I have a procedure which has a set of statements that is called repeatedly.i would like to put them inside a function, passing an IN parameter as well. How to do that? and how do u call the fn from within the procedure?
Pl help.
rgdsSQL> create or replace package calls is
2 procedure proc ;
3 end ;
4 /
Package created.
SQL> create or replace package body calls is
2 function func(p_param in number) return number is
3 begin
4 dbms_output.put_line('param is:'||p_param) ;
5 return(p_param * 2) ;
6 end ;
7 procedure proc is
8 ret_val number ;
9 begin
10 ret_val := func(100) ;
11 dbms_output.put_line('ret_val='||ret_val) ;
12 end ;
13 end ;
14 /
Package body created.
SQL> exec calls.proc ;
param is:100
ret_val=200
PL/SQL procedure successfully completed.
SQL>Message was edited by:
Kamal Kishore -
How to call the backing bean method through javascript
Hi
I have a command button associated with actionListener . Action Listener method associated with backing bean methods.
I want to fire the event on command button and backing bean method should be invoked from javascript dynamically.
can anybody help me asapJSF<h:form id="formId">
<h:commandButton id="buttonId" value="submit" actionListener="#{myBean.action}" />
</h:form>JSdocument.getElementById('formId:buttonId').click(); -
How to update the form bean after the first submission?
Hi all,
I am trying to refresh the data that have been retrieved from database to a jsp page. The first action class is retrieving data from database and display them in the jsp page. In the same jsp page I want to create a button where a user can click to refresh the data that has been update in the database side. This is done by second action class. Please let me know as this problem is hitting my head.
The first action class
public class StateResultAction extends BaseAction{
private int year;
private int month;
public ActionForward process(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
String forwardPage = "";
Vector data = null;
Log log = getLogger();
StateForm stateForm = ((StateForm)form);
log.debug("in StateResultAction:"+stateForm);
try {
year = stateForm.getStartYear();
month = stateForm.getStartMonth();
StateBusLogic busLogic = new StateBusLogic(stateForm);
if(stateForm.getSt().startsWith("98")){
data = busLogic.getBalance2();
}else{
data = busLogic.getBalance();
log.debug("size of data:"+data.size());
request.getSession().setAttribute("data", data);
}catch (Exception e){
log.error("Exception occur while query the balance:"+e);
forwardPage = "error";
request.getSession().setAttribute("startDate", fmrsForm.getStartDate());
request.setAttribute("endDate",stateForm.getEndDate());
request.setAttribute("st", stateForm.getSt());
if (stateForm.getProgNum() == 0 )
forwardPage = "state";
else
forwardPage = "sub-state";
return mapping.findForward(forwardPage);
}The second action class for Refreshing the same jsp page and getting the new data that just being entered in the database is
public class StateRefreshAction extends BaseAction {
public ActionForward process(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
return mapping.findForward("state");
}http://forum.java.sun.com/thread.jspa?threadID=5147813&messageID=9553925#9553925
-
How to get the short text values from F4 SEARCH HELP
Hi Friends,
My requirement is in Module -pool Screen Programming, i have Designed one field in a custom screen and provided a F4 search help to that field..
For eg the F4 help is displayed as below.
Value short text
1 A
2 B
3 C
4 D
5 E
6 F
7 G
When i select the first option (1) then value 1 appears in the field.
now i want the text relevant to the value 1 to appear by the side of the field.
Eg : 1 A (A should appear by the side of the value 1)
How do i achieve it?
Kindly help me.
Regards,
K.S.Kannan.
Edited by: kannan ks on Dec 8, 2008 4:05 PMhi
1) place a field adjacent to your value field on which F4 is operated
so now you will have 2 fields.
iam considering it as for ex: field1 & field2
2)
BOLD one is import in FM call
CLEAR: t_dynpfld_mapping,
e_dynpfld_mapping.
e_dynpfld_mapping-fldname = 'F0001'.
e_dynpfld_mapping-dyfldname = -
> name of field1 (for ex: your 1 value field name)
APPEND e_dynpfld_mapping TO t_dynpfld_mapping.
e_dynpfld_mapping-fldname = 'F0002'.
e_dynpfld_mapping-dyfldname = -
> name of field2 (for ex: your short text field name)
APPEND e_dynpfld_mapping TO t_dynpfld_mapping.
3))))))))
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield =
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = -
> name of field1 (for ex: your 1 value field name)
value_org = 'S'
TABLES
value_tab = itab
dynpfld_mapping = t_dynpfld_mapping
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3 -
How to call the EJB methods from servlet/jsp
Hello ,
i have write one ejb signOn having the method validateUser(username,password).i can able to call this function from client.java class.i want to know whether i can call this function from servlet.if yes then where to write that servlet and web.xml file.
At present i m using weblogic server 8.1and i create directory call c:\ejb\demo and put the ejb files(home ,remote,ejb class ,client.java) then i have created .jar file and put in application file.
Now i want to create a servlet for that i have to create a new directory and put the servlet,web.xml,weblogin-web.xml file and then create one .war file and put in application directory or do some thing extra.Please help me.
Thanks In Advance
[email protected]I think this might not be the most appropriate forum for your question. You might try a forum about ejb, or weblogic, or jndi.
-
Call the function in postgresql to jsp
again i'm a newbie of jsp.. i just wanna know how to call the function in postgresql to jsp.. how to code it?... thanks in advance
<%@ page contentType="text/html;charset=windows-1252" import="java.sql.*"%>
<%
try
Class.forName("org.postgresql.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/TESTDB","postgres","");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select catalog('catalog1') from catalog");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>
<%
while(rs.next()){
out.println(rs.getString(1)+"<br>");
%>
</body>
</html>
<%
}catch (Exception ex)
ex.printStackTrace();
%>
CREATE or Replace FUNCTION catalog(varchar) RETURNS catalog
AS $$ SELECT title FROM catalog WHERE catalogid = $1 $$
LANGUAGE SQL;
CREATE TABLE catalog
catalogid varchar(25) NOT NULL,
journal varchar(25),
publisher varchar(25),
edition varchar(25),
title varchar(45),
author varchar(25),
CONSTRAINT catalog_pkey PRIMARY KEY (catalogid)
WITH OIDS; -
How do I update a bean value from an AJAX call?
Hi all,
How do I update a bean value from an AJAX call? I suppose I could write a servlet to do it. However, this seems like a common problem, so I was wondering if there was some built in solution.
Thanks,
Grae
Edited by: caalip2 on Mar 30, 2010 1:07 PMcaalip2 wrote:
Raymond
Basically, I would user the following. The first choice for IE, the second for Firefox.
new ActiveXObject("Microsoft.XMLHTTP");
new XMLHttpRequest();
GraeDon't do this to yourself. If it were that easy there wouldn't be AJAX frameworks for JSF. Find one you like and use it. I've used a4j (part of RichFaces) successfully. -
How to refresh the input text value in backing bean
hi all
i want to know
how to refresh the input text value in backing bean?
i have tried this code ,but it doesnt work
public void click(ActionEvent actionEvent) {
tempConId.setValue("111111111111111");
AdfFacesContext.getCurrentInstance().addPartialTarget(tempConId);
sb know?
Edited by: Joe Zou on 2012-4-6 下午9:11The code looks good.
Here is a sample based on your use-case:
InputTextSample.jspx:
<af:form id="f1">
<af:panelFormLayout id="pfl1">
<f:facet name="footer">
<af:commandButton text="Ok" id="cb1" partialSubmit="true"
actionListener="#{InputTextSampleBean.onClick}"/>
</f:facet>
<af:inputText label="InputText" id="it1"
binding="#{InputTextSampleBean.myInputText}"/>
</af:panelFormLayout>
</af:form>
InputTextSampleBean.java:
import javax.faces.event.ActionEvent;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.context.AdfFacesContext;
public class InputTextSampleBean {
private RichInputText myInputText;
public InputTextSampleBean() {
public void setMyInputText(RichInputText myInputText) {
this.myInputText = myInputText;
public RichInputText getMyInputText() {
return myInputText;
public void onClick(ActionEvent actionEvent) {
this.myInputText.setValue("1234");
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTarget(this.myInputText);
} -
How to call the bean in jspdyn component?
Hi,
i created jspdyn component in that bean and bussiness logic class in NWDS.i created a method() in that businesslogic class.i called that method in bean class.i created both in same package,there is no error occur while creating the object of that class.but the bean class not recognize the business class method which i created. What is the cause? and also tell me how to call the bean in jsppage also.and also give me textfields,button and syntax of event handling in HTMLB,iam new to this area.so,give me one example step by step.Hi,
Please check on these links for a good start.
Java development methodologies (Part II)
Bean usage in JSPDynPage
jspDynPage portalapp.xml
Regards,
Harini S
Please avoid giving personal mail id(s). That may prevent others from getting the same information when needed.
Maybe you are looking for
-
Error installing Idm 8.1
Hi, I am getting the error "JDBC Driver Mismatch" when installing idm 8.1 . I am using jdk 1.6 and tomcat 6 with oracle 11g R2 as its repository. I used the ojdbc6.jar and placed in the lib folder as specified in the docs. Have anyone faced this issu
-
Just recently I bought a bunch of new albums on iTunes, and when I plugged my iPhone 4 in to sync the music over, it went through all 5 steps in the viewer box, but at the end it said, "The iPhone "andrea's iPhone" could not be synced. An unknown err
-
Hi Friends What should be the accounting entries in third party process during GR, Invoice booking and billing? Which TEK will be hit?
-
How to store, in an effective way, analyzer data into a relational database?
We want to store the "sweep traces" of a network analyzer in a relational database in a way that it saves as much as possible space without loosing resolution. The solutions were we thinking on are to separate the x-axes information from the y-axes i
-
we migrated our ebs system from linux to AIX last week. We are not able to print any barcodes in the reports. previous: 11.5.10.2, 10.2.0.2, linux5.5, western European, able to print barcodes present: 11.5.10.2, 10.2.0.2, AIX 6.1, UTF8, cannot print