3.1 Page 0 LOV APP_ITEM issues
Hello,
I recently upgraded from 3.0.1 to 3.1 and my application appears to have broken.
I have a select list on page 0. The LOV query references an application item using the bind syntax. similar to
select col1 d, col2 r
from my_table
where col3 = :MY_APP_ITEM
order by 1
Since upgrading to 3.1, the select lists are empty after submitting the page, even when the session shows a value in my application item.
This problem only manifests in the select list LOV. If i create a display only item with MY_APP_ITEM as the source, it displays fine.
It almost seems like the page 0 LOV queries are parsed before the session is populated on page load.
Has anybody seen this? Any advice?
Thanks in advance
Matt Cox
Hi Guys,
I am encountering a similar problem to the one mentioned here. I've tried to create a dynamic LOV as below:-
select state_name AS Display_val, state_abbrev as Return_Val
from Pay_US_States@&DB_LINK_APP_ITEM.
order by 1
but I get the following error message...
LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
When I change the query to reference the db link directly, it works fine.
select state_name AS Display_val, state_abbrev as Return_Val
from Pay_US_States@dbname_link
order by 1
I am using version 3.1.0.00.32 of APEX and the db link refers to a remote database. APEX itself is installed on a local XE database.
I have other page references to the application item which work fine but using it in LOVs does not seem possible.
The application item is set on my login page (page 211) in the login process as follows...
:DB_LINK_APP_ITEM := :P211_DB_NAME||'_LINK';
wwv_flow_custom_auth_std.login(
P_UNAME => :P211_USERNAME,
P_PASSWORD => :P211_PASSWORD,
P_SESSION_ID => v('APP_SESSION'),
P_FLOW_PAGE => :APP_ID||':2'
Any help would be great!
Thanks,
Donal
Similar Messages
-
Hi,
I have an lov where i search an employee using employee number. With the help of these lov i bring inormation related to this employee say
info1, info2, info3, info 4 and info5
All these fields are mapped to message styled text on parent page.
Now my issues is, when i click on the lov torch icon so as to search a new employee, it opens up the lov pop up window and clears all the fields related to my mapping for info1, info2, info3 except keeping info4 and info5. Ideally when i click on lov again, it should clear of all the fields which were avl on the page because of my previous search. I am not sure what causes this problem. Can anyone help me out.<lovMappings>
<lovMap id="lovMap3" lovItem="EmployeeNumber" criteriaFrom="EmpNumber" resultTo="EmpNumber"/>
<lovMap id="lovMap4" lovItem="EmployeeName" resultTo="EmpName" criteriaFrom="EmpName"/>
<lovMap id="lovMap5" lovItem="HrmName" resultTo="CurrHRM"/>
<lovMap id="lovMap6" lovItem="MgrName" resultTo="CurrMGR"/>
<lovMap id="lovMap7" lovItem="OrganizationName" resultTo="CurrOrg"/>
<lovMap id="lovMap8" lovItem="PuName" resultTo="CurrPU"/>
<lovMap id="lovMap9" lovItem="BusinessGroupName" resultTo="CurrBG"/>
<lovMap id="lovMap10" lovItem="EmpUserPersonType" resultTo="PersonType"/>
<lovMap id="lovMap11" resultTo="EmpPersonId" lovItem="EmployeePersonId"/>
<lovMap id="lovMap12" resultTo="EmpNum" lovItem="EmployeeNumber"/>
<lovMap id="lovMap13" resultTo="CurrBGId" lovItem="BusinessGroupId"/>
<lovMap id="lovMap14" resultTo="CurrOrgId" lovItem="OrganizationId"/>
<lovMap id="lovMap15" resultTo="CurrMGREmpNum" lovItem="MgrEmployeeNumber"/>
<lovMap id="lovMap16" resultTo="CurrMGRPersonId" lovItem="MgrPersonId"/>
<lovMap id="lovMap17" resultTo="CurrHRMEmpNum" lovItem="HrmEmployeeNumber"/>
<lovMap id="lovMap18" resultTo="CurrHRMPersonId" lovItem="HrmPersonId"/>
<lovMap id="lovMap19" resultTo="CurrPUEmpNum" lovItem="PuEmployeeNumber"/>
<lovMap id="lovMap20" resultTo="CurrPUPersonId" lovItem="PuPersonId"/>
<lovMap id="lovMap34" resultTo="frmEmpName" lovItem="EmployeeName"/>
<lovMap id="lovMap35" resultTo="frmCurrBG" lovItem="BusinessGroupName"/>
<lovMap id="lovMap36" resultTo="frmCurrOrg" lovItem="OrganizationName"/>
<lovMap id="lovMap37" resultTo="frmCurrMGR" lovItem="MgrName"/>
<lovMap id="lovMap38" resultTo="frmCurrHRM" lovItem="HrmName"/>
<lovMap id="lovMap39" resultTo="frmCurrPU" lovItem="PuName"/>
<lovMap id="lovMap44" lovItem="EmpUserPersonType" resultTo="frmPersonType"/>
<lovMap id="lovMap58" lovItem="IFG" resultTo="CurrIFG"/>
<lovMap id="lovMap59" lovItem="BS" resultTo="CurrBusSegment"/>
<lovMap id="lovMap60" lovItem="SB" resultTo="CurrSubBusiness"/>
</lovMappings>
When i clear off the LOV item by putting new employee number and click the torch icon, it clears of all the fields on parent page except IFG, BS, SB. -
Hi,
I have a page A with a button, clicking on which will forward (forwardImmediate) to Page B. Even in page B there is a button which will take you back (again forwardImmediate) to page A. When I click the button in Page A, it takes me to Page B without any issues but the page URI still points to that of Page A!! Similarly when I click the button in Page B it forwards to Page A, but the URL shown in the page is that of page B (note that I am not sharing the AM between pages, both are having different AMs). Can somebody let me know is this is the expected behaviour when pageContext.forwardImmediate is used? How this can be solved (to show the correct URL)?
Issue with the above is -
In Page A I have one more button which opens a Java Modal Popup window (using openWindow javascript) where user can create some records and clicking on Close in the popup should get closed and refresh the base page (not full page refresh, only a particular VO is refreshed to ensure that newly created record is reflected in base page). This is absolutely working fine when Page A is opened and popup button is clicked. But when I navigate to Page B (by clicking the button), then comeback to Page A from Page B(again using the button available in Page B), then open the popup and click on Close in the popup, it throws the error "Opener is Null or Not an object" OR "Object required" error (I am using JavaScript "window.opener.submitForm('DefaultFormName') and window.close" in the popup for close button event). Can anybody help me with this? Since this is happening only in the particular scenario (page navigation), I assume that the issue should be with URL or something. Please help.
Thanks in Advance,
ShreePlease use pageContext.sendRedirect() to show the appropriate URLs. Please go through the servlet/JSP topic understand the difference between sendRedirect and forwardURL. But, I doubt if the above would resolve the issue as it seems to be some JS specific error. Please check with the JS code.
Regards,
Guru. -
Page footer absolute position issue - Crstal Reports
Hi,
I have a page footer section in the crystal report.
There are 2 sections Page footer A and Page footer B.
Here I am displaying Page Footer A in the first page and Page Footer B on all the pages.
Here the issue is, as I applied a suppress condition on page footer A in order to display only on frist page. This is working fine. But in the second page the page footer B is displayed a bit above the end of page as the page footer A is suppressed.
Can we set absolute position for page footer B? So that, the page footer B will be displayed at the same way in all the pages as like the first page.
Thankyou,
Regards
Gowtham Sen.Hi All,
The issue got resolved. I used the option underlay. It worked well.
Thanks. -
Pages to Doc Compatibility Issues
Why can't Apple/Pages fix its compatibility issues w. Word? It let's U save a file as doc. but many changes made in doc. do not take (e.g. tables, indentations, and page brakes). Why does not Pages default to the folder I open a document in when I re-save the document? Even when opening a document and making a simple change and hitting Save, Pages takes me back to the root directory. That makes no sense. Arghhh!!
Given what you described, I'm quite sure that you didn't exported the document as a .doc file where it was stored the first time.
I repeat : when you open a .doc file to edit it, it's a foreign document and the app doesn't take care of its original location. What is meaningful for it is location of files using its native format.
From my point of view, the best scheme is to work always on the native Pages document (don't re-open a file exported as .doc). If changes are required, apply them in the Pages document, save it then (and only when it's saved as Pages) export it as .doc.
When I'm forced to create a Word document from Pages, I don't use File > Export …
I don't use Share > Export.
I use Save As the way you may see on this Screenshot:
This way the default location is the one where the Pages document was saved.
The changes in the layout aren't bugs but the results of deliberate design choices.
As I wrote, the goal was not to reproduce exactly in Word the layout of the Pages document.
It was just to give something readable.
The User Guide clearly states that differences may occur.
As far as I know, when you open on a PC a document created in Word on a mac, you are not sure that it will match exactly the original design.
During the export process, documents created in Pages will loose several of the features which make Pages an interesting tool. I hate M…Soft products but, if someone is forced to exchange on regular basis with Office users, iWork isn't the tool to use. Better work with Office or with one of its free clones.
Yvan KOENIG (VALLAURIS, France) samedi 11 juin 2011 21:48:24
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
LOV related issue in the create page
Hi,
I have created a search page and have made 3 lovs for 3 different search items.
Everything works fine in the search page.
Then I went ahead and created a Create Page and in this page, I am trying to reuse the LOVs that I made for the Search page.
But whenever I click on the LOV in the Create Page , it takes me to the Search Page.
I am not understanding the reason for this.
I looked at all the AM Definitions and everything is properly set.
Can anyone please let me know what might be the reason for this.
ThanksHi,
I have this piece of code in the controller of the create page
===============================================================
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Apply")!=null);
OAViewObject vo = (OAViewObject)am.findViewObject("AccountsVO1");
String setofbooksName = (String) vo.getCurrentRow().getAttribute("SetOfBooksName");
String LookupType = (String) vo.getCurrentRow().getAttribute("LookupType");
String LookupCode = (String) vo.getCurrentRow().getAttribute("LookupCode");
String Description = (String) vo.getCurrentRow().getAttribute("Description");
String OrclSegment1 = (String) vo.getCurrentRow().getAttribute("OrclSegment1");
String OrclSegment2 = (String) vo.getCurrentRow().getAttribute("OrclSegment2");
String OrclSegment3 = (String) vo.getCurrentRow().getAttribute("OrclSegment3");
String OrclSegment4 = (String) vo.getCurrentRow().getAttribute("OrclSegment4");
String OrclSegment5 = (String) vo.getCurrentRow().getAttribute("OrclSegment5");
String OrclSegment6 = (String) vo.getCurrentRow().getAttribute("OrclSegment6");
String OrclSegment7 = (String) vo.getCurrentRow().getAttribute("OrclSegment7");
String LgcySegment1 = (String) vo.getCurrentRow().getAttribute("LgcySegment1");
String LgcySegment2 = (String) vo.getCurrentRow().getAttribute("LgcySegment2");
String LgcySegment3 = (String) vo.getCurrentRow().getAttribute("LgcySegment3");
String LgcySegment4 = (String) vo.getCurrentRow().getAttribute("LgcySegment4");
String LgcySegment5 = (String) vo.getCurrentRow().getAttribute("LgcySegment5");
String LgcySegment6 = (String) vo.getCurrentRow().getAttribute("LgcySegment6");
String LgcySegment7 = (String) vo.getCurrentRow().getAttribute("LgcySegment7");
String EnableFlag = (String) vo.getCurrentRow().getAttribute("EnableFlag");
Date StartDateActive = (Date) vo.getCurrentRow().getAttribute("StartDateActive");
Date EndDateActive = (Date) vo.getCurrentRow().getAttribute("EndDateActive");
am.invokeMethod("apply");
MessageToken[] tokens = { new MessageToken("LOOKUP_TYPE",LookupType),
new MessageToken("LOOKUP_CODE",LookupCode)};
OAException confirmMessage = new OAException ("XMCI","XMCI_RS_TEST_MSG",
tokens,OAException.CONFIRMATION,null);
pageContext.putDialogMessage(confirmMessage);
pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/ap/accounts/webui/AccountsSearchPG",
null,OAWebBeanConstants.KEEP_MENU_CONTEXT,null,null,true,OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
======================================================================
am.invokeMethod("apply");
MessageToken[] tokens = { new MessageToken("LOOKUP_TYPE",LookupType),
new MessageToken("LOOKUP_CODE",LookupCode)};
OAException confirmMessage = new OAException ("XMCI","XMCI_RS_TEST_MSG",
tokens,OAException.CONFIRMATION,null);
pageContext.putDialogMessage(confirmMessage);
pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/ap/accounts/webui/AccountsSearchPG",
null,OAWebBeanConstants.KEEP_MENU_CONTEXT,null,null,true,OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
this piece of code gets fired whenever i select on the LOV item on the create page.
so it takes me to the search page on the click of the LOV button
Could anyone let me know how can I avoid this as I want the whole code to fire only when the user clicks on the APPLY button
Thanks -
Custom Page inline LOV font, buttons not rendering correctly.
Hi ,
i have created a inline LOV in my custom page and the LOV functions correctly BUT the font and the buttons are all messed up (ie displays in a wierd tiny font and the text for the 'cancel' and 'select' buttons in the LOV page appear like text with a small square next to them, though they do the right functions (ie cancel does the cancel etc).....
also, in the main page i display results in a simple table and programatically control some rows to be readonly and some enterable. Again am having presentation issue - ie the readonly rows appear much thinner than the ones where input allowed. this makes the data presentation look very wierd. i tried using CSS class, different itemstyles etc but just cant seem to get a uniform look.
has anyone faced this before ? would really appreciate some inputs.
Thanks.Hi,
I think the issue might be due to browser you are using. Are you using chrome/mozilla ?
Also try accessing the same page from internet explorer.
--Sushant -
LOV validation issue: "Select a valid value"
Hi,
I have a lov problem in oaf: "Select a valid value".
It is a common problem, but somehow I cannot figure it out.
LOV
- LovApplicationId (of type "formValue")
- LovApplicationShortName (of type "messageStyledText")
- LovApplicationName (of type "messageStyledText")
(based on combination of fnd_application and fnd_application_tl)
BASE PAGE
Two relevant items.
First one is "ApplicationId" of type "formValue" connected to view attribute "ApplicationId". (connected to EO attribute in VO)
Second one is "ApplicationName" of type "MessageLovInput" connected to view attribute "ApplicationName" (calculated in VO)
Two lovMappings.
First mapping:
LOV Region Item = LovApplicationName
Return Item = ApplicationName
Criteria Item = ApplicationName
Use for validation = no
Second mapping:
LOV Region Item = LovApplicationId
Return Item = ApplicationId
Criteria Item = <null>
Use for validation = yes
For example.
If I select "Inventory" in the LOV and click on the apply button in the base page, I am getting the error "Select a valid value".
If I select "Inventory Optimization" in the LOV and click on the apply button in base page, no error. And when I look in database the record is saved in my custom table with the correct application_id.
I have read many forum threads on this issue, but I cannot figure it out, what is wrong.
Please help me out.
Kind regards,
CorHi Haroon,
This doesn't solve the problem.
It is true the exception I am getting doesn't show up anymore.
But the application_id isn't saved to the database.
First thing I would expect in this case, that the mappings are not set properly.
But if I choose for the value "Inventory Optimization", the application_id is saved to the database.
If I choose for the value "Inventory" the application_id is not saved to the database.
So it is possible the get rid of the error in the screen, but the underlying problem is still there...
I have checked some core pages, similar to the one I have.
So an UPDATE page (rectification: instead of CREATE).
I have set all attributes the same, but the problem still occurs in my case.
Very strange.
I would make no difference running the page from jdeveloper or put the files on the application server and run it from Oracle, would it?
It makes no sense. But...
Kind regards,
Cor -
Hi ,
I have a LOV switcher attribute in my VO. After saving my page, I need the getter of the switcher to be executed so that the page shows the correct LOV returned by the switcher.
How do I go abt it?
Appreciate your help on this.Refreshing the switcher attribute can be taken care
1) By setting the dependent attributes
2) Groovy expression.
3) Based on the configuration for the switcher transient attribute (Always/Never/ Based on expression)
Hope you are using at least one of the above ways to refresh LOV switcher. You can debug the issue by generating the impl file and putting a break point at the getter of the variable. That might help you in getting more pointers.
Thanks,
Srini. -
Printable Page - Warn About Changes issue
Hi,
I am implementing Printable Page functionality by giving TargetFrame = _blank. And also I am setting Warn About Changes property to True. (pageLayoutRN's WarnAboutChanges is also set to True)
But after making some changes in the page and If I click the Printable Page button, the Save Model warning is not coming.
Any solution ?
SenthilKumar JI guess then it explains the issue. Save model gets invoked only on the following scenario:
# Selecting a tab, horizontal navigation or side navigation menu entry
# Selecting a global button (implies retainAM=N)
# Selecting a breadcrumb link.
# Selecting a link with URL parameter retainAM=Y and the Warn About Changes property set to True (note that this applies only to declaratively defined links; this does not apply to menu links)
# Selecting an image which does not post your changes. For example, selecting an LOV icon or a long tip window will not trigger the save model warning. However, if the user selects on an image that navigates to Yahoo, for example, the warning is displayed.
# Selecting a link that performs a form submit and has the Warn About Changes property set to True.
--Shiv -
Hi ,
I am updating po number in my table then I am attaching the PO number as a LOV in My Jdeveloper Page and Compilled, its working fine(Updating the LOV) in J Developer.I am moving the same page in to the server and going to see the application,it is not refreshed.But I will go to after an half on hour it is refreshed.
Any body can facing this kind of issue, help me how to solve this one? It will be grateful help for me.Awaiting for your earlier response.
Thanks,
PrakashNo!!! see Prakash ...
If you have made changes to the page on client and then you have FTP the page again onto server
then you need to bounce apache and also need to import the page again using xml importer command in application server.
if apache bounce does not reflect try bouncing the instance with the command provided by me...
Thanks,
Gaurav -
Hi,
We have a OAF page which has 2 LOVs. These LOVs are dependent i.e. 2nd LOV gets populated based on the value selected in the first LOV. We are seeing the below issue when we click on the 1st LOV
- In some instances (development, test), mouse pointer becomes hour-glass (busy) which is very useful to the end user. This is kind of a information message to the user that processing is not yet complete. He will wait till it becomes normal pointer before clicking on 2nd LOV. But in some of the instances (Production), mouse hour-glass is not visible so user is not aware that the 2nd LOV is not yet populated and he ends of selecting wrong value (because 2nd LOV has different value initially).
Is it way of showing mouse hour-glass when a event is being fired in OAF? Can this be controlled through OAF or is it system dependent? if it is system dependent, how can change this feature?
Any help on this would be of great help.
Thanks,
Shreeuse bodyBean.setBlockOnEverySubmit() in PR
This will block the user input by showing a busy icon on every submit action..
Use javascript to show a busy icon.
Amar. -
Lov Event Issue..Urgent!!!
Hi to all,
I create a lov dynamically
In processreq.
OAMessageLovInputBean billtoaddbean[] = new OAMessageLovInputBean[100];
billtoaddbean[t] =(OAMessageLovInputBean)createWebBean(pageContext, LOV_TEXT, null, AssoCmpnyCustBillToAdd);
billtoaddbean[t].setAttributeValue(REGION_CODE,"webui/TrailCompanyPG");
billtoaddbean[t].setLovRegion("/lov/webui/TrialBillToLovRN",0);
billtoaddbean[t].setUnvalidated(false);
and set the id like billtoaddbean[t].setID("AssoCmpnyCustBillToAddId"+t);
billtoaddbean[t].addLovRelations(pageContext, AssoCmpnyCustBillToAdd,"Address",LOV_CRITERIA ,LOV_REQUIRED_NO);
billtoaddbean[t].addLovRelations(pageContext,AssoCmpnyCustBillToAdd, "Address",LOV_RESULT,LOV_REQUIRED_NO);
and in prcessformreq, I did the code below (Just check the event)
if(pageContext.isLovEvent())
value.append("In Lov Event --");
System.out.println("IN LOV EVENT");
if(lovInputSourceId.equals("AssoCmpnyCustBillToAddId"+i))
System.out.println("In Asso Bill To Add Lov");
after this when i clicked the this lov means.. the search and select window will not appear.
Anything wrong way i did?
How to check the lov event.
Thanks in Advance
Regards
SenthurHi
pls modify your code according to following code to create the LOV ,
OAMessageLovInputBean lovInput =(OAMessageLovInputBean)createWebBean(pageContext, LOV_TEXT, null,
"inputTest");
webBean.addIndexedChild(lovInput);
// Specify the path to the base page.
lovInput.setAttributeValue(REGION_CODE, "/my/oracle/apps/ak/employee/webui/TestEmpSearchPG");
//lovInput.setAttributeValue(REGION_CODE, "/oracle/apps/dem/webui/Basic");
// Specify the application id of the base page.
lovInput.setAttributeValue(REGION_APPLICATION_ID, new Integer(20001));
// Specify the LOV region definition.
lovInput.setLovRegion("/my/oracle/apps/ak/lov/webui/EmployeesLovRN", 0);
lovInput.setUnvalidated(false);
lovInput.setPrompt("Manager ID");
lovInput.addLovRelations(pageContext, "inputTest", // base page item
"Empname", // lov item
LOV_RESULT, // direction
LOV_REQUIRED_NO);
lovInput.addLovRelations(pageContext, "inputTest", // base page item
"EmpNum", // lov item
LOV_CRITERIA, // direction
LOV_REQUIRED_NO);
please let me know if any issue there
thanx
Pratap -
Hi,
Since an upgrade from Word 2003 to Word 2010, we are experiencing printing issues with certain
documents that have a page width greater than its page height.
In Word 2003, it was no problem to set the page width greater than the page height while setting the page orientation to "portrait".
In Word 2010, this seems impossible: despite leaving the page orientation to "portrait", if one changes the page width/height as stated,
Word 2010 automatically adjusts the orientation to "landscape". Resetting the orientation to "portrait" will flip the page's width/heigth settings.
This behaviour causes printing problems: the page prints out 90° rotated.
I do not believe this is a printer driver issue: I tried several different printer drivers, and all give the same (bad) result. Setting the printer driver's page orientation settings (before printing) makes no difference, as
Word 2010 seems to force the page orientation settings.
Inserting the documents 90° rotated is not an option, since it causes problems with the printing margins.
This is very annoying, since we have to print official documents of a municipality (driver's licences).
Is there a workaround for this issue?
Regards,
Laurent Grandgaignage
Sysadmin Gemeentebestuur Stabroek, BelgiumHi
Thank you for using
Microsoft Office for IT Professionals Forums.
From your description, we can follow these steps to test this issue
Step 1: Repair Office 2010
1.
Click
Start, and then click Control Panel.
2.
Click
Programs and Features.
3.
Click the
Office 2010 program that you want to repair, and then click
Change.
4.
Click
Repair, and then click Continue. You might need to restart your computer after the repair is complete.
Step 2:
Rename the global template (Normal.dotm)Follow the steps for the operating system that you are using:
Windows Vista and Windows 7
a)
Exit Word 2010
b)
Click
Start.
c)
In the
Start Search box, type the following text, and then press
ENTER:
1.
%userprofile%\appdata\roaming\microsoft\templates
d)
Right-click
Normal.dotm, and then click Rename.
e)
Type
Oldword.old, and then press ENTER.
Microsoft Windows XP
a)
Exit Word 2010
b)
Click
Start, and then click Run.
c)
In the
Open box, type the following text, and then press ENTER:
%userprofile%\Application Data\Microsoft\Templates
d)
Right-click
Normal.dotm, and then click Rename.
e)
Type
Oldword.old, and then press ENTER.
f)
Close Windows Explorer.
How to troubleshoot print failures in Word 2010, Word 2007, and Word 2003
http://support.microsoft.com/kb/826845
Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
I can do for you, please feel free to let me know.
Hope that helps.
Sincerely
William Zhou CHNPlease remember to mark the replies as answers if they help and unmark them if they provide no help. -
A simple app to secure coldfusion pages - Running into an issue with Session
Hello, I am testing out how to protect pages in coldfusion and have run into an issue when attempting to create a process by which users can log out.
Essentially, I have three pages:
Page A - The form that submits to Page B
Page B - That checks the form.username and form.password against a database (works fine)
Page C - Logout page (Which is where I am having an issue).
Page C throws a "variable Session is undefined" error
Here is the code on Page C:
<cfset StructClear(Session)>
<cflocation url="index.cfm">
Here is the code on Page B:
<cfif NOT IsDefined ("form.username")>
<cflocation url="index.cfm" addtoken="No">
</cfif>
<cfquery name="test" datasource="cfdb">
SELECT * FROM USERS
WHERE USERNAME = '#FORM.username#'
AND PASSWORD = '#FORM.password#'
</cfquery>
<!---<CFSET Session.LoggedIn = "1">
<CFSET Session.FirstName = "#test.FirstName#">--->
<CFIF test.RecordCount IS 0>
<cflocation url="index.cfm" addtoken="No">
<CFSET StructClear(Session)>
<cfelse>
<CFSET Session.LoggedIn = "1">
<!---<cflocation url="test.cfm" addtoken="No">--->
</cfif>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p><a href="logout.cfm">Log Out</a></p>
<p> </p>
<p> </p>
<p><br>
This content is protected.
</p>
</body>
</html>
As you can see, nothing fancy
Now, I thought that the Session variable could be accessed by any page within a given browser instance, but I am obviously wrong.
What do I need to do for Page C (my logout page to be able to access the session variable).
Any guidance is greatly appreciated!1.
“Variable Session is undefined” error comes up when you try to manipulate a session variable which does not exist, as at that point in time. To take care of possible empty session structures, it is good practice to check first if your session is defined.
So you will have something like:
<cfif isDefined("session")>
<cfset StructClear(Session) />
<cfelse>
<cflocation url="index.cfm">
</cfif>
2.
To enable you access your session variables from any page in your application, you need to enable session management in your Application.cfm or Application.cfc.
cfm <cfapplication sessionmanagement="Yes" />
cfc <cfcomponent>
<cfset THIS.SessionManagement = "Yes" />
</cfcomponent>
Reference…http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7c48.html
Maybe you are looking for
-
Photoshop CS4 file associations (Vista) - fix
--Only tried on Windows Vista - For those who upgraded from Photoshop CS3 to CS4 and lost the ability to associate Photoshop with specific file extensions (like .jpg) because it didn't show up in the "Openwith" list. You might want to try this fix:
-
Error message when trying to view calender after publishing
After publishing my calender I get an offer to send email to invite viewing/subscribing. The email goes through but when I try to follow the link to view I get this error We're sorry but we cannot find the iCal you've requested. It's possible that it
-
Do I need to follow a procedure for reinstalling acrobat 7.0 professional?
I need to perform a system recovery on my laptop and I wonder if I am going to have any issues reinstalling acrobat 7.0 professional.
-
Screen goes blank after 10 secs when i access hotmail
my screen has been going blank after 19 secs when I open Hotmail or the farmville game. The audio however is fine but the screen turns blank (grey). This problem started after I downloaded IOS 5 for my iPad on the imac and then synchronised my itunes
-
Kernel panic with larch5.3 building CD!
Hi, could someone kindly help this. I got the kernel panic with larch5.3 building CD. I didn't get any error messages during the creating. The error message of starting system is in belowing words. :: Initializing writable layer for union (overlay) /