Oracle Apex 5 custom report - oracle

in my application I have a form based on a report with the list of Dishes. I want to change apperance of the report so that it doesn't look like a table, but more like a list. I don't want to have a heading. I would expect something similar to the amazon list after you submit your search:
http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=oracle+apex
Is it possibe to achieve it without creating a plugin? How would you approach this?

You can do this by creating a new bespoke report template for the report.
Go to Shared Components, Templates and create a new report template. Select "Named Column (row template)" as the template type.
After creating it, edit it and change the "Row template 1" property which initially looks like this:
<tr><td>#1#</td><td>#2#</td><td>#3#</td><td>#4#</td><td>#5#</td></tr>
Replace that with the HTML for each report row, for example:
<li>
<div class="picture">
<img src="#DISH_PICTURE#">
</div>
<div class="description">
<h2>#DISH_TITLE#</h2>
<p>#DISH_DETAILS#</p>
</div>
</li>
The words between #'s are column names from your report query (this template is bespoke for this particular report). So your query might be:
select dish_picture, dish_title, dish_details
from dishes
order by dish_seq;
Use the "Before Rows" and "After Rows" properties to define the HTML before and after the rows, for example <ul class="dishList"> and </ul>.
You can then apply styling using CSS in files or in the page attributes (for example).

Related

How to compose a link (`href`) in an Odoo 10 view

