Invoking binding operation from backing bean -- no data displayed in ADF table ?
Hello experts, I have data control derived from Web Service proxy client. In this data control, I have multi record list derived from web service call.In my ADF page, I have bunch of input components with many drop down lists and radio buttons, check boxes etc.
Finally I want to transfer user input to data control. In my ADF page, I have mapped the result set of data conrol to ADF table.
When I click submit button, the input data from ADF page is passed to data control operation. In the bean method, I am making use of operationBinding.execute() and operationBinding.getParamsMap().put(). I see it is fetching data by checking getResult().
I am invoking partial trigger also on the table. However, table is not getting populated with the data.
please help me. Jdeveloper verion is 11.1.1.6. I have set "Refresh" attribute to "never" for iterator in the bindings tab. But no luck. I see that control coming to data control and calling web service and getting the data and then it comes back to my bean method submit() and I see that getResult() is showing records fetched. But why the table on ADF page is not showing the data ?
thanks a lot in advance.
I still not able to get my table updated with data. If I set "Refresh" to "ifNeeded", soon after coming out of submit method of bean, it again tries to execute the web service call in the data control and brings empty result since the search parameters are empty. I do not know why it goes again to data control method. So, when I hit submit button, the bean method calls operationBidnding.execute() and before this I set the parameters also. After execute(), addPartialTarget() gets executed and it comes out of submit. At this time, it is supposed to go to ADF page. But I see that it tries to execute method in data control with empty parameters. This is ridiculous. It neither works with "never", nor with "ifNeeded".
I see many forums on this issue but no solution found...all those forums are not answered. This looks like it is a bug in ADF table not able to refresh from managed bean !!!!
thanks
Similar Messages
-
Invoke task flow from backing bean?
Hi,
Is there a way to invoke task flow from a backing bean? If yes, how?
Thanks in advanceThanks Frank. I am not an expert with ADF so please bear with me if my questions doesn't make sense. Basically what I am trying to achieve is this.
I have a taskflow and I am currently in a ui page which displays a page fragment inside this task flow. In this page, on click of a button, I need to call another task flow and show it in a adf popup. Is this the case referred in the pdf document that you pointed out?
Thanks -
Problem while invoking popup from backing bean
I am invoking a popup from backing bean method.
The same backing bean method has the business logic which depends on the data collected from popup(user enters some data on popup).
So I need the business logic to be executed after popup comes up.
The popup is coming after the execution of return statement in backing bean method . How do i make popup trigger at earlier point in the method.
<af:commandToolbarButton text="#{corePostupgradeuiBundle.SIGN_OFF_MIG}"
id="socb52"
partialSubmit="true"
actionListener="#{viewScope.signoffBean.signOffAgents}"
partialTriggers="t3"/>
public void signOffAgents(ActionEvent event) throws SQLException {
DCBindingContainer bc =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding summaryIter =
bc.findIteratorBinding("Signoff1Iterator");
showPopup("credentials"); //will get credential details from user and store in credential Bean
//Following logic uses the data collected from popup
EMCredentialReference credRef= credentialBean.getCredReference();
submitJOb(credRef);
public static void showPopup(String popupId) {
FacesContext context = FacesContext.getCurrentInstance();
StringBuilder script = new StringBuilder();
script.append("AdfPage.PAGE.findComponent(\"").append(popupId).append("\").show();");
ExtendedRenderKitService erks =
Service.getService(context.getRenderKit(),
ExtendedRenderKitService.class);
erks.addScript(context, script.toString());
UIComponent component = context.getViewRoot().findComponent(popupId);
RequestContext.getCurrentInstance().addPartialTarget(component);
}Well, your work flow is wrong.
What you try to accomplish should work out of the box as
1) user hit toolbar button
2) this opens a popup "credentials" which have listeners for ok and cancel
3) use fills in data in popup and hit ok or cancel
4) one of the listeners gets fired
5a) if OK listener you do your business logic
5b) if cancel you do something else
So all you have to do is the use a af:af:showPopupBehavioron the toolbar button, add a popup canel listener (if you need to act on canel) dependign on your popup design (dialog or simple button) add the appropriate listeners and in the listener method so your business logic.
Timo -
How to override the where clause (Bind Variables) in Backing Bean.
HI
I am using bind variables in VO and using exeutewithparam to pass the values to bind. Which is working fine.
But what i want now to override the values pro grammatically from backing_bean of that page.
How can i pass the values to bind variables from bean.
M Niaz.Hi
Try this if it works. this is from 10g
1)create value binding in the backing bean on any action
FacesContext ctx=FacesContext.getCurrentInstance();
ValueBinding vb= ctx.getApplication().createValueBinding("#{bindings['account_name1'].inputValue}");
2) and then set the value for binding
vb.setValue(ctx,(String)accountInput.getValue());
Now execute the method with method binding and execute it
ctx.getApplication().createMethodBinding("#{bindings.ExecuteWithParams.execute}",null).invoke(ctx,null);
Regards
Rohit -
Need to Add and Remove Columns of ADF Read Only table from Backing bean
I have a scenario where I am trying to Populate TransientVO which is shown has a ADF Read Only Table in page.
I have couple of Check Boxes Based on their selection I am trying to render and hide certain Columns.
But the Issue which I am facing is only the Column Header seems to change where as the Rows and Values doesnt..
even If I apply the expression language rendering condition on the outputText inside those columns.. ..
So I am thinking to add and remove VO Attribute columns to the table from backing bean.
Need some sample code snippet or a better design to achieve this. Its kind of urgent too...having an aggressive deadline :(
Please chip in People..
Thanks in Advance .
TKTable Code..
<af:table value="#{bindings.InventoryGridTrans.collectionModel}"
var="row"
rows="#{bindings.InventoryGridTrans.rangeSize}"
emptyText="#{bindings.InventoryGridTrans.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.InventoryGridTrans.rangeSize}"
rowBandingInterval="0" id="t4"
partialTriggers="::sbcSales ::sbcUsage ::cb1">
<af:column sortProperty="Period" sortable="false"
headerText="#{bindings.InventoryGridTrans.hints.Period.label}"
id="c38">
<af:outputText value="#{row.Period}" id="ot33"/>
</af:column>
<af:column sortProperty="Past12SalesCount"
sortable="false"
headerText="#{bindings.InventoryGridTrans.hints.Past12SalesCount.label}"
id="c29"
rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
<af:outputText value="#{row.Past12SalesCount}"
id="ot40"
rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}"
visible="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
<af:convertNumber groupingUsed="false"
pattern="#{bindings.InventoryGridTrans.hints.Past12SalesCount.format}"/>
</af:outputText>
</af:column>
<af:column sortProperty="Past12UsageCount"
sortable="false"
headerText="#{bindings.InventoryGridTrans.hints.Past12UsageCount.label}"
id="c40"
rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
<af:outputText value="#{row.Past12UsageCount}"
id="ot47"
rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
<af:convertNumber groupingUsed="false"
pattern="#{bindings.InventoryGridTrans.hints.Past12UsageCount.format}"/>
</af:outputText>
</af:column>
</af:column>
</af:table> -
How to show popup from backing bean code immediately?
Hi,
I'm using JDeveloper 11.1.2.1.0 and have problems with showing popups. I have a button with an action on my page and a method in backing bean.
I want to rise up few popups from this method in backing bean (for example just an anouncement that something will happen) or a dialog
(for example a question if you want to continue).
I understand how to get a dialog response to deal with it in code, but the problem is that the popup doesn't show up immediately, but only when
this method called on button finishes. I'd like to handle dialog responses in the middle of the action and then the code to continue with the execution.
Here is my backing bean code:
private RichPopup popup;
public String test() {
//Some code...
RichPopup.PopupHints hints = new RichPopup.PopupHints();
popup.show(hints);
//Here is the place for code which I want to be executed after popup closes,
//but is executed before the popup shows...
return null;
And here is part of my jssf:
<af:commandButton text="Test" id="cb1"
action="#{popupBean.test}"/>
<af:popup id="popup" binding="#{popupBean.popup}">
<af:dialog id="dialog" type="yesNo"
title="Dialog"
dialogListener="#{popupBean.onDialogAction}"
binding="#{popupBean.dialog}" clientComponent="true">
<af:outputText value="Do you want to continue?" id="ot1"/>
<af:clientListener method="onDialogCancel" type="dialog"/>
<af:serverListener type="DialogCancelHandlerEvent" method="#{popupBean.onDialogCancel}"/>
</af:dialog>
</af:popup>
Can someone give me some answer how to show the popup from backing bean code immediately?
Thanks in advance,
TinaIf you want to execute code after popup closes, then put this code in PopupCanceledListener or in DialogListener(you can't block method execution).
Dario -
Binding parameters in backing bean
hey,
i have a function func1(String str) with a parameter
in my bb i use code to invoke the function:
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("func1");
operationBinding.execute();
how can i bind parameter in backing bean?hi user,
+ with,
here some
your bean
public class Login {
private RichInputText it2;
private RichInputText it1;
public void setIt2(RichInputText it2) {
this.it2 = it2;
public RichInputText getIt2() {
return it2;
public void setIt1(RichInputText it1) {
this.it1 = it1;
public RichInputText getIt1() {
return it1;
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("checkLoginCredentials1");
operationBinding.getParamsMap().put("p_user", it2); p_user - bind var
operationBinding.getParamsMap().put("p_pwd", it1); p_pwd - bind var
} your method in am:
public String checkLoginCredentials1(String p_user, String p_pwd) {
/*set the bind variable value*/
vo.setNamedWhereClauseParam("p_user", p_user.toUpperCase());
vo.setNamedWhereClauseParam("p_pwd", p_pwd.toUpperCase());
return "Welcome" + " " + p_user.toUpperCase();
}p_user - say this in vo also
p_pwd - say this in vo also
just an references.
Edited by: Erp on Nov 23, 2011 11:00 PM -
Few basic doubts about accessing AM from backing bean class
Hi ADF experts,
I have just started working in ADF Faces.I made a sample search page.My page is attached to a managed backing bean. I have attached command button on my page to a custom method in backing bean class.
So on, click of button this method is called in backing bean.Now, i have few doubts:
1)How to get values of various UI beans in this event code?
2)I am accesing AM , in my method with this code:
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext extContext = facesContext.getExternalContext();
Application app = facesContext.getApplication();
DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(facesContext, "bindings");
//Accessing AM
ApplicationModule am = binding.getDataControl().getApplicationModule();
iS this correct ?
3) After getting handle of am how to call my custom method in AM Class?there was "invokeMethod" API in application module class in OAF, is there any such method here?
Please help me.
--ADF learner.Thanks for ur response Frank, actually I am from OA Framework back ground.It would be great if help us a little with ur valuble thoughts.
OA Framework also uses bc4j in model layer of framework. We have a requirement where our existing developers from OA Framework have to move to ADF to make a new application where time lines are quite strict.If this would not be possible we will switch to plain jsp and jdbc,but our tech experts say ADF Faces is the best tech.
In OA Framework, Application Module is key class for all busiess logic and Controller is used for page navigation. So, I m just trying to find the same similarity , where we write we add all event codes in custom action methods in the backing bean class of page, which we consider equivalent to process form request method in Controller class of OAF.
But there are two things, I still want to know:
1)While page render, how to call specific AM methods(like setting where clause of certain VOs)
2)In action methods, the way i described(I found that in one thread only)to access AM, what is wrong in that?Also, I went through
http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
where coule of examples use similar approach to access AM from backing bean class and call custom methods of AM(Doing various, deletes etc from VOs).
3)In these methods can we set any property of beans on the page, I am asking because in OAF, generally we use PPR for js alternatives.But all properties of beans cannot be set in post event.
Thanks and Regards
--ADF Learner -
Web services and ADF 11g- get Result from backing bean
I'm executing an action from backing bean (call Web service that returns complex data types)
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("unesiPonudu");
Object result = operationBinding.execute();
result is instance of oracle.adf.model.adapter.dataformat.XMLHandler$DataCollection but DataCollection is not accessible.
How to get results from method?
Tnx,
AndrejaHi,
there should be a result iterator in the Executables section which cotnains the result. If not, create it from the WS result entry in the DC palette. Once this iterator gets updated, you get the data from this iterator as it would be the case of a table accesses the WS
Frank -
Is it recommended to instantiate Model object from Backing Bean
Wondering what are the best practices in developing JSF,Spring, Hibernate application.
Appfuse/Equinox example instantiate Model Object i.e. POJO in the Backing bean. Here is the snippet
UserForm.java (Backing Bean)
public class UserForm {
public User user = new User();
public UserManager mgr;
// Getter & Setter methods for user & mgr
//Persistence
public String save() {
mgr.saveUser(getUser());
addMessage("user.saved", getUser().getFullName());
return "success";
I undertand the purpose of having UserManager defined in backing bean but wondering why do we need to have Model (i.e. User) defined in backing bean . Is this a best practice?
Is it recommended to populate model object with data in the backing bean and then call for business methods like mgr.saveUser(getUser());
Regards
BansiHere is some more info
UserForm is a JSF managed bean,
User is a hibernate mapped POJO, and
UserManager is manager class in Spring
I am wondering about perfomance issues i.e. making DB calls from backing bean getters or setters. DB calls can mean a performance hit, and JSF will call the getters and setters multiple times per page request (which means you'll be doing multiple DB calls). -
Clarification on application method calls from backing bean.
Hi Experts ,
In our application we are using two different ways to call application module methods from backing bean.
allication module method name : addRowValidUnitInfo
it has 2 parameters serialNumber,modelNumber
1.
BindingContainer bindings1 =
BindingContext.getCurrent().getCurrentBindingsEntry();
OperationBinding serialModelDetails =
bindings1.getOperationBinding("addRowValidUnitInfo");
serialModelDetails.getParamsMap().put("serialNumber",
serialNumber.getValue().toString());
serialModelDetails.getParamsMap().put("modelNumber",
modelNumber.getValue().toString());
serialModelDetails.execute();
String result =serialModelDetails.getResult().toString();
2.
EWarrantyAdminModule appModule =(EWarrantyAdminModule)
Configuration.createRootApplicationModule(amDef,config);
try {
String result = appModule.addRowValidUnitInfo(serialNumber.getValue().toString(), modelNumber.getValue().toString());
} catch (Exception e) {
finally {
Configuration.releaseRootApplicationModule(appModule,true);
Can any one tell me which one gives best performance and which one should be used in which situations.
For me both are working fine but just want to know whcih is the best practice and which gives best performance.
Regards
GayazThe approach 1 is the right way.
Reasons:
1) With Approach 2 - you are creating new ApplicationModule on the fly and release it at the end of the request. If you are invoking multiple method calls, you need to the same for each & every call.
This is not reusing the existing application module.
2) If the use cases which does calls for maintaining state across requests from the same client - across the application flow, Approach 2 cannot be used.
Read this blog post from Jobinesh (which indirectly distinguishes both these approaches).
http://jobinesh.blogspot.com/2010/04/invoking-applicationmodule-from-servlet.html
Thanks,
Navaneeth -
Unable to execute javascript from backing bean
Hello experts, I want to execute javascript function from backing bean method.
In my .jsff page, I have added the javascript as :
<jsp:root ..... >
<af:resource type="javascript" >
function fileDownloadJS() {
alert(" tesing js from backing bean");
</af:resource>
</jsp:root>
in my backing bean method :
public void callJSfuntion(ActionEvent actionEvent) {
RenderKit rk = FacesContext.getCurrentInstance().getRenderKit();
ExtendedRenderKitService erks = (ExtendedRenderKitService) Service.getService(rk, ExtendedRenderKitService.class);
erks.addScript(context, "fileDownloadJS();");
I have table in my .jsff page, inside table column, I have command link and when I click the link, I am invoking bean method :
<af:table ....>
<af:column sortProperty="title" sortable="true"
headerText="File name" width="250px" id="Title"
clientComponent="true">
<af:commandLink id="cl1" actionListener="#{MyBean.callJSfuntion}" clientComponent="true">
<af:outputText value="#{row.title}" id="ot1"/>
</af:commandLink>
</af:column>
.</table>
But when I run my taskflow and click on the link inside the table column, JS function is not invoked.
Absolutely no clue what is the issue.
Appreciate if you can help me out to resolve this issue. Thank you.For debugging purpose can you try :
<script type="javascript" >
function fileDownloadJS() {
alert(" tesing js from backing bean");
</script>
put it on top of the page and let me know what happens.
If it doesn't work try writing the function itself in your addScript(context, script); to see if it works. -
Invoke any operation from inside a webmethod
I think it is a easy problem but I can't solve it:
<br>
<p>
I like to generate with JWS a WSDL-file:
<br><p>
----------ANT Snip ----------------------<br>
<target name="build-service"><br>
<jwsc srcdir="${basedir}../../" destdir="../../output/${ear.deployed.name}"><br>
<jws file="/${packageName}/${javaClassName}"/><br>
</jwsc><br>
</target><br>
<br>
---------------------------------------<br>
<br><p>
I don't like to use user defined Types her. I want only invoke any operation from my Web Service Method if it is invoked.
<br>
My actually not worked code snip:
<br>
---------------------------------------------------<br>
<br>
..........................<br>
<br>
@WebService(name="anyPortType",<br>
serviceName="anyService",<br>
targetNamespace="http://example.org" )<br>
<br>
@SOAPBinding(style=SOAPBinding.Style.RPC,<br>
use=SOAPBinding.Use.LITERAL)<br>
<br>
@WLHttpTransport(portName="commuPort",<br>
contextPath="anyclient",<br>
serviceUri="anyclientimpl")<br>
<br>
public class HelloWorldImpl {
<p>
@WebMethod(operationName="persistMyData")<br>
public void invokeAnyMethod(com.any.AnyClass aClass){<br>
// invokeAnyMethod may persists Data or any thing else ....<br>
// notice: a user defined type "AnyClass" do not produce errors<br>
<b>Tools.invokeAnyMethod(aClass); <-- localized problem </b><br>
<br>
<br> <p>
..................................... <br>
<br>
} <br>
<br>
But it produce following compling-errors: <br>
<br>
C:\..\build.xml:54: Compile failed; see the compiler error output for details.
at weblogic.wsee.tools.anttasks.JwscTask.execute(JwscTask.java:184)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)
<br>
<p>
Can somebody help me please? It needs a simple solution I think.Hi Peter,
From the example in MSDN, It means when you declare a variable within a try or catch block, the variable is instantiated upon entrance to the block and marked for fear-down as the logic exits the block.This means any variables declared within a try
block will only be visible in the try block and not outside of it- like in the catch block.
The following links will help you understand more.
http://blogs.msdn.com/b/scottwil/archive/2005/03/21/400140.aspx
http://blogs.msdn.com/b/csharpfaq/archive/2004/08/12/how-to-keep-a-local-variable-in-scope-across-a-try-and-catch-block.aspx
http://stackoverflow.com/questions/94977/why-arent-variables-declared-in-try-in-scope-in-catch-or-finally
>> I think putting a "return" in the catch block above may make the compiler error go away.
No, the return statement terminates execution of the method in which it appears and returns control to the calling method. If the method is a
void type, the return statement can be omitted. The best way is Declare your variables before the try block.
Best wishes!
Kristin
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. -
How to reset RichSelectOneChoice in JSF form from backing bean method?
resetValue() is not working in this case. So any other method to reset from backing bean?
Did you store the component instance on a bean by selecting a “Binding” property of the “RichSelectOneChoice” component?
yourPage.jspx:
<af:selectOneChoice
binding="#{myBean._selectOneChoice}">
</af:selectOneChoice>myBean.java:
private RichSelectOneChoice _selectOneChoice;
public void set_selectOneChoice(RichSelectOneChoice _selectOneChoice) {
this._selectOneChoice = _selectOneChoice;
public RichSelectOneChoice get_selectOneChoice() {
return _selectOneChoice;
private void rerenderSelectOneChoice() {
AdfFacesContext.getCurrentInstance().addPartialTarget(this._selectOneChoice);
} -
Set label of adf command button from backing bean
How can we set the label of a command button from a backing bean using EL?
Is it : <af: commandButton text="#{bindings.email.label}" action.....hi,
create one string and generate accessor for it.
then in jspx, like this
text="#{PrintData.label}"
you can have the label in this way from backing bean.
private String label;
public void setLabel(String label)
this.label = label;
public String getLabel()
label = "test";
return label;
or else, through binding property of the command button, you can set it in the backing bean.
hope this is useful for you.
Maybe you are looking for
-
I have a new iPhone as my old one was stolen. How can I put my old contacts onto my new phone via iCloud? Thanks.
-
TIP: Editor Undo and Redo
It happend to me a couple of times already that I pressed some strange key combination by accident and erased the whole editor content; probably Ctrl-z. Unfortunately Undo from the web browser menu is greyed out and not available. Checking the Jive 5
-
Hello, I recieved my Iphone 4 as a gift in 2010 from my father who bought it in Dubai, we live in South Africa. It worked fine in the beginning but has become nothing more than an expensive iPod. I know everyone asks but seeing as i see no way to con
-
Recommend project management calendar tools that integrate with SharePoint
Hi All, Has anyone integrated SharePoint with project management tools like Trello or DivvyHQ. We built out a task management system in SharePoint, and would like to integrate it with an out-of-the-box project planning tool so marketers can take adv
-
AVCHD converted to ProRes via FCP's Log & Transfer --does ProRes retain TC?
Looking for any users who have imported AVCHD using FCP's Log & Transfer and converted to ProRes. Was your original camera timecode retained? Or was each of your clip's timecode reset to zero? More specifically, there are hopefully new users of Sony'