Value binding with parameters
Hello
Is it somehow possible to bind value to back-end data with parameter passing to backend method? See #{databaseConnectionList.delete(dbc)} in the example below. I just need to generate onclick javascripts for each row so if user clicks on the delete action a confirmation dialog box for actual row should display (eg. Are you sure to delete database connection "MyConnection1"?). Please write me the solution, any solution. THANKS A LOT.
PS: I use MyFaces
<h:dataTable
id="databaseConnectionsTable"
var="dbc"
value="#{databaseConnectionList.list}">
... columns ...
<h:column>
<f:facet name="header">
<h:outputText value="#{messages.actions}" />
</f:facet>
<h:commandLink action="#{databaseConnectionList.delete}" immediate="true" onclick="#{databaseConnectionList.delete(dbc)}">
</h:commandLink>
</h:column>
</h:dataTable>
Bingo!
Folks I did figure out the problem. In your environment the vm defaults to Java 1.4, meaning eclipse uses Java 1.4. Now, when you create a new project (as described in steps/clip) using Java 1.5 as the compiler/facet, AppXRay fails to Introspect due to incompatible version.
Try the following steps to resolve this issue:
- Correct the JRE used by eclipse,
Window > Preferences > Java > Installed JREs - If it defaults to JRE/JDK 1.4 version then add JDK/JRE 1.5 and mark it (1.5) as default.- Quit Workshop
- start > Programs > BEA Workshop > Workshop_Studio_3.x_xxx - Properties - modify Target field to use JDK 1.5 vm
Ex:
C:\<Workshop_Home_Dir>eclipse\eclipse.exe -data workspace -feature com.m7.nitrox -application org.eclipse.ui.ide.workbench -vm C:\<j2sdk1.5.0>bin\javaw.exe -vmargs -Xms128M -Xmx512M -XX:MaxPermSize=128M -Dosgi.splashLocation=C:\<Workshop_Home_Dir>Workshop\splash.bmp
NOTE: Due to the field length limitation, you might have to remove -Dosgi.splashLocation argument.
- re-launch Workshop
- retry the steps and you should not hit the reported issue
FYI:
- You can refer to Workshop/eclipse log
* .log within workspace.\.metadata directory
* workspace\.metadata\.plugins\com.m7.nitrox\wstudio.0.log
Similar Messages
-
SelectMany checkbox value-binded with HashMap String,ArrayList
Hello,
Someone can help me please?
Im trying to create a page with a lot of HtmlSelectManyCheckbox, and i need to value-bind then to the same Object in my BackingBean.
First i attemped to bind all HtmlSelectManyCheckbox with a single ArrayList, but only the last SelectMany had their values inserted on the ArrayList...
So, now im trying to bind all the HtmlSelectManyCheckbox with a HashMap<String,ArrayList>, because i would have just one object and for each entry I would have the checkboxes that were cheked in a single HtmlSelectManyCheckbox.
Now my question: there is a way to make this work?
my code example
Backing bean
private HashMap<String, ArrayList> respostaMatrizCheck = new HashMap<String, ArrayList>();
public HashMap<String, ArrayList> getRespostaMatrizCheck() {
return respostaMatrizCheck;
public void setRespostaMatrizCheck(HashMap<String, ArrayList> respostaMatrizCheck) {
this.respostaMatrizCheck = respostaMatrizCheck;and the bindings
<h:selectManyCheckbox value="#{backingBean.respostaMatrizCheck['1'] }">
<h:selectManyCheckbox value="#{backingBean.respostaMatrizCheck['2'] }">And the error message given when i tryed this is the following:
javax.servlet.ServletException: ValueBinding for UISelectMany must be of type List or Array
Any help would be welcome.
Thanks,
FerryHas anybody solved a problem like this? I am facing the same problem and no response helped me so far.
Here is the web code:
<h:selectManyCheckbox value="#{processor.languages.languages1}">
<f:converter converterId="languageConverter" />
<f:selectItems value="#{categoryController.allLanguagesAsSelectItems}" />
</h:selectManyCheckbox>My backing bean "processor" looks like this:
public Map<String, List<MyObject>> getLanguages() {
return languagesMap;
}(The backing bean has no "setLanguages()-method" since I did not need any with Map<String, String> for example.)
The converter I use creates a "MyObject" instance in its "getAsObject" conversion method.
I think everything should be okay then but the exception I get after submitting the page is:
java.lang.IllegalArgumentException: ValueBinding for UISelectMany must be of type List or Array
org.apache.myfaces.shared_impl.renderkit._SharedRendererUtils.getConvertedUISelectManyValue(_SharedRendererUtils.java:191)
org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedUISelectManyValue(RendererUtils.java:630)
org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.getConvertedValue(HtmlCheckboxRendererBase.java:308)
javax.faces.component.UISelectMany.getConvertedValue(UISelectMany.java:308)
javax.faces.component.UIInput.validate(UIInput.java:350)
.....Edited by: rapthor on Oct 31, 2007 6:39 AM -
Localized String with params - Value Binding Expression...
Hi All:
I see many e.g.s where a command button / or a label's value can be a localized resource string using the generic value binding expression:
"#{bundleVarName.keyName}"
what if the resource string has parameters? for e.g.
button.caption = Click Me for {0}
Can we assign a value binding expression with params for button captions etc.
Please help - I am a newbie in JSF,,,
regards
-SomeshJSF developers have forgotten about this :)
Use other tools for displaying such messages (f. e. JSTL) where you need to have parametrized messaged.
But mostly, non-parameterized JSF will be enough. -
How to query Database with Parameters and configure null value response?
Hi,
1.When capture attributes from forms & after applying several logics, passing to a DB table using an API, how to get relevant values for a given parameter in another DB table ?
2.When a DB table is queried, if the value does not exist, how to configure the response message ?
Thanks.Okay, you've provided exactly what John S. asked for - and no more. This is helpful, but not enough. I think we're going to need a use case to understand exactly what you are asking. What should the user see? What does the user do next? What should happen in the database and in the application when the user does this?
However, I'll try to read between the lines a bit, and get you part of the way there. To query the database with parameters in ADF BC, you need a View Object (VO). The simplest thing to do is create the SELECT command behind the VO with some bind variables and add the bind variables to your VO. At that point, you will get an ExecuteWithParameters operation in the Data Control. You can drag that operation onto a JSF page and it will give you an option to create a parameter form to let the user fill in the parameters to set the bind variables, and a button to execute the query with these values. Any table or form based on that same VO will show the selected data.
A Trinidad or ADF Rich Faces table will have an attribute to let you define some text to show the user if no data was retrieved by the query. But there are other ways to determine if data was retrieved which you can use to control other ways to display this information. For instance, I have a page that has an outputText component that has a "rendered" attribute to show the text only when there was no data retrieved by a query. -
How to bind values for input parameters from an adf table?
Hi,
The version I am using is
Jdev TP4 11.1.1.0.0
I need to know how to bind values for input parameters to methods.
I have created an af:table and I have a button created using a method which is outside the af:table. This method needs to take input parameter values from the column values in the table.
When I have an adf form instead of the table the binding works.
Any help?
Thanks.Hi Balaji,
you need to bind you table to a backing bean and call a method in the backing bean when you hit the button. In the method you get the selected row from the table and have access to the columns of it. Then call the the method with the parameters.
To bind the table to a bean select the properties of the table, go to behavior section and look for the advanced section 'Binding' property.
Select the small down arrow at the right side and click edit. In the dialog select or create a bean and property for the table.
Go to the button properties, look for 'Action', again select the small down arrow and click 'Edit'. Select the bean which holds the table property and create a method for the button.
The method look like public void bearbeitenQuelle(ActionEvent actionEvent)
// Add event code here...
RichTable lTable = getYourTable();
Object lData = lTable.getSelectedRowData();
FacesCtrlHierNodeBinding lNB = (FacesCtrlHierNodeBinding) lData;
YourViewRow lRow = (YourViewRow ) lNB.getCurrentRow();
}Hope the get you started
Timo -
How to bind with LOV In method parameters
Hi,
My requirement is I have one method with parameters in data controll. Some of the parameters want to link with LOVS(input combo box list of values ).
I tried with direct dragging with single selection choice list and select one list box. This is creating performance problem. So i am trying to bind with input combo box list of values.
Then i want to cascade with each other.
Anybody having any idea please guide me
Regards
Bijesh kemployeeDataProvider.getValue("EMPLOYEE.NUMBER0")
gives an error .What is the error? Does red x appears in the margin in the Java source editor? If so, when you place the curson over the red x, the tooltip shows the error. What does it say.
Is it a runtime error? Does a page show with a stacktrace? If so, what is the error? When you look at the stack trace do you find your page mentioned anywhere. If so, it shows a line number. What does that code look like (that is pointed to by the line number)? -
How to insert a null value to combobox which is bind with datasource
Hi,
i am working on c# winforms application. I have 2 comboboxes one is CustomerCbBox and another is OrderCbBox. CustomerCbBox is bind with data source.
on CustomerCbBox SelectedIndexChanged event data is populated in OrderCbBox from data source.
i want to add a null or empty field in CustomerCbBox. all I want is that when the user don't Select Customer Name and OrderNo null or empty data enter in database. but when i click Insert Button it generate error "Object reference is not "object
reference not set to an instance of an object".
here is my code.
private void MainForm_Load(object sender, EventArgs e)
production pd = new production();
CustomerCbBox.DataSource = pd.Customer();
CustomerCbBox.DisplayMember = "Cust";
CustomerCbBox.ValueMember = "CustId";
private void CustomerCbBox_SelectedIndexChanged(object sender, EventArgs e)
try
string PartyName = CustomerCbBox.SelectedIndex.ToString();
PONum1.DataSource = pd.GetPOnumActive(PartyName1);
PONum1.DisplayMember = "PONum";
PONum1.ValueMember = "PONum";
catch (Exception ex)
MessageBox.Show(ex.Message);
Please help me to solve this problem thanks.Hello,
We could check whether the user has selected any items before adding that to database.
if (CustomerCbBox.SelectedIndex > -1)
// do something
}else{//add dbnull to database}
And for adding null to databse, we could pass DBNull.Value instead.
Regards,
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Value binding not working with rendered attribute
In my jsf page i'm encountering problem with value binding it is not working for a h:inputText with rendered condition even when the rendered condition evaluates to true & the component is rendered.While trying to retrieve the value of the components with conditional rendering on submit i'm unable to retreive the value while on removing rendered condition the value binding is working perfectly
<h:selectOneMenu id="DropDown" value="#pc_GeneralRequestInfo.objInfoDTO.State}" rendered="#pc_GeneralRequestInfo.objAddressRequestDetailsDTO.selectedAddressType == 'HOME'}">
<f:selectItems value="#{pc_GeneralRequestInfo.statesList}" />
</h:selectOneMenu>There is a { missing from the value attribute in the code you posted.
-
How to create table with list/map value binding
I need to display few values in a tabular format. Is it possible to create adf table without having value binding to a VO object. Can I make a table with some list/map combination.
I want to change the display format with minimum change in the application. Hence I am looking for a change to define a list/map and map it with the table.
Following is the structure I need to display in.
| |Header1|Header2 |
|_______|_______|_______|
|Txt R1 |value 1 |Value 2 |
|_______|_______|_______|
|Txt R2 |Value 3 |value 4 |
|_______|_______|_______|
All the views does not have any relation. Hence I should not create a VO and adding rows of the VO object.
Edited by: Jaykishan on Jun 10, 2011 11:34 AMYes, you can do it. Create a pojo with the properties(column) you want to display in the table and create a list with the instances of pojos and then you can populate your table using the list.
Sample:
//POJO
public class SamplePojo {
private String col1;
private String col2;
public SamplePojo(String col1, String col2){
this.col1 = col1;
this.col2 = col2;
//add setter and getter methods
//Inside bean, prepare a list with pojo instances (Assume a getter exists for pojoList)
pojoList = new ArrayList();
pojoList .add(new SamplePojo("Value1", "Value2");
pojoList .add(new SamplePojo("Value3", "Value4");
etc.
//Inside jspx
<af:table value="#{<Bean>.pojoList}" var="pojo" ...>
<af:column headerText="Header1" ..>
<af:outputText value="#{pojo.col1}"/>
<af:column>
<af:column headerText="Header2" ..>
<af:outputText value="#{pojo.col2}"/>
<af:column>
</af:table>HTH
Sireesha -
Problem while Binding multiple Parameters to View Object[Solved]
Hello,
I am facing problem while binding multiple parameters with different data types in View Object query. For example suppose I have following query in my view object.
SELECT Header.ADDED_BY
Header.BATCH_ID,
FROM BATCH_HEADER Header
WHERE :1='deptAdmin' and Header.BATCH_ID
in
select batch_id from batch_header_dept_mapping where dept_id in(SELECT * FROM TABLE(CAST(:0 AS TABLE_OF_VARCHAR)))
I am able to pass the Bind variables of Array type for : 0 , using Steve's ArrayOfStringDomain example. (ArrayOfStringDomain) .
But after passing value to second bind parameter ie.. :1 .
I am getting the error as follows.
## Detail 0 ##
java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CHAR.
I tried to set
setWhereClauseParam(1,11); // 11 is Number
setWhereClauseParam(0,arr); // arr is arr = new Array(descriptor,conn,deptid); for in parameter.
But of no use , Please let me know if any thing missing form me or have any another solutions. Also please provide me any example if have.
Thank you,
Sandeep
Edited by: user11187811 on Oct 23, 2009 7:27 AM
Edited by: user11187811 on Oct 26, 2009 12:52 AM
Edited by: user11187811 on Oct 26, 2009 6:51 AMhi.
but when using non-Oracle named parameter binding styles as you've done (ie. , :1), regardless of what number you give each bind variable, they are sequenced 0, 1, 2 etc. As such your bind variable :1 is the 0th parameter, and your bind variable is the 1st parameter.Your statment is correct.
:1 i used was actually on 0th position and :0 was on 1 position. Like you said in sequence 0,1,2 etc. Now i get the answer and i corrected My mistake by assigning right values to right binding variable. and problem just solve.
Thanks Chris. -
Calling portal v2 pages with parameters in a jsp
Hello everybody,
I'm currently trying to create, in a jsp, a link to a portal-v2 page with parameters.
Practically :
[JSP / Portlet 1]
- a 1st jsp generates some links, all to the same page but each sets a different value to a parameter (for example a productId in a list).
[JSP / Portlet 2]
- a 2nd jsp gets this parameter and use it (for example it displays the details of the chosen product).
So the 1st portlet would be jsp (coded by a portlet designer) and clicking a link would lead to another page (chosen by a page designer) which would hold the 2nd portlet (= 2nd jsp, coded by the same portlet designer).
Writing the second jsp is easy : getting parameters is described in many examples and pdk articles.
But I can't find the java methods to use to generate the link. More precisely I don't know how to call the portal page (which would then be a jsp1's parameter). Adding the parameter is well described in the jpdk API-Doc.
I've tried to use portal events but they seem to work only in an html form. So I supposed it was a wrong way.
As I've lost myself so many times in the API-Doc and I didn't find any jpdk sample about that, I would be really thankfull if someone has an idea (may I hope for a sample code ? :-)
Thanks.
Jean-RochI'm having a similar problem!
I have a JSP page which I have published as a portlet to Portal. The JSP portlet is placed on Portal a page. I need to call this Portal page with some parameters in the URL, which should get passed to the JSP portlet.
In the JSP portlet I used this syntax in release 1 to retrieve the URL parameters:
String p_itemID = request.getParameter("item_id");
That worked great in release 1, but not in release 2.... I think the problem is that you need to define which parameters a portlet has, then map those portlet parameters to page parameters in the page properties. In dynamic page - portlets you define bind variables to accomplish this. But how do you do in JSP portlets? When you try to map Page Parameters to the JSP portlet you'll find that Portal doesn't think that the JSP portlet has any parameters. Hence the page parameters does not get passed to the portlet.
(More info: JDBC----getImportedKeys() )
I've looked at the Multipage example and the forminput example. But I don't see how pass a parameter in the URL to the very first JSP portlet from looking at those examples. I do see how you can pass parameters to the next JSP portlet, but that's not my problem. Maybe I'm missing something obvious...
Any ideas? -
Need to bind 2 parameters on my onLovInit
Hi again!
Now I need to bind 2 parameters on my onLovInit.
I call this function:
function setBinding(params)
//this works great
params["bindParam"]=document.getElementById('VB_Adm110ProgrammesEleves1LKP_ETA_ID_NON').value;
//Now how can I bind another parameter, something like:
//params["bindParam2"]=document.getElementById('VB_Adm110ProgrammesEleves1LKP_SEE_ID_NON').value;
return true;
}And in my struts, I have something like:
<set-property property="whereClause"
value="TheTable.TheColumn=:1/>
<set-property property="iterBinding" value="ProGrillesCheminementsLov1LookupIterator"/>
<set-property property="bindParams" value="ProGrillesCheminementsLov1LookupIterator=${param.bindParam}"/>Here, how can I bind the second parameters?
I hope you can understand! :)
Thanks for any help!
MartinMartin,
You are well on your way!
In onLovInit you have the right code, just uncomment the second line:
params["bindParam2"]=document.getElementById('VB_Adm110ProgrammesEleves1LKP_SEE_ID_NON').value;
In the struts-config, you only need to set the bindParams property (which by the way you can generate using the JAG). You can use a comma-delimited list of bind params:
<set-property property="bindParams" value="ProGrillesCheminementsLov1LookupIterator=${param.bindParam},${param.bindParam2}"/>
Now, in your View Object where clause definition, you must already include the where clause with bind params, something like :
column1 = :1 and columns2 = :2
Steven Davelaar,
JHeadstart Team. -
Calling stored procedures with parameters with the Database Connectivi​ty Toolkit
Hi all,
I am new to the forum and am having difficulty finding a solution to a particular problem I am having regarding using the LabVIEW Database Connectivity Toolkit on a project I am currently working on at my job. I have a database in which I have tables and stored procedures with parameters. Some of these stored procedures have input, output, and return parameters.
I have been trying to follow this example but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument
One such stored procedure I am working on implementing is named "dbo.getAllowablePNs", which executes "SELECT * from DeviceType" (DeviceType is the table). In this case, it does not require an input parameter, it has an output parameter that generates the table [cluster], and has a return parameter which returns an integer value (execution status code) to show if an error occurred. The DeviceType table has 3 columns; ID (PK, int, not null), PN (nvarchar(15), null), and NumMACAddresses (int, null). I have gone over many examples and have talking to NI support to try to implement this and similar stored procedures in LabVIEW but have not been successful. I am able to connect to the database with the Open Connection VI without error, but am running into some confusion following this step. I am then trying to use the Create Parameterized Query VI to call the stored procedure and set the parameters. I assume I would then use the Set Parameter Value VI for each parameter that is wired into the parameters input on the previous Parameterized Query VI? I am also having some confusion during and following these steps as well. I would greatly appreciate any advice or suggestions anyone might have in regards to this situation as I am not a SQL expert. Also, I would be happy to provide any more information that would be helpful.
Regards,
Jon
Solved!
Go to Solution.Also, I don't know if this would be helpful but here is the actual stored procedure in SQL:
CREATEPROCEDURE [dbo].[getLastSequenceNumber]
@p1 nvarchar(10)='WO-00000'
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SETNOCOUNTON;
-- Insert statements for procedure here
selectmax(SequenceNumber)from Devices where WorkOrderNumber= @p1
END
GO -
List view - filter with parameters
Hi,
I need to define a list view to filter data with parameters.
I saw how to do it with the SPD in another post
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/92271aa4-6582-4ea5-a10f-deaf02d2b62c/filtering-the-list-view-by-passing-date-parameters-using-sharepoint-desginer-2010?forum=sharepointcustomizationprevious
But need to do it in visual Studio (via definitins or Object Model).
How can I do that in Visual Studio?
Help is really appreciated.
Many thanks,
DDHi,
According to your description, you might want to create a list definition with the filter value from query string from URL. Then when you create a list instance with this list
definition, you will be able to filter the list view page by appending parameters to the URL in the address bar.
You can achieve this through modifying the Schema.xml file in the list definition project in Visual Studio like this:
How to create custom list definition
http://msdn.microsoft.com/en-us/library/office/gg276355(v=office.14).aspx
http://www.codeproject.com/Articles/412429/SharePoint-Create-List-Definition-and-Instanc
CAML Query Schema
http://msdn.microsoft.com/en-us/library/office/ms467521(v=office.15).aspx
Then we can filter the list with such an URL:
http://sp/Lists/List1/AllItems.aspx?Param1=2014-08-24&Param2=2014-08-28
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
How to call a AM method with parameters from Managed Bean?
Hi Everyone,
I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
Class[] paramTypes = { };
Object[] params = { } ;
invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
String aVal = "test";
Class[] paramTypes = {String.class };
Object[] params = {aVal } ;
invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
Thanks,
San.Simply do the following
1- Make your Method in Client Interface.
2- Add it to Page Def.
3- Customize your Script Like the below one to Achieve your goal.
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
operationBinding.getParamsMap().put("username", "oracle");
operationBinding.getParamsMap().put("role", "F1211");
operationBinding.getParamsMap().put("Connection", "JDBC");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
return null;
i hope it help you
thanks
Maybe you are looking for
-
How can two family members use iCloud separately with one apple ID?
-
I have a MSI 8600 GT (passive cooled model) and tried to hook it up to a 37 inch hdtv. The tv supports 720p resolution. I used a video out to composite cable that came with my card and a standard composite cable to hook up to the tv. With the tv on c
-
Error "Cannot be resolved to a type" on OwnerPIN, APDU, ISO7816
The error I'm reffering to might clearify the fact that I'm new at Java/javaCard-development. To learn how it all works I've downloaded an example and try to understand what happens. I opened the source in Eclipse and get errors "Cannot be resolved t
-
How to install "Oracle Universal Content Management 10g Patch Update Bundle
I have downloaded and installed Oracle Content Server 10g r3 , and i did a simple cycle for a work-flow , and after that i downloaded "Oracle Universal Content Management 10g Patch Update Bundle", but when i opened the file i found that it contains m
-
How do I cut out an image from one photo and paste it in another photo?
Help! I did use the scissors and eraser tool to cutout unwanted background, and now I have an image I want to save and copy to another photo. The problem is that Elements 11 won't let me open up another photo at the same time, or let me copy the se