I have a regular view in my views folder with the model= set etc. I am displaying fields with no issues. I just just need to compose a link and to complete this, all I need is the current record ID then hopefully I can do something as simple as this:
Report
Unfortunately the views documentation only tells me how to use fields which is not compatible with what I need.
My understanding is that any regular view is a QWeb view thats really in a <template> tag, so according to this QWeb documentation I tried this:
<a href="/rpt/the-report-for-widget?id=t-esc="id"'>Report</a> and
<a t-attrf-href="/rpt/the-report-for-widget?id=#{id}'>Report</a> and
<a t-attrf-href="/rpt/the-report-for-widget?id=#{model.id}'>Report</a> and
<a t-attrf-href="/rpt/the-report-for-widget?id=#{record.id}'>Report</a>
and about a dozen other things and nothing seems to work.
(just so you don't ask, yes I am updating the module before checking the result in the view)
I would prefer not to use t-attf-href when I could simply use href. A pointer to specific documentation would be great.
you can try this.
<a t-attrf-href="/rpt/the-report-for-widget?id={{id}}'>Report</a>

identifying xpath from Ext JS application

I'm trying to automated a application designed in Ext Js, xpath identification is become complex. Please help in getting the xpath for the below scenario.
For a dropdown having a set of names, need to select a name from the list available.
I'm using a mouse action to locate the drop down name and then moveToElement particular element in the List of menu present.
For example If the menu is containing a list of names like, Abi, Ashwini Asha, Ashwini, Diva.
Using parameterizing I'm able to select the names from the menu.
But when I need to select Ashwini from the menu ,since Ashwini Asha is already present in the menu , Ashwini Asha object gets clicked.
contains() is not working here. Which function should I use?
The below is the code which am using :
html :
<div id="combo-1023-inputWrap" class="x-form-text-wrap x-form- text-wrap-default" role="presentation" data-ref="inputWrap">
<input id="combo-1023-inputEl" class="x-form-field x-form-text x-form-text-default " type="text" autocomplete="off" aria-autocomplete="list" aria-expanded="false" aria-haspopup="true" aria-required="false" aria-invalid="false" aria-readonly="false" aria-disabled="false" aria-hidden="false" role="combobox" value="Triton" name="selectedName" size="1" data-ref="inputEl" data-componentid="combo-1023">
......
<li>------------ Ashwini Asha</li>
<li>------------ Ashwini</li>
</div>
to click on the menu :
action.moveToElement(driver.findElement(By.xpath("//input[#name='selectedName']"))).click().perform();
to load the data in the menu :
wait.until(ExpectedConditions.visibiltyOfElementLocated(By.xpath("//li[contains(text(),'"+NameParameter+"')]")));
click the object :
action.moveToElement(driver.findElement(By.xpath("//li[contains(text(),'"+NameParameter+"')]"))).click().perform();
Let me know how to select the name Ashwini alone?
Thanks
No need to use contains in your xpath. Go for exact match of the name.
By.xpath("//li[text()='"+NameParameter+"']")
or
By.xpath("//li[.='"+NameParameter+"']")
If I'm understanding this correctly, you could use:
Driver.Instance.findElements(...
This would return an array in which you could just iterate and perform actions on based on the .text of the element.

Microdata markup with properties on multiple pages

I'm creating a web page and currently I'm adding Microdata markup to the code. I’m using schema.org’s MusicGroup.
I have an index.html page from where I'd like to take the name and the image properties for this band:
<div class="container" itemscope itemtype="http://schema.org/MusicGroup">
...
<img itemprop="image" src="img/logo.png" alt="logo" />
<p>We are <span itemprop="name">NAME OF THE BAND</span>.</p>
...
</div>
However on the about_us.html page there is a short description which I'd also like to use:
<div class="container" itemscope itemtype="http://schema.org/MusicGroup">
...
<p itemprop="description">A description of the band.</p>
...
</div>
When I use the code like this, search enginges (understandably) treat them as two different MusicGroups:
MusicGroup 1:
Image: .../img/logo.png
Name: NAME OF THE BAND
MusicGroup 2:
Description: A description of the band.
How can I link these properties into one item?
Microdata’s name-value pairs are per webpage, not per website.
So on a website about a music group, it can be expected that each page contains an "own" MusicGroup item, which is, however, actually always about the same music group. But from the Microdata or schema.org perspective, these different items would not be semantically connected that way (consumers might guess this however, e.g. by comparing property values).
Microdata’s itemid attribute could be used to uniquely identify each item. But it is required that the used vocabulary supports "global identifiers for items" (itemid is used for some types on schema.org (e.g., in the example for MedicalScholarlyArticle), but it’s not clear to me if it’s really supported as required by Microdata for other types, like MusicGroup).
So in your case, you could:
leave it as it is
duplicate the information, so that each item has all relevant content (possibly using meta/link elements)
move all information on one page (possibly using itemref)
(if it should be allowed for general use with schema.org) use itemid to state that several items are actually about the same thing

Yahoo Pipe: How to parse sub DIVs

For a page which has multiple DIVs, how to just fetch content from DIVs that contain useful text and avoid other DIVs that are for ads, etc.
For example, a page structure like this:
...
<div id="articlecopy">
<div class="advertising 1">Ads I do not want to fetch.</div>
<p>Useful texts go here</p>
<div class="advertising 2">Ads I do not want to fetch.</div>
<div class="related_articles_list">I do not want to read related articles so parse this part too</div>
</div>
...
In this fictional example, I want get rid of the two DIVs for advertising and the DIV for related articles. All I want is to fetch the useful content in inside the parent DIV.
Can Pipe do this?
Thank you.
Try the YQL module with xpath. Something along these lines:
SELECT * from html where url="http://MyWebPageWithAds.com" and xpath='//div/p'
The above query will retrieve the part of the html inside the <p> tag under the parent <div> tag. You can get fancy with xpath if your DIVs have attributes.
Say for example you had a page with several DIVs, but the one you wanted looked like this:
<div>
<div>Stuff I don't want</div>
<div class="main_content">Stuff I want to add to my feed</div>
<div>Other stuff I don't want</div>
</div>
You would change the YQL string above to this:
SELECT * from html where url="http://MyWebPageWithAds.com"
and xpath='//div/div[contains(#class,"main_content")]'
I've only recently discovered YQL myself, and am fairly new to using xpaths, but it has worked for me so far.

jqgrid 2 span elements within one custom cell?

Within my custom cell there are 2 span-elements.
<span class="FormElement">
<span class="customelement" id="code" name="code">BER01_CN_045_002</span>
</span>
Is there a way to avoid this?
See the demo, I am talking about cell "code".
I think, that you should don't spend your time in such kind of code optimization. Like I tried to explain in my previous answer the first <span> will be inserted by jqGrid for all form elements having the option edittype:'custom'. The second <span> you inserted yourself in the code of your custom formatter. It is permitted to have nested <span> elements like to have nested <div> elements. I recommend you better to follows the jqGrid standard code as trying to make any kind of optimization which nobody will see at the end except you.
Moreover if you look more in the HTML code of your page generated by jqGrid you will see that the form itself (the form with id="FrmGrid_grid" in your example) are placed inside of <span>. In the same way in the code of the column headers you will also find <span class="s-ico"> which has another two <span> elements as the children. Would you like to try to "optimize" also the code? So I repeat my advice just to hold jqGrid standards and not trying to optimize such small pieces of code like nested <span> elements.

Resources