ForEach interaction with deferred value expressions in JSTL1.2

JSP2.1/JSF1.2 now provide more support for using the JSTL forEach tag with nested actions (deferred values) that refer to the iteration variable (see http://jcp.org/aboutJava/communityprocess/maintenance/jsr052/jstl-1_2-mr-changeLog_PFD.html).
However, this support is still quite limited. The current implementation (from glassfish or javaserverfaces projects on dev.java.net) only allow nested deferred-value expressions to refer to the "var" variable (not the "varStatus" variable), and only if the forEach "items" attribute itself refers to a deferred-value expression.
I see no reason why the following cases at least shouldn't also be supported:
(1) "items" attribute not present, just index values. eg:
<c:forEach var="it" begin="0" end="${fn:length(testlist) - 1}">
  <h:outputText value="#{it}." />
  <h:inputText value="#{testlist[it]}" size="20" />
</c:forEach>(2) varStatus available to deferred-value expressions:
<c:forEach items="#{testlist}" var="it" varStatus="is">
  <h:outputText value="#{is.index}." />
  <h:inputText value="#{it}" size="20" />
</c:forEach>Does this behaviour need to be mandated in the spec, or is it up to the implementations? The code that currently controls this behaviour is the "exposeVariables()" method of the class "javax.servlet.jsp.jstl.core.LoopTagSupport", which implies this is an issue for the spec.
Obviously you can write your own "forEach" tag that does support all this, but it would be nice if the JSTL had more complete support built-in.

As there seems to be no information about the problem in the Duke's Bank "formBasedLogin" tag, is there any other publicly available example of a custom JSF component that demonstrates how to implement the handling of deferred value attributes?
I would be most grateful for a minimal working example that demonstrates how to handle deferred value attributes in a JSF custom component.
Thanks
Stephan

Similar Messages

  • Interacting with Forte's Express repository

    Has anyone had any experience with Forte's GenericRepository or AppModel
    Library ?
    Specifically I want to be able to commit changes I have made using the
    abRepositoryClass (from AppModel) in addition to the ability to use an
    instantiation of an abRepositoryClass to move between workspaces.
    Thanks for your attention!
    Geoffrey Whittington
    Software Engineer, Descartes Systems Group Inc.
    [email protected]
    (519)746-8110 x2333

    Hello Forte-User,
    i have this problem inside access also. Because if the where-clause have too much conditions, i got an error: .. too complex... .
    My solution for you is:
    Test the Query-Statement (Database Statement) directly with access in an SQL-Command. If it works, may be the ODBC-Driver is not flexible enough.
    If not, than you have a problem using Access with Express. This means you may change the method in which manner Express makes Database Access.
    The default manner Express makes database accesses is 'Optimistic Verify'.
    This means before Update insert or delete occures Express make a re-Read of the data's with its last contents to secure that no other user makes changes on the data before (See Details on Concurrency Manager).
    You may test the same sample with 'Pessimistic-Verify' perhaps it works fine.
    Sorry for this bad message.
    Joseph Mirwald

  • How Users Interact with Oracle Database Express Edition in a Network?

    Please i just want to know how users can relate or access the Oracle DB xpress on a network. Coming from an oracle enterprise edition background i know when you install oracle on a network, isqlplus for example is centrally loaded meaning you dont need to install oracle on each machine in the network, so users can access the DB from their nodes. I am presently working in a big estate management firm and i want to create a structured database for them, they use excel to store records and want to introduce Oracle.

    You can access XE remotely through the browser after following the instructions here:
    http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/network.htm#BHCBCFBA
    If you are using APEX as the application, you'd need to do that. There may be other firewall consideration though (ie opening the relevant server ports).
    [There's no isqlplus anymore, but there is a similar sql worksheet in the Apex development environment).
    If you are just using the database as a data store behind, for example, a Java application, then connections will probably be through ODBC/JDBC/OCI and probably need some client installation too.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need to check tls/ssl but getting stuck with "You must provide a value expression on the right-hand side of the '-' operator."

    I would like to disable ssl 3 but need to test what sites only support ssl 3. I keep getting stuck with an error that is over my head. I've tried manipulating the string a dozen different ways and keep getting the same error. I am not familiar with -notin
    or how to specify which part of the property its checking: thanks a ton
    http://blog.whatsupduck.net/2014/10/checking-ssl-and-tls-versions-with-powershell.html
    line with issues:
    $ProtocolNames = [System.Security.Authentication.SslProtocols] | gm -static -MemberType Property | where-object{$_.Name -notin @("Default","None") | %{$_.Name}
    You must provide a value expression on the right-hand side of the '-' operator.
    At S:\scripts\test23.ps1:50 char:126
    + $ProtocolNames = [System.Security.Authentication.SslProtocols] | gm -static -MemberType Property | where-object{$_.Name - <<<< noti
    n @("Default","None") | %{$_.Name}
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : ExpectedValueExpression
    <#
    .DESCRIPTION
    Outputs the SSL protocols that the client is able to successfully use to connect to a server.
    .NOTES
    Copyright 2014 Chris Duck
    http://blog.whatsupduck.net
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    .PARAMETER ComputerName
    The name of the remote computer to connect to.
    .PARAMETER Port
    The remote port to connect to. The default is 443.
    .EXAMPLE
    Test-SslProtocols -ComputerName "www.google.com"
    ComputerName : www.google.com
    Port : 443
    KeyLength : 2048
    SignatureAlgorithm : rsa-sha1
    Ssl2 : False
    Ssl3 : True
    Tls : True
    Tls11 : True
    Tls12 : True
    #>
    function Test-SslProtocols {
    param(
    [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
    $ComputerName,
    [Parameter(ValueFromPipelineByPropertyName=$true)]
    [int]$Port = 443
    begin {
    $ProtocolNames = [System.Security.Authentication.SslProtocols] | gm -static -MemberType Property | where-object{$_.Name -notin @("Default","None") | %{$_.Name}
    process {
    $ProtocolStatus = [Ordered]@{}
    $ProtocolStatus.Add("ComputerName", $ComputerName)
    $ProtocolStatus.Add("Port", $Port)
    $ProtocolStatus.Add("KeyLength", $null)
    $ProtocolStatus.Add("SignatureAlgorithm", $null)
    $ProtocolNames | %{
    $ProtocolName = $_
    $Socket = New-Object System.Net.Sockets.Socket([System.Net.Sockets.SocketType]::Stream, [System.Net.Sockets.ProtocolType]::Tcp)
    $Socket.Connect($ComputerName, $Port)
    try {
    $NetStream = New-Object System.Net.Sockets.NetworkStream($Socket, $true)
    $SslStream = New-Object System.Net.Security.SslStream($NetStream, $true)
    $SslStream.AuthenticateAsClient($ComputerName, $null, $ProtocolName, $false )
    $RemoteCertificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]$SslStream.RemoteCertificate
    $ProtocolStatus["KeyLength"] = $RemoteCertificate.PublicKey.Key.KeySize
    $ProtocolStatus["SignatureAlgorithm"] = $RemoteCertificate.PublicKey.Key.SignatureAlgorithm.Split("#")[1]
    $ProtocolStatus.Add($ProtocolName, $true)
    } catch {
    $ProtocolStatus.Add($ProtocolName, $false)
    } finally {
    $SslStream.Close()
    [PSCustomObject]$ProtocolStatus
    Test-SslProtocols -ComputerName "www.google.com"

    V2 version:
    function Test-SslProtocols {
    param(
    [Parameter(
    Mandatory=$true,
    ValueFromPipelineByPropertyName=$true,
    ValueFromPipeline=$true
    )]$ComputerName,
    [Parameter(
    ValueFromPipelineByPropertyName=$true
    )][int]$Port = 443
    begin {
    $protocols=[enum]::GetNames([System.Security.Authentication.SslProtocols])|?{$_ -notmatch 'none|default'}
    process {
    foreach($protocol in $protocols){
    $ProtocolStatus = @{
    ComputerName=$ComputerName
    Port=$Port
    KeyLength=$null
    SignatureAlgorithm=$null
    Protocol=$protocol
    Active=$false
    $Socket = New-Object System.Net.Sockets.Socket('Internetwork','Stream', 'Tcp')
    $Socket.Connect($ComputerName, $Port)
    try {
    $NetStream = New-Object System.Net.Sockets.NetworkStream($Socket, $true)
    $SslStream = New-Object System.Net.Security.SslStream($NetStream, $true)
    $SslStream.AuthenticateAsClient($ComputerName, $null, $protocol, $false )
    $RemoteCertificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]$SslStream.RemoteCertificate
    $protocolstatus.Active=$true
    $ProtocolStatus.KeyLength = $RemoteCertificate.PublicKey.Key.KeySize
    $ProtocolStatus.SignatureAlgorithm = $RemoteCertificate.PublicKey.Key.SignatureAlgorithm.Split("#")[1]
    catch {
    Write-Host 'Failed'
    finally {
    New-Object PsObject -Property $ProtocolStatus
    $SslStream.Close()
    Test-SslProtocols -ComputerName www.google.com
    ¯\_(ツ)_/¯

  • I am updating my airport express. However, the message comes up with Invalid value - advertising a service globally using Bonjour requires a global hostname. WHat does this mean?

    i am updating my airport express. However, the message comes up with Invalid value - advertising a service globally using Bonjour requires a global hostname. WHat does this mean?

    thank you thank you for taking an interest. this is so frustrating.
    i only have apple keyboard, mighty mouse, and 20 inch cinema display connected. this morning took out memory and tried to boot up with individual pairs in the first bank. first the (2)256, the (2) 1g, and then the other (2) 1g modules. everytime I get the weird fuzzy wheel under the logo after a while, black screen flashes, then grey apple logo fuzzy screen then black forever.
    I ran tiger updates this morn. still will only boot to safe mode. then tried to run leopard disk to install it
    will not boot from leopard disk.
    tried safe boot, then doulble click install leopard, restart, then the saga repeats with the pixely red square around the wheel.
    these are fresh drives with only what came on instll disk loaded.
    thanks again for taking an interest.
    i love this system(well at least i did). I want to install leopard on my powerbook too but am terrified to do so right now since it is working and I have work to do. Can't afford to have no computer to do my work on...self employment is great?!
    This is making me crazy. I anxiously await your words of wisdom.

  • Interacting with a Telnet Stream with Reglar expressions

    I am having a bit of trouble figuring out how to do this:
    I need to interact with an open Stream (telnet in this case, ssh is next). {org.apache.commons.net.telnet}
    in pseudocode:
    in = telnet.getInputStream();
    out = new PrintStream(telnet.getOutputStream());
    readUntil (in,"username:|something:|Password:");
    if ("username:") {
          write(out,username);
          readUntil (in,"password:")
          write (out,password);
    } else if ("something:) {
           doSomethingWacky();
    } else if ("Password:") {
           write (out,password);
    readUntil ("some regex ending with >"); Any ideas on how to do the readUntil with some sort of regular expression?

    I have an update on my problem.
    Here is the new code, but the problem is that, for some reason it always takes 30000 ms on the last line of the read. Just to re-cap, InputStreamReader(in) is the InputStream of a telnet method.
    Any ideas on why br.readLine() would take 30 seconds to read the last line in? Profiling confirms that the script is sitting on readLine to return.
    Some debugging output is included as well
    calling for the method
             String ret = readUntil("Password: ",true);
         public String readUntil(String pattern, boolean discard) throws IOException
              String data = "";
              InputStreamReader isr = new InputStreamReader(in);
              BufferedReader br = new BufferedReader(isr);
              boolean readOn = true;
              while (readOn)
                   String line = "";
                   long t = new Date().getTime();
                   if ((line = br.readLine()) != null)
                        System.out.println((new Date().getTime()) - t + " inside of if readline");
                        if (line.matches(pattern))
                             System.out.println((new Date().getTime()) - t + " inside of if pattern");
                             readOn = false;
                        else
                             System.out.println((new Date().getTime()) - t + " inside of else pattern");
                             // if (!discard)
                             // data = data + line;
                   else
                        readOn = false;
                   t = new Date().getTime() - t;
                   System.out.println("readline took " + t + " ms and readOn = " + readOn);
                   if (line != null)
                        System.out.println(" line  = >>" + line + "<<");
              if (discard)
                   return null;
              else
                   return (data.toString());
         }Output:
    15 inside of if readline
    15 inside of else pattern
    readline took 15 ms and readOn = true
    line  =
    0 inside of if readline
    0 inside of else pattern
    readline took 0 ms and readOn = true
    line  =
    0 inside of if readline
    0 inside of else pattern
    readline took 0 ms and readOn = true
    line  = User Access Verification
    0 inside of if readline
    0 inside of else pattern
    readline took 0 ms and readOn = true
    line  =
    30125 inside of if readline
    30125 inside of if pattern
    readline took 30125 ms and readOn = false
    line  = Password:
    We can telnet to it as well.
    Ending.

  • Creating value expression​s dynamicall​y with strings and numbers?

    Hello everybody!
    I'm having a problem regarding passing arguments (DLL-Adapter) from different locations to a function in TestStand 3.5.
    Here is what I have:
    FileGlobals.Data.MyArray
    and
    StationGlobals.Data.MyArray
    Which means there are 2 arrays of the same type, one stored in the sequence and one globally. "Data" is just a container.
    The type of MyArray is a custom one each element containing a string and a number: Array[n].Name and Array[n].Nr
    Now I want to pass (string) arguments of the array to a function using a value expression of: FileGlobals.Data.MyArray[Step.index].Name
    Whereas Step.index is a local property (number) of a custom step. It's working well!
    Here is the actual problem:
    Since I have to sources, FileGlobals OR StationGlobals, I want to specify dynamically which string to pass.
    Therefore I introduced a property Step.ThisIsMyScope . It's a string containing either "FileGlobals" or "StationGlobals".
    I have been experimenting in expressions like
    Step.ThisIsMyScope + ".Data.MyArray[" + Step.index + "].Name"
    or Evaluate(...) , etc.
    Nothing worked.
    I do not want to use the API, though I managed to do things with getValString and temporary saving the Value in the step, but that's not nice nor transparent enough.
    May anyone help me?
    Thank you very much,
    Stefan

    Hi,
    have you tried Evaluate(Step.ThisIsMyScope + ".Data.MyArray[" + Step.index + "].Name")
    or
    (Step.ThisIsMyScope == "FileGlobals"  )  ?  (FileGlobals.Data.MyArray[ Step.index].Name)  :  (StationsGlobals.Data.MyArray[ Step.index].Name)
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 04-05-2007 10:09 AM
    Regards
    Ray Farmer

  • Is it possible to use page-scope beans in value expression ?

    Is it possible to use page-scope beans in value expressions ?
    For example,
    <c:forEach items="${DataScreens.records}" var="record" status="status">
    <tr>
      <td><h:command_link action="#{DataScreen.editRecord}">
                    <h:output_text value="#{DataScreen.modifyLabel}" />
                   <!----- PLEASE NOTE THAT status IS OF PAGE-SCOPE IN THE NEXT LINE -->
                   <f:parameter name="id" value="#{status.count}" />
              </h:command>
      </td>
      <td>...</td>
      <td>...</td>
    </tr>
    </c:forEach>In my case, I want to use JSTL instead of <h:dataTable>, because of some special
    requirements in this screen. Can someone please provide me with a workaround ?
    I get the following error on execution..
    12/26/03 16:36:23:734 JST] 59f0302f FacesArraySuf W com.sun.faces.el.ext.FacesA
    rraySuffix Attempt to apply the "." operator to a null value
    [12/26/03 16:36:23:736 JST] 59f0302f FacesArraySuf W com.sun.faces.el.ext.FacesA
    rraySuffix Attempt to apply the "." operator to a null value
    [12/26/03 16:36:23:756 JST] 59f0302f WebGroup E SRVE0026E: [Servlet Error]-
    [Argument Error: One or more parameters are null.]: javax.servlet.jsp.JspExcepti
    on: Argument Error: One or more parameters are null.
    at com.sun.faces.taglib.BaseComponentTag.doEndTag(BaseComponentTag.java:
    961)
    at com.sun.faces.taglib.html_basic.Command_LinkTag.doEndTag(Command_Link
    Tag.java:222)
    at org.apache.jsp._meisaiJoho._jspService(_meisaiJoho.java:365)
    at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.j
    ava:89)
    Thanks,
    Ajay

    Hello Ajay,
    I cant really understand how a particular style can be applied to only an individual column.In the simplest case the attribut 'columnClasses' of data_table contains
    the same number of style classes as you have columns in your table. These
    classes are then applied one to one to the columns.
    If there are fewer classes than columns then you can think of the classes
    beeing repeated until there is one class for each column. In the extreme
    case of only one class this means that this class is applied to all columns.
    The following example shows the simplest case of three columns
    and three classes. Just remove one or two classes from the columnClasses
    attribute to see the 'repeating' behavior.
    Wolfgang Oellinger
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <% session.setAttribute("PersonList", new foo.PersonList()); %>
    <f:view>
    <html>
    <head>
        <title>Styled Data Table</title>
        <style>
         /* for the columns */
            .nameClass { width: 30em; color: red; }
            .birthdayClass { width: 12em; color: green; background-color: #ccc; }
            .heightClass { width: 5em; color: blue; }
         /* for the header */
            .yellowClass { background-color: yellow; }
        </style>
    </head>
    <body>
      <h:form>
      <h3>Styled Data Table</h3>
      <h:data_table columnClasses="nameClass,
                                   birthdayClass,
                                   heightClass"
                            style="border: 1px solid black;"
                      headerClass="yellowClass"
                            value="#{PersonList.members}"
                              var="person">
        <h:column>
          <f:facet name="header"><h:output_text value="Name"/></f:facet>
          <h:output_text value="#{person.name}"/>
        </h:column>
        <h:column>
          <f:facet name="header"><h:output_text  value="Birthday"/></f:facet>
          <h:output_text value="#{person.birthday}"/>
        </h:column>
        <h:column>
          <f:facet name="header"><h:output_text  value="Height"/></f:facet>
          <h:output_text value="#{person.height}"/>
        </h:column>
      </h:data_table>
      </h:form>
    </body>
    </html>
    </f:view>

  • How to export "Managed by" field of Distribution and Security groups and import with new values? (Exchange 2010, AD 2003)

    My Active Directory environment is 2003 functional level and we have Exchange 2010.
    I am trying to find out the best way to do a mass edit for the "Managed by" values of our security and distribution groups.
    I know we can export the "managed by" field by csvde but I am not sure this is the correct way to do it. Also in the case that there are multiple users assigned to be managing a distribution group it only shows one value. Also powershell from Exchange
    2010 can be used with "get-distribution" but as our AD environment is 2003 is this correct also?
    Finally once the data is exported to csv can it be edited to then reimport and udpate the existing group managed by fields with new values?
    Not really sure that the best way to go about this is.
    Summary - We have 2003 AD with Exchange 2010 and I am trying to export a list of all our Distribution/Security groups showing the group name and managedby values so we can edit and update the
    existing managedby values with new ones. In some cases we have multiple users as the owners.
    Appreciate any advice on how this can be best achieved. Thank you.

    Hi,
    We can use the following command in Exchange 2010 to export "Managed by" field of Distribution and Security groups:
    Get-DistributionGroup | Select-object Name,@{label="ManagedBy";expression={[string]::join(“;”,$_.managedby)}},Primarysmtpaddress | Export-Csv
    C:\export.csv
    After you changed the Managed by field in export.csv and saved it as a new file named import.csv, we can run the following command to set with new value:
    Import-Csv C:\import.csv | Foreach-Object{ Set-DistributionGroup –Identity $_.Name –ManagedBy $_.ManagedBy}
    Hope it works.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • [8i] Best way to replace "similar" values with one value...?

    Below is some sample data:
    Sorry for the large set / complex set of sample data, but there should be no need to go through it in detail =).
    2 things to keep in mind:
    1) This is an 8i db
    2) I cannot create any new tables within this db, though I can create views
    CREATE TABLE     ord_master
    (     part_nbr          CHAR(25)
    ,     ord_nbr          CHAR(10)
    ,     sub_ord_nbr     CHAR(3)
    ,     ord_type          CHAR(2)
    ,     ord_stat          CHAR(2)
    ,     date_closed     DATE
    -- please note, though none of the columns in ord_master are explicitly defined as NOT NULL,
    -- none of them are NULL in the db, and given how things are input into the table, I don't
    -- even think it's possible
    -- a unique order is described by ord_nbr, sub_ord_nbr.  there should only be one record in
    -- this table for a given unique combination of those columns, though they are not the p.k.
    -- NOTE: dates default to 12/31/1900, so in the table above, if an order is still open (thus,
    -- not closed), it's date_closed will be 12/31/1900.  It will only change once the order closes.
    INSERT INTO     ord_master
    VALUES     ('ABC-123','1','1','AA','CL',TO_DATE('05/01/2009','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','1','2','AA','CL',TO_DATE('9/14/2009','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','2','1','AA','CL',TO_DATE('12/03/2009','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','3','1','AA','OP',TO_DATE('12/31/1900','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','4','1','AA','CL',TO_DATE('03/12/2004','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('XYZ-123','5','1','AA','CL',TO_DATE('03/12/2004','mm/dd/yyyy'));
    CREATE TABLE     op_detail
    (     ord_nbr          CHAR(10)
    ,     sub_ord_nbr     CHAR(3)
    ,     major_seq_nbr     CHAR(4)
    ,     wctr_id          CHAR(5)
    ,     oper_stat          CHAR(2)
    ,     plan_su_rsrc     NUMBER(5,2)
    ,     plan_run_rsrc     NUMBER(11,8)
    ,     plan_subc_amt     NUMBER(15,5)
    ,     act_su_rsrc     NUMBER(5,2)
    ,     act_run_rsrc     NUMBER(7,2)
    ,     act_subc_amt     NUMBER(15,2)
    ,     act_start_dt     DATE
    ,     dt_completed     DATE
    ,     qty_planned     NUMBER(13,4)
    ,     qty_recvd          NUMBER(13,4)
    ,     qty_complete     NUMBER(13,4)
    ,     qty_scrap          NUMBER(13,4)
    ,     qty_on_hold     NUMBER(13,4)
    -- similar to ord_master, thought none of the columns are explicitly defined as NOT NULL,
    -- none of the records have NULL values for any of these columns, and I don't think it's
    -- really possible with the way the system is
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0081', 'X516 ', 'CP', 0, 0, 0, 0, .2, 0, TO_DATE('02/03/2010', 'mm/dd/yyyy'), TO_DATE('02/03/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0324', 'Y000 ', 'CP', .1, .2, 0, 0, .87, 0, TO_DATE('04/06/2010', 'mm/dd/yyyy'), TO_DATE('04/06/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 159, TO_DATE('03/05/2010', 'mm/dd/yyyy'), TO_DATE('03/05/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0130', 'H211 ', 'CP', .5, .1, 0, .08, .63, 0, TO_DATE('02/10/2010', 'mm/dd/yyyy'), TO_DATE('02/10/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0120', 'H214 ', 'CP', .3, .05, 0, 0, .68, 0, TO_DATE('05/22/2009', 'mm/dd/yyyy'), TO_DATE('05/22/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0122', 'T203 ', 'CP', 2.5, 1, 0, .67, .3, 0, TO_DATE('05/28/2009', 'mm/dd/yyyy'), TO_DATE('05/28/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0130', 'H211 ', 'CL', .5, .1, 0, .67, .3, 0, TO_DATE('05/28/2009', 'mm/dd/yyyy'), TO_DATE('05/28/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 153.12, TO_DATE('06/10/2009', 'mm/dd/yyyy'), TO_DATE('06/10/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0324', 'Y000 ', 'CP', .1, .2, 0, 0, .08, 0, TO_DATE('06/17/2009', 'mm/dd/yyyy'), TO_DATE('06/17/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0081', 'X516 ', 'CL', 0, 0, 0, 0, 0, 0, TO_DATE('07/20/2009', 'mm/dd/yyyy'), TO_DATE('07/20/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0324', 'Y000 ', 'CL', .1, .2, 0, 0, 3.03, 0, TO_DATE('09/11/2009', 'mm/dd/yyyy'), TO_DATE('09/11/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 204.16, TO_DATE('08/11/2009', 'mm/dd/yyyy'), TO_DATE('08/11/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0130', 'H211 ','CP', .5, .1, 0, 1.97, 2.67, 0, TO_DATE('07/28/2009', 'mm/dd/yyyy'), TO_DATE('07/29/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 255.2, TO_DATE('11/06/2009', 'mm/dd/yyyy'), TO_DATE('11/06/2009', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0130', 'H212 ', 'CP', .5, .1, 0, .6, .03, 0, TO_DATE('10/21/2009', 'mm/dd/yyyy'), TO_DATE('10/21/2009', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0550', 'R501 ', 'WK', 1, 16, 0, 2.2, 12.4, 0, TO_DATE('05/19/2010', 'mm/dd/yyyy'), TO_DATE('12/31/1900', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0324', 'Y000 ', 'CL', .1, .2, 0, 0, .07, 0, TO_DATE('02/04/2010', 'mm/dd/yyyy'), TO_DATE('02/04/2010', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('4', '1', '0324', 'Y000 ', 'CP', .1, .2, 0, 0, .59, 0, TO_DATE('02/06/2004', 'mm/dd/yyyy'), TO_DATE('02/06/2004', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);This is the query I'm working with right now:
    SELECT     o.part_nbr               
    ,          s.major_seq_nbr          AS op_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END                         AS wctr
    ,          MIN(s.plan_su_rsrc)          AS min_plan_setup
    ,          AVG(s.plan_su_rsrc)          AS avg_plan_setup
    ,          MAX(s.plan_su_rsrc)          AS max_plan_setup
    ,          STDDEV(s.plan_su_rsrc)     AS sdev_plan_setup
    ,          MIN(s.plan_run_rsrc)     AS min_plan_run
    ,          AVG(s.plan_run_rsrc)     AS avg_plan_run
    ,          MAX(s.plan_run_rsrc)     AS max_plan_run
    ,          STDDEV(s.plan_run_rsrc)     AS sdev_plan_run
    ,          MIN(s.plan_subc_amt)     AS min_plan_subc
    ,          AVG(s.plan_subc_amt)     AS avg_plan_subc
    ,          MAX(s.plan_subc_amt)     AS max_plan_subc
    ,          STDDEV(s.plan_subc_amt)     AS sdev_plan_subc
    ,          MIN(s.act_su_rsrc)          AS min_act_setup
    ,          AVG(s.act_su_rsrc)          AS avg_act_setup
    ,          MAX(s.act_su_rsrc)          AS max_act_setup
    ,          STDDEV(s.act_su_rsrc)     AS sdev_act_setup
    ,          MIN(s.act_run_rsrc)          AS min_act_run
    ,          AVG(s.act_run_rsrc)          AS avg_act_run
    ,          MAX(s.act_run_rsrc)          AS max_act_run
    ,          STDDEV(s.act_run_rsrc)     AS sdev_act_run
    ,          MIN(s.act_subc_amt)          AS min_act_subc
    ,          AVG(s.act_subc_amt)          AS avg_act_subc
    ,          MAX(s.act_subc_amt)          AS max_act_subc
    ,          STDDEV(s.act_subc_amt)     AS sdev_act_subc     
    ,          MIN(s.act_start_dt)          AS min_start
    ,          MAX(s.act_start_dt)          AS max_start
    ,          MIN(s.dt_completed)          AS min_comp
    ,          MAX(s.dt_completed)          AS max_comp
    ,          MIN(s.qty_planned)          AS min_qty_plan
    ,          AVG(s.qty_planned)          AS avg_qty_plan
    ,          MAX(s.qty_planned)          AS max_qty_plan
    ,          STDDEV(s.qty_planned)     AS sdev_qty_plan
    ,          MIN(s.qty_recvd)          AS min_qty_recvd
    ,          AVG(s.qty_recvd)          AS avg_qty_recvd
    ,          MAX(s.qty_recvd)          AS max_qty_recvd
    ,          STDDEV(s.qty_recvd)          AS sdev_qty_recvd
    ,          MIN(s.qty_complete)          AS min_qty_comp
    ,          AVG(s.qty_complete)          AS avg_qty_comp
    ,          MAX(s.qty_complete)          AS max_qty_comp
    ,          STDDEV(s.qty_complete)     AS sdev_qty_comp
    ,          MIN(s.qty_scrap)          AS min_qty_scrap
    ,          AVG(s.qty_scrap)          AS avg_qty_scrap
    ,          MAX(s.qty_scrap)          AS max_qty_scrap
    ,          STDDEV(s.qty_scrap)          AS sdev_qty_scrap
    ,          MIN(s.qty_on_hold)          AS min_qty_hold
    ,          AVG(s.qty_on_hold)          AS avg_qty_hold
    ,          MAX(s.qty_on_hold)          AS max_qty_hold
    ,          STDDEV(s.qty_on_hold)     AS sdev_qty_hold
    ,          COUNT(*)                    AS rec_cnt
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END                         AS time_period
    FROM          ord_master o
    ,          op_detail     s
    ,          (     -- begin in-line view a, to get the min act_start_dt for each order
              SELECT     s1.ord_nbr
              ,          s1.sub_ord_nbr
              ,          MIN     (
                             CASE
                                  WHEN     s1.act_start_dt     > TO_DATE('01/01/2000','mm/dd/yyyy')
                                  THEN     s1.act_start_dt
                             END
                             )          AS ord_min_start
              FROM          op_detail s1
              GROUP BY     s1.ord_nbr
              ,          s1.sub_ord_nbr
              ) a     -- end in-line view a          
    WHERE     o.ord_nbr          = s.ord_nbr
    AND          o.sub_ord_nbr     = s.sub_ord_nbr
    AND          o.ord_nbr          = a.ord_nbr
    AND          o.sub_ord_nbr     = a.sub_ord_nbr
    AND          o.ord_type     = 'AA'
    AND          o.ord_stat     IN ('CL','OP')
    AND          s.oper_stat     IN ('CL','CP')
    GROUP BY     o.part_nbr
    ,          s.major_seq_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ORDER BY     o.part_nbr
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ,          s.major_seq_nbrThis gives me a bunch of descriptive statistics on some data stored in the database, broken into groups by the time period.
    I have 7 sets of possible values for the column wctr_id that are groups of similar/same work centers, and should be treated as the same, assuming the ord_nbr, sub_ord_nbr, and major_seq_nbr are the same. In my example case statement above, anytime I find 'H211' or 'H212', I am replacing it with 'Z211', which is my new, unique identifier for any wctr in the group ('H211', 'H212'). I have 7 of these sorts of groups that need to be replaced by a new, unique identifier. Is my CASE statement (noted above) the best way to do this, or is there a better way? These groups of similar-to wctr_id's are not listed in a table anywhere.

    Hi,
    As always, thanks for posting the CREATE TABLE and INSERT statements; that's very helpful, and leads to faster, better solutions.
    Another thing that is helpful, and promotes faster, better solutions, is to simplify your problem.
    For example, you have to compute a lot of aggregates, but it looks like you already know how to do that. This problem only involves the CASE expressions, and how they interact with the GROUP BY clause. So just cut out most of the aggregate functions.
    Also, it looks like the intricacies of in-line view a have nothing to do with your current problem. For purposes of posting this problem, pretend that a is a regular view, so it doesn't clutter up the main query.
    I think your problem could be restated like this:
    You already have a query like this:
    CREATE OR REPLACE VIEW a
    AS
              SELECT     s1.ord_nbr
              ,          s1.sub_ord_nbr
              ,          MIN     (
                             CASE
                                  WHEN     s1.act_start_dt     > TO_DATE('01/01/2000','mm/dd/yyyy')
                                  THEN     s1.act_start_dt
                             END
                             )          AS ord_min_start
              FROM          op_detail s1
              GROUP BY     s1.ord_nbr
              ,          s1.sub_ord_nbr
    SELECT     o.part_nbr               
    ,          s.major_seq_nbr          AS op_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END                         AS wctr
    ,          MIN(s.plan_su_rsrc)          AS min_plan_setup
              -- lots of other agtgregates go here in real query
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END                         AS time_period
    FROM          ord_master o
    ,          op_detail     s
    ,          a          -- in real query, a is an in-line view
    WHERE     o.ord_nbr          = s.ord_nbr
    AND          o.sub_ord_nbr     = s.sub_ord_nbr
    AND          o.ord_nbr          = a.ord_nbr
    AND          o.sub_ord_nbr     = a.sub_ord_nbr
    AND          o.ord_type     = 'AA'
    AND          o.ord_stat     IN ('CL','OP')
    AND          s.oper_stat     IN ('CL','CP')
    GROUP BY     o.part_nbr
    ,          s.major_seq_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ORDER BY     o.part_nbr
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ,          s.major_seq_nbr
    ;that produces this output:
    `                       MIN_
                           PLAN_
    PART_NBR   OP_N WCTR   SETUP TIME_PERIOD
    ABC-123    0081 X516      .0 12 mos. back
    ABC-123    0130 Z211      .5 12 mos. back
    ABC-123    0170 X928      .0 12 mos. back
    ABC-123    0324 Y000      .1 12 mos. back
    ABC-123    0120 H214      .3 24 mos. back
    ABC-123    0122 T203     2.5 24 mos. back
    ABC-123    0130 Z211      .5 24 mos. back
    ABC-123    0170 X928      .0 24 mos. back
    ABC-123    0324 Y000      .1 24 mos. back
    ABC-123    0324 Y000      .1 37 mos. back +The output is correct; the problem is, can we get the same results without 2 copies of the wctr CASE expression, and 3 copies of the time_period CASE expression?
    Is that a fair description of the problem?
    For starters, you can use column aliases in the ORDER BY clause. Unfortunately, that's the only place where you can use column aliases in the same query where they are defined . You can compute them in a sib-query, and then use them in super-queries.
    In other words, wouldn't it be nice if we had a table just like op_detail, but with an additional column called wctr? Make a view: either a regular view (especially if wctr, computed the same way, will be used in several different queries) or an in-line view, as shown below.
    Wouldn't it be great if there was a table that was just like a, except that it had time_period alreay computed? Make a view: either a regular view or an in-line view, as shown below.
    SELECT     o.part_nbr
    ,     s.major_seq_nbr          AS op_nbr
    ,     s.wctr
    ,     MIN(s.plan_su_rsrc)          AS min_plan_setup
         -- lots of other agtgregates go here in real query
    ,     a2.time_period
    FROM     ord_master      o
    ,     (          -- Begin in-line view s, with data from op_detail
                 SELECT  op_detail.*      -- or list all columns needed in main query
              ,     CASE          -- replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                       WHEN     wctr_id        IN ('H211','H212')
                       THEN     'Z211'
                       ELSE     wctr_id
                   END                    AS wctr
              FROM     op_detail
         ) s          -- End in-line view s, with data from op_detail
    ,     (           -- Begin in-line view a2, to compute time_period
              SELECT  a.*
              ,     CASE
                       WHEN ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                           THEN     '12 mos. back'
                           WHEN ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                           THEN     '24 mos. back'
                           WHEN ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                           THEN     '36 mos. back'
                           ELSE '37 mos. back +'
                   END                         AS time_period
              FROM     a          -- in real query, a is an in-line view
         ) a2          -- End in-line view a2, to compute time_period
    WHERE     o.ord_nbr     = s.ord_nbr
    AND     o.sub_ord_nbr     = s.sub_ord_nbr
    AND     o.ord_nbr     = a2.ord_nbr
    AND     o.sub_ord_nbr     = a2.sub_ord_nbr
    AND     o.ord_type     = 'AA'
    AND     o.ord_stat     IN ('CL','OP')
    AND     s.oper_stat     IN ('CL','CP')
    GROUP BY     o.part_nbr
    ,          s.major_seq_nbr
    ,          s.wctr
    ,          a2.time_period
    ORDER BY     o.part_nbr
    ,          a2.time_period
    ,          s.major_seq_nbr
    ;In your example, wctr is the same as wctr_id except for two values. If it was more complicated (e.g., if there were not just 2 values that need to be mapped to 'Z211', but also 3 values to were equivalent to 'Z987', and 1 that was to be treated like 'A012', and 5 that should appear as 'A666', and ...), then you could code all that in a humongeous CASE expression (a nested CASE expression, if it involves more that 128 branches), but it really belongs in a table, where you have the raw wctr_id (like 'H211') in one column, and its corresponding equivalent (such as 'Z211') in another. I know you said you can't create new tables; I'm just pointing this out so you can tell the people who won't let you create new tables that it's a bad idea, likely to cause errors and certain to waste time in the future.

  • Repost: Use Page-scope expressions in Value expressions

    Dear Adam Winer and expert group,
    I woud like to repost my problem. I had posted this in an earlier thread today. The issue that I would
    like to raise is regarding being able to use page-scoped beans in value expressions. I am trying to
    port some screens from Struts to JSF. Struts allows you to assign page-scoped beans to its input
    components. Adam Winer, you have been very helpful to me. I hope this issue can be solved.
    Thanks,
    Ajay
    Dear Adam Winer,
    I must admit that I am not able to understand your post properly. It is certainly because I have not
    properly understood the JSF architecture properly as yet.
    JSF automatically shows model bean values in the browser, and takes user input back into the model bean.
    But it would be nice to have the following scenario to work out....
    1. The JSP assigns the (initial) value to the JSF component.
    2. This value is displayed in the browser.
    3. When the user submits the form, the value goes to the model bean.
    Your post seems to indicate that the above is not possible. Could there not be any architectural
    workaround to make this possible ?
    Your post also seems to indicate that it is not possible to use an action from within a <c:forEach>.
    The following could also be perhaps ok (if it doesnt cause some other problem).
    <h:input_text initValue="#{pageScopeBean.someValue}" value="#{someBean.someValue}"><f:parameter initValue="#{status.count}" value="#{DataTable.selectedIndex}" />
    Perhaps, the expert team can come up with some brilliant solution. I am really keen.
    Ajay
    P.S ("Delayed execution", "Immediate execution", "does not exist on subsequent requests" are presently
    Greek and Latin to me.)
    No, that's not really possible, and it's not because
    we didn't try!
    "#{}" syntax means "evaluate this later". It has to
    mean that, for lots of reasons, including the need to
    evaluate these values on subsequent requests, and to
    evaluate these values repeatedly when a repeater
    component (like data_table) renders its output.
    Obviously, pageScope.status.count won't exist on
    subsequent requests, so that bit is hopeless. But it
    won't necessarily even work in the middle of the page,
    because there's no guarantee that the value of that
    <f:parameter> will only be used during the execution
    of <c:forEach>.
    We'd considered adding support for both delayed
    execution - "#{}" - and immediate execution - "${}" on
    JSF attributes, which would enable an example like
    this, but decided not to, for two reasons. First, it
    would be very confusing. Second, it actually opened a
    small security hole to do so that can't be solved
    without changes to the JSP EL architecture.
    -- Adam Winer (EG member)

    Dear Adam Winer,
    I read your post again and understood what you mean by "delayed execution" and "immediate execution".
    I am sorry, I think I read your post too quickly and hence didnt compherehend it.
    Please let me know if you think an alternative syntax such as
    <h:input_text initValue="#{pageScopeBean.someValue}" value="#{myBean.someValue}"/>Perhaps, this is not so different from the "#{}" and "${}" syntax that was discussed in the expert group.
    I am trying to imagine why a security loop-hole could be caused. If Struts doesnt have any problem
    getting values from a page-scoped bean, why does JSF have the problem ?
    Thanks for your help.
    Ajay
    We'd considered adding support for both delayed
    execution - "#{}" - and immediate execution - "${}" on
    JSF attributes, which would enable an example like
    this, but decided not to, for two reasons. First, it
    would be very confusing. Second, it actually opened a
    small security hole to do so that can't be solved
    without changes to the JSP EL architecture.

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • How can I use a date range in a list KPI value expression

    I am trying to create a series of status indicators for a document library in SharePoint 2010. I've made a status list for this. One of the desired KPI's is to show the percentage of documents that must be revised and approved within the next two
    months.
    I have a field which logs the next approval date (last approval date plus one year). In the standard form for the KPI I can set the value expression to return the percentage of documents to be reviewed between [Today] and a date that I fill
    in by hand (see image below). But I haven't yet been able to have the target date (two months from today) change dynamically. Is there a way to have the second date increment via a calculation here? Or do I need to use a recurring workflow to do this?
    Any help would be greatly appreciated - also if this post should be elsewhere. I am not a programmer, and just beginning to learn to make use of many of SharePoint's functions.
    Cheers,
    Russ Herald

    I'm not certain if you can use formulas here but if you can use the standard SharePoint Field Formulas you could try the following:
    For the second date could you just put: [Today]+60 to add 60 days to the current date
    Or to work with actual months you could possibly use: =DATE(YEAR([Today]),MONTH([Today])+2,DAY([Today])) to add exactly two months.
    Reference:
    https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx#sectionSection2

  • How to convert an array collection instance to a complex object for interaction with webservice

    Hi there,
    I have a stubborn problem that I am trying to work out the best way to solve the problem.  I am interacting with a WebService via HTTPService calling a method called find(String name) and this returns me a List of ComplexObjects that contain general string and int params and also lists of other Complex Objects.  Now using the code:
    ArrayCollection newOriginalResultsArray = new ArrayCollection(event.result as Array)
    flex converts my complex objects results to an arraycollection so that I can use it in datagrids etc.  Now up until this part is all good.  My problem is when getting a single instance from the results list, updating it by moving data around in a new datagrid for example - I want to interact with the webservice again to do an create/update.  This is where I am having problems - because these webservice methods require the complex object as a parameter - I am struggling to understand how I can convert the array collection instance back to my complex object without iterating over it and casting it back (maybe this is the only way - but I am hoping not).
    I am hoping that there is a simple solution that I am missing and that there is some smart cookie out there that could provide me with an answer - or at least somewhere to start looking. I guess if I have no other alternative - maybe I need to get the people who built the service to change it to accept an array - and let them do the conversion.
    Any help would be greatly appreciated.
    Bert

    Hi Bert,
    According to my knowledge you can use describeType(Object) method which will return an XML... That XML will contain Properties and values just iterate through the XML and create a new Object..   Probably u can use this method...
    public function getObject(reqObj:Object,obj:Object,instanceName:String,name:String=null,index:int=-1):Obj ect
                if(!reqObj)
                    reqObj = new Object();
                var classInfo:XML = describeType(obj);
                var className:String = instanceName;
                if(name!=null)
                    className=name+"."+className;
                if(index!=-1)
                    className=className+"["+index+"]";
                for each (var v:XML in classInfo..accessor)
                    var attributeName:String=v.@name;
                    var value:* = obj[attributeName]
                    var type:String = v.@type;
                    if(!value)
                        reqObj[className+"."+attributeName] = value; 
                    else if(type == "mx.collections::ArrayCollection")
                        for(var i:int=0;i<value.length;i++)
                            var temp:Object=value.getItemAt(i);
                            getReqObject(reqObj,temp,attributeName,className,i);
                    else if(type == "String" || type == "Number" || type == "int" || type == "Boolean")
                        reqObj[ className+"."+attributeName] = value; 
                    else if (type == "Object")
                        for (var p:String in value)
                            reqObj[ className+"."+attributeName+"."+p] = value[p];
                    else
                        getReqObject(reqObj,value,attributeName,className);
                return reqObj;
    Thanks,
    Pradeep

  • Visual Studio 2012 is no longer able to interact with any TFS server

    I can connect to the on-premise TFS2012 server using the instance of VS2012 installed on the server machine as well as the instance of VS2012 installed on a coworker's machine.
    I was able to interact with TFS2012 using the instance of VS2012 installed on my Win7 x64 machine, but only one time. Many reboots later, both of the server itself and my machine, I haven't been able to get VS2012 to interact properly with TFS.
    When I click on "Team" and select "Connect to Team Foundation Server", the "Team Explorer" VS window opens. In that window, no matter what button or link I click on, Visual
    Studio won't connect to TFS or allow me to choose a TFS server.
    1. Clicking on the Home icon takes me to page with two buttons: Pending Changes & settings.
    Clicking on "Pending Changes" takes me to a page where I can do 3 things: click on "no workspace" (nothing happens), click on Actions -> Open Source Control Explorer (which opens an
    empty Source Control Explorer Window, from which I can do nothing), click on "Settings", which shows me a page with 4 options:
    Security: clicking it results in the message "Team Foundation Error. Object reference not set to an instance of an object"
    Group Membership: clicking it results in the message "Team Foundation Error. Object reference not set to an instance of an object"
    Source Control: clicking it results in the message "Value cannot be null. Parameter name: serverName"
    Process Template Manager: clicking it results in the message "Value cannot be null: Parameter name: tpc"
    2. Clicking on the "Connect to Team Projects" icon takes me to a page where I can click on either:
    "Configure Team Projects": clicking it does nothing
    "Connect": clicking it does nothing
    "Sign Up": opens a Visual Studio Online page on my web browser
    If I instead go to File -> Source Control -> Advanced, there is only one option which appears to be working:
    Change Source Control. When I click on it I get a window with a table with rows that correspond to the current solution and the projects in the current solution. ie:
    Solution/Project: {item name}
    Server Name: "<No Server>"
    Server Binding: "<No Server>"
    Connected: {gray uncheckable checkbox}
    Status: "Not Controlled"
    Local Binding:
    Provider:
    Relative path:
    The buttons "Connect", "Disconnect", "Browse" are disabled. Clicking on the "Bind" button results in a window with the message "The mappings
    for the solution could not be found" and two buttons: Ok and
    Help. Clicking on Help results in a white window with the message:
    "The 'EurekaPackage' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\User\<username>\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml'.
    Continue to show this error message?"
    Clicking "yes" open the following page on my web browser, which essentially tells me to go back to the "Change Source Control" window and unbind the project, which VS is not letting me do:
    http://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=EN-US&k=k%28vs.tfc.sourcecontrol.MessageConnectionManagerCantBind%29;k%28TargetFrameworkMoniker-.NETFramework
    The following is an excerpt from the "ActivityLog.xml" file mentioned in the white window that appeared when I clicked on the "Help" button:
      <entry>
        <record>651</record>
        <time>2013/12/20 13:35:53.354</time>
        <type>Information</type>
        <source>Profile manager</source>
        <description>Begin export of category &apos;Source Control_TeamFoundation&apos; ({2A718788-A6D9-44C5-90EF-438BF5B06A74}) from package &apos;Microsoft.VisualStudio.TeamFoundation.VersionControl.HatPackage, Microsoft.VisualStudio.TeamFoundation.VersionControl, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; ({4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}).  3349472 KB of virtual memory currently available.</description>
      </entry>  <entry>
        <record>652</record>
        <time>2013/12/20 13:35:53.354</time>
        <type>Information</type>
        <source>Profile manager</source>
        <description>End export of category &apos;Source Control_TeamFoundation&apos; ({2A718788-A6D9-44C5-90EF-438BF5B06A74}).  3349472 KB of virtual memory currently available.</description>
      </entry>
      <entry> <entry>
    <record>664</record>
    <time>2013/12/20 13:48:51.961</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [Microsoft.Data.Entity.Design.BootstrapPackage.BootstrapPackage, Microsoft.Data.Entity.Design.BootstrapPackage, version=11.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>
    <guid>{7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB}</guid>
    <hr>80070002</hr>
    <errorinfo>Could not load file or assembly 'Microsoft.Data.Entity.Design.BootstrapPackage, Version=11.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
    </entry>
    <entry>
    <record>671</record>
    <time>2013/12/20 13:50:19.757</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{E8B06F41-6D01-11D2-AA7D-00C04F990343}</guid>
    </entry>
    <entry>
    <record>672</record>
    <time>2013/12/20 13:50:19.757</time>
    <type>Warning</type>
    <source>VisualStudio</source>
    <description>Unexpected system error mode before loading package [Visual Studio Web Browser Package]</description>
    <guid>{E8B06F41-6D01-11D2-AA7D-00C04F990343}</guid>
    </entry>
    <entry>
    <record>676</record>
    <time>2013/12/20 13:50:19.820</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{8C28E535-ABC9-4F92-B5C9-6C16617C8884}</guid>
    </entry>
    <entry>
    <record>677</record>
    <time>2013/12/20 13:50:19.820</time>
    <type>Warning</type>
    <source>VisualStudio</source>
    <description>Unexpected system error mode before loading package [EurekaPackage]</description>
    <guid>{8C28E535-ABC9-4F92-B5C9-6C16617C8884}</guid>
    </entry>
    <entry>
    <entry>
    <record>679</record>
    <time>2013/12/20 13:50:19.820</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [EurekaPackage]</description>
    <guid>{8C28E535-ABC9-4F92-B5C9-6C16617C8884}</guid>
    <hr>80070002</hr>
    <errorinfo>Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Web Tools\Eureka\Microsoft.VisualStudio.Web.Eureka.dll' or one of its dependencies. The system cannot find the file specified.</errorinfo>
    </entry>
      <entry>
        <record>559</record>
        <time>2013/12/20 14:30:48.880</time>
        <type>Error</type>
        <source>VisualStudio</source>
        <description>Could not convert file time to system time</description>
        <hr>80070057 - E_INVALIDARG</hr>
      </entry>
    </activity>
    What, if anything, can I do in order to be able to get Visual Studio 2012 to interact with TFS?

    I'll add that when I run devenv.exe with the flag /TFSLink, VS opens a Team Explorer window that contains the following text:
    An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\<username>\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml".Exception details:System.NullReferenceException: Object reference not set to an instance of an object.   at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context)   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

Maybe you are looking for

  • MacBook Pro 13" Late 2011, 16GB RAM and Apple Premium Service Center

    Hello all, My dad has a MacBook Pro 13" Late 2011, it came with a 4GB RAM. When he got Parallels and installed Windows 8, 4GB RAM were not enough to even deal with Safari so he had to buy 16GB RAM from Cruical. Today when he went to Apple Premium Ser

  • How to upload a PDF online, fill it, then save?

    Hi, I'm trying to figure out on how to upload a PDF to our own server (thru an FTP site) so users can fill it in, then save it to their computer's hard drive/desktop. i searched all over and cannot find a solution. Can someone please help? Thank you

  • Converting files with Camera Raw 4.1

    Have just upgraded to iphoto '08, and am having problems with "noise" in the raw conversion within iphoto. So, I'm using Camera Raw 4.1 instead (a bit of a pain as I have a batch of 200 photos to convert from a wedding!). A question ... can you save

  • Survey / Poll / Test Creation Documentation

    I'm trying to document a process for "non-technical" people to create surveys in my portal. I would like, if possible, to find some Oracle documentation (not online help) to help explain the process. The documentation seems not to exist but that seem

  • BAPI/LSMW/BDC/ALE-Idoc-Best One

    Hi Folks, What would be the best method to migrate master and transactional data.(One time upload). I am suggesting BAPI as we have internal thirdparty RFC calls while creating masterdata.(I guess we wouldnot get this RFC calls in recording). I gone