How to set Application Item value in a Page Item - oracle

I have a application Item in which I have fetched the value of user logged in.
How to fetch that value in page item

You mean, how to put application item's value into a page item?
:P1_USER := :APPLICATION_ITEM;
(I don't know which names you really use, but that's pretty much straightforward).
On the other hand, why did you create an application item for that? What's wrong with :APP_USER which is already built-in?

Related

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.

How do I point a menu item to a component's task?

How do I point a Joomla menu item to a specific task in my custom component? I have had no trouble creating menu items that point to my views, and each view is available in the list when I select my component in the menu. But I have not found a way to route the menu to one of my component's tasks.
In some cases, I am using a controller method (i.e. a task) to decide which models and views to present to the user. Usually this is when I need to display data from multiple models, or I need to use information in the session state to determine which view is appropriate for the user. It is in these cases that I need a menu item that points to the task.
So, how do I get a menu item to bring a user to "index.php?option=com_mycomponent&task=do.something"?
What have I tried already, you ask? I've looked at just about every Google reference I could find, and none seem to address this issue. I'm either looking for the wrong thing, or it's so dead easy that nobody has ever had to ask for help. I have also looked through the Joomla components & menu items, finding no examples of a menu item pointing to a controller task.
You can add a field to the request fieldset. Name it task. The value would be "do.something". Make the field type="hidden".
I'm suggesting the hidden because you really don't want the users to be able to change it.
The request fieldset is for fields that go into the url directly with the format &name=value.
I found the above answer not flexible enough and finally found this to work perfectly, you can override the menu item form xml ( administrator/components/com_menus/models/forms/item.xml ) and make the link field editable so you can add any request parameters you want, including tasks.
Make sure you leave/add the view name of the request as otherwise the link type cannot be determined, so add it even if it is not relevant eg. &view=yourview.
See system plugin onContentPrepareForm below
function onContentPrepareForm(&$form, $data) {
$option = JFactory::getApplication()->input->get('option');
// allow us to edit the link field of the menu item for this component to include some custom request values
if($option == 'com_menus' && $data->type=='component' && $data->request['option']=='com_your_component_name'){
$form->setFieldAttribute('link','readonly','false');
}
}

How to design this page in razor world

In MVC-3/Razor, I need to create a page which will have five set of controls. Each set will have a drop-down and a text box. User will select an option from drop-down and then provide some feedback on text box.
When the view is shown very first time, I only have to enable controls in first set. Whereas all controls in 4 other sets should be disabled. Once user perform action in first set of controls (select optino from drop-down and enter in text box), the second set should become enable now, whereas other set of controls should still be disbaled. The data shown in this second drop-down is dependent upon what user has selected in first drop-down. Once user complete action in this second set, the data in third drop-down will depend upon whatever user selected in first and second drop-down etc.
I am a web-form aspx developer and not sure what will be the best way of designing this in MVC-razor world (because there is not view state etc).
Step 1)
What needs to be clarified is what will cause the other “sets” to be enabled?
Is it after the user has selected an item in the dropdown
OR
Is it after they have entered some text in the textbox?
What also needs to be clarified is if you have a dropdown AND a textbox are they both enabled at the same time or is the textbox only enabled after you’ve selected an item in the dropdown?
Once you’ve got that figured out, move on to the next step.
Step 2)
Do the users need to visually see the 4 sets from the beginning (disabling the 3 other sets) or can you simply show the other sets (on the fly) once the previous one has been successfully filled?
Depending on the answers, this may vary your approach.
As for me, the way I’d do it is simply have/show one set that loads at the beginning.
Once the user has selected an item from the dropdown, I would make an AJAX call passing along the selected item and get back a list of values for the second dropdown.
Then, using jQuery, I would duplicate the row (or div) of the first set all while changing the values in the second dropdown box.
Repeat process for when an item is selected in the second dropdown.
But wait! There’s more!!!
Let’s assume you’ve reached the third set. What if the user decides to change the value in the first dropdown? What are your requirements if that happens? Should you remove all other sets and start back at square one? I guess so…
Since we are not aware of the full set of specs for your tasks, we can only assume stuff and this may (or not) be the best path to take.
Duplicating a row (or a div) using jQuery is quite fun and performance wise, it’s nice.
Keep in mind, you will have to give a different ID to your controls (dropdown + textbox) so when you submit the form, you could use the FormCollection to get those dynamically generated controls.

Filling dependent drop downs with ajax, need to set selected value to person's db value

I have a form where the location fields use a dependent drop down set up, if you choose united states as your country the state dropdown will appear. The fields are populated through an ajax call when fired so it's not loading every single country, state or province, and city in the world on page load lol.
It all works great, however the problem I'm running into is how to set the default selected value from what's already saved. It has to prepopulate those values otherwise if the member doesn't change the location fields every time he edits his profile the location fields will be blank.
I sort of got around the issue by simply doing a query select and then adding the value on top of the ajax pulled values, but this is a really cheesy way to doing it and doesn't work very well.
I need to find a way to set the selected value from the ajax results. I'm sure it can be done by somehow defining the selected value in the code but I'm not exactly sure on how to go about it.
You can find the selected value from db and use
<option selected value="<selected_value>">data</option>
while populating the data from ajax call..

How to call an event when the user "finally" selects an item in a list?

When a user clicks once on an item in a Grid or a ListBox, that item is usually selected, hence most UI frameworks have a onSelected event or the like for that.
However, how can we generally call the next step when a user "finally" selects an item by e.g. double clicking an entry? You know when some popup might appear in the context of the selected item and the user can do further stuff.
Strangely enough, I think I have never seen a word for that in any UI framework.
onPicked, onAccepted, onChosen, onFinallySelected, onResult? All kinda awkward or too special. Any other ideas?
I haven't found anything wrong with SelectionChangeCommitted
The wxWidgets framework uses the term activated to describe what you're talking about. So, the method could be called onActivated.

Resources