Why iam unable to get the valu from combobox

when i run this code
everytime iam getting blank alert
y iam unable to get the selected item from combo box
thank u
<%@ page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%><%@page import="java.sql.*,java.util.*,java.text.*,java.util.ArrayList, java.util.List,org.joda.time.DateTimeConstants,org.joda.time.LocalDate,
org.joda.time.Weeks"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
  <HEAD>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <TITLE>Reading Data From Text Fields</TITLE>
  </HEAD><BODY onload=Datevalue()>
     <form name="form1" action ="" method="post" onSubmit="update();">
    <img src="nendrasys_logo.gif" align="right"></img>
  <b><font color="669900"><h4 align="left">UserName:</font> 
<jsp:useBean id="user" scope="session" class="nendrasys.User" />
<jsp:getProperty name="user" property= "name"/>
&nbsp&nbsp&nbsp&nbsp
<b><font color="90be00"><h4 align="left">Designation:</font>
  <jsp:getProperty name="user" property= "designation"/>
  <br><font color="669900"><h4 align="right">Project:</font>
    <select name="Projects">
     <option>Project:1</option>
     <option>Project:2</option>
     <option>Project:3</option>
     <option>Project:4</option>
     <option>Project:5</option>
</select>
<%! String s; %>
<% DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
        Date date = new Date();
        //out.println(dateFormat.format(date));
            s=  dateFormat.format(date);
%>
<select name="Dates" sizes=1 id="dates" onchange="Datevalue(this.value)">
<script type="text/javascript">
<!--//
var begDate = new Date("10/01/2008");
var endDate = new Date();
var previousDate =new Date();
var presentDate =new Date("<%=s %>");
endDate.setDate(presentDate.getDate()+14);
begDate.setDate(begDate.getDate()+(6-begDate.getDay()));
while (begDate <= endDate) {
var datestring=[begDate.getDate(),(begDate.getMonth()+1),begDate.getFullYear()].join('/');
//  var datestring=[begDate.getDate().padZero(2),(begDate.getMonth()+1).padZero(2),begDate.getFullYear()].join('/');
if(previousDate < presentDate && presentDate <= begDate )
    document.writeln('<option selected>'+(datestring)+'</option>')}
else   
document.writeln('<option>'+(datestring)+'</option>')};
     previousDate.setDate(begDate.getDate());
    previousDate.setMonth(begDate.getMonth());
     previousDate.setYear(begDate.getYear());
    begDate.setDate(begDate.getDate()+7);
document.writeln('</select>');
//-->
</script>
<br><br>
<TABLE BORDER="2" BORDERCOLOR="#336699" CELLPADDING="2" CELLSPACING="2" WIDTH="100%">
<TR>
<TD>&nbsp&nbsp&nbsp</TD>
<TD bgcolor="669900"><label  id="sun"></label></TD>
<TD bgcolor="90be00"><label for="mon" id="Mon">Mon</label></TD>
<TD bgcolor="669900"><label for="tue" id="tue">Tue</label></TD>
<TD bgcolor="90be00"><label for="wed" id="wed">Wed</label></TD>
<TD bgcolor="669900"><label for="thu" id="thu">Thu</label></TD>
<TD bgcolor="90be00"><label for="fri" id="fri">Fri</label></TD>
<TD bgcolor="669900"><label for="sat" id="sat">Sat</label></TD>
<TD bgcolor="90be00"><label for="tot" id="tot">Total</label></TD>
</TR>
<tr>
<th>Project Work</th>
<td bgcolor="669900"><input type="text" name="c11" size="2" value="7" onBlur="javascript:document.frm.c12.value = document.frm.c11.value"></td>
<td bgcolor="90be00"><input type="text" name="c12" size="2" value="3"></td>
<td bgcolor="669900"><input type="text" name="c13" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c14" size="2"></td>
<td bgcolor="669900"><input type="text" name="c15" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c16" size="2"></td>
<td bgcolor="669900"><input type="text" name="c17" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c18" size="4"></td>
</tr>
<tr>
<th>Internal N/C</th>
<td bgcolor="669900"><input type="text" name="c21" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c22" size="2"></td>
<td bgcolor="669900"><input type="text" name="c23" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c24" size="2"></td>
<td bgcolor="669900"><input type="text" name="c25" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c26" size="2"></td>
<td bgcolor="669900"><input type="text" name="c27" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c28" size="4"></td>
</tr>
<tr>
<th>Public Holidays</th>
<td bgcolor="669900"><input type="text" name="c31" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c32" size="2"></td>
<td bgcolor="669900"><input type="text" name="c33" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c34" size="2"></td>
<td bgcolor="669900"><input type="text" name="c35" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c36" size="2" ></td>
<td bgcolor="669900"><input type="text" name="c37" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c38" size="4"></td>
</tr>
<tr>
<th>Holidays Taken</th>
<td bgcolor="669900"><input type="text" name="c41" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c42" size="2"></td>
<td bgcolor="669900"><input type="text" name="c43" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c44" size="2"></td>
<td bgcolor="669900"><input type="text" name="c45" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c46" size="2"></td>
<td bgcolor="669900"><input type="text" name="c47" size="2"></td>
<td bgcolor="90be00"><input type="text" name="c48" size="4"></td>
</tr>
</TABLE>
<br>
<center><input type="submit"  value="Submit" /> </center>
<%
String username   = request.getParameter("userid");
String pwd  = request.getParameter("pwd");
String connectionURL = "jdbc:mysql://localhost:3306/timestamp";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
String sql=null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root","nendrasys");
statement = connection.createStatement();
//rs=statement.executeQuery(sql); %>
</form>
<SCRIPT language='Javascript'>
function update()
    alert("ciaoooooo");
    <%
        try
            String value=request.getParameter("c11");
            String value1=request.getParameter("c12");
         //   if(value!=null)
          //  System.out.println(value);             
           // System.out.println(value1);
        catch(NullPointerException n)
    %>
</script>
<SCRIPT language='Javascript'>
function Datevalue(date)
       //  document.getElementById("dates").innerHTML=document.getElementById("sun").value;
  alert(date);
         //  alert( document.getElementById("dates"))
            <% System.out.println("bye");%>
</SCRIPT>
</BODY>
</HTML>

You mixed Java and Javascript in the expectation that they runs simultaneously.
You are Wrong.
You need to distinguish between the server side languages and client side languages. Java/JSP runs at the server side and produces a HTML page with other client side stuff in it like CSS and Javascript. When the HTML page is finished, it will be sent to the client and then Java/JSP stops. Once the HTML page is arrived at the client, there is no one line Java code in it, only its output/result. Do a View Source in your favourite web browser to see it. Only from that moment on, Javascript runs and/or can be invoked.
Whenever you want to use Java variables in Javascript, you need to print them out as a Javascript variable. Whenever you want to use Javascript variables in Java, you need to invoke a request to the server and pass them as parameters. The request can be either synchronous (a link or a form submit) or asynchronous (ajaxical).

