[CS4][JS] Accessing skewed text items
The following code snippet successfully finds all the skewed text in a
document and then removes the skew:
//Clear the find/change preferences.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeTextOptions.caseSensitive = false;
app.findChangeTextOptions.includeFootnotes = false;
app.findChangeTextOptions.includeHiddenLayers = false;
app.findChangeTextOptions.includeLockedLayersForFind = false;
app.findChangeTextOptions.includeLockedStoriesForFind = false;
app.findChangeTextOptions.includeMasterPages = false;
app.findChangeTextOptions.wholeWord = false;
//Search the document for all the skewed text
app.findTextPreferences.skew = 1;
// now remove all skews
app.changeTextPreferences.skew = 0;
However, I want to access each fragment of skewed text rather than
globally change them.
How do I access the collection of skewed text items as the
findTextPreferences does not seem to possess the required properties.
TIA
Doug Neale
Hi Peter,
I tried this on a single page document with some text set in italics:
//Clear the find/change preferences.
app.findTextPreferences = NothingEnum.nothing;
app.changeTextPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeTextOptions.caseSensitive = false;
app.findChangeTextOptions.includeFootnotes = false;
app.findChangeTextOptions.includeHiddenLayers = false;
app.findChangeTextOptions.includeLockedLayersForFind = false;
app.findChangeTextOptions.includeLockedStoriesForFind = false;
app.findChangeTextOptions.includeMasterPages = false;
app.findChangeTextOptions.wholeWord = false;
//Search the document for all the skewed text
app.findTextPreferences.skew = 1;
var myFound = app.activeDocument.findText();
if (myFound.length==0) {
alert("No skewed text was found");
else {
// ok we have some skewed text, now loop through each one
for (i =0; i < myFound.length; i++) {
var myTextObject = myFound[i];
var myText = myTextObject.Content;
and it always finishes up with the alert :-(
and debug confirmed that myFound.length was zero.
Should I be doing something else to find italic text?
Regards,
Doug Neale
Similar Messages
-
Using Page Text Item in an Authorization Scheme
Hello,
I will be having a text item is every page say, Px_RESP_ID (hidden and its value set in an earlier page), and want to use its value in an authorization scheme to verify if the user has an access to the page.
I'm using the following SQL in the authorization scheme -
Apex Version: Apex 3.2
Scheme Type: Exists SQL Query
SQL:
SELECT 1
FROM zs_users zu
, zs_responsibilities zr
, zs_user_resp_groups zur
WHERE
zu.user_name = :APP_USER
AND zr.resp_id = '&P'||:APP_PAGE_ID||'_RESP_ID.'
AND zu.user_id = zur.user_id
AND zr.resp_id = zur.resp_id
For some reason this approach is not working. Any ideas to help me move forward will be greatly appreciated.
Regards,
SeshuAFAIK an application item, or maybe a page 0 item, is the only way to do this (as those items effectively exist across all pages of an application). Unfortunately since authorization schemes are application-level, you can't really effectively reference page items at runtime since you aren't necessarily on that page.
The other option is an ugly one. Instead of creating one auth scheme (e.g.: "user_has_whatever_authority"), create one for every page (e.g.: "user_has_whatever_authority_1", "user_has_whatever_authority_2", etc.) and attach each auth scheme to each page by matching up the number in the name with the page. But this is a maintenance nightmare and terrible style IMHO, but it'll work. Your colleagues will hate you for it when you're gone though. -
How to control the cursor position on a text item..
Hello,
How can we control the cursor position programmatically on a text item.
i.e. how do we move the cursor to home or end of the text item.
TIA,
HitenIf you have an access to metalink.oracle.com, take a look at notes:
Note 61656.1 (V45) HIGHLIGHTING A REGION OF TEXT
Note 131028.1 Default Highlighting in Forms (Client Server)
and threads from metalink forum:
531481.996 "Select_All not working in 6.0.8.25.2", 153092.995 "Text item cursor position" -
Non public text items into a Public page
Hello,
I have a Page with Public Access, but inside it an item text which I would like to set as non public access item. In fact I do that, but when I display the page in view mode I can see that non public item although I had set the access th it as non public.
Is there any way of achieve that feature ?
Thanks in advance,
Izzat Sabbagh
ITCHi Izzat,
What version of Portal are you running? I am unaware of any issues related to what you are trying. Ensure that you are not trying to view the secure content as the owner/creator of the page group or page even though you have not given this user access to the item. The owner/creator of the page will always see everything.
I hope this helps,
Candace -
How do you write UNDO for a text item?? examples? or a REDO??
How do you write UNDO for a text item?? examples? or a REDO??
I created a pop-up menu with CUT, COPY, PASTE, UNDO, CLEAR for my text items.
Using MAGIC menu type works great but there is no MAGIC for UNDO or REDO.....
How do you write UNDO for a text item?? examples? or a REDO??
I have Oracle Forms 6i...
Lets say I highlight all the text in the text item, and start typing over it... then I realize OH NO it is the wrong text field...
Now I want to UNDO the typing and get back to the previous text.
I'd use the initial value that was populate right? How do I access that if that is correct?
Thanks, BillYou can use;
<ITEM> := Get_Item_Property(<ITEM>,DATABASE_VALUE);
Or you will have to write a pre-text-item trigger;
PRE-TEXT-ITEM:
:CTRL.CURRENT_VAL := :<BLOCK>.<ITEM>
MENU (PL/SQL):
:<BLOCK>.<ITEM> := :CTRL.CURRENT_VAL;
You may also want to set the item property back to ITEM_IS_VALID so that item validation does not fire again. -
hi
for me it is bug - but maybe there is logical explanation ...
it occurs in ID CS2 and CS4 - so probably in CS3, too
let's say we have only one TextFrame in document with contents:
Line1<enter>
Line2<#>
and run something like this (VBScript/VB6 example):
set myindi = createobject("indesign.application.cs2")
set mydoc = myindi.activedocument
set mystory = mydoc.stories.item(1)
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mystory.insertionpoints.item(1).contents = "QQQ" & vbcr
mystory.insertionpoints.item(-1).contents = vbcr & "QQQ"
msgbox(mystory.contents)
message will be:
QQQ
Line1
Line2
QQQ
but this code:
set myindi = createobject("indesign.application.cs2")
set mydoc = myindi.activedocument
set mystory = mydoc.stories.item(1).texts.item(1)
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mystory.insertionpoints.item(1).contents = "QQQ" & vbcr
mystory.insertionpoints.item(-1).contents = vbcr & "QQQ"
msgbox(mystory.contents)
return message with this:
Line1
Line2
QQQ
so ... why adding at end works but adding at beginning not ?
and the same behavior is for Word object - and probably for all other objects with .Texts
robin
www.adobescripts.co.ukHello Robin,
Looks like a VB thing: JS doesn't show that behaviour (in CS4).
Peter -
Text item of varchar2(2000) with vertical scrollbar not displaying properly
Hi,
I have a text item of varchar2(2000) with a vertical scroll bar.
I am populating data into the text item using a forms procedure.
(Look at the sample code below)
The problem is the rpadding is NOT displayed properly. I mean
the detail records are NOT shown straight below their respective column heading
in the text item. (BUT if I cut this stuff from the text item and paste it in a
notepad, then the alignment is correct and the data is shown below their
respective column headings)
My code is something like below ...
CURSOR c_get_lab_client_results
IS
SELECT res.lr_id lr_id, org.short_name org_name, TO_CHAR(res.specimen_taken_date,'DD-MON-YYYY') std, substr(res.accession_number,1,20) acc_num, res.lr_type lrtype, res.hdc_id hdcid
FROM bc_organisations org,
cq_laboratory_results res
WHERE cli_id = :clients.cli_id
AND lr_id = :results.lr_id
AND res.org_id = org.org_id
ORDER BY lr_id;
Begin
-- Header
SELECT :TRFRDTLS.TRANSFER_DETAILS||RPAD('ORGANISATION',16,' ')||' '||RPAD('SPECIMEN DATE',15,' ')||' '||RPAD('ACCESSION NUMBER',20)||' '||RPAD('RESULTS',16,' ')||chr(10)||chr(10)
INTO :TRFRDTLS.TRANSFER_DETAILS FROM DUAL;
-- Detail
FOR c1 IN c_get_lab_client_results LOOP
ls_results := RPAD('XXXX',16,' '); -- Just for example
SELECT :TRFRDTLS.TRANSFER_DETAILS||RPAD(TO_CHAR(c1.org_name),16,' ')||' '||RPAD(c1.std,15,' ')||' '||RPAD(c1.acc_num,20)||' '||ls_results||chr(10)
INTO :TRFRDTLS.TRANSFER_DETAILS FROM DUAL;
END LOOP;
End;
Thanks in advance.
CheersTry using a monospace font such as Courier New for the text item.
-
How to access the Text Frame, when we use scrollable frame,
Hi Friends,
How to access the Text Frame, when we use scrollable frame,
Thank you,
[ Nav ]That's the same question:
how can I access something (a page item) on a page…
Answer: you need something unique in that object you can get a handle on.
Or you use the selection a user of your script is doing and work with that selection…
A "scrollable frame" is nothing special. What it makes it a "scrollable frame" is the DPS software.
So you have to look for attached labels on the object, that identify the object for the PDS plug-in "Overlay Creator" as a "scrollable frame". That's possible with the "extractLabel("KeyString")" function. But you need to know the appropriate key-string in advance.
In another of your thread in the DPS forum, I basically answered the question how to obtain those key-strings.
When knowing the key-string you could loop through all your page items (you can skip all text frames) in the allPageItems-collection, to identify the "scrollable frame" by extracting the right label.
If you have more than one "scollable frames" you need a second unique identifier for the particular object.
That could be nearly any property.
Keep in mind, there is no "scrollableFrames" collection in the DOM !
Uwe -
Display Text Items in New Page
I am currently designing a Content Area for our new site and have come across a problem which I really need to find a way round.
I am adding HTML articles as text items into the Content Area. For the interface, I am using a Portal page and publishing the Content Area as a portlet onto this page. I need to do it this way rather than exposing the actual Content Area page as our organisation needs to use an external style sheet on the page for accessibility purposes.
What I need to be able to do is when a user clicks on the link for the item, it will open up inside a blank page inside the same browser window, preferably with a template added to it. I know there is actually an option to set the item to display inside a blank page but this 'blank' page is actually the Content Area page and this uses the internal Portal style.
There doesn't seem to be any way of specifying your own template for a Content Area page which is pretty much what I need to do.
Thanks in advance for any help!
RichardErik:
Very good to know! I ended up logging an SR after all, and included your post to help guide the support rep.
I'm pretty sure it's a server side problem, because the MIME type is served up incorrectly. IE seems to handle text/plain encoded that are actually HTML more gracefully than Firefox.
(As for handling anything else gracefully, well... that's another story :-) )
Thanks!
-John -
Hi All, can anyone tell what controls the width that input text items are rendered in an html region?
I have defined the width as 15 in the elements properties section in the item definition, the item is rendered a different width on different pc's.
I also noticed that the font that is used for input text is bigger on the pc's that render the item bigger. Are these 2 things related?
Can anyone tell me where the font used (and size) is set?
Thanks in advance
FintanFintan Stack wrote:
Hi All, can anyone tell what controls the width that input text items are rendered in an html region?
I have defined the width as 15 in the elements properties section in the item definition, the item is rendered a different width on different pc's.
I also noticed that the font that is used for input text is bigger on the pc's that render the item bigger. Are these 2 things related?Yes. This is caused by different local font settings at browser level. The size of the form control is relative to the element width at the locally-defined browser font size.
Can anyone tell me where the font used (and size) is set?The presentational aspects of APEX applications are controlled using a combination of HTML and CSS via themes and templates. Base font sizes will typically be set in theme CSS by specifying the CSS <tt>font-size</tt> property for the page <tt>body</tt> element (or more problematically using the universal selector).
If you want the form controls rendered at the same size irrespective of local font settings, specify an absolute width using CSS in the HTML Form Element Attributes:
style="width: 200px;"However, for accessibility and usability reasons I wouldn't recommend this: users should have the ability to control the font size locally so they can read it comfortably, and controls should be rendered relative to this. -
How to populate sequence in a text item in a form
I have a text item in a form.I want that the doc_id i.e the text item should be automatically populated with the help of sequence.I have created sequence named seq_doc_id.on which trigger i should write the code so that everytime the doc_id gets incremented by one. What should be the code.Can anyone gv me some hint.Do i have to use the loop for this?Please help
Hi,
I implemented a when-new-block-instance that does just that,
however due to navigation problems the trigger fires when it should not
the result is I got holes in the sequence.
Is there a system variable status to check with an If test
to make sure the sequence is called only at inserting time? -
Updating a value of a text item in a multi record block based on a change
Hi,
I need to change the value of a text item in a multi record block based on a change to another item's value in the same block.
Suppose there's a text item in a multi record block called dt1 which is of type date, which is changed in a particular record. I want to change the values of the another item in the same multi record block, for all other records by running a loop through all the records in multi record block. I dont want to do it on the press of a button, it should do automatically on change. Help me resolve this issue.Hi,
I need to change the value of a text item in a multi record block based on a change to another item's value in the same block.
Suppose there's a text item in a multi record block called dt1 which is of type date, which is changed in a particular record. I want to change the values of the another item in the same multi record block, for all other records by running a loop through all the records in multi record block. I dont want to do it on the press of a button, it should do automatically on change. Help me resolve this issue. -
Multiple values from database on a single text item
i am trying to do the following
on a single text item in a form
(under form property pallete->records->number of items displayed is 5) run a triger "when-new-block-instance" with the following pl/sql statement
declare
menu_item VARCHAR2(35);
begin
select label into menu_item
from menu_options;
end;
however, once i run the form it gives me
WHEN-NEW-BLOCK-INSTANCE trigger raised unhandeled exception ORA-01422
however, if in the pl/sql statement contains only
begin
execute querry;
end;
then it works fine
The problem i beleive is the fact that the first querry retreives multiple values or recordset instead of A record.
How can i go arond this and allow the form to list all the values in this form. Eventually i will need to add conditional SQL statments and that is why just execute querry will not work.
Also, is there a way to dynamically assign a number to "number of records shown" property?
All help is very much appreciated!
nullHi, Marko
I teach Forms, and I usually find a bad idea to use SQL statements directly (in particular when you can "make" Forms to do what you want).
Inside PL/SQL, a SELECT..INTO statement is supposed to select a single row, otherwise an error occurs.
EXECUTE_QUERY works.
If by "conditional SQL statements" you mean restricted (filtered) queries, you don't need to write SQL to do this.
You can set the DEFAULT_WHERE block property to a different value before using EXECUTE_QUERY, like:
SET_BLOCK_PROPERTY('your_block', DEFAULT_WHERE, 'where menu_id > 100');
And the answer to your second question is no, you cannot dynamically change the number of records a block is displaying.
You can limit the number of records your block queries from the database table using Maximum Records Fetched block property (available in Forms 6 and above, not sure about Forms 5). However, this will only work as expected if you set Query All Records to Yes.
Hope this helps,
Pedro -
Text items not being refreshed by LOV items.
Hi all,
I've got a strange LOV behavior problems which I cannot solve and require your valuable time and efforts.
I've created a simple ADF JSF pages with 3 fields and the first field is LOV enabled. For all new row, after clicking the LOV icon, the LOV will show up and after selecting a particular value, it closes the LOV screen and replace it with a new row with the selected LOV data. It is all working well for all new rows just like a normal LOV should perform.
But I had problem with existing data. The row which I selected from the LOV somehow cannot referesh and overwrite any existing row (visually) but after commiting the data, it was actually written and refreshed with the correct data. Is there a property in the JHeadstart Application Definition Editor where I enforce the text items to be refreshed by the LOV items?
Thank you for your time and efforts.
Kind Regards,
JohnHi Guys,
I've performed the following scenarios attempting to refreshed Text items by the LOV Items.
Scenario 1: Create a new column called some_key load unique number into it. Set this column as the primay key and deselect existing primary keys as key attributes. Also, I've created a sequence and some_key is of type of DBSequence getting value from the new sequence starting from 1.
After generation when run and the result is:
JBO-27022: Failed to load value at index 11 with java object of type oracle.jbo.domain.DBSequence due to java.sql.SQLException.
## Detail 0 ##java.sql.SQLException: Invalid column index
Scenario 2: Create a unique index for the some_key column, rerun and the result is:
JBO-27022: Failed to load value at index 11 with java object of type oracle.jbo.domain.DBSequence due to java.sql.SQLException.
## Detail 0 ##java.sql.SQLException: Invalid column index
Scenario 3: Set some_key as number instead of DBSequence (from Entity Object Editor), rerun and the result is:
JBO-27021: Failed to load CustomDatum value at index 11 with java object of type oracle.jbo.domain.Number due to java.sql.SQLException.
## Detail 0 ##java.sql.SQLException: Invalid column index
Scenario 4: Deattach the offending View Object from the Application Module. Remove the offending view link and view object. Recreate view object and view link. Reset some_key is of type of DBSequence getting value from the new sequence starting from 1 (From the Entity Object Editor). After generation when run and result is:
SUCCESSFULLY!!
So, I guess the bottom line is here are the following things which you need to perform in order to enable text item to be refreshed by LOV item (if the detail table has composite primary keys)
1.) Create a new column
2.) Load unique value to it
3.) Create unique index for it
4.) Create entity object, view object and view link object.
5.) Set the new column as primary key.
6.) Deselect the key attributes for all composite primary key columns.
Regards,
John -
Forms (V10G) - RunTime Text Item -- Editor
Hello:
What are the available options to enhance forms runtime SYSTEM/DEFAULT editor for Text Items? We like to add spell checker, text format features in to field editor.
I am sure there are Java based editors out there that Forms could invoke. I am hoping I am not the fist one with this requirement and someone may have done this. Perhaps could provide some input.
Forms V 10G. (This posting is NOT about PL/SQL editor in Developer)
ThanksHello,
You can use Webutil.You can call MS Word checkspell function.
Check this:
http://sheikyerbouti.developpez.com/webutil-docs/fichiers/Webutil_store_edit_docs.pdf
Cheers,
Suresh
Maybe you are looking for
-
Using tab groups but Firefox 28.0 crashes and even can not save all tabs in archive recently
Hi. I installed tab groups addon on my firefox 28.0 (firefox portable version) and each group has its tabs. of course. Problem is that Firefox crashes when i work on a group with the tabs and even can not save all tabs in archive as MAFF recently too
-
The battery compartment door on my Magic Mouse appears to be jammed shut and will not open, the device is only 5 months old and this is the first time I have needed to open it to change the batteries. Are there any suggestions?
-
Can't open itunes or install or uninstall any apple programs, says error 2203
Hi itunes will not open on my PC, i have tried many oprtion that others have suggested but none work. I cannot install or reinstall as it keeps coming up with the error message 2203
-
Issue with Column Alias Name in a SELECT statement
I am trying to run sql query(IN ORACLE) to get the data from a remote database(TERADATA). The query is select (table1.exp_date - table1.setup_date) AS day_diff, CASE WHEN day_diff = '0' THEN 'YES' WHEN day_diff > '0' THEN 'NO' ELSE 'Unknown' END AS a
-
Hi- Does anyone know if there are problems with integrating a single XI instance with multiple backend databases..or is it more advisable to match-up one XI instance with one backend database? Thanks,