Tags: bug, click, control, cvs, double, here1, members, method, oracle, programming, tools

Is this a bug?

On Programmer » Development Tools

11,526 words with 0 Comments; publish: Wed, 13 Feb 2008 10:19:00 GMT; (200187.50, « »)

hi members of the oracle forum.

i have some questions which i would like to ask here:

1) im using data control and cvs, when i double click the method button,it doesnt seem to auto generate the code in the backing page.but at the same time if i used it as a stand alone apps,it would work perfectly.can any one tell me what the problem is?

2) i tried to convert a list of string from select one choice into an Integer..but it does not work here is the error and code (the action for this code is after the createNewProduk button clicked):

ERROR

javax.faces.FacesException: #{backing_ecm_admin_ecmProdukBaru2.commandButton1_action}: javax.faces.el.EvaluationException: java.lang.NumberFormatException: For input string: "null" at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78) at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:244) at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230) at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)Caused by: javax.faces.el.EvaluationException: java.lang.NumberFormatException: For input string: "null" at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72) ... 29 moreCaused by: java.lang.NumberFormatException: For input string: "null" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:447) at java.lang.Integer.parseInt(Integer.java:497) at etanah.ecm.view.backing.EcmProdukBaru2.commandButton1_action(EcmProdukBaru2.java:204) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126) ... 30 more

CODE in the backing page

public String commandButton1_action() {

// Add event code here...

UnitOfWork uow = sessionFactory.acquireUnitOfWork();

BindingContainer bindings = getBindings();

OperationBinding operationBinding =

bindings.getOperationBinding("createNewProduk");

Object result = operationBinding.getResult();

//Object result = operationBinding.execute();

EcmProduk newProduk = new EcmProduk();

if (result != null)

newProduk = (EcmProduk)result;

if (!operationBinding.getErrors().isEmpty()) {

return null;

}

//TODO coding for the .java so it can store all the input values

CoreInputText text = getInputText1();

CoreInputText numberText = getInputText3();

HtmlInputFileUpload file = getInputFileUpload1();

if (file != null) {

Object oo = file.getValue();

String s = (String)text.getValue();

Double d = (Double)numberText.getValue();

UploadedFileDefaultMemoryImpl u =

(UploadedFileDefaultMemoryImpl)file.getValue();

byte[] gambar;

gambar = JSFUtils.processInputFile(u);

if (gambar != null) {

newProduk.setGambar(gambar);

newProduk.setFormatGambar(u.getContentType());

newProduk.setNamaGambar(u.getName());

}

}

//int kk =

//Integer.parseInt(String.valueOf(getSelectOneChoice1().getValue()));

Integer kk = Integer.parseInt(String.valueOf(getSelectOneChoice1().getValue()));

operationBinding =

bindings.getOperationBinding("findAllEcmKodKategoriProduk");

Vector allKodKategori = (Vector)operationBinding.getResult();

EcmKodKategoriProduk kodKategoriProduk = new EcmKodKategoriProduk();

kodKategoriProduk = (EcmKodKategoriProduk)allKodKategori.get(kk);

kodKategoriProduk =

(EcmKodKategoriProduk)uow.readObject(kodKategoriProduk);

EcmKategoriProduk kategoriProduk = new EcmKategoriProduk();

kategoriProduk = (EcmKategoriProduk)uow.registerObject(kategoriProduk);

kodKategoriProduk.addEcmKategoriProduk(kategoriProduk);

kategoriProduk.setEcmKodKategoriProduk(kodKategoriProduk);

kategoriProduk.setEcmProduk(newProduk);

uow.commit();

return null;

}

just in case u guys wanna see the design here is the code

<?xml version='1.0' encoding='windows-1252'?>

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"

xmlns:h="http://java.sun.com/jsf/html"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:af="http://xmlns.oracle.com/adf/faces"

xmlns:afh="http://xmlns.oracle.com/adf/faces/html"

xmlns:Jenia-base="http://www.jenia.org/jsf/chart"

xmlns:Jenia-dataTools="http://www.jenia.org/jsf/dataTools"

xmlns:Jenia-popup="http://www.jenia.org/jsf/popup"

xmlns:Jenia-template="http://www.jenia.org/jsf/template"

xmlns:t="http://myfaces.apache.org/extensions">

