cannnot able to perform update on navigation in wp7 - windows-phone-7

i want to Create a Simple Database in wp7.In Mainpage i simply add the Records in database and i have another button view which is used to navigate to another page where gridview control is there that can display the data from database that is already done.In the second page i have two Buttons delete and update and i have a textbox where user can enter the id and based on that id the delete and update process can be done.i done the delete operation but i don't know how to update the selected id because onclicking the update button
it should navigate to main page and their corresponding values have to be filled in respective fields.when i tried to use onnavigated method to get the selected id record and if the page loads during startup it throws exception "no key was found"
in the line
var n = PhoneApplicationService.Current.State ["list"];
how to make the application to load so that it does not consider the key.please help me to solve this problem.Thanks

Just check to see if the key exists first:
if (PhoneApplicationService.Current.State.ContainsKey("list") == true)
{
n = PhoneApplicationService.Current.State["list"];
PhoneApplicationService.Current.State.Remove("list");
}
before trying to load it.

Related

"Oracle Apex error: no data found" when opening a form

I have a very simple Oracle Apex app. I created a button on the home page. I also created a second page using the "Form" template, and the source for this form is a table in the local database.
I set the button to open the form, and I passed the value of the primary key of this form (it's a column called ID) from the home page to the form page, as this screenshot of the button's behavior shows (3 is the page number of the form, P3_ID is the page item in the form associated with the primary column "ID", and 1 is the value that I passed for P3_ID):
The table that the form references is empty, i.e. there is no row with ID equal to 1. Meaning I want to pass the value of 1 to this form so that it automatically create a row with ID of 1 after the user fills out the rest of the form. Here is the form page:
Now the error. When I run the app and press the button, I get this error:
The error says it's from the process called "Initialize form Warcraft Particulars". I searched everywhere and I couldn't find a process by that name anywhere in the app. What am I doing wrong?
Pre-rendering process (in a form) will try to execute query and fetch a row whose ID = 1; as it doesn't exist, Apex raises the no_data_found error. That's why you got it (the error).
Moreover, you're doing it wrong - don't pass ID you'd want to create, fill it in form's process (or use a database trigger which will put a sequence number into the ID column, or use an identity column if your Oracle database supports it (12c onward)).
Furthermore, I'd suggest a slightly different approach: don't create a form that's alone in the Universe. Approach that lets you both view existing data, update (or delete) it and insert new rows is to use a Wizard and choose a report with a form. Exact naming is different from one Apex version to another; for example, current apex.oracle.com Apex version is 22.2 and it offers "Interactive report", while the 1st Wizard page lets you choose whether you want (or not) to include a form page (you'd say "Yes").
Anyway: once you find the correct option, choose it and wizard will then create an interactive report page you'd use to
view current data
it has an edit icon at the beginning of each row which - when pressed - navigates to the form page where you can edit values or delete entire row
create new row (by pressing the "Create" button)
and a form page which does what I described a moment ago.

How update record in a table based on a button click in Apex

I'm currently designing an application using Apex 20.1. When the user clicks a button I want to update the record in a table.
I changed the button action to define by dynamic action and the dynamic action is to execute PL/SQL:
UPDATE COSTCODETOCATEGORY
SET
ACTIVE = 'N'
WHERE
TROPOS_COSTCODE = :P21_TROPOS_COSTCODE;
Unfortunately no changes are made to the table. Does anyone have ideas what is wrong?
Why dynamic action and not process?
Button, when pressed, by default submits.
Create the process and put
UPDATE COSTCODETOCATEGORY SET
ACTIVE = 'N'
WHERE TROPOS_COSTCODE = :P21_TROPOS_COSTCODE;
and that should just work, with no additional actions.

Child Table Selections are Reset After "DialogOk" Event (Maximo - Jython Automation Script)

The Issue: We are running Maximo 7.6.1 or greater; I have a custom application (no java class customizations) that includes a custom dialog, and this dialog is used to update data in the app.
My application includes 4 main tables, where the selected row in table 1 filters table 2, the selected row in table 2 filters table 3, and so on... this allows the user to manage data that is structured in a basic hierarchy.
Based on the users settings in the dialog, rows are manipulated/added in the application, and the data is refreshed and saved when the user clicks ok.
The Problem: Although the data is updating correctly when the user clicks Ok and the dialog closes, all the table selections are reset... so whatever record the user was working on - although updated correctly - is no longer displayed. This seems to happen due to the "DialogOK" event being triggerd... however, without running this event, the data does not update in the UI.
How can I ensure Maximo does not reset the selections after the dialog closes and data is updated?
Alternatively, I actually found I was able to access the databeans for each of the tables within my Jython script, and was able to get the index of each currently selected row... How can I set the current row of each databean/table to it's previous value after the "DialogOk" event completes? This could be a solution to manually reset the selection.
Thanks!
Try something like this:
from psdi.common.context import UIContext
from psdi.webclient.system.controller \
import SessionContext, Utility, WebClientEvent
context = UIContext.getCurrentContext()
wcs = context.getWebClientSession()
control = wcs.findControl('name of table')
row = control.getCurrentRow()
#do stuff that breaks the row
control.setCurrentRow(row)
control.rowChanged()

Oracle Apex Item ID (XXX) is not an item defined on the current page

Clicking on a Save button gives error - Item ID (123) is not an item defined on the current page. Contact your application administrator.
I have tried running the below query to find out the item, however, this query gives no data found.
select * from apex_application_page_items where item_id = '123';
Can someone please suggest a solution for this.
That's a specific error message. It means that the item (123) does exist in the app, but shouln't have been submitted with the page. It could be an application-level item rather than a page item. Try running this JavaScript code in the console to see if you can find the element (just replace 123 with the correct item name):
$('#123,[name="123"]').length
If you created an item manually and missed to check all its properties, then it might have been created with a source set to a database column (whose name is equal to page item name). That's usually the case when you create a display item; if so, just set its source to null.
Alternatively, enable debug mode, run the page and then view debug results. In there, you'll see what's going on during page submit and - hopefully - fix the problem.

Why is my Oracle APEX DML Form stuck in edit mode and not going back to create mode?

I have created a page based on "Form & Report" template. So there is the Report page on which there is the create button. That create button leads to the form page which contains.
It is pretty simple. I don't know if there is a cache memory not emptying itself or if there is a setting that I have not properly set.
When I want to create a new database record, Oracle Apex behaves as if I asked it to update a record (though it still presents me with empty text fields).
Below the image of what's happening.
Create button of the Report
Buttons for edit are shown when I click the create button
Those edit buttons are shown instead of the buttons below => This means that the Apex software is behaving like I asked to edit a record not to insert a record.
Why is this happening?
You need to take a look at your create button. Is it passing a value to the form? If so, you probably don't want that. Is it clearing the cache of the form? If not, you probably want to clear it.
Also, on the form page take a look at your processes.. specifically the Automated Row Fetch (ARF) process.. what's the primary key that this process is using?
Also, take a look at the conditions for each button on your form. For the delete/save buttons you likely want a condition type of "value of item / column in expression 1 Is NOT NULL".
For your create button you would want the opposite.. "value of item /... IS NULL".
In both cases for the expression 1 you'd want to use the item that your ARF is leveraging.
#Bloomberg58 if you used the wizard that should not have anyway try to validate the create button in report page and the server-side validation of create and save button in form page

Resources