Displaying Text in List Component
I am using AS3 to load data from an XML document into an Array and use the Array as a dataProvider for a List Component. If I addChild the list to the main timeline, everything works fine. All 38 elements show up in the list with readable text. When I addChild the list into a MovieClip, all 38 rows of the list get created, but no text shows up. What the hell is going on? Does anyone know what the fix for this is and why in the world this is happening?
Here's my code:
TOCList = new List();
TOCList.dataProvider= new DataProvider(TOCArray);
TOCList.labelField="theLabel";
TOCList.y=75;
TOCList.width=250;
TOCList.height=350;
addChild(TOCList);
When I change the addChild(TOCList) to navBar.sceneMenu.addChild(TOCList) the list shows up formatted correctly, just no text.
I figured it out with help from another web site's forum and the problem was that the MovieClip that I was loading into was masked, so the font needed to be embedded and my code...
var myFormat:TextFormat = new TextFormat();
myFormat.font="Tahoma";
TOCList.setStyle("embedFonts", true);
TOCList.setStyle("textFormat", myFormat);
...wasn't working, but I didn't know, because the text wasn't showing.
The fix was actually to use the StyleManager...
StyleManager.setStyle( "textFormat", new TextFormat("Arial") );
StyleManager.setStyle( "embedFonts", true );
...to force all components to this style.
I have no idea why the above code doesn't work. If anybody knows, please tell me!!!
Similar Messages
-
Need help displaying images with List component for Flash CS4 (ActionScript 3.0)
Hi folks:
I am an inexperienced user of Flash CS4 Pro (v10.0.2). I am attempting to use the List component with ActionScript 3.0 to make a different image display when a user clicks each item in a list.
I did find a tutorial that showed me how to make different text display using a dynamic text box and the following ActionScript:
MyList.addEventListener(Event.CHANGE, ShowSelectedItem);
function ShowSelectedItem(event:Event):void {
ListText.text=MyList.selectedItem.data;
...where My List is the instance of the List component and ListText is the dynamix text box. In this case, the user clicks an item in the list, defined by the label value in the dataProvider parameter of the List component, and text displays as defined in the data value in the dataProvider parameter.
However, as I mentioned to start, what I really want to do is make images display instead of text. Can anyone provide me the steps to do this?
I appreciate your help (in advance)!!
CindyHi...thanks for responding! I was planning on using images from the Library, but if there is a better way to do it, I'm open. So far, I just have text in the data property. This is part of my problem. I don't know what I need to put in the data value for an image to display. Do I just put the image file name and Flash will know to pull it from the Library? Do I need to place the images on the stage on different frames? I apologize for the "stupid user" questions, but as you can tell, I'm a newbie.
Appreciate your patience and any help you can offer!
Cindy -
Displaying Text as HTML in the UIscrollbar component
Greetings.
I have a window on my Flash stage that has some scrollable copy in it. The problem is, I can't seem to have any formatting for the text ... if I select a word or two to make bold, it all turns bold. I gather I need to use the "Display Text as HTML" checkbox and then paste in some HTML formatted text but this doesn't seem to work. I searched this forum and found that others were designating "htmlText" in Actionscript instead of just "text" ... that didn't work either. I probably just did it wrong, or maybe it's becuase I'm using the UI component "UIscrollBar" for it's scrolling of the text.
Is there anything else I need to do to be able to format some text with strong tags and maybe some href links?
I have my properties inspector with the following check marks:
Display as HTML
Multiline
Dynamic Text
selectable
Thanks everyone.Shamelss bump
-
Display Arabic text in ScrollPane Component ?
hello,
i have RSS reader it's work fine with english but the problem
is arabic text don't display in RSS reader just english and help
about to display arabic text in ScrollPane component that component
reader info from xml file and display it ?
Regard,
Crimsonany idea ?
-
Displaying items in different colors in a List component
Hi.
How can I make each label of an item in a List component
appear in a different color? I can change the color of the items in
the list, but I want the items to appear in different colors...
Thanks,
- YuvalHi.
How can I make each label of an item in a List component
appear in a different color? I can change the color of the items in
the list, but I want the items to appear in different colors...
Thanks,
- Yuval -
Using a List Component to create a photo gallery.
This feels like a lot to be asking but i'm gonna go ahead and
ask to see what happens.
I'm trying to figure out how to use a list component to
select 6 items from a large list, display the words to the 6
selected items (in a text field), then finally (by pressing a
button) I would like to load the 6 corresponding pictures for the
selected items into a seperate frame. If there is anyone that could
point me in the right direction it would be greatly appreciated. I
have been trying to find information online about programming the
List Component but haven't had any luck. Is there a book that
anyone recommends that could help me? I've been doing simple
animations and websites in flash but i'm now looking to learn some
actionscripting as well. Thanks.Hi PinkPowerRanger,
Per my understanding that you have two fields in the table "Date and Time picker" which is Date/time type and another is "Item ID", you need to get the Month from the Date field to display in the X-axis and count(Item ID) related to each
month to display in the Y-Axis, right?
I have tested on my local environment and can do this by create two calculated fields to get the month and year values from the Date/Time field.
Details information below for your reference:
Right click the main dataset to select the "Add Calculated field", specify an name of the new calculated field and add the expression in the field source as below:
Year: =Year(Fields!Date.Value)
Month: =MonthName(Month(Fields!Date.Value))
Add the three field in the Chart as below and remember in the Value area you have got the Count(ItemID) but not SUM(ItemID):
Preview you will got the chart like below:
If you still have any problem, please feel free to ask.
Regards
Vicky Liu
Vicky Liu
TechNet Community Support -
How to get selected item value and display text in selectOneChoice ?
Hi
Thank you for reading my post
I bind the a selectOneChoice component to my backing bean so i have an object which represent this component in the backing bean.
now i need to find which item is selected by use , i know that i can use
getSelect_service().getValue.toString() , but it will return the value of the selected item, how about its display text ?
I should say that i create an static list for selectOneChoice items.
thanksUsing JDeveloper 10.1.3.1, freshly downloaded off OTN. I used the following code to try and identify the problem you are encountering. I attempted to use a valueChangeListener in combination with af:selectOneChoice components that use SelectItems and the singular SelectItem. I could not reproduce the error in either case. Please post more information about your development environment.
<af:selectOneChoice label="Label 1"
binding="#{backing_test.selectOneChoice1}"
id="selectOneChoice1"
valueChangeListener="#{backing_test.valueChangeListener}"
autoSubmit="true" immediate="true">
<af:selectItem label="1" value="1"
binding="#{backing_test.selectItem1}"
id="selectItem1"/>
<af:selectItem label="2" value="2"
binding="#{backing_test.selectItem2}"
id="selectItem2"/>
<af:selectItem label="3" value="3"
binding="#{backing_test.selectItem3}"
id="selectItem3"/>
</af:selectOneChoice>
<af:selectOneChoice label="Label 2"
binding="#{backing_test.selectOneChoice2}"
id="selectOneChoice2" valueChangeListener="#{backing_test.valueChangeListener}"
autoSubmit="true" immediate="true">
<f:selectItems value="#{backing_test.items}"
binding="#{backing_test.selectItems1}"
id="selectItems1"/>
</af:selectOneChoice>
public void valueChangeListener(ValueChangeEvent evt){
// returns a UISelectOneChoice object
System.out.println(evt.getSource().getClass().getName());
// returns a string
System.out.println(evt.getNewValue().getClass().getName());
public Map getItems(){
items = new HashMap();
items.put("11","11");
items.put("12","12");
items.put("13","13");
return items;
} -
Hi all,
I have a list component and I have set up initial query in advance search, which generates the listing of the articles.
Now I am planning to add a search box and upon providing the new search text I would like to search again and utilizing same list component I would like to display new result list.
I looked a the init.jsp and found the place where I think it executes the initial query?
I tried to override source and query string but it is not taking an effect. Also I am not able to find the jar for "com.day.cq.wcm.foundation.List", I wanted to decompile and wanted to see how querys are executed.
List list = new List(slingRequest, new PageFilter());
list.setQuery("Test");
list.setSource("search");
Any pointers would be helpful!
Thanks in advance.I am workiing on a similiar workflow for an upcoming artilce that dicusses how to query the AEM CQ JCR: http://scottsdigitalcommunity.blogspot.ca/2013/02/querying-adobe-experience-manager-data.h tml .
This sample app queries the JCR for customer data, supports filtering, and displays the result set in a grid contol located in the client:
Although this article will not be posted until Feb 23 --I can provide a few pointers. Like most workflows in computer science -- you can perform a task in more than 1 way. I find that you get more power when you wrap the JCR Query Manager API within an OSGi component and develop the service to expose an operation that queries the JCR and returns the result set.
You can return the result set to the client and display the data in a web page - similiar to the pic above. Of course -- you can do the same workflow using sling -- its a matter of preferece IMHO. I prefer to develop OSGi services to do the heavy lifting and let the client call the service and display the data.
For example - to call the OSGI service from a client:
com.adobe.aem.CustomerService cs = sling.getService(com.adobe.aem.CustomerService .class);
String XML = cs.getCustomerData(filter) ;
In this workflow -- the query results are stored in an XML DOM and returned to the client -- where the data is parsed and displayed. The complete artilce will be posted next Fri.
Here is a snippet of the backend Java logic that is wrapped in the OSGi and queries the JCR that is called from the client:
public Document getCustomerData(String filter) {
Customer cust = null;
List<Customer> custList = new ArrayList<Customer>();
try {
Session session = this.repository.loginAdministrative(null);
// Obtain the query manager for the session ...
javax.jcr.query.QueryManager queryManager = session.getWorkspace().getQueryManager();
//Setup the query based on user input -- 3 options are All Customers,
//Active Customer or Past Customer
String sqlStatement="";
//Setup the query to get all corresponding customer nodes -- which are of node type nt:unstructured
if (filter.equals("All Customers"))
sqlStatement = "SELECT * FROM [nt:unstructured] WHERE CONTAINS(desc, 'Customer')";
else if(filter.equals("Active Customer"))
sqlStatement = "SELECT * FROM [nt:unstructured] WHERE CONTAINS(desc, 'Active')";
else if(filter.equals("Past Customer"))
sqlStatement = "SELECT * FROM [nt:unstructured] WHERE CONTAINS(desc, 'Past')";
//Execute the query and get the results ...
javax.jcr.query.Query query = queryManager.createQuery(sqlStatement,"JCR-SQL2");
javax.jcr.query.QueryResult result = query.execute();
//Iterate over the nodes in the results ...
javax.jcr.NodeIterator nodeIter = result.getNodes();
while ( nodeIter.hasNext() ) {
//For each node-- create a customer instance
cust = new Customer();
javax.jcr.Node node = nodeIter.nextNode();
//Set all Customer object fields
cust.setCustFirst(node.getProperty("firstName").getString());
cust.setCustLast(node.getProperty("lastName").getString());
cust.setCustAddress(node.getProperty("address").getString());
cust.setCustDescription(node.getProperty("desc").getString());
//Push Customer to the list
custList.add(cust);
// Save the session changes and log out
session.save();
session.logout();
//Return the customer data within an XML DOM
return toXml(custList);
catch(Exception e)
e.printStackTrace();
return null;
Hope this helps.. -
Problems With List Component Flash Cs3
Hello Friends,
I am working in Flash Cs3.
I am having a List component in my application.
I added 10 items into my list component. Now out of those 10 items, i want to disable particular list items like Item 4, Item 8, Item 9. How to do this using flash cs3 or flash 8.0.
Item1 -- Enabled state
Item2 -- Enabled state
Item3 -- Enabled state
Item4 -- Disabled state
Item5 -- Enabled state
Item6 -- Enabled state
Item7 -- Enabled state
Item8 -- Disabled state
Item9 -- Disabled state
Item10 -- Enabled state
Any suggestions/ideas would be really appreciated.
Regards,
RajeshHello Friends,
I got a partial solution for this. Now i can able to disable a particular list item using flash cs3. I achived this. But it was happening only after clicking the item values....
But i need in a diff way like, as soon as you run the flash file it has to disable. how is this possible in flash cs3.
this is the code :
import fl.controls.List;
import fl.controls.listClasses.CellRenderer;
import fl.controls.listClasses.ListData;
import fl.events.ListEvent;
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
var sampleItem1:Object = { label:"John Alpha" };
var sampleItem2:Object = { label:"Mary Bravo" };
var sampleItem3:Object = { label:"Trevor Gamma" };
var sampleItem4:Object = { label:"Susan Delta" };
var myList:List;
var tf:TextField;
ListDataExample()
function ListDataExample() {
createList();
tf = new TextField();
tf.x = 10;
tf.y = 125;
addChild(tf);
function createList():void {
myList = new List();
myList.move(10,10);
myList.addItem(sampleItem1);
myList.addItem(sampleItem2);
myList.addItem(sampleItem3);
myList.addItem(sampleItem4);
myList.rowCount = 4;
myList.addEventListener(ListEvent.ITEM_CLICK,listItemSelected);
addChild(myList);
function listItemSelected(e:ListEvent):void {
var cr:CellRenderer = myList.itemToCellRenderer(e.item) as CellRenderer;
var listData:ListData = cr.listData;
if(cr.listData.row == 2) {
cr.enabled = false
tf.text = "Row selected: " + listData.row;
waiting for your replies.
Regards,
Rajesh -
HELP for writing a Programme that displays text.
Check the API for methods in JEditorPane. Then write and run a program that uses a JEditorPane to just display text, just text.
What should I add or delete in the following code so that it just displays TEXT.
My code is ----->
WEBBROWSER------------------>
import java.awt.*;
import java.awt.event.*;
import java.net.*;
// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
public class WebBrowser extends JFrame {
private WebToolBar toolBar;
private WebBrowserPane browserPane;
// WebBrowser constructor
public WebBrowser()
super( "Deitel Web Browser" );
// create WebBrowserPane and WebToolBar for navigation
browserPane = new WebBrowserPane();
toolBar = new WebToolBar( browserPane );
// lay out WebBrowser components
Container contentPane = getContentPane();
contentPane.add( toolBar, BorderLayout.NORTH );
contentPane.add( new JScrollPane( browserPane ),
BorderLayout.CENTER );
// execute application
public static void main( String args[] )
WebBrowser browser = new WebBrowser();
browser.setDefaultCloseOperation( EXIT_ON_CLOSE );
browser.setSize( 640, 480 );
browser.setVisible( true );
} // end main
} // end class WebBrowser
WebPane.java
// WebBrowserPane.java
// WebBrowserPane is a simple Web-browsing component that
// extends JEditorPane and maintains a history of visited URLs.
package browser;
// Java core packages
import java.util.*;
import java.net.*;
import java.io.*;
// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
public class WebBrowserPane extends JEditorPane {
private List history = new ArrayList();
private int historyIndex;
// WebBrowserPane constructor
public WebBrowserPane()
// disable editing to enable hyperlinks
setEditable( false );
// display given URL and add it to history
public void goToURL( URL url )
displayPage( url );
history.add( url );
historyIndex = history.size() - 1;
// display next history URL in editorPane
public URL forward()
historyIndex++;
// do not go past end of history
if ( historyIndex >= history.size() )
historyIndex = history.size() - 1;
URL url = ( URL ) history.get( historyIndex );
displayPage( url );
return url;
// display previous history URL in editorPane
public URL back()
historyIndex--;
// do not go past beginning of history
if ( historyIndex < 0 )
historyIndex = 0;
// display previous URL
URL url = ( URL ) history.get( historyIndex );
displayPage( url );
return url;
// display given URL in JEditorPane
private void displayPage( URL pageURL )
// display URL
try {
setPage( pageURL );
// handle exception reading from URL
catch ( IOException ioException ) {
ioException.printStackTrace();
WebPAne.java---------------
// WebToolBar.java
// WebToolBar is a JToolBar subclass that contains components
// for navigating a WebBrowserPane. WebToolBar includes back
// and forward buttons and a text field for entering URLs.
package browser;
// Java core packages
import java.awt.*;
import java.awt.event.*;
import java.net.*;
// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
public class WebToolBar extends JToolBar
implements HyperlinkListener {
private WebBrowserPane webBrowserPane;
private JButton backButton;
private JButton forwardButton;
private JTextField urlTextField;
// WebToolBar constructor
public WebToolBar( WebBrowserPane browser )
super( "Web Navigation" );
// register for HyperlinkEvents
webBrowserPane = browser;
webBrowserPane.addHyperlinkListener( this );
// create JTextField for entering URLs
urlTextField = new JTextField( 25 );
urlTextField.addActionListener(
new ActionListener() {
// navigate webBrowser to user-entered URL
public void actionPerformed( ActionEvent event )
// attempt to load URL in webBrowserPane
try {
URL url = new URL( urlTextField.getText() );
webBrowserPane.goToURL( url );
// handle invalid URL
catch ( MalformedURLException urlException ) {
urlException.printStackTrace();
// create JButton for navigating to previous history URL
backButton = new JButton( new ImageIcon(
getClass().getResource( "images/back.gif" ) ) );
//backButton = new JButton( "Back");
backButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event )
// navigate to previous URL
URL url = webBrowserPane.back();
// display URL in urlTextField
urlTextField.setText( url.toString() );
// create JButton for navigating to next history URL
forwardButton = new JButton( new ImageIcon(
getClass().getResource( "images/forward.gif" ) ) );
//forwardButton = new JButton("Fwd");
forwardButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event )
// navigate to next URL
URL url = webBrowserPane.forward();
// display new URL in urlTextField
urlTextField.setText( url.toString() );
// add JButtons and JTextField to WebToolBar
add( backButton );
add( forwardButton );
add( urlTextField );
} // end WebToolBar constructor
// listen for HyperlinkEvents in WebBrowserPane
public void hyperlinkUpdate( HyperlinkEvent event )
// if hyperlink was activated, go to hyperlink's URL
if ( event.getEventType() ==
HyperlinkEvent.EventType.ACTIVATED ) {
// get URL from HyperlinkEvent
URL url = event.getURL();
// navigate to URL and display URL in urlTextField
webBrowserPane.goToURL( url );
urlTextField.setText( url.toString() );
Please REPLY.WEBBROWSER------------------>
import java.awt.*;
import java.awt.event.*;
import java.net.*;
// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
public class WebBrowser extends JFrame {
private WebToolBar toolBar;
private WebBrowserPane browserPane;
// WebBrowser constructor
public WebBrowser()
super( "Deitel Web Browser" );
// create WebBrowserPane and WebToolBar for navigation
browserPane = new WebBrowserPane();
toolBar = new WebToolBar( browserPane );
// lay out WebBrowser components
Container contentPane = getContentPane();
contentPane.add( toolBar, BorderLayout.NORTH );
contentPane.add( new JScrollPane( browserPane ),
BorderLayout.CENTER );
// execute application
public static void main( String args[] )
WebBrowser browser = new WebBrowser();
browser.setDefaultCloseOperation( EXIT_ON_CLOSE );
browser.setSize( 640, 480 );
browser.setVisible( true );
} // end main
} // end class WebBrowser
WebPane.java
// WebBrowserPane.java
// WebBrowserPane is a simple Web-browsing component that
// extends JEditorPane and maintains a history of visited URLs.
package browser;
// Java core packages
import java.util.*;
import java.net.*;
import java.io.*;
// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
public class WebBrowserPane extends JEditorPane {
private List history = new ArrayList();
private int historyIndex;
// WebBrowserPane constructor
public WebBrowserPane()
// disable editing to enable hyperlinks
setEditable( false );
// display given URL and add it to history
public void goToURL( URL url )
displayPage( url );
history.add( url );
historyIndex = history.size() - 1;
// display next history URL in editorPane
public URL forward()
historyIndex++;
// do not go past end of history
if ( historyIndex >= history.size() )
historyIndex = history.size() - 1;
URL url = ( URL ) history.get( historyIndex );
displayPage( url );
return url;
// display previous history URL in editorPane
public URL back()
historyIndex--;
// do not go past beginning of history
if ( historyIndex < 0 )
historyIndex = 0;
// display previous URL
URL url = ( URL ) history.get( historyIndex );
displayPage( url );
return url;
// display given URL in JEditorPane
private void displayPage( URL pageURL )
// display URL
try {
setPage( pageURL );
// handle exception reading from URL
catch ( IOException ioException ) {
ioException.printStackTrace();
WebPAne.java---------------
// WebToolBar.java
// WebToolBar is a JToolBar subclass that contains components
// for navigating a WebBrowserPane. WebToolBar includes back
// and forward buttons and a text field for entering URLs.
package browser;
// Java core packages
import java.awt.*;
import java.awt.event.*;
import java.net.*;
// Java extension packages
import javax.swing.*;
import javax.swing.event.*;
public class WebToolBar extends JToolBar
implements HyperlinkListener {
private WebBrowserPane webBrowserPane;
private JButton backButton;
private JButton forwardButton;
private JTextField urlTextField;
// WebToolBar constructor
public WebToolBar( WebBrowserPane browser )
super( "Web Navigation" );
// register for HyperlinkEvents
webBrowserPane = browser;
webBrowserPane.addHyperlinkListener( this );
// create JTextField for entering URLs
urlTextField = new JTextField( 25 );
urlTextField.addActionListener(
new ActionListener() {
// navigate webBrowser to user-entered URL
public void actionPerformed( ActionEvent event )
// attempt to load URL in webBrowserPane
try {
URL url = new URL( urlTextField.getText() );
webBrowserPane.goToURL( url );
// handle invalid URL
catch ( MalformedURLException urlException ) {
urlException.printStackTrace();
// create JButton for navigating to previous history URL
backButton = new JButton( new ImageIcon(
getClass().getResource( "images/back.gif" ) ) );
//backButton = new JButton( "Back");
backButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event )
// navigate to previous URL
URL url = webBrowserPane.back();
// display URL in urlTextField
urlTextField.setText( url.toString() );
// create JButton for navigating to next history URL
forwardButton = new JButton( new ImageIcon(
getClass().getResource( "images/forward.gif" ) ) );
//forwardButton = new JButton("Fwd");
forwardButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event )
// navigate to next URL
URL url = webBrowserPane.forward();
// display new URL in urlTextField
urlTextField.setText( url.toString() );
// add JButtons and JTextField to WebToolBar
add( backButton );
add( forwardButton );
add( urlTextField );
} // end WebToolBar constructor
// listen for HyperlinkEvents in WebBrowserPane
public void hyperlinkUpdate( HyperlinkEvent event )
// if hyperlink was activated, go to hyperlink's URL
if ( event.getEventType() ==
HyperlinkEvent.EventType.ACTIVATED ) {
// get URL from HyperlinkEvent
URL url = event.getURL();
// navigate to URL and display URL in urlTextField
webBrowserPane.goToURL( url );
urlTextField.setText( url.toString() );
} -
Help needed Displaying ALV Secondary list without using oops concept
Hi Experts
Help needed Displaying ALV Secondary list without using oops concept.
its urgent
regds
rajasekharhi chk this code
******************TABLES DECLARATION*****************
TABLES : VBAP,MARA.
*****************TYPE POOLS**************************
TYPE-POOLS : SLIS.
****************INTERNAL TABLES**********************
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
END OF IT_VBAP.
****************TEMPORARY VARIABLES******************
DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
*****************FIELD CATALOG***********************
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
****************LAYOUT*******************************
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
***************VARIANT*******************************
DATA : G_VARIANT LIKE DISVARIANT.
****************SAVE*********************************
DATA : G_SAVE(1) TYPE C.
*****************EVENTS******************************
DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
G_EVENTS TYPE SLIS_T_EVENT.
******************PF STATUS**************************
DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
******************USER COMMAND************************
DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
R_UCOMM LIKE SY-UCOMM.
****************SELECTION SCREEN************************
SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
***************AT SELECTION SCREEN*********************
AT SELECTION-SCREEN.
PERFORM VALIDATE.
**************START-OF-SELECTION**************************
START-OF-SELECTION.
PERFORM GET_DETAILS.
PERFORM FIELDCAT.
PERFORM LAYOUT.
PERFORM VARIANT.
PERFORM SAVE.
PERFORM EVENTS.
PERFORM ALV_DISPLAY.
*********************FORMS*******************************************
*& Form validate
text
--> p1 text
<-- p2 text
FORM VALIDATE .
SELECT SINGLE VBELN
FROM VBAP
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'enter valid vbeln'.
ENDIF.
ENDFORM. " validate
*& Form get_details
text
--> p1 text
<-- p2 text
FORM GET_DETAILS .
SELECT VBELN
POSNR
MATNR
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'no details found'.
ENDIF.
ENDFORM. " get_details
*& Form fieldcat
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'POSNR'.
WA_FIELDCAT-OUTPUTLEN = 6.
WA_FIELDCAT-SELTEXT_L = 'ITEM'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-OUTPUTLEN = 18.
WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. " fieldcat
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
WA_LAYOUT-ZEBRA = 'X'.
ENDFORM. " LAYOUT
*& Form VARIANT
text
--> p1 text
<-- p2 text
FORM VARIANT .
CLEAR G_VARIANT.
G_VARIANT-REPORT = SY-REPID.
ENDFORM. " VARIANT
*& Form SAVE
text
--> p1 text
<-- p2 text
FORM SAVE .
CLEAR G_SAVE.
G_SAVE = 'A'.
ENDFORM. " SAVE
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
CLEAR XS_EVENTS.
XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND XS_EVENTS TO G_EVENTS.
ENDFORM. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
WRITE :/ ' INTELLI GROUP'.
ENDFORM. "TOP_OF_PAGE
*& Form ALV_DISPLAY
text
--> p1 text
<-- p2 text
FORM ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = PF_STATUS
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = G_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBAP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form SET_PF_STATUS
text
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'Z50651_PFSTATUS' EXCLUDING EXTAB.
ENDFORM. "SET_PF_STATUS
*& Form SET_USER_COMMAND
text
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'DC'.
READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SELECT SINGLE MTART
FROM MARA
INTO V_MTART
WHERE MATNR = IT_VBAP-MATNR.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
ELSE.
WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
WRITE :/ 'MATERIAL TYPE :' , V_MTART.
ENDIF.
ENDIF.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CLOSE'.
CALL TRANSACTION 'SE38'.
ENDCASE.
REPORT Z_ALV_INTERACTIVE MESSAGE-ID ZMSG_50651
LINE-SIZE 100
LINE-COUNT 60
NO STANDARD PAGE HEADING.
******************TABLES DECLARATION*****************
TABLES : VBAP,MARA.
*****************TYPE POOLS**************************
TYPE-POOLS : SLIS.
****************INTERNAL TABLES**********************
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
END OF IT_VBAP.
****************TEMPORARY VARIABLES******************
DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
*****************FIELD CATALOG***********************
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
****************LAYOUT*******************************
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
***************VARIANT*******************************
DATA : G_VARIANT LIKE DISVARIANT.
****************SAVE*********************************
DATA : G_SAVE(1) TYPE C.
*****************EVENTS******************************
DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
G_EVENTS TYPE SLIS_T_EVENT.
******************PF STATUS**************************
DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
******************USER COMMAND************************
DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
R_UCOMM LIKE SY-UCOMM.
****************SELECTION SCREEN************************
SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
***************AT SELECTION SCREEN*********************
AT SELECTION-SCREEN.
PERFORM VALIDATE.
**************START-OF-SELECTION**************************
START-OF-SELECTION.
PERFORM GET_DETAILS.
PERFORM FIELDCAT.
PERFORM LAYOUT.
PERFORM VARIANT.
PERFORM SAVE.
PERFORM EVENTS.
PERFORM ALV_DISPLAY.
*********************FORMS*******************************************
*& Form validate
text
--> p1 text
<-- p2 text
FORM VALIDATE .
SELECT SINGLE VBELN
FROM VBAP
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'enter valid vbeln'.
ENDIF.
ENDFORM. " validate
*& Form get_details
text
--> p1 text
<-- p2 text
FORM GET_DETAILS .
SELECT VBELN
POSNR
MATNR
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'no details found'.
ENDIF.
ENDFORM. " get_details
*& Form fieldcat
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'POSNR'.
WA_FIELDCAT-OUTPUTLEN = 6.
WA_FIELDCAT-SELTEXT_L = 'ITEM'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-OUTPUTLEN = 18.
WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. " fieldcat
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
WA_LAYOUT-ZEBRA = 'X'.
ENDFORM. " LAYOUT
*& Form VARIANT
text
--> p1 text
<-- p2 text
FORM VARIANT .
CLEAR G_VARIANT.
G_VARIANT-REPORT = SY-REPID.
ENDFORM. " VARIANT
*& Form SAVE
text
--> p1 text
<-- p2 text
FORM SAVE .
CLEAR G_SAVE.
G_SAVE = 'A'.
ENDFORM. " SAVE
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
CLEAR XS_EVENTS.
XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND XS_EVENTS TO G_EVENTS.
ENDFORM. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
WRITE :/ ' INTELLI GROUP'.
ENDFORM. "TOP_OF_PAGE
*& Form ALV_DISPLAY
text
--> p1 text
<-- p2 text
FORM ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = PF_STATUS
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = G_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBAP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form SET_PF_STATUS
text
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.
ENDFORM. "SET_PF_STATUS
*& Form SET_USER_COMMAND
text
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'DC'.
READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SELECT SINGLE MTART
FROM MARA
INTO V_MTART
WHERE MATNR = IT_VBAP-MATNR.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
ELSE.
WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
WRITE :/ 'MATERIAL TYPE :' , V_MTART.
SUBMIT SLIS_DUMMY WITH P_MATNR EQ IT_VBAP-MATNR
WITH P_MTART EQ V_MTART.
ENDIF.
ENDIF.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CLOSE'.
CALL TRANSACTION 'SE38'.
ENDCASE.
plz reward if useful -
How to display TEXT more than 500 char in a report as multiple lines.
Hi Friends,
i have a requirement like i should display Texts of length more than 500 Characters in a report( ALV LIST) as multiple lines
I am fetching the data Using FM READ_TEXT
the output im currently geeting with 150 Char in lenth as a single line
How we can split the text into multiple lines in a report
first i would like to know is it possible? if possible please give your valuable suggitions if not is there any alternative way to do this task.
Thanks & regards
kumar.Hi,
This is possible but the Solution might not look Standard/Appropriate to you.
In ALV, you can have Multiple Line Output...There is a Field in the Field Catalogue..called as Row_position...this is by default 0...which means Single row/Line ALV output....You can have this Value in the Range of 0 to 3.......A ALV field with row_position 1, will be displayed in the second line for every record...i.e. you will have multiple line for a single record of ALV.
In your case......you can use this but you need to split your field in two fields.....but you may end up spliting a single word....but for that also you can design the logic of splitting the Fiel value at SPACE only......
This may work.......and Sorry if not work...... -
Scrollbar doesn't show all text in RichEditableText component ...
The program is loading text from an external XML-file into a RichEditableText component.
However, scrolling an scrollbar does not show all the available text.
To me, it looks like the scrollbar is not updated to adopt itself to the new text.
Does someone has any pointers, how to fix this, because I have no clue where to look?
Thanks in advance,
Peter
Code snippets:
The bindable 'data' is filled with an html-formatted text, when the XML-file is loaded.
TextFlow is used to display the html-formatted text.
MyTextScrollPanel component contains VScrollBar and component MyTextScrollPanelScrollingContentSkin:
<s:VScrollBar id="vscrollbar" left="185" right="0" top="0" bottom="0" fixedThumbSize="true"
viewport="{contentGroup}" />
<components:MyTextScrollPanelScrollingContentSkin id="contentGroup" clipAndEnableScrolling="true"
left="0" right="20" top="0" bottom="0"/>
MyTextScrollPanelScrollingContentSkin component:
<fx:Script>
<![CDATA[
[Bindable] public var data:String;
]]>
</fx:Script>
<s:RichEditableText id="textContent" d:userLabel="Text" x="0" y="0" width="185" height="682"
editable="false" selectable="false" color="#ffffff"
fontFamily="Myriad Pro" fontSize="12" tabStops="S0 S50 S100 S150 S200"
textFlow="{TextConverter.importToFlow(data, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
whiteSpaceCollapse="preserve" >
</s:RichEditableText>One (practical) solution I came up myself, is adopting the height of the RichEditableText to the length of the data:
<s:RichEditableText id="textContent ... height="{data.length}" .... />
A practical height value turns out to be {data.length/2}, indicating that 50% of the text is html-tags and whitespaces (??)
Does someone knows or could point to a more elegant solution?
Note: the division "/2" worrows me, since the customer is proving the text.
Thanks,
Peter -
Printing to PDF from MS Office: lost hyperlinks if display text changed
Greetings.
I'm using Acrobat Pro vers. 8.1.7 and MS Office 2007.
I'm not sure if this is an Acrobat or an MS Office issue or somewhere in between.
I need to print an Excel document to a PDF with hyperlinks.
Creating hyperlinks in Excel is no problem.
If I print to a PDF (using Adobe PDF Converter printer driver), the hyperlink appears and works in the PDF. No problem.
But I need to change the display text of the link - instead of a URL I need to display a "user friendly" name.
Problem.
If I edit the link in Excel and change the display text, the link works in Excel, no problem.
But when I print to a PDF the link is lost. I get pretty blue underlined text, but the link information is not embedded in the PDF.
Problem!
I've experimented and done some research, but nothing so far.
Any ideas?
Help!
Thank you,
GregThe links you are seeing in the PDF are likely not hard links, but what Acrobat thinks are links. That is what happens when you print to the Adobe PDF printer. If you want to retain the links in the original form, you need to use PDF Maker (or may be listed as create PDF) in Excel. The end result should be a PDF with the links appearing in the same way as in Excel.
-
Help with a vertical scroll bar issue with a List component
hi. i have a basic <s:list> that uses an XMLListCollection as it's data provider and a very basic itemrenderer. when a row in the list is clicked a function gets the list.selectedIndex then populates some text fields with more xml data. that all works fine.. the problem i have is that the vertical scroll bar on the list seems to be "clickable" - just like a row in the list. the scroll bar scrolls normally but when it's clicked the selectedIndex becomes -1 which is not helpful b/c the value -1 is passed to the XMLListCollection.
any ideas? cheers.thanks but still problematic...surely the <s:List> component shouldn't return a value when the scrollbar thumb is clicked? i created a very basic list (see below) and made the list dimensions short enough so that there is a vertical scrollbar and found that when the scrollbar thumb is clicked the trace(event.currentTarget.selectedIndex) returns a number. that's annoying b/c i just want a selectedIndex value for a row that is clicked not the scrollbar.
any ideas to get around? cheers
<fx:Script>
<![CDATA[
protected function list1_clickHandler(event:MouseEvent):void
trace(event.currentTarget.selectedIndex);
]]>
</fx:Script>
<s:List x="162" click="list1_clickHandler(event)" y="276" labelField="@label" width="144" height="153">
<s:dataProvider>
<s:XMLListCollection>
<fx:XMLList xmlns="">
<node label="one"/>
<node label="two"/>
<node label="three"/>
<node label="four"/>
<node label="five"/>
<node label="six"/>
<node label="seven"/>
<node label="eight"/>
<node label="nine"/>
<node label="ten"/>
<node label="eleven"/>
</fx:XMLList>
</s:XMLListCollection>
</s:dataProvider>
</s:List>
Maybe you are looking for
-
Ipod not syncrhonizing with Itunes
I have an early generation ipod that will no longer synchronize with Itunes. I downloaded Synchios to get the ipod music onto the computer. Then deleted Synchios software. Now, when I connect the ipod, it says it is synchronizing but newly purchas
-
Can someone tell me how to install older Java 1.5.0_30 to overide Java 1.6.29 in my Intel 10.6.8 Snow Lepoard run mac? Java 29 is ruining a program and i woul dkiek to go to the older Java that does not ruin the program on my older 2008 macbook Helo?
-
Image gallery only on iPhone, not on iMac
Hi, I would like to put some images on my iPhone6 and cancel them on my iMac afterwards. However it seems, iTune forces me to keep them on my iMac as well. Is there a hidden way I don't know? This should actually be a basic and simple thing to do...
-
Background Jobs - Process Chains
Hello, I want to schedule a background job for a process chain so that it triggers the process type and start executing... Can anyone please let me know how i can do it?
-
Organizer Error message importing to Editor
Okay I have pse 5 on my windows computer, I just upgraded to CS4. Now I have installed it on my computer. When I open the organizer, select my photo to be edited by CS4, under Edit there is an option for Photoshop along with Editor. When I click on i