Similar Messages

  • Unable to get the values from PAYLOAD

    Hi,
    i'm unable to get the values of payload. When i use
    currentTask = client.getTaskQueryService().getTaskDetailsById(workflowContext, taskID);
    Element payload = (Element)currentTask.getPayloadAsElement();
    node = (Element)payload.getFirstChild();
    System.out.println(node.getElementsByTagName("documentName").item(0).getNodeValue());
    I get null but i instantiate the bpel process with a value and i have
    - <payload>
    - <ns1:DocumentReviewProcessRequest xmlns:ns1="http://xmlns.oracle.com/bpel/Review">
    <ns1:documentTitle>vbvnmbvn</ns1:documentTitle>
    <ns1:documentName>bvnbvnvn</ns1:documentName>
    <ns1:URI>http://www.first.pt</ns1:URI>
    <ns1:assignees>gestdoc</ns1:assignees>
    <ns1:groups />
    </ns1:DocumentReviewProcessRequest>
    </payload>
    if i use System.out.println(node.getElementsByTagName("HELLO").item(0).getNodeValue());
    I get a normal erro 'cause this variable don't exist...
    Can someone please help me?
    Thanks!!

    I think the problem is UME related. I had the same problem once. Try using a system user for searching, instead of the logged on user.
    Like this:
    com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getUser("cmadmin_service");
    Please reward the points if this helps.

  • Unable to get the value from the textfield in valueChangeEvent

    Hi,
    I have created one custom textField by extending the CoreInputText. Now i have attched default ValueChangeListener to it. I am using this textField in my application.
    Now i type some thing and do a focus lost, the value change listener get called. i want to validate the value entered. In that listener method if i take the getSource() from ValueChnageEvent object and do a getValue() I am getting the entered value.
    My problem is that if i do a getValue() of the textField i am not gettting the value entered.
    How can i get the entered value from the textfield.? Is there any method to notify to do this?
    Thanks in advance.

    Hi,
    I tried to the value from coreInputText also. If i check the getValue method of the component, i am getting the last updated value. I have debug the FlowPhaseListsner also. And i found that this listener is calling before the updateModel phase. Due to that i am not getting the value from the Field.

  • Unable to get the values from ISearchResultList

    Hi,
    I am working on KM Indexmanagemnt API for searching with TREX, to build a search similar to msn or google.
    I am following the example of Thilo Brandt, and after building the query, I am unable to retrieve the result from ISearchResultList, the results size its displaying is zero. But session.getTotalNumberResultKeys() is retrieving a value 20.
    Here is the code I am using, please tell me where I am doing wrong.
    public class SearchComponetOne extends AbstractPortalComponent {
         public void doContent(IPortalComponentRequest request,     IPortalComponentResponse response) {
      com.sap.security.api.IUser nwUser =
                   UMFactory.getAuthenticator().getLoggedInUser();
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try {
          user = WPUMFactory.getUserFactory().getEP5User(nwUser);
         } catch (UserManagementException e) {
                   response.write(e.getMessage());
       response.write("<html><head><title>Search</title></head><body>");
      ResourceContext c = new ResourceContext(user);
      try {
        IIndexService indexService = (IIndexService) ResourceFactory
                             .getInstance()
                             .getServiceFactory()
                             .getService(
                             IServiceTypesConst.INDEX_SERVICE);
       SearchQueryListBuilder sqb = new SearchQueryListBuilder();
       sqb.setSearchTerm("sap");
      IQueryEntryList qel = sqb.buildSearchQueryList();
      // get an instance of federated search
    IFederatedSearch federatedSearch =
                   (IFederatedSearch) indexService.getObjectInstance(
              IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
         List indexList = new ArrayList();
         String index = null;
         if (index != null && index.length() > 0) {
              // take a specified index from index= parameter
              indexList.add(indexService.getIndex(index));
         } else {
              // take all available indexes
              indexList = indexService.getActiveIndexes();
         // it is recommended to use a search session object
         // for searching execution
         ISearchSession session = null;
         if (session == null)
         session = federatedSearch.searchWithSession(qel, indexList, c);
    response.write("Inside doContent session.getNumberResultKeys() => " + session.getNumberResultKeys()); // output as 20
         this.renderResultHeader(response, session, indexList);
         // get all results from the search session
    ISearchResultList results =     session.getSearchResults(1, session.getTotalNumberResultKeys());
    response.write(" from session => " + results.size() + " and size is : " + results.toString());  // I am getting the results.size() as zero
    Thanks

    I think the problem is UME related. I had the same problem once. Try using a system user for searching, instead of the logged on user.
    Like this:
    com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getUser("cmadmin_service");
    Please reward the points if this helps.

  • Unable to get the value from the jsp page.

    Hi,
    I have developed a JSP, having two split fields seperated by some buttons..The sample code for the same is like this..
    (Only the required portion is included)
    <script>
    function reloadPageOK() {
    document.product.method="post"
    document.product.action="./TheSamePage.jsp?status=OK"
    document.product.submit()
    function moveValue(from,to) {
    if(from.selectedIndex>=0) {
    var text=from[from.selectedIndex].text
    var length= to.length
    to[length]=new Option(text,from.value,false,false)
    from.remove(from.selectedIndex)
    function moveAll(from,to) {
    if(from.length>0) {
    var menutext="";
    var i;
    var len=from.length
    for(i=0;i<len;i++) { 
    from.selectedIndex=0
    menutext=from[0].text
    var length= to.length
    to[length]=new Option(menutext,from.value,false,false)
    from.remove(from.selectedIndex)
    </script>
    <table width="100%" border="0" cellspacing="0" >
    <tr class="contactDetail">
    <td width="10%" class="table_grid1" rowspan="4">
    <div class="contactDetail">
    <select name="lstProviderLeft" size="7" style="width:111">
    <option> PDP</option>
    <option> Net</option>
    <option> Par</option>
    <option> Non-Par</option>
    </select>
    </div>
    </td>
    <td width="20%" bgcolor="#FFFFFF" class="contactDetail">
    <input type="button" value=" > " name="btnLtrProvider" class="button" onclick="moveValue(lstProviderLeft,lstProviderRight)">
    </td>
              <td width="10%" bgcolor="#FFFFFF" rowspan="4" class="contactDetail"> <font face="Arial, Verdana, Helvetica, sans-serif" size="2" >
              <select name="lstProviderRight" size="7" style="width:111"></select>
              </font></td>
    <tr>
    <td width="8%" class="contactDetail">
    <input type="button" value=" >> " name="btnLtrAllProvider" class="button" onclick="moveAll(lstProviderLeft,lstProviderRight)" >
    </td>
    </tr>
    <tr>
    <td width="8%" class="contactDetail">
    <input type="button" name="btnRtlProvider" value=" < " class="button" onclick="moveValue(lstProviderRight,lstProviderLeft)" >
    </td>
    </tr>
    <tr>
    <td width="8%" class="contactDetail" height="22">
    <input type="button" name="btnRtlAllProvider" value=" << " class="button" onclick="moveAll(lstProviderRight,lstProviderLeft)" >
    </td>
    </tr>
    </table>
    <p align = "center"> <input type="button" value=" OK " onclick="reloadPageOK()">
    The page is working fine. That is we can move the values in the left field to right as single or group.After submitting I need to get the values in the left & right fields respectively.
    I have used the method
    request.getParameterValues("lstProviderLeft");
    and pointed this to an array of strings,but it returns 'null' .
    How can I solve the above problem....Post your comments on this issue
    Thanking u

    probably the request.getParmeterValues will not work in this case as the name of the 2 select boxes are different....
    You can do this utility by using Javascript....concantinate the values of the 2 select boxes and put the concantinated strings (with a delimiter) in two hidden fields and capture the same fields in the target JSP/Servlet.
    I have modified ur code...have a look...
    --------------------Start-----------------
    <html>
    <head></head>
    <title></title>
    <body>
    <script language="Javascript">
    function reloadPageOK()
    document.product.method="post" ;
    document.product.action="./TheSamePage.jsp?status=OK" ;
    document.product.submit();
    function moveValue(from,to)
         if(from.selectedIndex>=0)
              var text=from[from.selectedIndex].text;
              var length= to.length ;
              to[length]=new Option(text,from.value,false,false);
              from.remove(from.selectedIndex);
    function moveAll(from,to)
         if(from.length>0)
              var menutext="";
              var i;
              var len=from.length;
              for(i=0;i<len;i++)
                   from.selectedIndex=0;
                   menutext=from[0].text ;
                   var length= to.length;
                   to[length]=new Option(menutext,from.value,false,false) ;
                   from.remove(from.selectedIndex);
    function fnSubmitPage(from,to)
         var strfromSelBox = "";
         var strtoSelBox = "";
         if(from.length>0)
              var len=from.length;
              for(var i=0;i<len;i++)
                   strfromSelBox=strfromSelBox+":"+from.text ;               
         if(to.length>0)
              var len=to.length;
              for(var i=0;i<len;i++)
                   strtoSelBox=strfromSelBox+":"+to[i].text ;               
         document.product.hdFromValue.value=strfromSelBox;
         document.product.hdFromValue.value=strtoSelBox;
         document.product.method="post" ;
         document.product.action="" ;//Name of the JSP or servlet wherever u want to direct to....
         document.product.submit();
    </script>
    <form name="product">
    <input type="hidden" name="hdFromValue">
    <input type="hidden" name="hdToValue">
    <table width="100%" border="0" cellspacing="0" >
    <tr class="contactDetail">
         <td width="10%" class="table_grid1" rowspan="4">
              <div class="contactDetail">
                   <select name="lstProviderLeft" size="7" style="width:111">
                        <option> PDP</option>
                        <option> Net</option>
                        <option> Par</option>
                        <option> Non-Par</option>
                   </select>
              </div>
         </td>
         <td width="20%" bgcolor="#FFFFFF" class="contactDetail">
              <input type="button" value=" > " name="btnLtrProvider" class="button" onclick="moveValue(lstProviderLeft,lstProviderRight)">
         </td>
         <td width="10%" bgcolor="#FFFFFF" rowspan="4" class="contactDetail">
              <font face="Arial, Verdana, Helvetica, sans-serif" size="2" >
                   <select name="lstProviderRight" size="7" style="width:111">
                   </select>
              </font>
         </td>
    <tr>
         <td width="8%" class="contactDetail">
              <input type="button" value=" >> " name="btnLtrAllProvider" class="button" onclick="moveAll(lstProviderLeft,lstProviderRight)" >
         </td>
    </tr>
    <tr>
         <td width="8%" class="contactDetail">
              <input type="button" name="btnRtlProvider" value=" < " class="button" onclick="moveValue(lstProviderRight,lstProviderLeft)" >
         </td>
    </tr>
    <tr>
         <td width="8%" class="contactDetail" height="22">
              <input type="button" name="btnRtlAllProvider" value=" << " class="button" onclick="moveAll(lstProviderRight,lstProviderLeft)" >
         </td>
    </tr>
    </table>
    <input type="button" value=" OK " onclick="reloadPageOK()">
    <input type="button" value=" Submit " onclick="fnSubmitPage(lstProviderRight,lstProviderLeft)">
    </form>
    </body>
    </html>
    --------------------Finish---------------
    Hope this helps...
    Thanks

  • Unable to get the media from the Endeca Experience manager version 11.0.0

    Hi.,
    Iam unable to get the media from the Endeca Experience Manager for my endeca app 'CRS'.
    I have created the endeca app named 'CRS' using the reference app discover-data-catalog-integration and successfully initialized and indexed.Iam able to see the Indexed data in my endeca_jspref and the configurations in my Experience Manager.
    I want to import the media from my experience manager(this is my actual requirement) and for this iam executing the get_media.bat cmd from my application's control folder,the cmd was executing successfully without any errors, but the media folder was not populating with any images that i can see in the Experience manager .Please do the needful to resolve this issue.
    ThankYou!!!
    C:\>cd Endeca\apps\CRS\control
    C:\Endeca\apps\CRS\control>get_media.bat
    [07.04.14 11:48:08] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
    [07.04.14 11:48:09] INFO: Updating provisioning for component 'DailyReportGenerator'.
    [07.04.14 11:48:09] INFO: Updating definition for component 'DailyReportGenerator'.
    [07.04.14 11:48:10] INFO: Definition updated.
    [07.04.14 11:48:10] INFO: Exporting resource 'http://localhost:8006/ifcr/sites/CRS/media' to 'C:\Endeca\apps\CRS\control\..\config\media'
    [07.04.14 11:48:11] INFO: Finished exporting resource.

    What media are you trying to import?  There won't be any media returned with get_media unless you but media in to begin with using the set_media cmd.  However, it's preferable to use the media MDEX rather than storing media in the ECR.

  • Unable to get the response from dynamic partnerlink

    Hi
    I used dynamic partnerlink, in this i am able to invoke the services dynamcially but i am unable to get the response from the services which i had invoked dynamically. In my dynamic partnerlink wsdl i had included callback binding and call back service in the wsdl you can see them below
    <binding name="LoanServiceCallbackBinding" type="tns:LoanServiceCallback">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="onResult">
    <soap:operation soapAction="onResult" style="document"/>
    <input>
    <soap:header message="tns:RelatesToHeader" part="RelatesTo" use="literal" required="false"/>
    <soap:body use="literal"/>
    </input>
    </operation>
    </binding>
    <service name="LoanServiceCallbackService">
    <port name="LoanServiceCallbackPort" binding="tns:LoanServiceCallbackBinding">
    <soap:address location="http://openuri.org"/>
    </port>
    </service>
    please help me on this
    thanks
    Srikanth

    Hi, thanks for the input
    Actually My partnerLink had two messageTypes one for Input message request and the other for the Output message request and for the input message i had used the operation as initiate also for the output messsage type operation as result.For both of them binding is defined.
    With these am passing the values from myBPELl to the service which am nvoking dynamically but unable to capture the response the variables are local to myBPEL.

  • Siebel 8.0.0.12 Fix Pack; Unable to get the seed from binary file.

    Hello Folks,
    Can anyone throw some light into what action is required on my scenario.
    I have applied Fix Pack Siebel 8.0.0.12 on top of 8.0.0.11 SBA. After it is appled, I am facing a documented issue within the Release Notes for the 8.0.0.12 Fix Pack
    The issue is "UNABLE TO LAUNCH URL AFTER APPLYING SIEBEL 8.0.0.12". I tried the steps given with the MR document, however, I am still having this issue.
    I am also not sure what is expected at the step of; Run the following command: seedgeneratorutil myseed.dat abcdef .
    It's asking me for a value to enter for seed at command prompt. "Enter the seed":
    what I should give here. As an assumption values,I gave SADMIN and tried to launch but still shows up the same error
    Please Assit
    Steps Details from Release Notes:
    UNABLE TO LAUNCH URL AFTER APPLYING SIEBEL 8.0.0.12
    Component: Server Infrastructure
    Subcomponent: SWSE
    Product Version: Siebel 8.0.0.12
    Base Bug ID: 11938270
    **Users are unable to launch the URL after applying the Siebel 8.0.0.12 Fix Pack.
    **Use the following workaround to address this issue:
    Navigate to the eappweb/bin directory from the command line on the SWSE installation.
    Run the following command:
    seedgeneratorutil myseed.dat abcdef
    NOTE: In the example, myseed.dat is a filename. You can give any file name you wish.
    The myseed.dat file is generated in the eappweb/bin directory.
    Edit eapps.cfg to include the following parameters under the SWE section:
    seedfile = < complete path for myseed.dat >
    Bounce the web server.
    (For Linux only) Copy libmod_swe.so from the eappweb/bin folder to the web/ohs/modules folder
    Thanks
    Kumar

    Wilson,
    Thanks for your reply.I have repeated the steps and regenerated the error messages.
    Browser
    Message:
    An error occurred while trying to process your request. This error indicates a problem with the configuration of this server and should be reported to the webmaster (along with any errors listed below). We apologize for the inconvenience
    Initialization error:
    Unable to get the seed from binary file.
    Log
    2021 2011-09-20 23:23:01 0000-00-00 00:00:00 +0530 00000000 001 003f 0001 09 ss110920_7068 7068 7852 E:\sba80\SWEApp\log\ss110920_7068.log 8.0.0.12 [20444] ENU
    ProcessPluginState     ProcessPluginStateError     1     000000024e781b9c:0     2011-09-20 23:23:01     7852: [SWSE] Unable to get the seed from binary file.
    Eapps.cfg
    [swe]
    Language = enu
    Log = errors
    LogDirectory = $(SWSERoot)\log
    ClientRootDir = $(SWSERoot)
    SessionMonitor = False
    AllowStats = true
    LogSegmentSize = 0
    LogMaxSegments = 0
    DisableNagle = False
    seedfile = E:\sba80\SWEApp\BIN\80012seed.dat
    Thanks
    Kumar

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get the values from a html form embedded in a swing container

    Hi all,
    I am developing an application in which i have to read a html file and display it in a swing container.That task i made it with the help of a tool.But now i want to get the values from that page.ie when the submit button is clicked all the values of that form should be retrived by a servlet/standalone application.I don't know how to proceed further.Any help in this regard will be very greatful
    Thanks in advance,
    Prakash

    By parsing the HTML.

  • Getting the Values from a Tiled View

    Hi,
    I have a TiledView and I have checkbox in the tiled view. I am trying
    to get the values of the checked boxes.
    I have coded like this.
    Object[] links = getRSystemLinks().getCbSystemUrl().getValues();
    if I see the links.length i get only one. In html If I see the code
    it appends the TileIndex in brackets. If I replace the TileIndex with
    0 in all the fields in endCbSystemUrl method I get the correct values.
    In the TiledView beginDisplay() method my code is like this.
    if (getPrimaryModel() == null) throw new ModelControlException
    ("Primary model is null");
    super.beginDisplay();
    resetTileIndex();
    pgCustomizeLinksViewBean parentBean = (pgCustomizeLinksViewBean)
    getParent();
    ((DatasetModel) getDefaultModel()).setSize
    (parentBean.SystemChoicesValue.size());
    Any Suggestions on this.
    Thanks
    Namburi

    Namburi--
    Remember, the getValues() method does not return the values from a column in
    a TiledView. It is strictly for use by fields that can have multiple
    values, like multi-select list boxes.
    DO NOT remove the indexing feature from the field names, especially in the
    case of checkboxes, because checkboxes aren't submitted back to the server
    unless they are checked. By overriding the automatic checkbox tracking
    feature JATO provides, you won't be able to tell which checkboxes were
    actually checked by row--you'll simply get back a list the same size as the
    number of checkboxes that were checked, without any placeholders for the
    ones that weren't checked.
    Instead, on submit, you simply need to move through the tiledView and check
    the value of checkbox on each row:
    tiledView.beforeFirst();
    while (tiledView.next())
    if (getDisplayFieldBooleanValue("myCheckBox"))
    You can use the same construct to build up an array or list:
    List checkedList=new LinkedList();
    tiledView.beforeFirst();
    while (tiledView.next())
    if (getDisplayFieldBooleanValue("myCheckBox"))
    checkedList.add(new Boolean(true))
    else
    checkedList.add(new Boolean(false))
    Todd
    Todd Fast
    Senior Engineer
    Sun Microsystems, Inc.
    todd.fast@s...
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, October 17, 2001 3:49 PM
    Subject: [iPlanet-JATO] Getting the Values from a Tiled View
    Hi,
    I have a TiledView and I have checkbox in the tiled view. I am trying
    to get the values of the checked boxes.
    I have coded like this.
    Object[] links = getRSystemLinks().getCbSystemUrl().getValues();
    if I see the links.length i get only one. In html If I see the code
    it appends the TileIndex in brackets. If I replace the TileIndex with
    0 in all the fields in endCbSystemUrl method I get the correct values.
    In the TiledView beginDisplay() method my code is like this.
    if (getPrimaryModel() == null) throw new ModelControlException
    ("Primary model is null");
    super.beginDisplay();
    resetTileIndex();
    pgCustomizeLinksViewBean parentBean = (pgCustomizeLinksViewBean)
    getParent();
    ((DatasetModel) getDefaultModel()).setSize
    (parentBean.SystemChoicesValue.size());
    Any Suggestions on this.
    Thanks
    Namburi
    [email protected]

  • NullPointerException - Cannot get the value from variable f_cashGiven

    In SubCheckout.java (a POS), what I want is when Payment button (f_cashPayment) is pressed, the action "Cash" is performed, get the value from Cash Given (f_cashGiven), do the subtraction and post the value as Cash Return (f_cashReturn). The code is filled in actionPerformed. But I cannot get the value by using f_cashGiven.getValue() from VNumber class. It returns NULL. This should be quite straight forward, but I do not know what is wrong. Please help!
    Enclosed please find the source code of SubCheckout.java and VNumber.java
    This is the code of SubCheckout.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.pos;
    import java.awt.*;
    import java.awt.event.*;
    import java.math.BigDecimal;
    import javax.swing.border.*;
    import org.compiere.grid.ed.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     POS Checkout Sub Panel
    *  @author Jorg Janke
    *  @version $Id: SubCheckout.java,v 1.3 2005/03/11 20:28:22 jjanke Exp $
    public class SubCheckout extends PosSubPanel implements ActionListener
          *      Constructor
          *     @param posPanel POS Panel
         public SubCheckout (PosPanel posPanel)
              super (posPanel);
         }     //     PosSubCheckout
         private CButton f_register = null;
         private CButton f_summary = null;
         private CButton f_process = null;
         private CButton f_print = null;
         private CLabel f_lcreditCardNumber = null;
         private CTextField f_creditCardNumber = null;
         private CLabel f_lcreditCardExp = null;
         private CTextField f_creditCardExp = null;
         private CLabel f_lcreditCardVV = null;
         private CTextField f_creditCardVV = null;
         private CButton f_cashPayment = null;
         private CLabel f_lcashGiven = null;
         private VNumber f_cashGiven = null;
         private CLabel f_lcashReturn = null;
         private VNumber f_cashReturn = null;
         private CButton f_creditPayment = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(SubCheckout.class);
          *      Initialize
         public void init()
              //     Title
              TitledBorder border = new TitledBorder(Msg.getMsg(Env.getCtx(), "Checkout"));
              setBorder(border);
              //     Content
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              gbc.insets = INSETS2;
              //     --     0
              gbc.gridx = 0;
              f_register = createButtonAction("Register", null);
              gbc.gridy = 0;
              add (f_register, gbc);
              f_summary = createButtonAction("Summary", null);
              gbc.gridy = 1;
              add (f_summary, gbc);
              f_process = createButtonAction("Process", null);
              gbc.gridy = 2;
              add (f_process, gbc);
              f_print = createButtonAction("Print", null);
              gbc.gridy = 3;
              add (f_print, gbc);
              //     --     1 -- Cash
              gbc.gridx = 1;
              gbc.gridheight = 2;
              gbc.fill = GridBagConstraints.BOTH;
              gbc.weightx = .1;
              CPanel cash = new CPanel(new GridBagLayout());
              cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash")));
              gbc.gridy = 0;
              add (cash, gbc);
              GridBagConstraints gbc0 = new GridBagConstraints();
              gbc0.insets = INSETS2;
              gbc0.anchor = GridBagConstraints.WEST;
              f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven"));
              cash.add (f_lcashGiven, gbc0);
              f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount,
                   Msg.translate(Env.getCtx(), "CashGiven"));
              f_cashGiven.addActionListener(this);
              f_cashGiven.setColumns(10, 25);
              cash.add (f_cashGiven, gbc0);
              f_cashGiven.setValue(Env.ZERO);
              f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn"));
              cash.add (f_lcashReturn, gbc0);
              f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount,
                   "CashReturn");
              f_cashReturn.setColumns(10, 25);
              cash.add (f_cashReturn, gbc0);
              f_cashReturn.setValue(Env.ZERO);
              f_cashPayment = createButtonAction("Payment", null);
              f_cashPayment.setActionCommand("Cash");
              gbc0.anchor = GridBagConstraints.EAST;
              gbc0.weightx = 0.1;
              cash.add (f_cashPayment, gbc0);
              //     --     1 -- Creditcard
              CPanel creditcard = new CPanel(new GridBagLayout());
              creditcard.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "CreditCardType")));
              gbc.gridy = 2;
              add (creditcard, gbc);
              GridBagConstraints gbc1 = new GridBagConstraints();
              gbc1.insets = INSETS2;
              gbc1.anchor = GridBagConstraints.WEST;
              gbc1.gridx = 0;
              gbc1.gridy = 0;
              f_lcreditCardNumber = new CLabel(Msg.translate(Env.getCtx(), "CreditCardNumber"));
              creditcard.add (f_lcreditCardNumber, gbc1);
              gbc1.gridy = 1;
              f_creditCardNumber = new CTextField(18);
              creditcard.add (f_creditCardNumber, gbc1);
              gbc1.gridx = 1;
              gbc1.gridy = 0;
              f_lcreditCardExp = new CLabel(Msg.translate(Env.getCtx(),"CreditCardExp"));
              creditcard.add (f_lcreditCardExp, gbc1);
              gbc1.gridy = 1;
              f_creditCardExp = new CTextField(5);
              creditcard.add (f_creditCardExp, gbc1);
              gbc1.gridx = 2;
              gbc1.gridy = 0;
              f_lcreditCardVV = new CLabel(Msg.translate(Env.getCtx(), "CreditCardVV"));
              creditcard.add (f_lcreditCardVV, gbc1);
              gbc1.gridy = 1;
              f_creditCardVV = new CTextField(5);
              creditcard.add (f_creditCardVV, gbc1);
              gbc1.gridx = 3;
              gbc1.gridy = 0;
              gbc1.gridheight = 2;
              f_creditPayment = createButtonAction("Payment", null);
              f_creditPayment.setActionCommand("CreditCard");
              gbc1.anchor = GridBagConstraints.EAST;
              gbc1.weightx = 0.1;
              creditcard.add (f_creditPayment, gbc1);
         }     //     init
          *      Get Panel Position
         public GridBagConstraints getGridBagConstraints()
              GridBagConstraints gbc = super.getGridBagConstraints();
              gbc.gridx = 0;
              gbc.gridy = 3;
              return gbc;
         }     //     getGridBagConstraints
          *      Dispose - Free Resources
         public void dispose()
              super.dispose();
         }     //     dispose
          *      Action Listener
          *     @param e event
         public void actionPerformed (ActionEvent e)
              String action = e.getActionCommand();
              if (action == null || action.length() == 0)
                   return;
              log.info( "PosSubCheckout - actionPerformed: " + action);
              if (e.getSource() == f_cashGiven) {
                   f_cashGiven.setValue(f_cashGiven.getValue());
                   System.out.println("f_cashGiven"+f_cashGiven.getDisplay());
              //     Register
              //     Summary
              //     Print
              if (action.equals("Cash")) {
                   BigDecimal CashGiven, GrandTotal, CashReturn;
                   System.out.println("Cash given is "+f_cashGiven.getDisplay());
                   CashGiven = (BigDecimal)f_cashGiven.getValue();
                   GrandTotal = (BigDecimal)p_posPanel.f_curLine.getOrder().getGrandTotal();
                   CashReturn = CashGiven.subtract(GrandTotal);
                   f_cashReturn.setValue(CashReturn);
              //     Cash (Payment)
              //     CreditCard (Payment)
         }     //     actionPerformed
    }     //     PosSubCheckoutThis is the code of VNumber.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.grid.ed;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import java.math.*;
    import java.text.*;
    import java.util.logging.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import org.compiere.apps.*;
    import org.compiere.model.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     Number Control
    *      @author      Jorg Janke
    *      @version      $Id: VNumber.java,v 1.41 2005/09/03 01:57:16 jjanke Exp $
    public final class VNumber extends JComponent
         implements VEditor, ActionListener, KeyListener, FocusListener
         /**     Number of Columns (12)          */
         public final static int SIZE = 12;
          *  IDE Bean Constructor
         public VNumber()
              this("Number", false, false, true, DisplayType.Number, "Number");
         }   //  VNumber
          *     Create right aligned Number field.
          *     no popup, if WindowNo == 0 (for IDs)
          *  @param columnName column name
          *  @param mandatory mandatory
          *  @param isReadOnly read only
          *  @param isUpdateable updateable
          *  @param displayType display type
          *  @param title title
         public VNumber(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable,
              int displayType, String title)
              super();
              super.setName(columnName);
              m_columnName = columnName;
              m_title = title;
              setDisplayType(displayType);
              LookAndFeel.installBorder(this, "TextField.border");
              this.setLayout(new BorderLayout());
    //          this.setPreferredSize(m_text.getPreferredSize());          //     causes r/o to be the same length
    //          int height = m_text.getPreferredSize().height;
    //          setMinimumSize(new Dimension (30,height));
              //     ***     Text     ***
              m_text.setBorder(null);
              m_text.setHorizontalAlignment(JTextField.TRAILING);
              m_text.addKeyListener(this);
              m_text.addFocusListener(this);
              //     Background
              setMandatory(mandatory);
              this.add(m_text, BorderLayout.CENTER);
              //     ***     Button     ***
              m_button.setIcon(Env.getImageIcon("Calculator10.gif"));
              m_button.setMargin(new Insets(0, 0, 0, 0));
              m_button.setFocusable(false);
              m_button.addActionListener(this);
              this.add (m_button, BorderLayout.EAST);
              //     Prefereed Size
              this.setPreferredSize(this.getPreferredSize());          //     causes r/o to be the same length
              //  Size
              setColumns(SIZE, CComboBox.FIELD_HIGHT-4);     
              //     ReadWrite
              if (isReadOnly || !isUpdateable)
                   setReadWrite(false);
              else
                   setReadWrite(true);
         }     //     VNumber
          *  Dispose
         public void dispose()
              m_text = null;
              m_button = null;
              m_mField = null;
         }   //  dispose
          *     Set Document
          *  @param doc document
         protected void setDocument(Document doc)
              m_text.setDocument(doc);
         }     //     getDocument
         private String               m_columnName;
         protected int               m_displayType;     //  Currency / UoM via Context
         private DecimalFormat     m_format;
         private String               m_title;
         private boolean               m_setting;
         private String               m_oldText;
         private String               m_initialText;
         private boolean               m_rangeSet = false;
         private Double               m_minValue;
         private Double               m_maxValue;
         private boolean               m_modified = false;
         /**  The Field                  */
         private CTextField          m_text = new CTextField(SIZE);     //     Standard
         /** The Button                  */
         private CButton              m_button = new CButton();
         private MField          m_mField = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(VNumber.class);
          *      Set no of Columns
          *     @param columns columns
         public void setColumns (int columns, int height)
              m_text.setPreferredSize(null);
              m_text.setColumns(columns);
              Dimension size = m_text.getPreferredSize();
              if (height > size.height)               //     default 16
                   size.height = height;
              if (CComboBox.FIELD_HIGHT-4 > size.height)
                   size.height = VLookup.FIELD_HIGHT-4;
              this.setPreferredSize(size);          //     causes r/o to be the same length
              this.setMinimumSize(new Dimension (columns*10, size.height));
              m_button.setPreferredSize(new Dimension(size.height, size.height));
         }     //     setColumns
          *     Set Range with min & max
          *  @param minValue min value
          *  @param maxValue max value
          *     @return true, if accepted
         public boolean setRange(Double minValue, Double maxValue)
              m_rangeSet = true;
              m_minValue = minValue;
              m_maxValue = maxValue;
              return m_rangeSet;
         }     //     setRange
          *     Set Range with min & max = parse US style number w/o Gouping
          *  @param minValue min value
          *  @param maxValue max value
          *  @return true if accepted
         public boolean setRange(String minValue, String maxValue)
              if (minValue == null || maxValue == null)
                   return false;
              try
                   m_minValue = Double.valueOf(minValue);
                   m_maxValue = Double.valueOf(maxValue);
              catch (NumberFormatException nfe)
                   return false;
              m_rangeSet = true;
              return m_rangeSet;
         }     //     setRange
          *  Set and check DisplayType
          *  @param displayType display type
         public void setDisplayType (int displayType)
              m_displayType = displayType;
              if (!DisplayType.isNumeric(displayType))
                   m_displayType = DisplayType.Number;
              m_format = DisplayType.getNumberFormat(displayType);
              m_text.setDocument (new MDocNumber(displayType, m_format, m_text, m_title));
         }   //  setDisplayType
          *     Set ReadWrite
          *  @param value value
         public void setReadWrite (boolean value)
              if (m_text.isReadWrite() != value)
                   m_text.setReadWrite(value);
              if (m_button.isReadWrite() != value)
                   m_button.setReadWrite(value);
              //     Don't show button if not ReadWrite
              if (m_button.isVisible() != value)
                   m_button.setVisible(value);
         }     //     setReadWrite
          *     IsReadWrite
          *  @return true if rw
         public boolean isReadWrite()
              return m_text.isReadWrite();
         }     //     isReadWrite
          *     Set Mandatory (and back bolor)
          *  @param mandatory mandatory
         public void setMandatory (boolean mandatory)
              m_text.setMandatory(mandatory);
         }     //     setMandatory
          *     Is it mandatory
          *  @return true if mandatory
         public boolean isMandatory()
              return m_text.isMandatory();
         }     //     isMandatory
          *     Set Background
          *  @param color color
         public void setBackground(Color color)
              m_text.setBackground(color);
         }     //     setBackground
          *     Set Background
          *  @param error error
         public void setBackground (boolean error)
              m_text.setBackground(error);
         }     //     setBackground
          *  Set Foreground
          *  @param fg foreground
         public void setForeground(Color fg)
              m_text.setForeground(fg);
         }   //  setForeground
          *     Set Editor to value
          *  @param value value
         public void setValue(Object value)
              log.finest("Value=" + value);
              if (value == null)
                   m_oldText = "";
              else
                   m_oldText = m_format.format(value);
              //     only set when not updated here
              if (m_setting)
                   return;
              m_text.setText (m_oldText);
              m_initialText = m_oldText;
              m_modified = false;
         }     //     setValue
          *  Property Change Listener
          *  @param evt event
         public void propertyChange (PropertyChangeEvent evt)
              if (evt.getPropertyName().equals(org.compiere.model.MField.PROPERTY))
                   setValue(evt.getNewValue());
         }   //  propertyChange
          *     Return Editor value
          *  @return value value (big decimal or integer)
         public Object getValue()
              if (m_text == null || m_text.getText() == null || m_text.getText().length() == 0)
                   return null;
              String value = m_text.getText();
              //     return 0 if text deleted
              if (value == null || value.length() == 0)
                   if (!m_modified)
                        return null;
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(0);
                   return Env.ZERO;
              if (value.equals(".") || value.equals(",") || value.equals("-"))
                   value = "0";
              try
                   Number number = m_format.parse(value);
                   value = number.toString();      //     converts it to US w/o thousands
                   BigDecimal bd = new BigDecimal(value);
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(bd.intValue());
                   if (bd.signum() == 0)
                        return bd;
                   return bd.setScale(m_format.getMaximumFractionDigits(), BigDecimal.ROUND_HALF_UP);
              catch (Exception e)
                   log.log(Level.SEVERE, "Value=" + value, e);
              if (m_displayType == DisplayType.Integer)
                   return new Integer(0);
              return Env.ZERO;
         }     //     getValue
          *  Return Display Value
          *  @return value
         public String getDisplay()
              return m_text.getText();
         }   //  getDisplay
          *      Get Title
          *     @return title
         public String getTitle()
              return m_title;
         }     //     getTitle
          *      Plus - add one.
          *      Also sets Value
          *     @return new value
         public Object plus()
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(0);
                   else
                        value = Env.ZERO;
              //     Add
              if (value instanceof BigDecimal)
                   value = ((BigDecimal)value).add(Env.ONE);
              else
                   value = new Integer(((Integer)value).intValue() + 1);
              setValue(value);
              return value;
         }     //     plus
          *      Minus - subtract one, but not below minimum.
          *      Also sets Value
          *     @param minimum minimum
          *     @return new value
         public Object minus (int minimum)
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(minimum);
                   else
                        value = new BigDecimal(minimum);
                   setValue(value);
                   return value;
              //     Subtract
              if (value instanceof BigDecimal)
                   BigDecimal bd = ((BigDecimal)value).subtract(Env.ONE);
                   BigDecimal min = new BigDecimal(minimum);
                   if (bd.compareTo(min) < 0)
                        value = min;
                   else
                        value = bd;
              else
                   int i = ((Integer)value).intValue();
                   i--;
                   if (i < minimum)
                        i = minimum;
                   value = new Integer(i);
              setValue(value);
              return value;
         }     //     minus
          *     Action Listener
          *  @param e event
         public void actionPerformed (ActionEvent e)
              log.config(e.getActionCommand());
              if (ValuePreference.NAME.equals(e.getActionCommand()))
                   if (MRole.getDefault().isShowPreference())
                        ValuePreference.start (m_mField, getValue());
                   return;
              if (e.getSource() == m_button)
                   m_button.setEnabled(false);
                   String str = startCalculator(this, m_text.getText(), m_format, m_displayType, m_title);
                   m_text.setText(str);
                   m_button.setEnabled(true);
                   try
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                   catch (PropertyVetoException pve)     {}
                   m_text.requestFocus();
         }     //     actionPerformed
          *     Key Listener Interface
          *  @param e event
         public void keyTyped(KeyEvent e)    {}
         public void keyPressed(KeyEvent e)  {}
          *     Key Listener.
          *          - Escape           - Restore old Text
          *          - firstChange     - signal change
          *  @param e event
         public void keyReleased(KeyEvent e)
              log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar()
                           + " -> " + m_text.getText());
              //  ESC
              if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                   m_text.setText(m_initialText);
              m_modified = true;
              m_setting = true;
              try
                   if (e.getKeyCode() == KeyEvent.VK_ENTER)     //     10
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                        fireActionPerformed();
                   else     //     indicate change
                        fireVetoableChange (m_columnName, m_oldText, null);     
              catch (PropertyVetoException pve)     {}
              m_setting = false;
         }     //     keyReleased
          *     Focus Gained
          *  @param e event
         public void focusGained (FocusEvent e)
              if (m_text != null)
                   m_text.selectAll();
         }     //     focusGained
          *     Data Binding to MTable (via GridController.vetoableChange).
          *  @param e event
         public void focusLost (FocusEvent e)
         //          log.finest(e.toString());
              //     APanel - Escape
              if (e.getOppositeComponent() instanceof AGlassPane)
                   m_text.setText(m_initialText);
                   return;
              try
                   fireVetoableChange (m_columnName, m_initialText, getValue());
                   fireActionPerformed();
              catch (PropertyVetoException pve)     {}
         }   //  focusLost
          *     Invalid Entry - Start Calculator
          *  @param jc parent
          *  @param value value
          *  @param format format
          *  @param displayType display type
          *  @param title title
          *  @return value
         public static String startCalculator(Container jc, String value,
              DecimalFormat format, int displayType, String title)
              log.config("Value=" + value);
              BigDecimal startValue = new BigDecimal(0.0);
              try
                   if (value != null && value.length() > 0)
                        Number number = format.parse(value);
                        startValue = new BigDecimal (number.toString());
              catch (ParseException pe)
                   log.info("InvalidEntry - " + pe.getMessage());
              //     Find frame
              Frame frame = Env.getFrame(jc);
              //     Actual Call
              Calculator calc = new Calculator(frame, title,
                   displayType, format, startValue);
              AEnv.showCenterWindow(frame, calc);
              BigDecimal result = calc.getNumber();
              log.config( "Result=" + result);
              calc = null;
              if (result != null)
                   return format.format(result);
              else
                   return value;          //     original value
         }     //     startCalculator
          *  Set Field/WindowNo for ValuePreference
          *  @param mField field
         public void setField (MField mField)
              m_mField = mField;
              if (m_mField != null
                   && MRole.getDefault().isShowPreference())
                   ValuePreference.addMenu (this, popupMenu);
         }   //  setField
          *      Remove Action Listner
          *      @param l Action Listener
         public void removeActionListener(ActionListener l)
              listenerList.remove(ActionListener.class, l);
         }     //     removeActionListener
          *      Add Action Listner
          *      @param l Action Listener
         public void addActionListener(ActionListener l)
              listenerList.add(ActionListener.class, l);
         }     //     addActionListener
          *      Fire Action Event to listeners
         protected void fireActionPerformed()
              int modifiers = 0;
              AWTEvent currentEvent = EventQueue.getCurrentEvent();
              if (currentEvent instanceof InputEvent)
                   modifiers = ((InputEvent)currentEvent).getModifiers();
              else if (currentEvent instanceof ActionEvent)
                   modifiers = ((ActionEvent)currentEvent).getModifiers();
              ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED,
                   "VNumber", EventQueue.getMostRecentEventTime(), modifiers);
              // Guaranteed to return a non-null array
              Object[] listeners = listenerList.getListenerList();
              // Process the listeners last to first, notifying those that are interested in this event
              for (int i = listeners.length-2; i>=0; i-=2)
                   if (listeners==ActionListener.class)
                        ((ActionListener)listeners[i+1]).actionPerformed(ae);
         }     //     fireActionPerformed
    }     //     VNumber

    If getValue() returns null, you need to trace the execution of the code and figure out which sequence of code is leading to the return of null. This method looks complex - a lot of if statements. If you do not have a debugger, put System.out.println statements inside the method to figure out what's going on.

  • Swing: when trying to get the values from a JTable inside an event handler

    Hi,
    I am trying to write a graphical interface to compute the Gauss Elimination procedure for solving linear systems. The class for computing the output of a linear system already works fine on console mode, but I am fighting a little bit to make it work with Swing.
    I put two buttons (plus labels) and a JTextField . The buttons have the following role:
    One of them gets the value from the JTextField and it will be used to the system dimension. The other should compute the solution. I also added a JTable so that the user can type the values in the screen.
    So whenever the user hits the button Dimensiona the program should retrieve the values from the table cells and pass them to a 2D Array. However, the program throws a NullPointerException when I try to
    do it. I have put the code for copying this Matrix inside a method and I call it from the inner class event handler.
    I would thank you very much for the help.
    Daniel V. Gomes
    here goes the code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import AdvanceMath.*;
    public class MathF2 extends JFrame {
    private JTextField ArrayOfFields[];
    private JTextField DimOfSis;
    private JButton Calcular;
    private JButton Ativar;
    private JLabel label1;
    private JLabel label2;
    private Container container;
    private int value;
    private JTable DataTable;
    private double[][] A;
    private double[] B;
    private boolean dimensionado = false;
    private boolean podecalc = false;
    public MathF2 (){
    super("Math Calcs");
    Container container = getContentPane();
    container.setLayout( new FlowLayout(FlowLayout.CENTER) );
    Calcular = new JButton("Resolver");
    Calcular.setEnabled(false);
    Ativar = new JButton("Dimensionar");
    label1 = new JLabel("Clique no bot�o para resolver o sistema.");
    label2 = new JLabel("Qual a ordem do sistema?");
    DimOfSis = new JTextField(4);
    DimOfSis.setText("0");
    JTable DataTable = new JTable(10,10);
    container.add(label2);
    container.add(DimOfSis);
    container.add(Ativar);
    container.add(label1);
    container.add(Calcular);
    container.add(DataTable);
    for ( int i = 0; i < 10 ; i ++ ){
    for ( int j = 0 ; j < 10 ; j++) {
    DataTable.setValueAt("0",i,j);
    myHandler handler = new myHandler();
    Calcular.addActionListener(handler);
    Ativar.addActionListener(handler);
    setSize( 500 , 500 );
    setVisible( true );
    public static void main ( String args[] ){
    MathF2 application = new MathF2();
    application.addWindowListener(
    new WindowAdapter(){
    public void windowClosing (WindowEvent event)
    System.exit( 0 );
    private class myHandler implements ActionListener {
    public void actionPerformed ( ActionEvent event ){
    if ( event.getSource()== Calcular ) {
    if ( event.getSource()== Ativar ) {
    //dimensiona a Matriz A
    if (dimensionado == false) {
    if (DimOfSis.getText()=="0") {
    value = 2;
    } else {
    value = Integer.parseInt(DimOfSis.getText());
    dimensionado = true;
    Ativar.setEnabled(false);
    System.out.println(value);
    } else {
    Ativar.setEnabled(false);
    Calcular.setEnabled(true);
    podecalc = true;
    try {
    InitValores( DataTable, value );
    } catch (Exception e) {
    System.out.println("Erro ao criar matriz" + e );
    private class myHandler2 implements ItemListener {
    public void itemStateChanged( ItemEvent event ){
    private void InitValores( JTable table, int n ) {
    A = new double[n][n];
    B = new double[n];
    javax.swing.table.TableModel model = table.getModel();
    for ( int i = 0 ; i < n ; i++ ){
    for (int j = 0 ; j < n ; j++ ){
    Object temp1 = model.getValueAt(i,j);
    String temp2 = String.valueOf(temp1);
    A[i][j] = Double.parseDouble(temp2);

    What I did is set up a :
    // This code will setup a listener for the table to handle a selection
    players.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ListSelectionModel rowSM = players.getSelectionModel();
    rowSM.addListSelectionListener(new Delete_Player_row_Selection(this));
    //Class will take the event and call a method inside the Delete_Player object.
    class Delete_Player_row_Selection
    implements javax.swing.event.ListSelectionListener
    Delete_Player adaptee;
    Delete_Player_row_Selection (Delete_Player temp)
    adaptee = temp;
    public void valueChanged (ListSelectionEvent listSelectionEvent)
    adaptee.row_Selection(listSelectionEvent);
    in the row_Selection function
    if(ex.getValueIsAdjusting()) //To remove double selection
    return;
    ListSelectionModel lsm = (ListSelectionModel) ex.getSource();
    if(lsm.isSelectionEmpty())
    System.out.println("EMtpy");
    else
    int selected_row = lsm.getMinSelectionIndex();
    ResultSetTableModel model = (ResultSetTableModel) players.getModel();
    String name = (String) model.getValueAt(selected_row, 1);
    Integer id = (Integer) model.getValueAt(selected_row, 3);
    This is how I got info out of a table when the user selected it

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the value from databank

    Hi,
    How to get the value from databank? and how to set the same value to visual script object?
    thanks,
    ra

    Hi,
    You can use GetDatabankValue(HeaderName, Value) to get the value from databank and SetDataBankValue(HeaderName, Value) to set the value to databank.
    You can refer to the API Reference to see list of associated functions and techniques we can use with related to Data Bank.
    This is the for OFT but if you are using Open Script then you have direct access for getting the databank value but when it comes to setting a value you have to use File operation and write you own methods to do the set operation.
    Thanks
    Edited by: Openscript User 100 on Nov 13, 2009 7:01 AM

Maybe you are looking for

  • 10.6.8 combo & 10.6.7 pdf fonts problem

    Does the 10.6.8 update combo correct the pdf fonts problem that was inherent to 10.6.7?  After a couple days of stress I had to do the lengthy 10.6.7 uninstall process in order to refine my doctoral dissertation.  This has made me gun-shy & fearful o

  • How to find or bypass the password for unlock backup for iphone with mac?

    Hi, My Iphone is not working for some reason and i realy need the information that was on it. I have a backup in my itune and i tried to download it to my ipod using the "restore from backup" option. Unfortuanlty, it asked me for a backup password wh

  • Converting Date Into Milliseconds?

    I want to convert the following date and time into milliseconds: 4/21/2003 21.50. I know how to convert milliseconds into a date, but not the other way around. Could someone, please, help?

  • Questions about external hard drive

    I'm running out of space on my macbook and am going to get an external hard drive, at least 500Gb. I see all kinds of different prices here and at places like circuit city, best buy, etc. I was wondering if just any external drive that uses USB will

  • Label1.text + Label2.text = Mess

    Hello! Im sorry im troubling you with this (i guess) simple problem. My problem i simple. I want to add two numbers stored in two different label components. Ex: Label1.text = 1; Label2.text = 1; Label3.text = Label1.text + Label2.text; The result is