Passing a text field value into popup page using URL - oracle-apex

I am trying to pass the value of a text field from one page to another using the URL but failing miserably.
The reason for this is as follows:
I have an apex page which displays a machines properties (make, model, what products it makes, machine ID (:P1_INPUT)). Some machines can only make one product, other can make a variety.
I use a query to complete the following: If the machine only makes one type of product , the product number is displayed in :P1_item. If a machine can make more than one product it displays in :P1_item the world 'multiple'.
I want to build in the ability to click on a button next to :P1_Item, a popup appears with the products the machine makes if ‘multiple’ is displayed. I have the popup bit working but its not passing my :P1_INPUT from the page to the popup page text field :P3_OUPUT
The following code i have on the button, so when it is clicked, it opens a popup page (this works) and should populate the text field (P3_OUTPUT) with the value passed from P1_INPUT (this doesnt work).
My button is set to Redirect to URL and i have this in the URL target.
javascript:popupURL('f?p=&APP_ID.:HELLOWORLD:&SESSION.:::&P3_OUTPUT.:&P1_INPUT.')
I cant use a branch because i dont want the main page showing the machine properties to submit.

Your URL is wrong: f?p=&APP_ID.:HELLOWORLD:&SESSION.:::&P3_OUTPUT.:&P1_INPUT. : you want to provide a value for the item P3_OUTPUT while you have set &P3_OUTPUT. which is a substitution string and would put the value of P3_OUTPUT in the string.
You need to set the URL to f?p=&APP_ID.:HELLOWORLD:&SESSION.::::P3_OUTPUT:&P1_INPUT., which would correctly set the value of P3_OUTPUT and add an extra semi-colon between the session identifier and the arguments-values pair.

Related

Calling a non-modal dialog page passing IR report ID in page url

I am trying to change all popup pages in an app from normal page template to non-modal-dialog page template in apex 5.1
I'll try to describe the complete use-case:
I have an Interactive report page with link columns for each record which opens a dialog window where users can edit/interact with the record.
The dialog has Previous/Next buttons to allow users to navigate through the records.
When a filter is set on the report, the dialog window should take this into account in the Next/Previous behavior.
For e.g. if the report filter selects only one row, then the dialog window Next/Previous buttons are disabled because there are no more rows shown by the report to navigate through.
For this functionalities, I need to pass the IR-report ID to the non-modal page.
Now the href property of the link column in the IR report should be something like:
javascript:apex.navigation.dialog('f?p=123:40:12345678:::40:P40_SIGNAL_DEF_ID,P40_IR_REPORT_ID,P40_MODE:42,41982451655076402,E&p_dialog_cs=NwEcqexhNPGD1VziCXol65xHCP8',{title:'SIGNALS_DIGITAL',height:'auto',width:'720',maxWidth:'960',modal:false,dialog:null},'t-Dialog-page--standard '+'',apex.jQuery('#myStaticID'));
Only two parts in this link I am concerned about. One is the checksum part (p_dialog_cs=NwEcqexhNPGD1VziCXol65xHCP8) and other part is the IR report ID(41982451655076402) I used apex_util.prepare_url function in the SQL query but this is not returning IR report ID something like :
javascript:apex.navigation.dialog('f?p=123:40:12345678:::40:P40_SIGNAL_DEF_ID,P40_IR_REPORT_ID,P40_MODE:42,,E&p_dialog_cs=NwEcqexhNPGD1VziCXol65xHCP8',{title:'SIGNALS_DIGITAL',height:'auto',width:'720',maxWidth:'960',modal:false,dialog:null},'t-Dialog-page--standard '+'',apex.jQuery('#myStaticID'));
I am not able to get the IR report ID here I tried using $v("myStaticID_report_id") inside this query but not working(though it is working in console)
So right now I am calling apex_util.prepare_url with dummy string say 'report_ID' the result I am passing to a javascript function as an argument. In javascript function, I am extracting the url part of the string(because I need the checksum value) and then replacing the dummy variable with $v("myStaticID_report_id") and then calling apex.navigation.dialog from there.
Now its functional but this needs to be repeated in almost 70 pages in my application. So I want to know if there is a better way to do this.
Thanks in advance

How to fill dynamic form fields using capybara

I have a form that contains a select box and a text field.
The text field is displayed dynamically based on the selectbox selection. If the value of selectbox is "Yes", then the text field will be displayed and vice versa.
I am running an rspec test and filled the select box value with "Yes"
select 'Yes', from: 'property[have_water_bills]'
Now i want to fill a value on the text field
fill_in 'property[irrigation_cycle_count]', with: 5
But i am getting the following error.
Capybara::ElementNotFound:
Unable to find field "property[irrigation_cycle_count]"
That is, capybara cannot find the dynamic element. Does anyone know how to fix this?
Poltergeist doesn't gemerate a click event when choosing an item from a select. It generates a focus on the option, change on the select, blur on the option. It is more like if a user selected the option with keyboard instead of using a mouse. You probably should be doing the logic to display your text field on the change event anyway so that it works if people use a mouse or a keyboard to navigate around your page. It also makes more sense to run your show/hide logic on the change event because that's what you actually care about, not clicks.
Finally got this to work using the following piece of code
page.execute_script("$('#have_water_bills').val('true').trigger('click')")

Cannot get Read Only Condition to work on Oracle Apex page

