Pass value of htmlb object to controller

Hi ,
I have a set of 5 button on my jsp,
On the click of any button , I want to pass the id of the button to the controlloer somehow.
can somebdy explain how to do please
say the button ids are b1, b2, b3, b4 , b5
on click of b3 , i want the b3 to be passed to a function in controler.
Edited by: namit bhandari on Nov 5, 2008 5:10 PM

Hi Namith,
you add a htmlb button in jsp by using the tag:
<hjb:button>
(See the reference [http://help.sap.com/saphelp_nw04s/helpdata/en/f1/9a0e41a346ef6fe10000000a1550b0/frameset.htm|http://help.sap.com/saphelp_nw04s/helpdata/en/f1/9a0e41a346ef6fe10000000a1550b0/frameset.htm])
One of its attributes is the onSelect tag, which allows you to define the Java function of your controller that needs to be called when a user clicks that button. If you give every button a different method name in the onSelect tag, you will be able to separate the different button clicks !
Kind regards,
Frederic

Similar Messages

  • Passing value from one object to another

    Hello all,
    Here is the situation: In a BEx query I will have a user entry variable for an object 0COMPANY. There is another object 0PCOMPANY that is used in the same report.
    I  want to accept the same value (that is entered by the user for 0COMPANY object) for the other object (0PCOMPANY) too without entering it separately.
    I believe It's not big a deal if I write a custom exit.
    But, is it possible to achieve the same goal without writing a custom exit?
    Can anyone help?
    Thanks,
    Pranab

    Pranab/Eugene
    Pranab you are right and I got the same error.Have you seen the error details, it clearly says that you have to handle with EXIT.
    I have tried Eugene's idea of moving to filter.It is once again telling the same error.
    Instead of my own input variable I tried with SAP Standard SAP variable for both characteristics.Even though I got the same error.
    It's BW!!! you can't do whatever you want.
    Pranab! better to obey BW and go for Exits.
    Enjoy!!
    Regs
    Gopi.

  • Passing values to subreport that has many records?

    I have a report with a subreport in it and that subreport is a bill that includes things like name, address, etc. My report will run the subreport many times for each bill that comes up.
    I am needing to pass values to text objects in these individual subreports that is information that is obtained in the code. My code works fine when this subreport is ran on it's own but I'm having trouble figuring out how to change the code up to put the information into individual subreports. Here is a simple example of some of my code:
    using (PrintBills reportPrintBills = new PrintBills())
        using (CrystalReportBill reportBill = new CrystalReportBill())
            CrystalDecisions.CrystalReports.Engine.TextObject lblBalanceDue = ((CrystalDecisions.CrystalReports.Engine.TextObject)reportBill.Summary.ReportObjects["lblBalanceDue"]);
            CrystalDecisions.CrystalReports.Engine.TextObject lblName = ((CrystalDecisions.CrystalReports.Engine.TextObject)reportBill.Summary.ReportObjects["lblName"]);
            DataSet ds = new DataSet();
            GetBills(ref ds, "Bills", date);
            DataView dvID = new DataView(ds.Tables["Bills"]);
            num = 0;
            foreach (DataRowView rowID in dvID)
                GetBioInfo(ref ds, "BioData", id);
                DataRow row = ds.Tables["BioData"].Rows[num];
                lblName.Text = row["Stu_Name"].ToString();
                lblBalanceDue.Text = String.Format("{0:C}", row["Amount_Due"]);
                num++;
        reportPrintBills.SetParameterValue("@tblMonth", date);
        reportPrintBills.SetParameterValue("@begdate", strBegdate);
        reportPrintBills.SetParameterValue("@enddate", strEnddate);
        //Export to PDF code here
    reportBill does not display the values obviously. Somehow I need to set that reportBill is a subreport of reportPrintBills in the code so that each record will recognize the TextObject values that I am sending to them.
    Another solution I've tried is adding parameter fields to reportBill and reportPrintBills and linking them up and then passing values like so:
    foreach (DataRowView rowCWID in dvCWID)
        GetBioInfo(ref ds, "BioData", id);
        DataRow row = ds.Tables["BioData"].Rows[num];
        name = row["Stu_Name"].ToString();
        amtDue = String.Format("{0:C}", row["Amount_Due"]);
        reportPrintBills.SetParameterValue("@strName", name);
        reportPrintBills.SetParameterValue("@strAmtDue", amtDue);
        num++;
    But the value stays the same in all of the subreports rather than changing with each pass through.

    Open the report up in the Designer and Click on Edit, Subreport Links. Likely what you can do is use Shared Variables to pass values from the main report to the subreport.
    You need to do this in the report first. If you are using RAS then you can at runtime. If RAS is not available to you then no way in code.
    See these samples:
    Root Page
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessIntelligence%28BusinessObjects%29+Home
    Enterprise Samples (including managed and unmanaged ras)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsSDKSampleApplications
    Non-Enterprise Samples
    http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
    Exporting Samples (RAS)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Also refer to the DSK help files for the Engine or RAS and search on the subreportcontroller.
    If you are using RAS I'll move your post to the SDK forum.
    Thank you
    Don

  • Servlet passing values to JSP and ClasscastException

    I am using weblogic 5.1 to run my Servlets.
              I want to know when I forward from a servlet to a JSP how do I pass
              values especially Java Objects (Sometimes Objects of User written Java
              classes).
              Uptil now I have been putting all values in the session from where the
              JSP picks them up, but somehow I have a feeling that this is not the
              right way.
              In a code I am putting a Java Object (It contains two attributes of
              Java.util.Vector type) in the session so that the JSP to which I am
              forwarding it to can use it I have put my class in the ServletClasses.
              Intertestingly it runs well till the contents of the Vector are changed.
              As the contents of the vector are changed, it throws ClassCastException
              The StackTrace is as follows:
              java.lang.ClassCastException
              at
              jsp_servlet._select_95_account_95_profile._jspService(_select_95_account_95_pro
              file.java, Compiled Code)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java, Compiled
              Code)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java,
              C
              ompiled Code)
              at
              weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.j
              ava:143)
              at
              com.logistics.optistopasp.servlet.AccountSelectServlet.doPost(AccountSelectServ
              let.java, Compiled Code)
              at
              com.logistics.optistopasp.servlet.AccountSelectServlet.doGet(AccountSelectServl
              et.java:35)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java,
              C
              ompiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.j
              ava, Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.j
              ava, Compiled Code)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextMan
              ager.java, Compiled Code)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,
              Compile
              d Code)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
              Compiled Code
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
              Compiled Code)
              Can anybody please Help!!!!.
              Thanks
              Pankaj
              

    Only can confirm your finding - the jsp is using a different class loader to the servlet that originally instantiated the object. There's the rub. I haven't figured out yet how to fix that. I can get the classloader but don't know how to get the runtime to use that class loader to perform cast.
              

  • Servlet passing Values to JSP

    I want to know when I forward from a servlet to a JSP how do I pass
              values especially Java Objects (Sometimes Objects of User written Java
              classes).
              Uptil now I have been putting all values in the session from where the
              JSP picks them up, but somehow I have a feeling that this is not the
              right way.
              Suppose my servlet is forwarding to a jsp . What should it do in case an
              exception happens in the servlet and wants to forward it to the jsp.
              Putting the Exception object in the session is an alternative but I
              wonder that is the best approach.
              If someone knows a better way od doing it, please help.
              Pankaj
              

    You could probably use setAttribute
              ..before forwarding the control to JSP.
              req.setAttribute("message", "Hello, world");
              ServletContext app = getServletContext();
              RequestDispatcher disp;
              disp = app.getRequestDispatcher("Dispmessage.jsp");
              Cheers,
              Naggi
              pankaj wrote:
              > I want to know when I forward from a servlet to a JSP how do I pass
              > values especially Java Objects (Sometimes Objects of User written Java
              > classes).
              > Uptil now I have been putting all values in the session from where the
              > JSP picks them up, but somehow I have a feeling that this is not the
              > right way.
              > Suppose my servlet is forwarding to a jsp . What should it do in case an
              > exception happens in the servlet and wants to forward it to the jsp.
              > Putting the Exception object in the session is an alternative but I
              > wonder that is the best approach.
              > If someone knows a better way od doing it, please help.
              >
              > Pankaj
              

  • Passing Value to a Angular Controller from MVC Controller Action

    Hi ,
    I have a Angular MVC Application my Angular controller code is like below.
    app.controller('SearchController', ['$scope','$http',function ($scope, $http) {
        $scope.sessionGuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        $scope.searchValue = "";
        $scope.stockNumber = "";
        $scope.searchRequest = {
            Criteria: [],
            resultsTabIndex: 0,
            orderBy: "sortbypopularity",
            value:"mut" //Added
    I have a view Search.Html Which display the data on the basis of searchRequest object which is defined in Controller above.
    Now i have a requirement that i Need to show this view from MVC controller.
    Do you have any idea how can i pass value to controller which is required by the search request object  so that i can show the view with the data.
    Thanks

    Hi,
    Is it relate to SharePoint?
    Seems more like an Angular related issue, I would suggest you post this question to the corresponding forum, you will get more help and confirmed answers there.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Passing Values to Object Type Attributes

    Hi Experts,
    I need to pass values to object type attributes amount,channel and company code from zprogram.
    I have got FM 'SWO_INVOKE'.But in this FM how will I pass values to 3 attributes.
    I have created object type through SWO1 .Is it necessary to call FM SWO_CREATE before FM 'SWO_INVOKE'.
    Please suggest.
    Regards,
    Kaustubh.

    Hi,
    I guess you will have to Initialize business object first by using the function module "SWO_CREATE' and then call the other function module to pass the attributes. I am not sure, but please check by passing the attribute name and value to the tables parameter 'CONTAINER'.
    CONTAINER-ELEMENT = <Attribute name>.
    CONTAINER-VALUE = <value from the Zprogram>.
    Hope this will help.
    Thanks,
    Samson

  • Pass values to bind variales and execute VO query

    Hi All,
    I have a requirement to add validation to an appraisal page via OAF.
    As a part of testing I need to check, if the values in the query of VO is displayed in the page.
    VO - QuestAnsValuesVO
    EO - QuestAnswerValueEO, QuestFieldEO
    The VO query is
    SELECT * FROM (SELECT QuestAnswerValueEO.QUEST_ANSWER_VAL_ID, QuestAnswerValueEO.QUESTIONNAIRE_ANSWER_ID, QuestAnswerValueEO.FIELD_ID, QuestAnswerValueEO.OBJECT_VERSION_NUMBER, QuestAnswerValueEO.VALUE, QuestFieldEO.FIELD_ID AS QUEST_FIELD_ID, QuestFieldEO.NAME, QuestFieldEO.TYPE, QuestFieldEO.HTML_TEXT, rank() over (partition by QuestFieldEO.NAME order by QuestFieldEO.FIELD_ID) AS RANK, QuestAnswerValueEO.QUESTIONNAIRE_ANSWER_ID AS QUESTIONNAIRE_ANSWER_ID1 FROM HR_QUEST_ANSWER_VALUES QuestAnswerValueEO, HR_QUEST_FIELDS QuestFieldEO WHERE QuestFieldEO.QUESTIONNAIRE_TEMPLATE_ID(+) = :1 and QuestAnswerValueEO.QUESTIONNAIRE_ANSWER_ID(+) = :2 AND QuestFieldEO.FIELD_ID = QuestAnswerValueEO.FIELD_ID (+)) QRSLT ORDER BY QUEST_FIELD_ID
    I am trying to execute this query in the extended controller class so that i can get the values printed on the page. I am getting SQL exception saying - not all variables are bound.
    How do i pass values to bind variables :1 and :2 and execute this query?
    Please help.
    Thanks
    Geetha

    Geetha,
    Instead of :1 and :2 use a named bind variable as part of your VO and then set either a default value or set its value during runtime. See this example on how to create bind variable:
    http://formattc.wordpress.com/2010/04/02/custom-java-bind-variable-in-a-where-clause-of-an-adf-view-object/
    Once created, you can set its value during runtime either in ApplicationModuleImpl or in ViewObjectImpl class
    e.g.,
             ViewObjectImpl view = this.getEmpView();
            VariableValueManager vm = view.ensureVariableManager();
            vm.setVariableValue("empNo", value);
            view.executeQuery();regards,
    ~Krithika

  • [ipad] SplitView and passing value to DetailViewController

    Sorry for my english
    i'm creating a Splitview project
    in my RootViewController i have a table view
    that when use didSelectRowAtIndexPath load another one tableview with WithNibName method;
    When i try to pass a value from a selected cell to the detailview doesn't work without error;
    to test i try to pass value to detailview from second table loading it as first one table in pop control and it work;
    what am i forgetting?
    I attached You my project
    First table is loaded from RootViewController class
    Second one form SecondTable class
    and the DetailView from DetailViewController
    thanks....
    www.emanueleferrari.it/test.zip

    Hi Emanuele, and welcome to the Dev Forum!
    bolco wrote:
    When i try to pass a value from a selected cell to the detailview doesn't work without error;
    I don't have an iPad dev environment right now, so can't run your project, but here are some suggestions that might lead you in the right direction:
    Since the transition between the RootViewController and the SecondTable controller object is working correctly under your split view controller, I don't see why the transition from the SecondTable controller object to the DetailViewController object should be different. So try something like this:
    // SecondTable.m
    #import "DetailViewController.h"
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // ricaviamo il link dell'elemento selezionato
    NSString *link = [[elencoFeed objectAtIndex:indexPath.row] objectForKey: @"link"];
    NSLog(@"%s: link=%@", _func_, link);
    // ripiliamo il link da spazi, return e tabs
    link = [link stringByReplacingOccurrencesOfString:@" " withString:@""];
    link = [link stringByReplacingOccurrencesOfString:@"
    " withString:@""];
    link = [link stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSLog(@"%s: link=%@", _func_, link);
    // apriamo la nuova vista
    DetailViewController *dvController = [[DetailViewController alloc]
    initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
    dvController.detailItem = link;
    [self.navigationController pushViewController:dvController animated:YES];
    [dvController release];
    I removed the alert view code to simplify things, and I would recommend leaving it out until you get the above, basic transition working correctly.
    Are you presenting the alert view so the user can decide whether or not the detail view should be opened? If so, you might want something like this:
    // SecondTable.m
    #import "DetailViewController.h"
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // ricaviamo il link dell'elemento selezionato
    // ripiliamo il link da spazi, return e tabs
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:link message:@"Your description"
    delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
    [alert show];
    [alert release];
    - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) {
    // apriamo la nuova vista
    DetailViewController *dvController = [[DetailViewController alloc]
    initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
    dvController.detailItem = alertView.title;
    [self.navigationController pushViewController:dvController animated:YES];
    [dvController release];
    The code which brings up the detail view is placed in the alert view delegate method because the main thread isn't suspended after [alert show]. Note the link which must be passed to the detail view has been saved in the 'title' property of the alert view, so it's already available in the alert view delegate method.
    - Ray

  • JSF2 : Problem passing values with f:setPropertyActionListener

    Hi,
    I'm a JSF newbie, and I'm in front of a weird problem on a JSF2 / Glassfish3 project. I'm working on GlassFish Server Open Source Edition 3.1 (build 43) with Mojarra 2.1.0 (FCS 2.1.0-b11).
    I'm using a commandLink to pass values from a page to a backing bean. This example works (here is only the relevant code) :
    user.xhtml :
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:composition template="sublayout.xhtml">
      <ui:define name="maincontent">
        <p><a name="projects"><h:outputText value="Projects" /></a></p>
        <p><h:outputText value="#{userController.user.login} has initiated the following projects:" /></p>
        <h:dataTable value="#{userController.getProjects()}" var="p">
          <h:column>
            <h:form>
              <h:outputText value="#{p.id}: " />
              <h:commandLink action="#{projectController.doGetProject()}">
                <h:outputText value="#{p.title}" />
                <f:setPropertyActionListener value="#{p.id}" target="#{projectController.projectId}" />
              </h:commandLink>
            </h:form>
          </h:column>
        </h:dataTable>
      </ui:define>
    </ui:composition>
    </html>userController.java:
    // package, imports...
    @ManagedBean(name = "userController")
    @RequestScoped
    public class UserController {
      @EJB
      private UserServiceEJBLocal userServiceEJB;
      private FacesContext ctx = FacesContext.getCurrentInstance();
      private User user = new User();
      private long userId;
      private String password;
      private String passwordConfirmation;
      public String doGetUser() {
        try {
          user = userServiceEJB.findById(userId);
        } catch (ObjectNotFoundException e) {
          ctx.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "User not found" + userId, "User not found : " + e.getMessage()));
          return null;
          return "user.faces";
      public ArrayDataModel<Project> getProjects() {
        return new ArrayDataModel<Project>(user.getProjects().toArray(new Project[user.getProjects().size()]));
      // Getters and setters
    }projectController.java:
    // package, imports...
    @ManagedBean(name = "projectController")
    @RequestScoped
    public class ProjectController {
      @EJB
      private ProjectServiceEJBLocal projectServiceEJB;
      FacesContext ctx = FacesContext.getCurrentInstance();
      private Project project = new Project();
      private long projectId;
      public String doGetProject() {
        try {
          project = projectServiceEJB.findById(projectId);
        } catch (ObjectNotFoundException e) {
          ctx.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Project " + projectId + " was not found", e.getMessage()));
          return null;
        return "project.faces";
      // Getters and setters
    }The proble occurs on the XHTML page below :
    project.xhtml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:composition template="sublayout.xhtml">
      <ui:define name="maincontent">
        <h:form>
          <h:commandLink action="#{userController.doGetUser()}">
            <h:outputText value="#{projectController.project.author.login}" />
            <f:setPropertyActionListener value="#{projectController.project.author.id}" target="#{userController.userId}" />
          </h:commandLink>
        </h:form>
      </ui:define>
    </ui:composition>
    </html>The commandLink syntax seems to be the same as the one provided above, but when I test this for, I get an IllegalArgumentException from Glassfish. Here it is, from the Glassfish server.log :
    [#|2011-08-22T11:15:11.462+0200|WARNING|glassfish3.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=95;_ThreadName=Thread-1;|/project.xhtml @32,42 target="#{userController.userId}": Can't set property 'userId' on class 'org.creagora.server.ejb.managed.UserController' to value 'null'.
    javax.el.ELException: /project.xhtml @32,42 target="#{userController.userId}": Can't set property 'userId' on class 'org.creagora.server.ejb.managed.UserController' to value 'null'.
         at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:139)
         at com.sun.faces.facelets.tag.jsf.core.SetPropertyActionListenerHandler$SetPropertyListener.processAction(SetPropertyActionListenerHandler.java:206)
         at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
         at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
         at javax.faces.component.UICommand.broadcast(UICommand.java:300)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
         at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
         at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
         at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
         at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.IllegalArgumentException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:601)
         at javax.el.BeanELResolver.setValue(BeanELResolver.java:381)
         at com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
         at com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
         at com.sun.el.parser.AstValue.setValue(AstValue.java:197)
         at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:286)
         at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
         ... 35 more
    |#]So I wonder : what makes the first example work, that fails in this one ? Where does this 'null' value come from ? I tested every value (project, author, author id), everything is correct. But for some reason, the projectController.project.author.id is not passed to the userController.userId.
    If I try to replace
    <f:setPropertyActionListener value="#{projectController.project.author.id}" target="#{userController.userId}" />by this (obviously incoherent but syntically correct)
    <f:setPropertyActionListener value="#{projectController.project.id}" target="#{userController.userId}" />I don't get the IllegalArgumentException anymore, but the value is still not passed, and the value of userController.userId is never updated, and remains set to 0.
    But if I hardcode a valid value :
    <f:setPropertyActionListener value="1" target="#{userController.userId}" />It works...
    I can't understand why a 'null' value appears from who knows why, given that the only value passed are of long type.
    Can you help me ? It's getting frustrating, and I didn't find any help on Google so far...
    Thanks!
    Xavier
    Edited by: 880733 on 22 août 2011 04:04

    Ok, I have a little more time now.
    You ask how the value can be null when the property is a long. What is happening is that something in the chain is null, e.g. the author is not set on the project. (Although usually you get an exception with that kind of thing.) The EL resolver is actually not really part of JSF, it is a separate library. Furthermore it is weakly typed so it doesn't know what type of thing projectController.project.author.id is until it evaluates it. If something is null along the way, there is no way for it to know whether the end result should have been a long, a Long, a String or anything else.
    You asked how to pass values without setPropertyActionListener. It is certainly possible. In fact, I would not be surprised if my entire application did not use setPropertyActionListener. Let's start with the first case. In that situation you were using a dataTable. The customary thing to do is to bind the dataTable to a UIData property in a managed bean. Then, in your action method, you can invoke UIData.getRowData() and get the object instance associated with the row in the table that was activated by the user.
    In your second example it is a little difficult to appreciate everything going on without more context but I'll just guess at what I don't know. I'm going to assume you have a simple page here. On the request that generates this page, projectController.project.author.id is known. I imagine the problem is that this is in request scope, causing projectController.project.author.id to be forgotten on the next request. The simplest solution is to store the project somewhere in session scope. I would recommend against putting the Controller classes themselves in the session scope.  Instead create a set of beans for session scope and inject them into the Controller classes.
    There are many other ways to skin the same cat. Many people object to over-using session scope. So you could store something small like just the id in the session. Or you could pass the id using h:inputHidden. Or you could use Tomahawk's s:saveState.
    HTH

  • Passing values from a FORM to another FORM

    Hi,
    I have to pass values from FORM "A" to FORM "B". What is the best way to do this?\
    Can I use a GLOBAL variable?
    Thanks,
    Marc.

    I think he meant the global namespace.
    You set a :global_your_name_here to a value and that value is available in your entire application. See the help file section on the global namespace for more information.
    Forms parameters are parameters that you form picks up from the outside when it starts. The calling entity must supply them in the URL or they will be set to null. You set them up in the object navigator in the Parameters node.

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • How to pass values from main window to pop-up window?

    I want to pass a value from the main window (1st form) to pop-up window (2nd form). The first form is of name booking.jsp and 2nd form is of name Fund_booking.jsp. I am using window.showModalDialog to open the window. I think, I have written right code in main window to pass the value but even then I am not able to get it on pop-up window. I am not even able to display an alert on pop-up window saying "hi" by writing a function on save Button in pop-up window. The code is as follows:
    On booking.jsp:
    <script>
    function popup()
    var aForm;
    aForm = D_requisition_id.options[D_requisition_id.selectedIndex].text;
    \\Here I have captured value from a drop down box in my main window form and assigned it to the variable.
    alert(aForm);
    var myObject =new Object();
    myObject.Brandcode = aForm;
    alert(myObject.Brandcode);
    window.showModalDialog("Fund_booking.jsp",myObject,"dialogHeight:400px;dialogWidth:420px;");
    </script>
    <button name="B_FundBooking" tabIndex=4 style='POSITION:absolute;LEFT:393;TOP:292;WIDTH:100;height:24;BACKGROUND-COLOR:buttonface' onClick ="popup()">Fund Booking</button>
    On Fund_booking.jsp:
    <SCRIPT>
    var oMyObject = window.dialogArguments;
    var sBrandcode = oMyObject.Brandcode;
    alert(sBrandcode);
    </SCRIPT>
    Even the following alert is not getting displayed in pop-up window;
    <script>
    function ValidateData()
    alert("Hi");
    </script>
    <button name="B_Save" tabIndex=1 style='POSITION:absolute;LEFT:255;TOP:315;WIDTH:75;height:24;BACKGROUND-COLOR:buttonface' onClick ="ValidateData()">Save</button>
    I am using DIV instead of frames in my both forms. I just want to get that value in my pop-up window to write a query based on which data will get displayed in my table of pop-up window.
    Plz help me to solve this problem.

    Well, this is actually a JavaScript question, not a Java question but I can give some hints.
    When you do pop-up windows you need to put JavaScript in the html of the pop-up itself. Data can be passed by creating new fields in the window object, which the popup can access via the window.openner field.
    So, before invoking the popup add any data to be passed to the window object, then the onLoad function in the popup grabs the data.

  • Convert String variable value  to an Object referece type

    Hi all,
    I want to know that if there any possible way to convert String variable value to a Object reference type in java. I'll explain by example if this is not clear.
    Let's think that there is a string variable name like,
    String name="HelloWorld";
    and there is a class name same to the variable value.
    class HelloWorld
    I am passing this string variable value to a method which is going to make a object of helloworld;
    new convertobj().convert("HelloWorld");
    class convertobj{
    public void convert(String name){
    // in hert it is going to create the object of HelloWorld;
    // HelloWorld hello=new HelloWorld(); just like this.
    now i want to do this from the name variable value.( name na=new name()) like wise.
    please let me know if there any possible way to do that.
    I am just passing the name of class by string variable then i wanted to make a instance of the class which come through the variable value.
    thanx.

    Either cast the object to a HelloWorld or use the reflection API (Google it) - with the reflection API you can discover what methods are available.
    Note: if you are planning to pass in various string arguments and instantiate a class which you expect to have a certain method... you should define an interface and have all of your classes that you will call in this way implement the interface (that way you're sure the class has a method of that name). You can then just cast the object to the interface type and call the method.
    John

  • Error trying to run SSIS Package via SQL Server Agent: DTExec: Could not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object

    Situation:
    SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
    Windows 7 - 64 bit.
    The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
    It uses 3 package variables:
    *) SQLCommand (String) to specify the SQL Statement to be executed by the package
    Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
    Value: f:\Output Data.xls
    *) EXCELOutputFIle (String) to specify path and filename of the Excel output file
    Property path: \Package.Variables[User::SQLCommand].Properties[Value]
    Value: select * from CartOrder
    *) VarObjectDataSet (Object) to hold the data returned by SQL Server)
    Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
    Value: System.Object
    It consists out of 2 components:
    *) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
    *) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
    Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
    However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
    This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only.  This makes me wonder if it is uberhaupt possible to set the value of a package variable
    of type Object.
    Can anybody help me on this please ?
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  6:40:20 PM  DTExec: Could
    not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object.  Started:  6:40:20 PM  Finished: 6:40:21 PM  Elapsed:  0.281 seconds.  The package execution failed.  The step failed.
    Thank you very much in advance
    Jurgen

    Hi Visakh,
    thank you for your reply.
    So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
    I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
    first question about the object type package variable.
    Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
    Thx in advance
    Jurgen
    Yes exactly
    You need to set values only forthem which needs to be controlled from outside the package
    Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
    Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for