<jsp:output omit-xml-declaration="true" doctype-root-element="HTML"

doctype-system="http://www.w3.org/TR/html4/loose.dtd"

doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>

<jsp:directive.page contentType="text/html;charset=windows-1252"/>

<f:view>

<afh:html binding="#{backing_ecm_admin_ecmProdukBaru2.html1}" id="html1">

<afh:head title="Produk Baru"

binding="#{backing_ecm_admin_ecmProdukBaru2.head1}" id="head1">

<meta http-equiv="Content-Type"

content="text/html; charset=windows-1252"/>

<link type="text/css" rel="stylesheet" href="/app/links/?link=css/screen.css"/>

</afh:head>

<afh:body binding="#{backing_ecm_admin_ecmProdukBaru2.body1}" id="body1">

<af:messages binding="#{backing_ecm_admin_ecmProdukBaru2.messages1}"

id="messages1"/>

<h:form binding="#{backing_ecm_admin_ecmProdukBaru2.form1}" id="form1"

enctype="multipart/form-data">

<af:panelForm binding="#{backing_ecm_admin_ecmProdukBaru2.panelForm1}"

id="panelForm1">

<af:selectOneChoice value="#{bindings.EcmKodKategoriProdukkodKategori.inputValue}"

label="#{bindings.EcmKodKategoriProdukkodKategori.label}"

binding="#{backing_ecm_admin_ecmProdukBaru2.selectOneChoice1}"

id="selectOneChoice1">

<f:selectItems value="#{bindings.EcmKodKategoriProdukkodKategori.items}"

binding="#{backing_ecm_admin_ecmProdukBaru2.selectItems1}"

id="selectItems1"/>

</af:selectOneChoice>

<af:inputText value="#{bindings.namaProduk.inputValue}"

label="#{bindings.namaProduk.label}"

required="#{bindings.namaProduk.mandatory}"

columns="#{bindings.namaProduk.displayWidth}"

binding="#{backing_ecm_admin_ecmProdukBaru2.inputText1}"

id="inputText1">

<af:validator binding="#{bindings.namaProduk.validator}"/>

</af:inputText>

<af:inputText value="#{bindings.keterangan.inputValue}"

label="#{bindings.keterangan.label}"

required="#{bindings.keterangan.mandatory}"

columns="#{bindings.keterangan.displayWidth}"

binding="#{backing_ecm_admin_ecmProdukBaru2.inputText2}"

id="inputText2" rows="5">

<af:validator binding="#{bindings.keterangan.validator}"/>

</af:inputText>

<af:panelLabelAndMessage label="Label 1"

binding="#{backing_ecm_admin_ecmProdukBaru2.panelLabelAndMessage1}"

id="panelLabelAndMessage1">

<t:inputFileUpload binding="#{backing_ecm_admin_ecmProdukBaru2.inputFileUpload1}"

id="inputFileUpload1"/>

</af:panelLabelAndMessage>

<af:inputText value="#{bindings.hargaUmum.inputValue}"

label="#{bindings.hargaUmum.label}"

required="#{bindings.hargaUmum.mandatory}"

columns="#{bindings.hargaUmum.displayWidth}"

binding="#{backing_ecm_admin_ecmProdukBaru2.inputText3}"

id="inputText3">

<af:validator binding="#{bindings.hargaUmum.validator}"/>

<f:convertNumber groupingUsed="false"

pattern="#{bindings.hargaUmum.format}"/>

</af:inputText>

<af:commandButton actionListener="#{bindings.createNewProduk.execute}"

text="createNewProduk"

disabled="#{!bindings.createNewProduk.enabled}"

binding="#{backing_ecm_admin_ecmProdukBaru2.commandButton1}"

id="commandButton1"

action="#{backing_ecm_admin_ecmProdukBaru2.commandButton1_action}"/>

</af:panelForm>

</h:form>

</afh:body>

</afh:html>

</f:view>

<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_ecm_admin_ecmProdukBaru2-->

</jsp:root>

3) is it true that if im using data control for my application it wont run at all?

p/s: im using Jdev SE 10.1.3.0.4.3673

BuildJDEVADF_10.3_NT_060125.0900.3673

thnx for helping and giving hands to a newbie like me.i pretty much appreciates it.

All Comments

Leave a comment...

  • 0 Comments