Var question

Hi
In the column i am restricting the product with customer exit var. For ex i am searching for 124  ( * cabn be  any number0-9).
The code works fine if the result of the varialble exists. issue is if the result of the customer exit doesnot exists in the product  table then it brigs all the values.
For ex i am looking for product product 12346. If this value doesnot exits then it showing the all the values of the product in the reprot.
Here user donot enter any values at runtime. I am using  IF i_step = 1.  CASE i_vnam.
Please suggest how to resolve this issue.

HI ,if the product number is empty which restrict the product  will be  same as no restriction . you can fill the L_S_RANGE with user' s input or 1236 , then  APPEND L_S_RANGE TO E_T_RANGE .

Similar Messages

  • Sub var question

    Hello...I have two questions re: substitution variables.<BR><BR>1. I believe Essbase evaluates sub vars "bottom-up"--that is, if you have the same variable name at multiple levels (database, application, server), Essbase uses the value from the lowest level. This is the case regardless of whether you're using the variable in a calc, report script, spreadsheet retrieval, etc. Is this correct?<BR><BR>2. What in the world does the "Set Substitution Variable Scope" command in the calc script editor do? It doesn't effect syntax checking, or the way the calc runs. I've also noticed this command doesn't exist in EAS...<BR><BR>Thanks,<BR>Jared<BR><BR>

    You already have a spry horizonal menu that you appear to be using as a vertical.  You might be able to insert another <ul> within the <li>, like so
    <ul id="MenuBar1" class="MenuBarHorizonal">
      <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
          <ul>
            <li><a href="#">Item 1.1</a></li>
            <li><a href="#">Item 1.2</a></li>
            <li><a href="#">Item 1.3</a></li>
          </ul>
      </li>
    If that does not work, perhaps you might just want to delete what you have and insert a vertical spry menu.
    I also notice all of your html files start with caps, looks like you have an Index html and a index.html.  I'm guessing that gave you a few headaches.
    Gary

  • Total newb var question

    Hello :) ,
    so Im a total newb :(
    I am trying to make this code into a function....
    <code>
    jd_label.setIcon(new javax.swing.JLabel(){
    public javax.swing.Icon getIcon(){
    try {
    return new javax.swing.ImageIcon(
    new java.net.URL("http://ns2.taproot.bz/java/prima_interface/thumbs/02.jpg")
    catch (java.net.MalformedURLException e){
    return null;
    }.getIcon());
    </code>
    problem is, Im such a new i dont know how to use a var on this line...
    jd_label.setIcon(new javax.swing.JLabel(){
    I would like jd_label to be a $var but java just wants to update
    a label named "var".... i.e.
    JLabel jd = new Jlabel();
    string fred = jd
    fred.setIcon()
    but this freaks out... in PERL it seems the vars are a little more
    reconazable...
    $fred.setIcon();
    Could some one please help me :)
    Thanks in advance,
    jd

    Thank you :)
    Im still confused...but that will pass in time
    As for the code in the first post... that was from a scrip i wrote
    but the section i posted NetBeans wrote. here is the whole scrip...
    All i really want to do is put pictures on labels...and i thought, why write
    the same code for every button, ill just make a function out of the whole setIcon bit and call it for each label that needs a picture, passing the url of the picture off to the function... Below gets me one pic on one label, so
    how can i reproduce this efffect on other lables using the same code over and over?
    import javax.swing.*;
    import java.awt.*;
    public class HelloWorldSwing {
    public static void main(String[] args) {
    JFrame frame = new JFrame("HelloWorldSwing");
    JLabel label = new JLabel("Hello World");
    JLabel jd_label = new JLabel();
         JTextField tex = new JTextField("sup suka");
         JPanel pan = new JPanel();
         pan.setLayout(new GridLayout(1,3,10,10));
         pan.add(label);
         pan.add(jd_label);
         pan.add(tex);
    // i wanna make this bit into a fuction to reuse
         jd_label.setIcon(new javax.swing.JLabel() {
    public javax.swing.Icon getIcon() {
    try {
    return new javax.swing.ImageIcon(
    new java.net.URL("http://ns2.taproot.bz/java/prima_interface/thumbs/02.jpg")
    } catch (java.net.MalformedURLException e) {
    return null;
    }.getIcon());
         frame.getContentPane().add("Center", pan);
         frame.pack();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);

  • Session var question

    never mind...got it
    Edited by: mbowles on Aug 27, 2009 6:03 AM

    To answer your question no. For security reasons, you cannot retrieve a sessoin using its ID.
    Is it an extremely secure piece of information?
    If the servlet and applet are talking to the same web application, you could possibly pass the data via the application scope (have a map in application scope, keyed by the session ID, and put the value to pass in that)
    Its not completely secure, because any servlet/jsp in the application can view that data, but it is a sidestep hack to accomplish what you wish :-)

  • Simple var question

    when i declare a variable using "var", is it relative only to
    the timeline it is declared on? for example, can i have the a
    variable named "location" in two different movie clips? will flash
    know the difference between the variable in each movie clip, or do
    i have to use an unique variable name in each movie clip?

    do you work for adobe? by no means am i complaining about
    your omnipresence, i love it. just wondering though. thanks
    again.

  • Simple Crystal Var Question!

    Post Author: Confisk8d131
    CA Forum: Formula
    I have a report that Im trying to generate in which one of the Commands prints out a Status on the detail line. For example one of the Status names that gets pulled is called "Open Invoice" and another is called "Closed Invoice" Instead of having " Open Invoice" I would like the detail line print "OI" How can this be done? I tried to use the Variable function but was unsure how to ues this, any help to a new Crystal user would be helpful. THANKS.

    Post Author: foghat
    CA Forum: Formula
    You could create a formula and use that in your report:@statusname: if {status.name} = 'Open Invoice'  then 'OI' else if {status.name} = 'Closed Invoice' then 'CI' else ''

  • Setting XML based exam to where there are two correct answers in a question

    I have an exam which pulls in questions from an XML file and to indicate what the correct answer is you would indicate in the XML as such:
    PROBLEM id="1">
                    <QUESTION>What is the State Capital of California:</QUESTION>
                    <CHOICE letter="a">San Fransisco.</CHOICE>
                    <CHOICE letter="b">San Diego.</CHOICE>
                    <CHOICE letter="c">Los Angelas.</CHOICE>
                    <CHOICE letter="d" correct="true">Sacremento.</CHOICE>
                </PROBLEM>
    There is one question, that is structured so there are two right answers, but when I add correct="true" to both answers I want as right only one is calculated correctly in the scoring. I thinking I need to make an adjustment in the code that pulls in the XML, but not sure where. Hoping someone can help.
    Here is the AS code.
    package exam {
        import flash.net.* //to create URLRequest and load XML file
        import flash.events.* //for Load events
        //import flash.display.* //for testing purposes - remove when testing complete
        //This class downloads the XML document, and then inserts info into arrays and variables.
        //Also provides text of questions and correct answers when requested.
        internal class XaMLDiplomat extends EventDispatcher {
            //VARIABLES:
            //for loaded XML doc
            private var myXML:XML;
            //for loading in XML
            private var examLoader:URLLoader;
            private var numQstns:Number; //count of total questions in a section
            private var sectStart:Number;
            //contains exam questions - ALL ARRAYS ARE ZERO RELATIVE -> actual question numbers = array index + 1
            private var questions:Array;
            //contain associated answer choices
            private var choiceA:Array;
            private var choiceB:Array;
            private var choiceC:Array;
            private var choiceD:Array;
            private var choiceE:Array;
            private var choiceF:Array;
            //array of the correct answers
            private var answers:Array;
            //use custom Mixer class to randomize order
            private var myMixer:Mixer;
            private var isRandom:Boolean;
            //CONSTRUCTOR
            public function XaMLDiplomat () { //NEED TO ADD ARGUMENTS (docLocation)
                //create URLRequest from argument
                var examSite:URLRequest = new URLRequest("protected/exam.xml");
                //create a loader for the XML
                examLoader = new URLLoader();
                //add listener for load completion
                examLoader.addEventListener(Event.COMPLETE, fullyLoaded);
                examLoader.load(examSite);
                //var ugly:Mixer = new Mixer(25);
            //Load listener - creates XML object, and checks it for multiple sections. If multiple, it asks users
            //which section they want - FIRST it needs to check database for any completed sections.
            //If single, it goes ahead and starts array creation for first (& only) section
            private function fullyLoaded (e:Event):void {
                myXML = new XML(examLoader.data);
                //myXML.prettyPrinting = false;
                //still need to pull out SYSTEM data and pass it along...
                var system:XMLList = myXML..SYSTEM;
                var sysObj:Object = new Object();
                sysObj.examTitle = system.TITLE.toString();
                sysObj.totalMin = system.MINUTES.toString();
                sysObj.retakePW = system.RETAKEPW.toString();
                var numSections:Number = myXML..SECTION.length();
                if (numSections == 1) {
                    generateArrays(1);
                dispatchEvent(new MultiSectEvent(MultiSectEvent.SECTIONS, numSections, sysObj));
            //Assigns arrays to instance variables for the selected section
            internal function generateArrays (sectn:Number):void {
                var whichSection:XMLList = myXML..SECTION.(@id == String(sectn));
                var probList:XMLList = whichSection.PROBLEM;
                numQstns = probList.length();
                sectStart = Number(probList[0].@id);
                questions = new Array();
                choiceA = new Array();
                choiceB = new Array();
                choiceC = new Array();
                choiceD = new Array();
                choiceE = new Array();
                choiceF = new Array();
                answers = new Array();
                for (var i:Number=0; i<numQstns; i++) {
                    var curProb:XMLList = probList.(@id == String(i+1));
                    if (curProb.QUESTION.hasSimpleContent()) {
                        questions[i] = curProb.QUESTION.toString();
                    }else {
                        //trace(curProb.QUESTION.toXMLString());
                        questions[i] = dropTags(curProb.QUESTION[0]);
                    choiceA[i] = curProb.CHOICE.(@letter == "a").toString();
                    choiceB[i] = curProb.CHOICE.(@letter == "b").toString();
                    choiceC[i] = curProb.CHOICE.(@letter == "c").toString();
                    choiceD[i] = curProb.CHOICE.(@letter == "d").toString();
                    choiceE[i] = curProb.CHOICE.(@letter == "e").toString();
                    choiceF[i] = curProb.CHOICE.(@letter == "f").toString();
                    answers[i] = curProb.CHOICE.(hasOwnProperty("@correct") && @correct == "true")[email protected]();
                //randomizing test
                //var makeRandom:Boolean;
                //system.RANDOM.toString() ==  'true' ? makeRandom = true : makeRandom = false;
                //myMixer = new Mixer(numQstns,makeRandom);
                trace("Question: "+questions[3]);
                trace("a: "+choiceA[3]);
                trace("b: "+choiceB[3]);
                trace("c: "+choiceC[3]);
                trace("d: "+choiceD[3]);
                trace("\r\n answer: "+answers[3]); */
            //method for external classes to acquire text of current exam question
            internal function getQuestion (qnum:Number):Object {
                var returnObj:Object = new Object();
                var randomQ:Number = myMixer.getRandomNumber(qnum-1);
                returnObj.q = questions[randomQ];
                returnObj.ca = choiceA[randomQ];
                returnObj.cb = choiceB[randomQ];
                returnObj.cc = choiceC[randomQ];
                returnObj.cd = choiceD[randomQ];
                returnObj.ce = choiceE[randomQ];
                returnObj.cf = choiceF[randomQ];
                returnObj.num = qnum;
                //trace(randomQ);
                return returnObj;
            private function dropTags (txt:XML):String {
                var txtString:String = "";
                for each (var child:XML in txt.*) {
                    if (child.nodeKind == "text") {
                        txtString += child.toString();
                    }else {
                        txtString += " " + child.toXMLString();
                //trace(txtString);
                return txtString;
            private function dropTags (txt:String):String {
                var sliceStart:Number = txt.indexOf(">");
                var sliceStop:Number = txt.lastIndexOf("<");
                return txt.slice((sliceStart+1), sliceStop);
            internal function getAnswer (num:Number):String {
                return answers[num];
            internal function getQCount ():Number {
                return numQstns;
            internal function getSectStart():Number {
                return sectStart;
            internal function getRealNum (num:Number):Number {
                return myMixer.getRandomNumber(num-1);

    this may or may not be the probel, but as it stands right now, when you select and anser it becomes hi-lighted and when you click off and select another answer the previous answer is deselected and the current answer is hi-lighted. I need to allow for multiple selections. This code is what is doing to current select/de-select functionality.
    package exam {
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        //This class displays the current question, and contains the Choices for the question
        public class QMachine extends Sprite {
            //VARIABLES
            private var QObject:Object; //object from XaMLDiplomat, containing necessary text
            private var limit:Number;
            private var QNumTxt:TextField;
            private var QTxt:TextField;
            private var txtStyle:StyleSheet;
            private var choiceA:Choice;
            private var choiceB:Choice;
            private var choiceC:Choice;
            private var choiceD:Choice;
            private var choiceE:Choice;
            private var choiceF:Choice;
            //CONSTRUCTOR
            public function QMachine (hite:Number) {
                limit = hite;
                var style:Object = new Object();
                style.fontFamily = "Arial";
                //style.fontWeight = "bold";
                style.fontSize = "16";
                style.color = "#333333";
                txtStyle = new StyleSheet();
                txtStyle.setStyle("p",style);
                QNumTxt = new TextField();
                QNumTxt.styleSheet = txtStyle;
                //QNumTxt.embedFonts = true;
                QNumTxt.htmlText = "<p>1) </p>";
                QNumTxt.autoSize = TextFieldAutoSize.RIGHT;
                QNumTxt.x = 10;
                QNumTxt.mouseEnabled = false;
                QTxt = new TextField();
                QTxt.styleSheet = txtStyle;
                //QTxt.embedFonts = true;
                QTxt.width = 300;
                QTxt.multiline = true;
                QTxt.wordWrap = true;
                QTxt.autoSize = TextFieldAutoSize.LEFT;
                QTxt.htmlText = "<p>Question 1</p>";
                QTxt.x = 35;
                QTxt.mouseEnabled = false;
                addChild(QNumTxt);
                addChild(QTxt);
                choiceA = new Choice("a");
                choiceA.x = 350;
                addChild(choiceA);
                choiceB = new Choice("b");
                choiceB.x = 350;
                addChild(choiceB);
                choiceC = new Choice("c");
                choiceC.x = 350;
                addChild(choiceC);
                choiceD = new Choice("d");
                choiceD.x = 350;
                addChild(choiceD);
                choiceE = new Choice("e");
                choiceE.x = 350;
                addChild(choiceE);
                choiceF = new Choice("f");
                choiceF.x = 350;
                addChild(choiceF);
                addEventListener(MouseEvent.MOUSE_UP, selectResponse, true);
            internal function newQuestion (obj:Object, prior:String = ""):void {
                //trace(obj.num);
                QNumTxt.htmlText = "<p>"+ obj.num + ".</p>";
                QTxt.htmlText = "<p>"+ obj.q + "</p>";
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();
                choiceA.resetSize();
                choiceB.resetSize();
                choiceC.resetSize();
                choiceD.resetSize();
                choiceE.resetSize();
                choiceF.resetSize();
                choiceA.changeTxt(obj.ca);
                choiceB.changeTxt(obj.cb);
                choiceB.y = choiceA.height + 5;
                if (obj.cc == undefined || String(obj.cc) == "") {
                    choiceC.visible = false;
                }else {
                    choiceC.changeTxt(obj.cc);
                    choiceC.y = choiceB.y + choiceB.height + 5;
                    choiceC.visible = true;
                if (obj.cd == undefined || String(obj.cd) == "") {
                    choiceD.visible = false;
                }else {
                    choiceD.changeTxt(obj.cd);
                    choiceD.y = choiceC.y + choiceC.height + 5;
                    choiceD.visible = true;
                if (obj.ce == undefined || String(obj.ce) == "") {
                    choiceE.visible = false;
                }else {
                    choiceE.changeTxt(obj.ce);
                    choiceE.y = choiceD.y + choiceD.height + 5;
                    choiceE.visible = true;
                if (obj.cf == undefined || String(obj.cf) == "") {
                    choiceF.visible = false;
                }else {
                    choiceF.changeTxt(obj.cf);
                    choiceF.y = choiceE.y + choiceE.height + 5;
                    choiceF.visible = true;
                var curHite:Number;
                if (choiceF.visible) {
                    curHite = choiceF.y + choiceF.height + 5;
                }else if (choiceE.visible) {
                    curHite = choiceE.y + choiceE.height + 5;
                }else if (choiceD.visible) {
                    curHite = choiceD.y + choiceD.height + 5;
                }else {
                    curHite = choiceC.y + choiceC.height + 5;
                if (curHite > (limit-150)) {
                    shrinkText();
                if (prior != "") {
                    if (prior == "a") {
                        choiceA.nowSelected();
                    }else if (prior == "b") {
                        choiceB.nowSelected();
                    }else if (prior == "c") {
                        choiceC.nowSelected();
                    }else if (prior == "d") {
                        choiceD.nowSelected();
                    }else if (prior == "e") {
                        choiceE.nowSelected();
                    }else if (prior == "f") {
                        choiceF.nowSelected();
            private function shrinkText() {
                choiceA.dropSize();
                choiceB.dropSize();
                choiceC.dropSize();
                choiceD.dropSize();
                choiceE.dropSize();
                choiceF.dropSize();
                choiceB.y = choiceA.y + choiceA.height + 5;
                choiceC.y = choiceB.y + choiceB.height + 5;
                choiceD.y = choiceC.y + choiceC.height + 5;
                choiceE.y = choiceD.y + choiceD.height + 5;
                choiceF.y = choiceE.y + choiceE.height + 5;
                var curHite:Number = 0;
                if (choiceF.visible) {
                    curHite = choiceF.y + choiceF.height + 5;
                }else if (choiceE.visible) {
                    curHite = choiceE.y + choiceE.height + 5;
                }else if (choiceD.visible) {
                    curHite = choiceD.y + choiceD.height + 5;
                }else {
                    curHite = choiceC.y + choiceC.height + 5;
                if (curHite > (limit-150)) {
                    shrinkText();
            private function selectResponse (e:MouseEvent):void {
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();
                var letter:String = e.target.parent.getLetter();
                dispatchEvent(new ResponseEvent(ResponseEvent.SELECTION, letter));
            internal function setPriorResponse() {
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();

  • Additional Pageflow - JavaScript Questions

    I was hoping someone (bea employee???) could answer a couple more JavaScript questions
    for me?? First one is how do I (can I) do something similar to what John Rohrlich
    (see below) suggested inside a netui-data:grid tag? Among other things that didn't
    workI tried this:
    <netui-data:anchorColumn action="deleteUsr" title="">
    <netui:anchor action="deleteUsr" onClick="return confirmDelete('user', {container.item.usr_nm}
    ); return false;">
    Drop
    <netui:parameter name="userToDrop" value="{container.item.usr_nm}" />
    </netui:anchor>
    </netui-data:anchorColumn>
    From this snippet you might be able to guess what my next question is. Is there
    a way to render a variable inside the onClick value? I have tried a number of
    things to no avail, stuff like:
    <netui-data:getData resultId="thisId" value="{container.item.userId}" />
    <netui:anchor action="dropUser" onClick="return confirmDelete('user', '<%=(String)pageContext.getAttribute("thisId");%>');
    return false;">
    BTW this is in a repeater I have else ware in my code. I would really like to
    convert everything to grids to get the sorting, filtering and paging capabilities.
    I would like to be able to pass the parameter to my JavaScript so the user has
    a little more info on what he is dropping - here is the script:
    function confirmDelete(){
    //arg 1 would be the record type i.e. "user"
    //arg 2 would be the key identifier i.e. "Fred"
    var question = "Are you sure you want to drop this record?";
    var argNum = confirmDelete.arguments.length;
    if (argNum == 1){
    question = "Are you sure you want to drop this "+confirmDelete.arguments[0]+"?";
    else if (argNum == 2){
    question = "Are you sure you want to drop the "+confirmDelete.arguments[0]+"
    "+confirmDelete.arguments[1]+"?";
    return confirm(question);
    Thanks,
    John
    "John Rohrlich" <[email protected]> wrote:
    John,
    If you want to put up a confirm dialog before calling an action from
    an
    anchor it is done as follows.
    Here is an example from code of mine that deletes a customer order, if
    the
    user confirms the delete. I pass the order id as a parameter.
    - john
    Here is the JavaScript -
    function confirmDelete() {
    if(confirm('Continue with order delete?'))
    return true;
    else
    return false;
    Here is a sample anchor tag -
    <netui:anchor action="requestToDeleteOrder" onClick="return
    confirmDelete(); return false;">
    Delete
    <netui:parameter name="orderId" value="{container.item.orderId}"/>
    </netui:anchor>

    Thanks Eddie, I looked at that reply when you gave it but it didn't give me enough
    to go on. You suggested:
    <netui-data:expressionColumn title="Show Alert" value="<a href='javascript:alert(12345);return
    false;> {container.item.customername}</a>" />
    I started a new thread after that one - What is the best way to call a pageflow
    action from JavaScript? Guess I was sort of beating around the bush on this. Can
    you see where I was going? If I use the method you describe above how do I call
    my dropUser pageflow action if the user confirms the drop in the java dialog?
    Thanks, John
    Eddie O'Neil <[email protected]> wrote:
    John--
    You might check an earlier response about this from a different thread.
    "Re: Confirmation dialog w/netui:anchor and netui-data:anchorColumn"
    on
    1/28/2004.
    It's possible to do though not intentional; the 8.1 grid wasn't
    really designed to do this.
    The NetUI team is certainly aware of the limitations with using this
    version of the grid and is working to address said limitations with a
    much improved tag set in v9. If you have additional feedback on
    features you'd like to see, please feel free to send them along --
    including your top 10 (or whatever!) reasons not to use the grid. :)
    In the meantime, depending on what you need to do, the repeater may
    suit your needs well, though you may need to do some work to implement
    sort / filter logic.
    Hope that helps.
    Eddie
    John H wrote:
    So what you are telling me is that a cant do somthing as simple aspop up a confirmation
    when using a grid? That really stinks if that is the case. I am thinkingI need
    to write up "Top ten reasons not to use a grid." Thanks for the repeatercode.
    "John Rohrlich" <[email protected]> wrote:
    John,
    The grid doesn't support event handlers like onClick but I have included
    code here to show you how to pass parameters to your javaScript event
    handler when using the repeater. Let me know if you have any questions
    about
    the code.
    Most of the code is standard repeater code. The interesting code is
    below
    (also see my code comments). I have also attached the full jsp fileand
    the
    jpf file you need to try my example.
    - john
    <script language="JavaScript">
    function confirmDelete(phrase) {
    if(confirm(phrase))
    return true;
    else
    return false;
    </script>
    <netui-data:repeater dataSource="{pageInput.orders}" defaultText="No
    orders">
    <netui-data:repeaterItem>
    <tr valign="top">
    <td>
    <netui:label value="{container.item.orderId}"
    defaultValue=" "></netui:label>
    </td>
    <!-- You can't bind data to onClick so you need to build
    a
    string. -->
    <!-- The string will be the function call with the
    parameters you are passing. -->
    <!-- Here is the building of the string -->
    <netui-data:getData resultId="orderId"
    value="{container.item.orderId}" />
    <%
    String somePhrase = "Do you want to delete item " +
    pageContext.getAttribute("orderId") + "?";
    String foo = "return confirmDelete(\'" + somePhrase+
    return false";
    %>
    <td>
    <netui:anchor action="requestToDeleteOrder"
    onClick="<%=foo%>" >
    Delete
    <netui:parameter name="orderId"
    value="{container.item.orderId}"/>
    </netui:anchor>
    </td>
    </tr>
    </netui-data:repeaterItem>
    "John H" <[email protected]> wrote in message
    news:[email protected]...
    I was hoping someone (bea employee???) could answer a couple moreJavaScript questions
    for me?? First one is how do I (can I) do something similar to whatJohn
    Rohrlich
    (see below) suggested inside a netui-data:grid tag? Among other thingsthat didn't
    workI tried this:
    <netui-data:anchorColumn action="deleteUsr" title="">
    <netui:anchor action="deleteUsr" onClick="return confirmDelete('user',{container.item.usr_nm}
    ); return false;">
    Drop
    <netui:parameter name="userToDrop" value="{container.item.usr_nm}"/>
    </netui:anchor>
    </netui-data:anchorColumn>
    From this snippet you might be able to guess what my next questionis. Is
    there
    a way to render a variable inside the onClick value? I have trieda
    number of
    things to no avail, stuff like:
    <netui-data:getData resultId="thisId" value="{container.item.userId}"/>
    <netui:anchor action="dropUser" onClick="return confirmDelete('user','<%=(String)pageContext.getAttribute("thisId");%>');
    return false;">
    BTW this is in a repeater I have else ware in my code. I would reallylike to
    convert everything to grids to get the sorting, filtering and pagingcapabilities.
    I would like to be able to pass the parameter to my JavaScript sothe
    user has
    a little more info on what he is dropping - here is the script:
    function confirmDelete(){
    //arg 1 would be the record type i.e. "user"
    //arg 2 would be the key identifier i.e. "Fred"
    var question = "Are you sure you want to drop this record?";
    var argNum = confirmDelete.arguments.length;
    if (argNum == 1){
    question = "Are you sure you want to drop this"+confirmDelete.arguments[0]+"?";
    else if (argNum == 2){
    question = "Are you sure you want to drop the"+confirmDelete.arguments[0]+"
    "+confirmDelete.arguments[1]+"?";
    return confirm(question);
    Thanks,
    John
    "John Rohrlich" <[email protected]> wrote:
    John,
    If you want to put up a confirm dialog before calling an action
    from
    an
    anchor it is done as follows.
    Here is an example from code of mine that deletes a customer order,if
    the
    user confirms the delete. I pass the order id as a parameter.
    - john
    Here is the JavaScript -
    function confirmDelete() {
    if(confirm('Continue with order delete?'))
    return true;
    else
    return false;
    Here is a sample anchor tag -
    <netui:anchor action="requestToDeleteOrder" onClick="return
    confirmDelete(); return false;">
    Delete
    <netui:parameter name="orderId" value="{container.item.orderId}"/>
    </netui:anchor>

  • How to process unknown number of components question?

    I have a table that will display a dynamic list of questions and radio buttons. The user will select one radio button per question. How would I retrieve the radio button values once the form is submitted?
    thanks
    <table>
    <ui:repeat var="question" value="#{bean.questionnaire}" varStatus="status">
    <tr>
    <td width="80%">
    #{question}
    </td>
    <td>
    <h:selectOneRadio value="" id="answer#{status.index + 1}">
    <f:selectItems value="#{bean.optsList}" />
    </h:selectOneRadio>
    </td>
    </tr>
    </ui:repeat>
    </table>

    Do it the JSF way: you'll have to map the value to some backing bean property. Did you know you can bind components to a Map or a List? If you use a Map, you can use the ID as the index and at the backing bean side easily look them up (or iterate over the map to get them all).
    Do a google search for "JSF backing bean map property" or something along that line to get examples. A read of BalusC's datatable article might also give some insights:
    http://balusc.blogspot.com/2006/06/using-datatables.html

  • Problem with f:validator and f:attribute

    Here is part of my code:
    <h:dataTable value="#{getQuestionsBean.answers}"
                                       var="question">
                                       <h:column>
                                       <h:panelGrid columns="1">
                                                 <h:inputText id="inputAnswer" value="#{question.answer}"
                                                      rendered="#{question.isInputText}" required="true">
                                                      <f:attribute name="pattern" value="#{question.validatePattern}"/>
                                                      <f:attribute name="errorMessage" value="error text" />
                                                      <f:validator validatorId="custom" />
                                                 </h:inputText>
                                                 <h:message for="inputAnswer" errorClass="errorMessage"/>
    </h:dataTable>
    "custom" is a custom validator witch need a dynamic pattern and error message text. When I send this values like in my code(in pattern atribute), in validator I have only null's. When I put into value just text (like in errorMessage attribute)everything is ok. Any ideas? It's very importent and I can't solve it. Please help.

    Hi,
    I'm stuck in the same problem...did u get any solution for this problem.
    Thanks
    ved

  • How to check collection.contains(..) inside a tag ?

    Hi,
    I'm using both struts and jtsl tags in my jsp. JSP session has a Collection named "responses" that contains string objects.
        <c:forEach items="${page.questions}" var="question" varStatus="i">
              <tr>
                   <th align="left"><c:out value="${question.questionId}. ${question.text}"></c:out></th>
              </tr>
            <c:forEach items="${question.answers}" var="answer" varStatus="j">
              <tr>
               <td>     
                         <c:set var="aKey" value="${question.OID}_${answer.OID}"></c:set>
                      <c:if test="${question.type == 1}">
                         <c:out value="${answer.answerId}"/>
                         <input id="<c:out value="KEY_${question.OID}"/>" name="<c:out value="KEY_${question.OID}"/>" type="radio" <c:if test="??? session.getAttribute("responses").contains(${question.OID}_${answer.OID}) ???" ><c:out value="selected=true"/></c:if> value="<c:out value="${question.OID}_${answer.OID}"/>"><c:out value="${answer.text}"/>                 
                      </c:if>
                      <c:if test="${question.type == 2}">
                         <c:out value="${answer.answerId}"/>
                         <input id="<c:out value="KEY_${answer.OID}"/>" name="<c:out value="KEY_${answer.OID}"/>" type="checkbox"  value="<c:out value="${question.OID}_${answer.OID}"/>"><c:out value="${answer.text}"/>                 
                      </c:if>                  
                 </td>
            </tr>                  
            </c:forEach>
         </c:forEach>Please see the following line in the code
    <c:if test="??? session.getAttribute("responses").contains(${question.OID}_${answer.OID}) ???" ><c:out value="selected=true"/></c:if>I need to check if a collection contains a string value or not. If contains I'm selecting the radio button otherwise not.
    Any help will be appreciated!
    Thanks

    There is no way to tell if a collection contains a value.
    If you changed your datastructure to a Map, you can check for the existence of a key in a map, but thats about it.
    Alternatively write a static function for this operation, and import it into the jsp as an EL function.
    Cheers,
    evnafets

  • Can't get transitions to execute

    Hi folks,
    I'm building my first Flex app, which is a typical simple quiz. Intro state, string of questions, then a result.
    I'm stuck right now in that my transitions are not running. I suspect it has something to do with the fact that I extended the Application class and typed my main application mxml file to that class so that I could keep Actionscript separate from MXML in two separate files. The app will switch states successfully but it won't run the transition effects on a state change, and so my endEffect event is not firing...
    It may be that I have something else wrong altogether.
    Here is the application MXML file:
    <?xml version="1.0" encoding="utf-8"?>
    <classes:QuizApplication
        xmlns:local="*"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:classes="classes.*"
        layout="absolute"
        currentState="landingState"
        >
        <mx:HTTPService id="questions" url="./data/questions.xml" />
        <classes:states>
            <mx:State name="landingState"/>
            <mx:State name="landingStateOut" basedOn="landingState"/>
            <mx:State name="question">
                <mx:RemoveChild target="{text1}"/>
                <mx:RemoveChild target="{startButton}"/>
                <mx:AddChild relativeTo="{vbox1}" position="lastChild">
                    <local:FormHolderVBox id="formHolder" applicationVO="{applicationVO}" width="348" height="248" />
                </mx:AddChild>
            </mx:State>
            <mx:State name="resultState"/>
            <mx:State name="betweenQuestions1" basedOn="question">
                <mx:RemoveChild target="{formHolder}"/>
                <mx:RemoveChild target="{vbox1}"/>
            </mx:State>
        </classes:states>
        <classes:transitions>
            <mx:Transition id="advanceTransition0" fromState="landingState" toState="landingStateOut">
                <mx:Fade
                    duration="2000"
                    id="fadeToBetween"
                    alphaFrom="1"
                    alphaTo="0"
                    effectEnd="continueAdvance();"
                />    
            </mx:Transition>        
            <mx:Transition id="advanceTransition1" fromState="question" toState="betweenQuestions" effect="{fadeToBetween}" />        
            <mx:Transition id="advanceTransition2" fromState="question" toState="betweenQuestions">
                <mx:Fade
                    id="fadeToQuestion"
                    alphaFrom="0"
                    alphaTo="1"
                />    
            </mx:Transition>        
        </classes:transitions>
        <mx:Canvas x="45" y="41" width="392" height="361" id="canvas">
            <mx:VBox x="21" y="47" height="291" width="348" id="vbox1">
                <mx:Text text="Take this quick quiz to find out what type of shopper you are!" width="347" height="40" fontSize="12" id="text1"/>
                <mx:Button label="Start the Quiz" id="startButton"/>
            </mx:VBox>
        </mx:Canvas>
        <mx:Text text="What kind of shopper are you?"  fontSize="21" fontWeight="bold" fontFamily="Arial" x="45" y="41"/>
    </classes:QuizApplication>
    And here is the associated Actionscript:
    package classes
        import classes.events.AdvanceEvent;
        import flash.events.MouseEvent;
        import mx.collections.ArrayCollection;
        import mx.containers.Canvas;
        import mx.controls.Button;
        import mx.core.Application;
        import mx.events.FlexEvent;
        import mx.events.EffectEvent;
        import mx.rpc.events.ResultEvent;
        import mx.rpc.http.mxml.HTTPService;
        public class QuizApplication extends Application
            [Bindable]
            public var startButton:Button;
            public var canvas:Canvas;
            public var questions:HTTPService;
            //[Bindable] ?
            public var questionVOs:ArrayCollection;
            [Bindable]
            public var applicationVO:ApplicationVO;
            //CONSTRUCTOR
            public function QuizApplication()
                super();
                this.addEventListener(FlexEvent.APPLICATION_COMPLETE, init);
                // go ahead and create singleton of DataClass to store globals
                applicationVO = new ApplicationVO();
            //METHODS
            private function init(e:FlexEvent):void
                startButton.addEventListener(MouseEvent.MOUSE_UP, handleStartQuiz);
                questions.addEventListener(ResultEvent.RESULT, handleQuestionData);
                questions.send();
                // set up listeners for app business
                canvas.addEventListener(AdvanceEvent.FORWARD, advanceToQuestion);
                //canvas.addEventListener(AdvanceEvent.BACKWARD, advanceToQuestion);
            //    canvas.addEventListener(AdvanceEvent.CONTINUE, continueAdvance);
                // set to start with question 1
                applicationVO.currentQuestion = 0;
            // EVENT HANDLERS
            private function handleStartQuiz(e:MouseEvent): void
            //currentState = "question"; // states hard-coded in mxml
            trace("should set state to landingStateOut");
            trace("currentState now is "+currentState);
            currentState = "landingStateOut";
            trace("currentState now is "+currentState);        
            private function handleQuestionData(e:ResultEvent): void
                applicationVO.questionVOs = new ArrayCollection();
                // loop through XML's ArrayCollections and create an ArrayCollection of QuestionVO's, one for each question in XML
                 for each (var question:Object in e.result.questions.question)
                    var newVO:QuestionVO = new QuestionVO();
                    newVO.questionID = question.id;
                //    trace("question.id is "+question.id);
                    newVO.questionText = question.text;
                //    trace("question.text is "+question.text);
                    newVO.answers = new ArrayCollection();
                    for each (var answer:Object in question.answers.answer)
                        newVO.answers.addItem(answer);
                    //    trace("answer is "+answer);
                    applicationVO.questionVOs.addItem(newVO);
            private function advanceToQuestion(e:AdvanceEvent):void
                trace("should transition to next question now");
                e.stopImmediatePropagation();    
                if (e.type == "forward")
                    //somehow call the transition AdvanceTransition
                    applicationVO.currentQuestion++;
                    currentState = "betweenQuestions1";
                else
                    applicationVO.currentQuestion--;
                    currentState = "betweenQuestions1";
            public function continueAdvance():void
                trace("should transition now from betweenQuestions2 to question state");
                //currentState = "question";
    Can anyone point out what I've got wrong that could cause the Transitions not to work? I thought they were simply supposed to execute on a state change from A to B, for which you've indicated set up a Transition from state A to B.
    Many thanks!

    Ok, I finally figured out what was wrong.  I was missing the concept that you had to specify a target element in the effect definition in your transition upon which the transition would play.  Transition plays now.

  • Dynamic forms in jsf

    Hi all,
    This question has probably been asked a thousand times, but I can't find the answer.
    I am an experienced Struts developer, but now I want to create an application using jsf.
    It will be some kind of quiz with multiple choice questions. The problem is that the number of questions is not fixed, so for 1 quiz there can be 10 questions and for another one 20.
    In struts I know that there is something called map-backed action forms that can be used for this kind of thing.
    Does jsf have something like this? I can't seem to figure it out.
    Thank you.

    There is one thing that I don't like in the example. The generation of components in the backing bean. I am trying to generate them inside my jsp, but it won't work.
    This is the code I use.
    The jsp page
    <body><h:form binding="#{backing_quiz.form1}" id="form1">
            <p>
              <h:dataTable value="#{backing_quiz.questions}" var="question">         
                <h:column>                   
                  <h:outputText value="#{question.questionText}"/>
                  <h:selectOneRadio layout="pageDirection">             
                        <f:selectItems value="#{question.answers}" />                       
                  </h:selectOneRadio>             
                </h:column>
              </h:dataTable>
            </p>
            <p>
              <h:messages/>
            </p>
            <p>
              <h:commandButton value="commandButton1"
                               binding="#{backing_quiz.commandButton1}"
                               id="commandButton1"
                               action="#{backing_quiz.commandButton1_action}"/>
            </p>     
          </h:form></body>The backing bean with session scope.
    public class Quiz {
        private HtmlForm form1;
        private HtmlDataTable dataTable1;
        private HtmlCommandButton commandButton1;
        private ArrayList questions = null;
        private HtmlSelectOneRadio selectOneRadio1;
        private UISelectItem selectItem1;
        private UISelectItem selectItem2;
        private UISelectItem selectItem3;
        public void setForm1(HtmlForm form1) {
            this.form1 = form1;
        public HtmlForm getForm1() {
            return form1;
        public ArrayList getQuestions() {
            if(questions == null) {             
                System.out.println("Create new list");
                questions = new ArrayList();
                Question question = new Question();
                ArrayList answers = new ArrayList();
                answers.add(new SelectItem(1,"vraag 1 antwoord 1"));
                answers.add(new SelectItem(2,"vraag 1 antwoord 2"));
                answers.add(new SelectItem(3,"vraag 1 antwoord 3"));       
                question.setQuestionText("vraag 1");
                question.setAnswers(answers);
                questions.add(question);
                question = new Question();
                answers = new ArrayList();       
                answers.add(new SelectItem(1,"vraag 2 antwoord 1"));
                answers.add(new SelectItem(2,"vraag 2 antwoord 2"));
                answers.add(new SelectItem(3,"vraag 2 antwoord 3"));
                answers.add(new SelectItem(4,"vraag 2 antwoord 4"));
                question.setQuestionText("vraag 2");
                question.setAnswers(answers);
                questions.add(question);
            return questions;
        public void setDataTable1(HtmlDataTable dataTable1) {
            this.dataTable1 = dataTable1;
        public HtmlDataTable getDataTable1() {
            return dataTable1;
        public void setCommandButton1(HtmlCommandButton commandButton1) {
            this.commandButton1 = commandButton1;
        public HtmlCommandButton getCommandButton1() {
            return commandButton1;
        public String commandButton1_action() {
            // Add event code here...
            System.out.println("add item with number " + (((Question)questions.get(0)).getAnswers().size()+1));
            ((Question)questions.get(0)).getAnswers().add(new SelectItem((((Question)questions.get(0)).getAnswers().size()+1) , "Nieuwe vraag " + ((Question)questions.get(0)).getAnswers().size()+1 ));
            return null;
    }The commandButton1_action() needs to add an answer to the first question. This is in fact the backsite where quizes can be created.
    When the action is called an it's redirected to the same page, the answer is added, but due to the fact that the page is rerenderd, the previously selected are gone.
    Is this clear or do I need to give more explanation?

  • Print functionality in MDM Standard Business Packages iViews

    Hi Experts,
    I have successfully connected MDM repository and EP and created system objects and system aliases and suitable user mapping. Now I am having a page with 5 iViews - Text Search, PickList search, Hierarchy search, Resultset and ItemDetails.
    The requirement is to have a print button in the page which when, clicked will generate a user friendly (preferrably a PDF) page and will allow the user to take a print out of the resulting PDF page generated.
    I have gone through the following links
    [Re: Print button;
    To be more specific, I am still not sure how to add a custom button and action to a standard iView - the deployed portal content is not a Web Dynpro application =, although I am not very sure what exactly is it.
    Regards.
    Rohit

    Hi vara,
    Question 1: How to add default search criteria to Search iViews in
    MDM Portal Business Package
    Ans. You can make use of Named Searches. Open the Data Manager Create a entry in the Named Search table, select the desired Supplier as a search criteria and save the search in the Named Search created and assign this Named Search to the user in MDM Console. Now use this user while performing User Mapping step. This will limit the Records to the search criteria of the named search and whenever you create new records satisfying the search criteria, it will get added to named search automatically.
    For 2 and 3
    I tried this in MDM 5.5 SP02, but no luck
    Regards,
    Jitesh Talreja

  • Can I do in Java the same thing I do in Pascal ?

    In Pascal, I may write a procedure :
    procedure poser_question (VAR question: t_question);
    The parameter question is passed by reference, so it works as a resultat parameter.
    According to my Java book, parameters are only passed by value, so I cannot have the construction :
    Combi question = new Combi ();
    poser_question (question);
    Is it exact ? Or may 'question' in calling poser_question (question) be a resultat parameter ?

    Jean-Jacques wrote:
    In Pascal, I may write a procedure :
    procedure poser_question (VAR question: t_question);
    The parameter question is passed by reference, so it works as a resultat parameter.
    According to my Java book, parameters are only passed by value, so I cannot have the construction :
    Combi question = new Combi ();
    poser_question (question);Java passes variables by value, but there are two separate kinds; primitive and reference variables. In your example you're passing a Combi object reference (by value). This means that a reference (pointer) to the Combi object becomes available within the poser_question method. You can use this reference to change fields in the Combi object (which exists outside poser_question).
    The above is equivalent to what would happen in Pascal if you were to pass a Combi record by VAR.

Maybe you are looking for

  • Set Not to Sleep, But it Does Anyway

    Although I have my system set to " Never" sleep it still does and I don't want it to. When I go to bed at night I leave my system running, when I wake up it's sleeping and my AirPort is off. Any clues why? BTW, display is set to sleep after 20 min. T

  • Aperture Crashing

    I posted this a few days ago, but I am coming to my wits end. In the last 3 days, Aperture has crashed over 20 times. Originally the crashes seem to coincide with Time Machine backing up, but this is not always the case. Aperture has crashed when I h

  • Computer won't fully start... strange flashing error HELP!!!!

    when i start my computer... it plays the opening sound... the apple appears and it spins... but then it goes to a black screen... for a minute i can type in letters (similar to MS-DOS mode on a PC).. but then it freaks out and this error starts flash

  • My internal hard drives don't appear in disk utility. Can't install os X

    Hi, I have a macpro. In this computer are 4 1TB hard drives. They were set up as a raid set. I booted my comp with a snow leopard install disk and opened raid utility to delete the raid set so I can install os X on one hard drive and use the other ha

  • Moving library to a different hard drive

    I have an Ibook G4 with 60Gb of memory that is quickly filling up with music. I'd like to move the music onto the external drive that I use for backup, thereby freeing space on the laptop. Any thoughts on the proper way to do this? Thanks.