Trying to add a read condition to my page. Nothing I am doing works. I would like to use the PL/SQL Expression condition type but cannot get it to evaluate properly. My app is a workflow application and I want the page to display in READ mode when the status is not DRAFT. So, naturally I try to code the Expression as:
:P2_PDD_STATUS_CD != 'DRAFT'
This results in the page being opened in edit mode no matter what the status value. What am I missing? I've verified the column name several times. As a matter of testing, I was not able to get the Expression 1 = Expression 2 condition type to work either.
Getting APEX Page Item Conditional Properties to Work as Designed:
The Quick Answer: Wherever you place the page item that influences the READ-ONLY state of the text field page/region item, the change in its value/state has to happen sequentially before the event that fetches and displays the conditionally read-only text field...
The best way to make sure the state you have changed "sticks" is to associate a page redirect with that field so that the rest of the page items and dependent properties has an opportunity to recognize that the read-only page indicator value has been altered (from DRAFT to non-DRAFT, etc.)
The Test Data Schema: Speech Writer's Block App
This example uses a single table. The text-document is an oversized VARCHAR2 typed field, though it really could be anything... even a LOB/CLOB typed value for larger capacity. The schema:
The PAGE Design and Layout
The example is designed in a single page. Two regions: The speech catalog (top) and the speech editor form (bottom) are processed in the following order:
Query the speech catalog for the report display (fetch)
If a SPEECH_ID value was designated at page-load (or reload) fetch all fields for the speech document record where the speech id = the page item containing the speech id value.
If a SPEECH_Id was recently chosen (after the page is rendered), then redirect the page to itself setting page item SPEECH ID = selected speech id #.
The FORM Region Design
This defines what the "edit" button does from the report output of possible speech selections. Notice that selecting this button value sets an automatic redirect to the same page, containing the revised STATUS-MODEvalue.
Rendering Sequence Design
The rendering of the page passes through each region and design block once. If a item value is upstream (i.e., processed before) from a defining item value (such as the STATUS: DRAFT, ARCHIVE, etc.)... or it can be changed after the page render is completed, a redirect action would help in this case.
The Conditional READ-ONLY Page ITEM Property
Output and Results
Normal Speech Edit (DRAFT) Mode
Archive Mode for READ ONLY Speech Text Access
Discussion of Alternative Designs
It is possible to do this with a workflow that spans multiple pages. It might even be easier that way. For example, the determining, incoming page item properties should be set at ANY time prior to when the previous page is redirected to it.
Additional Comments (aside)
Sorry in advance for the slightly abnoxious-sized watermark-credits text on my screen-captures. I'm set up with a new tool (Skitch) and it is nearly impossible to get a sense of scale when it's finally home within a Stack Overflow post...
Enjoy anyways: Onward!

How to remove ID from URL in Joomla 2.5

I am trying to remove id from url in Joomla2.5.8.
so I tried to set a reference to the below URL.
http://developernote.com/2012/05/how-to-remove-id-from-url-in-joomla-2-5/
I succeeded to remove id like below.
joomla/index.php/aaaa/bbbb.html ≫ joomla/index.php/aaaa/bbbb/105-cccc.html
But Only displays a ”blank page”.
I don't know what was wrong.
Could you give me some advice?
-program development environment-
・joomla!2.5.8
・SEO setting
Search Engine Friendly URL Yes
use URL rewriting No
Adds Suffix to URL Yes(add .html)
UNICODE Aliases No
・htaccess
no setting
The problem is that most likely the article you are trying to link to does not have a corresponding menu item associated with it. The problem comes from itemID inheritance. When you don't have a specific menu item for an article, it then inherits the itemID from its parent category. By commenting out the lines in router.php, you are stopping this from happening so the article will not have an itemID and cause a 404 error. You either need to create a menu item directly to the item (which would eliminated the itemID to begin with) or you need to create a menu item for the parent category. In either case, you can put it in a new menu that is not displayed in any modules.

passing and getting variables to a cfwindow

I have a table within a form that has many identical rows. At the beginning of each row is a text field and a button that creates a <cfwindow> so that the user can browse an inventory and select a single item. Then I need that item's name and ID to get sent back to the main page and populate the text box.
The main page form works fine. The <cfwindow> works fine (search, display, etc..). I cannot figure out a way to get the variable being set in the <cfwindow> back to the main page and just populate the text field for that specific row and not redraw the entire page. I can't even get the <cfwindow> to access any variable on the main page and I thought that it was just a floating div and would have access to all of the main page variables that are set.
This is one row of the main page (the index is for looping through to create unique names for each row variables):
<cfinput type="button" value="Select" name="xSelect#i#" onClick="ColdFusion.Window.create(blah blah blah...)/>.
<cfinput type="text" name="x1s#i#xName" value="form.x1s#i#xName" size="30" disabled="true"/>
in the <cfwindow>, a query populates a list of items, each with a radio button. User needs to select one and it needs to return that item's ID back to the main page for that row:
I appreciate the feedback. Here's what I ended up doing:
- passed the variables to the cfwindow via url with a button and an onClick="ColdFusion.Window.create..."
- in the cfwindow, I used the url variables as a reference and I have a search dialogue that then sends the search results along with the url variable (via url variables) to a simple action page that just displays a form with the variables populated via an onclick="javascript:ColdFusion.navigate..."
- back in the main page I have a cfdiv that binds to the action page via a url
So by starting with a reference that I pass to my search function, I keep it "tagged" and then every time it is refreshed it shows up in the main page correctly.
So it's working now and the last thing that I need to do is put all my dynamic variables in an array to reduce the overhead.
In ColdFusion you could put something into the session scope or you could use javascript to set hidden fields on the calling page. There may be a nicer solution but that's a couple of quick ones.
Use a Javascript function call in your link on the parent window.
From the Javascript function, use ColdFusion.Window.create to create the child window with a dynamic url passing the vars you need.
Et voilà.