Re-intializing a .JSPX pagedef variable iterator value?

I am using ExecuteWithParams operation to create an ADF parameter (search) form on a .jspx page. By default, the attributes reference a variable iterator which are stored in the request scope (see excerpt from developer's guide below). I can save the inputvalue from the parameter form to a processScope variable by using a setActionListener that is fired when the user presses the commandButton. However, how can I re-intialize the inuptvalue on the search form (using the value saved to the processScope variable) when the .jspx page is re-loaded?
-------------- code snippets --------------------------------------
// search.jspx page - inputvalue on search form
<af:inputText value="#{bindings.keywords.inputValue}"
label="#{bindings.keywords.label}">
<af:validator binding="#{bindings.keywords.validator}"/>
</af:inputText>
// search.jspx page - setActionListener to save inputValue to processScope
af:commandButton actionListener="#{bindings.FindMethod.execute}"
text="Search">
<af:setActionListener from="#{bindings.keywords.inputValue}"
to="#{processScope.keywords}"/>
</af:commandButton>
// searchPageDef.xml - variable iterator used to store variables for ADF parameter form
<executables>...........
<variableIterator id="variables">
<variable Type="java.lang.String" Name="FindMethod_keywords"
IsQueriable="false"/>
</variableIterator>
<bindings>......
<methodAction id="FindMethod" MethodName="FindMethod
RequiresUpdateModel="true" Action="999"
DataControl="SearchServiceDataControl"
InstanceName="SearchServiceDataControl.dataProvider">
<NamedData NDName="keywords" NDType="java.lang.String"
NDValue="${bindings.FindMethod_keywords}"/>
</methodAction>
<attributeValues id="keywords" IterBinding="variables">
<AttrNames>
<Item Value="FindMethod_keywords"/>
</AttrNames>
</attributeValues>
-------------excerpt for developer's guide ------------------------------------------------------
Because you dropped the ExecuteWithParams operation, the attributes reference a
variable iterator that accesses the variables instead of a collection’s iterator. This is
because the operation (unlike the returned collection) does not need to access an
instance of an object; therefore, there is nothing to hold the values entered on the page.
Variables act as these data holders.
JDeveloper creates a variable for each named bind variable. The variables are declared
as children to the variable iterator, and are local, meaning they live only during a
single request, and while they are carried across subsequent post-backs to the same
form, they would be forgotten (and re-initialized) when a user navigates to some other
page.

Receive an answer to a difficult JDev question = Excellent.
Get working example code to solve your problem = Priceless.
Thanks for the reply, er, I mean code sample! This does the trick and was what I was looking for.
However, it does seem to have a side effect that has created another issue that I posted in a separate thread:
af:inputText value fields refreshed when a backing bean is used for value?

Similar Messages

  • 12C - No context menu in the variables iterator of pageDef

    Hello everyone!!
    I'm using jDev 12c and I just noticed that below behavior:
    I have a .jsf page and I go to the bindings (pageDef) of the page.
    In the variables iterator (Executables column) I right click in order to select  "Insert inside variables -> variable" but nothing happens. No context menu appears whatsoever.
    So, there's no declarative way to create a variable.
    Either the menu is missing on purpose or probably has been omitted accidentally.
    Just wanted to mention that...

    Hi Timo.
    Thanks a lot for your reply.
    You are right that I can insert a variable through the structure window (unfortunatelly I hadn't read your article before). This is not a problem.
    The other issue remains.
    So I create a variable (via the structure window) and then I create an attributeValue pointing to the just created variable. So far so good.
    By clicking on other attributeValues, operations, tree bindings etc which reside in the same pageDef, after a few clicks the attributeValue of the variable is pointing to an irrelevant iterator! It's very easy to reproduce.

  • Variable Iterator Refresh Problem

    Hi,
    I have two method in application module that I dropped on a jspx page as two buttons and the method returns as af:outputtext on that page. When I press one of the buttons to invoke the related method, it clears the result of the other method. Both outputtexts are binded to same variable iterator on the binding site. There seems no relation between these two outputtexts other than being binded to same variable iterator. So why invoking one method clears the result of the other method? Is variable iterator is refreshed everytime a method is invoked? Any help is appreciated.
    Best Regards,
    Salim

    Hi,
    the variable iterator is refreshed as a whole. The binding container is in request scope, which also guarantees that the iterator survives. So the work around is to execute both of the methods from a single button
    Frank

  • "Could not create variable iterator" on creating ADF Parameter Form

    I've got a managed bean with a method;
    public String cmdLogin_action(String userName, String passWord) {
    // Add event code here...
    return "success";
    I've created a data control, but whenever I try to drag it onto a page and select "Create ADF Parameter Form", I get the dialog to specify bindings between parameters and elements in the form, then when I press OK I get a dialog entitled "Could not create widget" with the message "Could not create variable iterator".
    Anyone know what's wrong?

    Hi,
    actually why do you use ADF binding for this at all? You already have the POJO managed by ADF and the textfield binding to this is
    #{managedBeanName.username) for a String username with getter and setters in it. Why do you want to add a JSF lifecycle managed POJO to a ADF lifecycle managed binding that would provide no additional functionality to you, except that the two lifecycles my interfere with each other (though they are linked together).
    Note that the pageDef file needs to create variables for all the arguments in a method, which then is referenced by attribute bindings.
    Frank                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • BW Query variable default value put in Crystal report variable question

    Why BW Query variable default value put in Crystal report variable for BO InfoView to open crystal report.
    I using Analyzer to open bw query,variables had default value ,but crystal report can't had variable default value ,and can't search variable  value.
    pho:
    [http://file.itpub.net/f/e38876ad4f6efb7e73980488e7d71f8d/4ae940e9/day_091029/20091029_2b04da1232144feba180OrB23SNvXtoT.gif/p/1.gif]
    [http://file.itpub.net/f/d93ddfe61e0eaf80429726c61f1a02ff/4ae940e9/day_091029/20091029_3211ffe04bf0302fbab5FRKnbwmH80p7.gif/p/BW_QUERY_Crystal.gif]
    Edited by: flying on Oct 29, 2009 8:20 AM

    I Know what to do .
    but Crystal report date variable value are Garbage characters "###".
    PHO:
    [http://file.itpub.net/f/39a8510104476707ae21c945db93ecba/4ae97949/day_091029/20091029_32dcbb7e7d99141483aesJ9KBJHXN0Kj.gif/p/2.gif]

  • How to assign a JSP variabl's value to a JavaScript variable?

    Hello,
    I want to assign a JSP variable's value to JAVASCRIPT variable.
    or how to assign JavaScript variable's value to JSP varialbe
    HOw do i do it ?
    can anyone please help?
    Regards and thanks for your time.
    Ashvini

    I want to assign a JSP variable's value to
    JAVASCRIPT variable.
    var jsVariable = <%=someVariable%>;
    or how to assign JavaScript variable's value to JSP
    varialbeYou can't. JSP is server-side and JavaScript is client-side. The JSP variables are never available on the client side for any sort of assignment.

  • Passing variable having value as whole SOAP request to command while invoking ODI WS call

    When passing variable in place of soap request message (variable value is whole SOAP request message prepared using procedure) in ODI Invoke WebService command like -->
    OdiInvokeWebService "-URL=url...." "-PORT_TYPE=..." "-OPERATION=..." "-RESPONSE_MODE=NEW_FILE" "-RESPONSE_FILE_CHARSET=UTF8" "-RESPONSE_XML_ENCODING=UTF-8" "-RESPONSE_FILE=..." "-RESPONSE_FILE_FORMAT=SOAP" "-HTTP_USER=..." "-HTTP_PASS=..."
    #SOAPREQUESTMESSAGE
    Gives error :
    ODI-1226: Step OdiInvokeWebService 1 fails after 1 attempt(s).
    ODI-1241: Oracle Data Integrator tool execution fails.
    Caused By: com.sunopsis.wsinvocation.SnpsWSInvocationException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '#' (code 35) in prolog; expected '<'
    at [row,col {unknown-source}]: [1,1]
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.loadFromXML(AbstractMessageImpl.java:333)
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.loadFromString(AbstractMessageImpl.java:348)
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.fromString(AbstractMessageImpl.java:403)
        at com.sunopsis.wsinvocation.client.impl.AbstractJWSDLParserImpl.fromXML(AbstractJWSDLParserImpl.java:272)
        at com.sunopsis.wsinvocation.client.impl.AbstractJWSDLParserImpl.getWebServiceRequestByOperation(AbstractJWSDLParserImpl.java:260)
        at com.sunopsis.dwg.tools.common.WebserviceUtils.getSOAPMessage(WebserviceUtils.java:94)
        at com.sunopsis.dwg.tools.common.WebserviceUtils.invoke(WebserviceUtils.java:138)
        at com.sunopsis.dwg.tools.InvokeWebService.actionExecute(InvokeWebService.java:327)
        at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3437)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1509)
        at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:44)
        at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
        at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
        at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
        at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
        at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
        at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
        at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
        at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
        at java.lang.Thread.run(Thread.java:662)
    Thanks in anticipation...

    the used variable 'SOAPREQUESTMESSAGE' is being created in a procedure using jython.
    1. Can we use this variable (SOAPREQUESTMESSAGE) value in the next step that is while invoking web service request (can it persist) ?
    2. If not then how can we use this variable value to invoke ws request in next step ?
    Would like to appreciate help.
    Pls reply.

  • How can I use an iteration value from a "while" (or "for") loop as part of a filename?

    I am using the "Write To Measurement File" function  inside a while structure and would like to incorporate the iterative value from the while-loop as part of the file name. I'm not sure how to do it. Any suggestions?

    Like this:
    Edit: Oops. Sorry for the double answer.
    Message Edited by smercurio_fc on 05-22-2007 04:25 PM
    Attachments:
    Example_BD.png ‏3 KB

  • How do you save a Waveform Graph as an X Y chart + be able to save the coordinates at a variable iteration?

    I am trying to do this with an O-Scope VI, and I am very new at LabVIEW, so please excuse any errors, or obvious questions.

    Hi Nick,
    Which specific VI or set of VIs are you using to get this data? In order to put data in an XY Graph you will need to put together a cluster of your X and Y data and feed it to the XY Graph. You prepare the cluster by developing an array of X coordinates and an array of Y coordinates and bundling them (Using a Bundle function) into a cluster.
    By variable iteration do you mean an iteration of the user's choice, or a specific iteration count (like every 10th iteration)? Choosing when to load data into the cluster or when to display new data on the XY Graph can be done by using case structures and a button on the front panel. You could also use the iteration [i] terminal of your loop and some math and Boolean logic to choose when to execute certain commands.
    Some resources that might help a new user:
    http://zone.ni.com/devzone/cda/tut/p/id/5054
    http://zone.ni.com/devzone/cda/tut/p/id/5247
    http://zone.ni.com/devzone/cda/tut/p/id/5243
    http://zone.ni.com/devzone/cda/tut/p/id/7605
    Will
    Certified LabVIEW Architect, Certified Professional Instructor
    Choose Movement Consulting
    choose-mc.com

  • How can i pass a variable's value from PR to PFR

    Dear all,
    hope you are fine.
    i would like to pass a variable's value from PR to PFR.
    how can i do that.
    please suggest.
    in PR:
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    i would like to get this value to PFR.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

  • Trouble passing iteration values between two separate VI's

    Hello,
    I'm having a bit of trouble passing a while loop iteration value from one vi to another.
    I have tried creating a sub-vi of the "B VI" and dropping the icon into the main vi (in picture called "A VI") and just pull the itereation value out this way. So far no luck as an error occurs which causes Labview to crash.
    I've spent a lot of time trying to use invoke nodes, globals and VI server references but I haven't gotten them to work either. 
    In the pictures below "A VI" is the main acquisition application. "B VI" is the motor control application. Each VI will run at the same time but with their own front panel. Anyway, I would like to pass the while loop iteration value (Called "Steps") from the "B VI" to the "A VI" (essentially use this itereation value to keep track of the number of motor rotations.)
    So far no luck so any help would be appreciated.
    thanks in advance
    SS
    Attachments:
    A VI1.jpg ‏149 KB
    B VI1.jpg ‏169 KB

    Hi,
    sorry for the confusion. I attached less confusing block diagrams...hope that helps .
    The only thing that is in B that i'd like to import into A is the "STEPS" iteration value. (its circled in green).
    I'm looking to have this iteration value (from B) updated as A's loop runs.
    I use the outside while loop instead of hitting the run continuously button....habit i guess
    Right now I'm getting stuck on using Vi references....I've modeled examples fromt the forums and i just can't get it to work....its driving me nuts.
    thanks again
    Attachments:
    A.jpg ‏57 KB
    B.jpg ‏49 KB

  • How to set variable default value by program?

    Dear all,
    We would like to set a BW variable default value by program (not using query designer).
    Do you have any ABAP sample code for this? I'm really new in ABAP programming.
    we are using BI 7.0
    Thank you for your help!
    Olivier DESFOUR

    Hi Olivier,
    FOllowing is the code which defaults calmonth to first month of the year to current month - 1.
    Data : input1(4) TYPE n,
           input3(2) TYPE n.
    WHEN 'YQV_FD'.
      if i_step = 1.
      input1 = sy-datum+0(4).
      concatenate input1 '01' into l_s_range-low.
      input3 = sy-datum+4(2) - 1.
      concatenate input1 input3 into l_s_range-high.
      l_s_range-sign = 'I'.
      l_s_range-opt = 'BT'.
      APPEND l_s_range TO e_t_range.
      endif.

  • Unexpected type  required: variable   found   : value

    Hello, these are my errors:
    PWC6197: An error occurred at line: 43 in the jsp file: /jsp/ListRedirect.jsp
    PWC6199: Generated servlet error:
    string:///ListRedirect_jsp.java:96: unexpected type
    required: variable
    found : value
    PWC6197: An error occurred at line: 43 in the jsp file: /jsp/ListRedirect.jsp
    PWC6199: Generated servlet error:
    string:///ListRedirect_jsp.java:96: incomparable types: java.lang.String and int
    ==================================
    any suggestions??
    <%      
    if (listData.getListURL()= null || listData.getListInfo() == 0)
              String baseUrl = "/content/listings.html?";
             String listUrl = null;
                  if (userData.isAgentType()) {
                    listUrl = parentPage + baseUrl + "ag_id=" + userData.getAgentID();
                  }  if (userData.isBrokerType()) {
                  listUrl = parentPage + baseUrl + "br_id=" + userData.getAdverID();
                  }  if (userData.isOfficeType()) {
                  listUrl = parentPage + baseUrl + "ag_id="= + userData.getAdverID();
                  } else {
                  listUrl = parentPage + "/content/homefinder.html";
                   if (listData.getListURL() && listData.getListInfo() == 1) {
                       listUrl = listData.getListURL();
               else {
                    listUrl = parentPage + "/content/homefinder.html";
    %>     

    mimsc wrote:
    if (listData.getListURL()= null || listData.getListInfo() == 0)
    The 1st part of this if statement is incorrectly an assignment, not a equation.
    Further on, this code belongs in Java classes like servlets, not in JSPs. This would not only introduce clean code separation, but also greatly improve debugging and maintenance.

  • Extract Variables and Values out of a String

    Hello Everbody!
    I have a question, hope that anyone can help me.
    I have a string of this kind: "frame= 2255 q=0.0 size= 2739kB time=75.0 bitrate= 299.3kbits/s"
    Know I want to deconstruct it and extract the variables and
    values written in there. There is some Whitespace in it.
    After the extraction it have to look like this:
    frame=2255
    q=0.0
    Greetz Christian

    What is a StringTokenizer?http://java.sun.com/j2se/1.5.0/docs/api/java/util/StringTokenizer.html
    Can you give me an
    example? Would be great! http://www.google.com/search?q=java+stringtokenizer+example
    You can first use space as the delimiter, to get tokens
    a=b
    c=d
    etc.
    Then you can tokenize each of those tokens on =.
    However, this doesn't work if you can have spaces around the = or inside the values:
    a = b
    c="d e f"
    If you can have this, you'll have to take a different approach. String.split might serve you better in that case, but you'll have to learn a bit about regex first.
    Sun's Regular Expression Tutorial for Java
    Regular-Expressions.info

Maybe you are looking for

  • MSI B85M-G43 can't install Windows 7. Hard disk not detected.

    Hi, I just built a new computer for the first time.  I followed the instructions and did everything correctly. but am unable to install Windows 7 Ultimate 64bit. Hard disk isn't always detected during the installation. But when it appeared in the "Wh

  • FileInfo SDK .jar not working- XMP not in wizard

    Hi, I am trying to install the FileInfo SDK for Adobe Flash Builder 4. I have followed all of the proper steps to install the .jar file in the plugins folder, but XMP does not show in the wizard as a project typer. The correct .jar file is in the plu

  • My ipone4 screen is black cannot answer when calls come in

    The screen went black/blank, I cannot answer it but it allows calls to come in - any suggestions?

  • Creating fake depth in a photo

    I have a scene I need for a project, the problem is for the setting in question I've been unable to find any suitible footage on any of the stock sites, I have however found some photos that are ideal only, their not video's So I thought maybe I coul

  • Pdf not opening with Safari

    Safari will not open pdf files.  I have 8.1.3 and this is still an issue on my phone and tablet.  It will not allow to open Safari files in iBooks either.  This is a problem on my phone, tablet, and friends and families tablets, so I know this must b