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
Similar Messages
-
Problem passing arguments with air.swf
I'm attempting to launch my AIR application using
launchApplication() in air.swf. I'm having problems passing
arguments to my application due to what appears to be some
restriction in allowed characters. To get around this, I've even
tried URL encoding and Base-64 encoding my arguments to make them
more friendly, but it's still failing:
Error: Invalid argument: PG5vIGlkZW50aWZpZXI+
at AIR$/escapeArguments()
at AIR/launchApplication()
at
adlm_launcher/onDownloadClick()[E:\adlm\launcher\src\adlm_launcher.mxml:181]
It seems that any kind of punctuation is not allowed in
arguments. URL encoding them doesn't work either because the % is
rejected. Is there any other way around this?Yes; it's a security restriction. Browser invocation require
process creation, and many process creation APIs giving special
meanings to certain characters. Letting those characters through
has in the past been a source of security vulnerabilities. While we
also try to avoid using APIs with this behavior, extra layers of
defense are also good.
I think + and / may actually be safe choices; you make a good
point that they're useful for Base64. If you could submit a feature
request at www.adobe.com/go/wish, we'll definitely consider it.
Another option, btw, is to use the LocalConnection API to
pass data between the web page and your application once your app
is launched. LocalConnection has fewer restrictions on the data
passed. -
Problem passing values to cfc component
I have a cfc component with methods to insert, retrieve and
update a record in a table. There are several forms associated with
the component, each which handles a subset of the fields in the
table. The update method is called with arguments that identify
which subset of fields is to be modified and the values for those
fields.
The forms typically have a couple of radio button groups and
a couple of lists, most of which allow multiple selections. I want
to create a variable for each radio button group and each list. The
variables give the button selected (for the buttons) and a string
of the values selected (for the lists). These are to be passed as
arguments to the update method.
I can construct the variables using standard Java script
statements (if, for,etc.). But if I do, CFINVOKEARGUMENT doesn't
recognize them. The same thing happens if I try to use CFQUERY
directly. I get a message like "variable is undefined". If I try to
set the values using CFSET statements, it doesn't recognize the
form fields. It says the field is not an element of the form.
So I can look at the form fields to create a variable but
then the variable can't be used by the update method. Or I can
create an argument that can be passed to update, but it doesn't
know anything about the form values. I've tried all variations I
can think of with and without #'s and single & double quotation
marks.
Suggestions would be appreciated.See in line comments.
waz69 wrote:
> Sorry for the delayed response...I was pulled away right
after I posted my
> problem. Here are extracts from the code. I've only
included the sections
> that deal with updating the table.
>
> In the CFC file:
>
> <cffunction access="public" name="SaveFormValues"
output="false"
> returntype="boolean">
> <cfargument name="Screen" type="string"
required="yes">
> <cfargument name="Arg1" type="string"
required="yes">
> <cfargument name="Arg2" type="string"
required="yes">
> <cfargument name="Arg3" type="string"
required="yes">
> <cfargument name="Arg4" type="string"
required="no">
> <cfargument name="Arg5" type="string"
required="no">
> <cfargument name="Arg6" type="string"
required="no">
> <cfset var isSuccessful=true>
> <cftry>
> <cfquery name="SaveValues" datasource="FPDS
Sample">
> UPDATE Report_specs SET
> <cfif arguments.Screen EQ "Scope">
> ReportOn = '#arguments.Arg1#',
> SubtotalGroup = '#arguments.Arg2#',
> Projects = '#arguments.Arg3#',
> Sites = '#arguments.Arg4#'
> </cfif>
> <cfif arguments.Screen EQ "Criteria"> (,,code goes
here for next set of
> fields...) </cfif>
> <cfif arguments.Screen EQ "Table"> (,,code goes
here for next set of
> fields...) </cfif>
> <cfif arguments.Screen EQ "Chart"> (,,code goes
here for next set of
> fields...) </cfif>
> <cfif arguments.Screen EQ "Detail"> (,,code goes
here for next set of
> fields...) </cfif>
> WHERE Report_specs.rid = #Session.FPRU_rid#
> </cfquery>
> <cfcatch type="Database"><cfset
isSuccessful=false></cfcatch>
> </cftry>
> <cfreturn isSuccessful />
> </cffunction>
>
> In the CFM file:
>
> <head>
> <script language="JavaScript">
>
> function SaveValues(frm) {
> var RptOn="", SubGrp="", SL="", PL="" ;
> for(var i=0; i<3; i++)
> {if(frm.ReportOn
.checked) RptOn = frm.ReportOn.value ;
> if(frm.SubtotalGroup
.checked) SubGrp = frm.SubtotalGroup.value ; } ;
> for(i = 0; i < frm.Projects.options.length; i++)
> {if(frm.Projects.options
.selected ) PL = PL + ', ' +
> frm.Projects.options.value ; } ;
> for(i = 0; i < frm.Sites.options.length; i++)
> {if(frm.Sites.options
.selected ) SL = SL + ', ' +
> frm.Sites.options.value ; } ;
>
> ...(This is the section where I'm having problems. I
have the values I want
> to pass the variables just defined.
> But I can't get them into the CFINVOKEARGUMENT
statements below. I've
> tried variations of #'s, CFSETS, etc.)...
>
> <cfobject component="RecordAccess"
name="SaveValues">
> <cfinvoke component="#SaveValues#"
method="SaveFormValues" >
> <cfinvokeargument name="Screen" value="Scope">
> <cfinvokeargument name="Arg1" value="RptOn">
> <cfinvokeargument name="Arg2" value="SubGrpr">
> <cfinvokeargument name="Arg3" value="PL">
> <cfinvokeargument name="Arg4" value="SL">
> </cfinvoke>
> }
>
> </script>
> </head>
This is never going to work. JavaScript is executed on the
client's
computer in the browser. It is no idea of what is CFC is or
how to
access one. The cfc lives on the server, it can only exist
and run
while the http request is being built by the CF engine.
>
> <body onFocus="GetValues(this.form)" >
>
> <form action="" method="post" name="ScopeDetail"
id="ScopeDetail">
> <table width="85%" border="0" cellspacing="2"
cellpadding="2">
> <tr>
>
> ...(various buttons)...
>
> <td width="8%"><input name="SaveForm"
type="button" id="SaveForm"
> onclick="SaveValues(this.form)"
value="Save"></td>
>
> ...(other buttons)...
>
> </table>
>
> <table width="96%" border="0" cellspacing="2"
cellpadding="2">
> <tr>
> ...(column headers)...
> </tr>
>
> <tr>
> <td rowspan="3" align="right"
valign="top"> </td>
> <td height="110" colspan="2" align="right"
valign="top"><div
> align="left">
> <p>
> <label> <input name="ReportOn" type="radio"
value="Users" checked>
> Unique users</label>
> <br>
> <label> <input type="radio" name="ReportOn"
value="AllVisits"> All
> visits</label>
> <br>
> <label> <input name="ReportOn" type="radio"
value="LastVisit"> Last visit
> only</label>
> <br>
> </p>
> </div></td>
> <td rowspan="3" valign="top"> </td>
> <td colspan="3" rowspan="3"
valign="top"><p><select name="Projects"
> size="10" multiple id="Projects"
onChange="getSites(this.form)"><cfoutput
> query="ProjectList">
> <option
>
value="#ProjectList.projectid#">#ProjectList.projectname#</option>
> </cfoutput></select></p></td>
> <td width="3%" rowspan="3"
valign="top"> </td>
> <td width="34%" rowspan="3"
valign="top"><select name="Sites" size="15"
> multiple id="Sites">
> <option> ---------------------------------------
</option>
> </select></td>
> <tr>
> <td height="23" colspan="2" align="right"
valign="top"><div align="left">
> <h3>Show Summaries of </h3>
> </div></td>
> <tr>
> <td height="100" colspan="2" align="right"
valign="top"><div
> align="left">
> <label> <input name="SubtotalGroup"
type="radio" value="Both" checked>
> Project & Sites</label>
> <br>
> <label> <input type="radio"
name="SubtotalGroup" value="Projects">
> Projects only</label>
> <br>
> <label> <input type="radio"
name="SubtotalGroup"
> value="Sites"> Sites only</label>
> </div></td>
>
> </table>
> </form>
> </body>
waz69 wrote:
> I tried creating hidden fields to which I assign my
desired values. The
> CFINVOKEARGUMENTs then become:
>
> <cfinvokeargument name="Arg1" value=frm.Hide1>
> <cfinvokeargument name="Arg2" value=frm.Hide2>
> etc.
>
> What ends up in the table is the name of the field
(frm.Hide1) not
the value
> of the field. I've also tried with with quotes (single
and double)
which give
> the same result and with #'s which gives me an error
about undefined
element.
>
This is what your are going to need to do. But the javascript
form
object no longer exists once the request has been sent to the
server.
After that you are dealing with the "form" structure. So your
arguments
are going to look something like.
<cfinvokeargument name="Arg1" value="#form.Hide1#">
OR interchangeably
<cfinvokeargument name="Arg2" value="#form['Hide2']#">
When blending JavaScript and ColdFusion, one must be
constantly aware of
the order of actions. JavaScript can only run and exist on
the client,
it has no direct knowledge of any ColdFusion variables or
logic.
Vice-a-versa, ColdFusion only runs and exists on the server.
It has no
direct knowledge of the Client or its state.
To blend the two you have to carefully pass any required,
shared
information from one location to the other. -
Passing values with href.
I am creating a report region by selecting some fields from the table. I then made one particular field a hyper link and i want to have a pop up window (to select some criteria) when you click on the hyperlink.
My pop up window display will be different depending on which hyperlink you have clicked (depending on datatype). How can I pass a value or a set of values (separated by comma) so I can see and use those values in pop up window and can display and hide particular item/items
Help is highly appreciated.
pbHi Prashant,
There are a few ways of doing this - this is what I do when I need this sort of functionality
1) in the report select the column you want to link on - or create a derived column
2) in the link column set the target to URL
3) in the URL field type something like:
javascript:popup('#ST#','#STATE_NAME#');
where the values between the hash symbols are the values you want to pass to the new window
4) create a new window with hidden items corresponding to the values that you want to pass
5) in the report page go the page attributes and add some javascript in the HTML header section:
<script language="javascript">
function popup(value1,value2){
var newWindow;
newWindow = window.open("f?p=&APP_ID.:2:&APP_SESSION.::NO::P2_TEXT1,P2_TEXT2:"+value1+","+value2+"","myWindow","width=200,height=400");
newWindow.focus();
</script>
where the value1 and value2 parameters are the values passed in and the P2_TEXT1 and P2_TEXT2 are the items on the popup page you want to populate.
If you do a general search on the internet for window.open you should be able to find the other attributes that can be used to hide scrollbars, status bar etc, if that is needed.
hope that helps
Adam -
Passing values with HttpsURLconnection and reading response back
i need to communicate with a server url using HttpsURLConnection and pass 2 strings and read the response back.
how can i make this using HttpsURLConnection object.
HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext
.getSocketFactory());
HttpsURLConnection https = null;
https = (HttpsURLConnection) new URL(host).openConnection();// host url of the server program
https.setRequestMethod("POST");
https.setDoInput(true);
https.setDoOutput(true);
https.setRequestProperty("IP", "10.900.10.2");// i am not sure how to pass two strings.
https.connect();
// have to read response back from a server program
please help,
thanks in advance.You can get around this by using javascript. That way your parent document is not getting refreshed.
Create form inputs in the parent document for each of the variables you want to gather from the popups.
You can then fire a function in the parent window when the user clicks a button in each popup that sends the values to the parent window. Just use:opener.funcname(var1, var2, var3...);Create the function funcname() in the parent window that takes each value to be added and sets the form inputs appropriately. You may want to use a different function for each popup window, like submitPopup1, submitPopup2 and so on.
You can then make the last popup submit the form in the parent window:
opener.document.FORMNAME.submit();Where FORMNAME is the name of your form. -
Problems passing value to an APEX application URL
Greetings,
My environment is:
Apex 4.0.1
Oracle 11g
Apex Listener (Weblogic 10g)
I am trying to pass a value to an Apex application from outside of Apex. Here is the URL I am using:
http://<servername>:<portno>/apex/f?p=138:2:0::::F138_ID:abcde
What happens when I enter this URL is the Login page is presented and I can successfully log in. I am directed to page 2 but the value of F138_ID is empty. I have tried it with an application item and a page item but still no value is passed. I have tried creating the page item where the value is populated from the application item. I have tried setting the value in a PL/SQL process. (:P2_ID := :P138_ID;) again no luck.
Should this work? And if so, does anyone have any idea why it isn’t?
Thanks for your help,
LarryThanks Sarvan,
Unforunatly that did not work. I have been working with it some more and noticed that if the page I am trying to access has an Authentication of 'Page is Public' the passing of the value works as expected. It is only when Authentication is set to 'Page Requires Authentication' (i.e. the user needs to provide a userid and password) that it fails. Do you have any idea how to get around this?
Thanks
Larry -
Report-Report Passing Values with SMOD_RSR00004
Hi,
I operated the BADI SMOD_RSR00004 which suppose to help in mapping values from a sender report to a receiver report.
I didn't succeed to see in a debug mode the sender query's time characteristic value I used.
I mean that all the rows/columns characteristics of the sender query are available on the BADI method in a debug mode, but the column time characteristic of the sender query is not.
Also, does anyone know how should I enter the values I mapped to the export parameters in the method.
I found a good documentation here:
RS_BBS_BADI documentation,
But my problems I presented here has no solution mentioned there.
Best Regards,
Shani BashkinHi again,
Does anyone have any idea for solving this problem???
Thanks,
Shani Bashkin -
Problem passing value from List Item to List Item
OK I will try to explain what I am trying to do. I have a Form that List Item at the top and they cascade from left to right. When I get to the BPOST_TAG I choose the Bpost then move to EPOST_TAG to choose the Epost. The EPOST_TAG should show all the Epost that go with Bpost you already chose, but it only showing 1 or 2. Below is the example of how should work!
SYSTEM COUNTY ROUTE BPOST_TAG EBPOST_TAG
1 77 80 025 030
------- The Return Values Should be as below-------------------------------------------------
Sy Co Route Dir Bpost Epost Miles Descrption
1 77 80 1 025 026 ? ?
1 77 80 1 026 027 ? ?
1 77 80 1 027 028 ? ?
1 77 80 1 028 029 ? ?
1 77 80 1 029 030 ? ?
1 77 80 2 025 026 ? ?
1 77 80 2 026 027 ? ?
1 77 80 2 027 028 ? ?
1 77 80 2 028 029 ? ?
1 77 80 2 029 030 ? ?
The top 5 List Items are based on the first Data Block (PMISCURR) and the bottom 8 columns are based on the second Data Block (PMISCURR1).
I have PRE-QUERY on the first Data Block (PMISCURR), below is code for the PRE-QUERY.
DECLARE
Wh_clause VARCHAR2(200);
BEGIN
IF :PMISCURR.SYSTEM is not null then
Wh_clause := 'SYSTEM = '||:PMISCURR.SYSTEM;
END IF;
IF :PMISCURR.COUNTY is not null then
Wh_clause := WH_CLAUSE ||'AND COUNTY = '||:PMISCURR.COUNTY;
END IF;
IF :PMISCURR.ROUTE is not null then
Wh_clause := WH_CLAUSE ||'AND ROUTE = '||:PMISCURR.ROUTE;
END IF;
IF :PMISCURR.BPOST_TAG is not null then
Wh_clause := WH_CLAUSE ||'AND BPOST_TAG = '||:PMISCURR.BPOST_TAG;
END IF;
IF :PMISCURR.EPOST_TAG is not null then
Wh_clause := WH_CLAUSE ||'AND EPOST_TAG = '||:PMISCURR.EPOST_TAG;
END IF;
END;
OK It's just not my day I can't even get this line-up! :)
Edited by: Monty on May 5, 2011 2:58 PMHello,
Simply get the current item value in a When-List-Changed trigger:
current_value := :block.listitem ;Francois -
How to pass values with comma to comma seperated param in sp
hi all,
i have one sp which has param name as cordinatorname varchar(max)
in where condition of my sp i passed as
coordinator=(coordinatorname in (select ltrim(rtrim(value)) from dbo.fnSPLIT(@coordinatorname,',')))
but now my promblm is for @coordinatorname i have values as 'coorcinator1', 'coordinato2,inc'
so when my ssrs report taking these values as multiselect, comma seperated coordinator2,inc also has comma already
how to get this solved. please help me..
luckyIn the SSRS report, on the parameters tab of the query definition, set the parameter value to
=join(Parameters!<your param name>.Value,",")
In your query, you can then reference the value like so:
where yourColumn in (@<your param name>)
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Passing values with each program run
Hi ,
I have a program which runs 6 days a week and updates a table.Now my requirement is to assign a value to a field for each day when the program runs every day in the week.
<b>For first day - D
second day - D-1
sixth day - D-5.</b>
when the program runs after D-5 it should again start from D.
How can i achieve this please advise.
Regards
PavanHi kumar,
1.
03-Jun-06 D
04-Jun-06 D-1
05-Jun-06 D-2
06-Jun-06 D-3
07-Jun-06 D-4
08-Jun-06 D-5
09-Jun-06
10-Jun-06 D
11-Jun-06 D-1
12-Jun-06 D-2
13-Jun-06 D-3
2. this program will give output,
based upon date input.
3. just copy paste
report abc.
data : monday type sy-datum.
data : abc(3) type c.
data : diff type i.
DATA : DAYNR TYPE C.
parameters : mydate type sy-datum default sy-datum.
START-OF-SELECTION.
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
DATE = mydate
IMPORTING
WEEK =
MONDAY = monday
SUNDAY =
DIFF = MYDATE - MONDAY.
DAYNR = DIFF.
ABC = 'D'.
IF DIFF >= 1.
CONCATENATE ABC '-' DAYNR INTO ABC.
ENDIF.
WRITE ABC.
regards,
amit m. -
Passing values to another page with %
I have a button that redirects to another page in my application. I am passing the value of one my fields to the target page via <Set These Items> and <With These Values>. The source field has a % at the end of it. When the value gets passed to the target, the % is not passed. Is there a problem passing values with % in them?
Here is the passing parameter list:
Set These Items: P22_DB_NAME
With These values: &P2_DB_NAME.
The value of P2_DB_NAME is "ESB%". When it gets to the target page it is "ESB".Brian,
you will need to encode the percent sign and use
%25
instead of
Make your button an url and use this link. It will replace the percentage with the encoded value and pass the value to the specified item.
redirect('f?p=&APP_ID:22:&SESSION.::::P22_DB_NAME:'+$x('P2_DB_NAME').value.replace(/%/, '%25'));
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------------------ -
Hello,
We are facing Problemon Value Help is that while Clicked on the u201CValue Helpu201D button we
are getting Popup with all the values. If I Passed value with search
field then also we are getting all the value.(Search Option is not
working)
Waiting for your response.
Thanks
Chittya BejHi Chittya
Are you using BI - BEx query for creating value Help? If yes then you need to first select variable type as 'Multiple Single values'.
Then while creating 'Value Help', there is one tab for 'Get Data From' here select 'Diamension Table'. & then try with search options. IN search options you need to select ' Between, Greater than etc' & then give From & To values. IT will work.
If you have any issues then do let me know.
Regards
Sandeep -
Hello i have little problem with pass values to pop up
I want to pass values when user click on current row then show right click context menu to pop up.
i need help following code. Because it doesn't pass current row values , it passes all values in database. i thought filter doesn't work .
First i added Bind Variables named VarEnqID and Criteria named GetbyIDCriteria on my view object .
Second i created view object classes and object interfaces and view object classes method's code :
public void setSearch1C(String input)
ViewCriteria vc = getViewCriteria("GetByIDCriteria");
vc.resetCriteria();
setVarEnqID(input);
//setVarEnqId2(input);
applyViewCriteria(vc);
executeQuery();
Third i drag setSearch1C from data control to right click context menu and add attribute named Id to bindings then choose id into value.How is the context menu and the pop-up wired up?
Have you set the pop-up to lazyUncached?
Which value from the current row do you want to pass to the method?
Which Jdev version do you use?
Timo -
Problem with f:setPropertyActionListener and f:ajax
Hello,
This is my first post to this forums.
I am having some problems with the following scenario in JSF2: I have a h:dataTable populated with some items (ex. folders) and for each item I have a h:commandLink that is ajax enabled and has a f:setPropertyActionListener as a child that sets the selected folder on the backing bean and also re-renders another h:dataTable with a different kind of items (files). This part is working as expected. I want the second table to behave as the first one - when I click a h:commandLink I want to perform some action on the backing bean and to re-render a part of the page. The problem is that the action listener is not invoked, nor is the f:setPropertyActionListener.
This is the code:
<h:form id="form">
<h:dataTable var="folder" value="#{bean.folders}">
<h:column>
<h:commandLink actionListener="#{bean.go}" value="Select">
<f:attribute name="folder" value="#{folder}"/>
<f:setPropertyActionListener value="#{folder}" target="#{bean.folder}"/>
<f:ajax execute="@this" render=":form:imageTable"/>
</h:commandLink>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Folder"/>
</f:facet>
<h:outputText value="#{folder}"/>
</h:column>
</h:dataTable>
<h:panelGroup id="imageTable">
<h:dataTable value="#{bean.files}" var="image" rendered="#{bean.folder != null}">
<h:column>
<h:commandLink actionListener="#{bean.action}">
<f:ajax execute="@this" render=":form:pictureDialog"/>
<h:graphicImage value="#{image}" width="200"/>
<f:setPropertyActionListener value="#{image}" target="#{bean.image}"/>
<f:attribute name="image" value="#{image}"/>
</h:commandLink>
</h:column>
</h:dataTable>
</h:panelGroup>
<p:dialog widgetVar="dialog">
<p:outputPanel id="pictureDialog">
<h:graphicImage value="#{bean.image}"/>
</p:outputPanel>
</p:dialog>
</h:form>Any ideas on how can I achieve this and why it is not working properly in the current form?
Thank you
FlorinThe solution seams to be declaring the bean as having view scope.
-
Passing values to iframed page with flash chart.
Hi,
I'm trying to dynamically generate a series of charts within a sql report.
In my report i make several calls to a page with a (flash) chart and i pass some values to this page/chart by setting page items through the source url of the iframe.
The problem is that all the iframed instances of the page in my report display the same data although each iframe sets specific page item values through its source url.
(only the page item values that were set by the last call to the page are being used by all the other chart instances)
So why does this happen?
Are the iframed charts rendered to slow?
Is this a flash problem?
Should i call each iframe within a seperate session?
And does anyone know how to correctly pass values to the iframed page / chart so each instance of the page/chart displays the correct data?
Thanks
NielsSolved my problem by leaving the SESSION part blank in the src url of the iframe.
Apex creates a new session for every iframe now, the page items values are not overwritten and the data is displayed correctly.
Maybe you are looking for
-
Unable to install Device CALs on Windows Server 2012 after OS Reinstall
Due to a hardware fault we had to reinstall Windows Server 2012. I have activated the Terminal Services licensing Server but I am unable to install Device CALs that we have purchased. The error is as follows: "Remote Desktop Services Licensing is una
-
Checkboxes in nested repeaters always return false
I display a table using nested <netui-data:repeater> tag sets. <p> In the left column of the table, I have a checkbox to indicate user row selections for further action. These checkboxes are bound to an array of Row objects that have a boolean field
-
Trying to Install a plug-in and it keeps opening Terminal instead of Installer
When I go to the file and right click, I go to Get Info>Open With it says Terminal. That's not right and I know that but I don't know what is supposed to be there. Isn't it supposed to be some type of installer? There's a thread for Lion that says go
-
I have Firefox 3.6.10. When I checked for plug-ins updates, it opened the "plug-in check" page and showed the Shockwave Flash 10.1 r82 as "vulnerable", explaining a potential security vulnerability and suggesting to update to latest version if existe
-
VMware 5.0 and Esxi 5.0 with Windows 8
Hi Guys, We have a Virtual server which got Esxi 5.0 installed and I am using Vmware Vsphere 5.0 to manage it. Today I was going to create a Windows 8.1 VM to perform troubleshooting regarding WSUS server. But when i was creating new VM in VSphere i