How a custom control is advised it gains or looses focus?
Hey, at least I have a question to ask, instead of answering them... :-)
Actually, I already asked it in another thread, in one of my answers: [onMouseClicked Event Is Failing To Fire|http://forums.sun.com/thread.jspa?threadID=5391008] but I fear it is lost in a rather lengthly message, so I ask it in its own thread, because I was to bring the attention of knowledgeable people (hello Sun people! :-D).
The question is simple: In a custom control in JavaFX 1.2, with skin and behavior, how a control is advised when it gains or looses focus?
The purpose is to let the skin to change the look of the component upon these events, like it is done for standard controls (eg. putting a border around the focused control).
If the control is clicked, you know (unless it is disabled) that it will have the focus. But I see no way to see the lost of focus, nor when we gain (or loose) it with Tab/Shift+Tab (if it has focusTraversable to true).
I looked for onFocus() and onBlur() events (or similar), but found nothing. No mixin, nothing related in javafx.scene.input.TextInput and friends, etc.
I explored the Web but since 1.2 is still new, I found not much information. Only a fragment of source code in [Re: Further location optimizations|http://markmail.org/message/gsevtlkeq45rrdun] where I see scene.getFocusOwner() but this one isn't easily usable because it is package protected (and it is not an event, anyway).
A possible solution would be to have a timer to inspect the state focused of the nodes, but it is so kludgy I didn't even tried to implement it!
I hope I just missed the information... If there is no easy/official/working way in 1.2, I hope this will be corrected for next version!
That's a very good remark, handling of focus highlight shouldn't be done at control (model)'s level. I hesitated to put it in behavior, but it feels more natural in the skin, so I did as you suggested.
you'll need an interface, and JavaFX does not do thatYou have mixins. But I didn't used them here.
focused variable never is set to trueHave you included the
public override var focusTraversable = true;
line?
To support multiple skins, my control becomes:
public class StyledControl extends Control
// Data related to the control (the model)
public var count: Integer;
public override var focusTraversable = true;
init
if (skin == null) // Not defined in instance
// Define a default styler
skin = ControlStyler {}
package function Incr(): Void
if (count < 9)
count++;
}quite bare bones (I intendedly keep the model simple).
Note I still define a default skin in case user doesn't provide it: they shouldn't care about this detail unless they want to change it.
I defined an abstract default skin, implementing most variables (particularly the public ones that can be styled) and the focus change:
public abstract class DefaultControlStyler extends Skin
//-- Skinable properties
public var size: Number = 20;
public var fill: Color = Color.GRAY;
public var textFill: Color = Color.BLACK;
public var focusFill: Color = Color.BLUE;
package var mainPart: Node; // Decorations (id, focus) are kept out of layout
package var focusHighlight: Node;
package var idDisplay: Text;
package var valueDisplay: Text;
init
behavior = ControlBehavior { info: bind control.id }
node = Group
//-- Behavior: call controller for actions
onMouseReleased: function (evt: MouseEvent): Void
(behavior as ControlBehavior).HandleClick(evt);
postinit
// Once defined by the sub-class, insert into the node
insert [ mainPart, idDisplay, valueDisplay ] into (node as Group).content;
public abstract function ShowIncrement(): Void;
var hasFocus = bind control.focused on replace
if (hasFocus)
ShowFocus();
else
HideFocus();
// Default handling of focus display, can be overriden if needed
public function ShowFocus(): Void
insert focusHighlight into (node as Group).content;
public function HideFocus(): Void
delete focusHighlight from (node as Group).content;
public override function contains(localX: Number, localY: Number): Boolean
return mainPart.contains(localX, localY);
public override function intersects(localX: Number, localY: Number,
localWidth: Number, localHeight: Number): Boolean
return mainPart.intersects(localX, localY, localWidth, localHeight);
}and the concrete skins implement the mainPart, idDisplay, valueDisplay, focusHighlight nodes, override ShowIncrement with an animation, override getPrefWidth and getPrefHeight to set to mainPart size and might override ShowFocus or HideFocus (if we want it behind mainPart for example).
The behavior is:
public class ControlBehavior extends Behavior
public var info: String; // Only for debug information...
// Convenience vars, to avoid casting each time
var control = bind skin.control as StyledControl;
var csSkin = bind skin as DefaultControlStyler;
public override function callActionForEvent(evt: KeyEvent)
println("{info}{control.count}: KeyEvent: {evt}");
if (evt.char == '+')
Incr();
package function HandleClick(evt: MouseEvent): Void
control.requestFocus();
Incr();
function Incr(): Void
control.Incr();
println("{info}: Ouch! -> {control.count}");
csSkin.ShowIncrement();
}and knows only the abstract default skin (to apply feedback of user input to skin).
I use it as follow:
Stage
title: "Test Styling Controls"
scene: Scene
width: 500
height: 500
content:
HBox
translateX: 50
translateY: 100
spacing: 50
content:
StyledControl { id: "Bar" },
StyledControl { /* No id */ layoutInfo: LayoutInfo { vpos: VPos.BOTTOM } },
StyledControl { id: "Foo" },
StyledControl { id: "Gah" },
StyledControl { id: "Bu", skin: AltCtrlStyler {} },
stylesheets: "{__DIR__}../controlStyle.css"
}BTW, I tried layoutY: 50 in place of the layoutInfo definition, but the control remained at default place. Am I reading incorrectly the ref. or is this a bug?
Similar Messages
-
Problem with custom control and focus
I've a problem with the focus in a custom control that contains a TextField and some custom nodes.
If i create a form with some of these custom controls i'm not able to navigate through these fields by using the TAB key.
I've implemented a KeyEvent listener on the custom control and was able to grab the focus and forward it to the embedded TextField by calling requestFocus() on the TextField but the problem is that the TextField won't get rid of the focus anymore. Means if i press TAB the first embedded TextField will get the focus, after pressing TAB again the embedded TextField in the next custom control will get the focus AND the former focused TextField still got the focus!?
So i'm not able to remove the focus from an embeded TextField.
Any idea how to do this ?Here you go, it contains the control, skin and behavior of the custom control, the css file and a test file that shows the problem...
control:
import javafx.scene.control.Control;
import javafx.scene.control.TextField;
public class TestInput extends Control {
private static final String DEFAULT_STYLE_CLASS = "test-input";
private TextField textField;
private int id;
public TestInput(final int ID) {
super();
id = ID;
textField = new TextField();
init();
private void init() {
getStyleClass().add(DEFAULT_STYLE_CLASS);
public TextField getTextField() {
return textField;
@Override protected String getUserAgentStylesheet() {
return getClass().getResource("testinput.css").toExternalForm();
@Override public String toString() {
return "TestInput" + id + ": " + super.toString();
}skin:
import com.sun.javafx.scene.control.skin.SkinBase;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.EventHandler;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
public class TestInputSkin extends SkinBase<TestInput, TestInputBehavior> {
private TestInput control;
private TextField textField;
private boolean initialized;
public TestInputSkin(final TestInput CONTROL) {
super(CONTROL, new TestInputBehavior(CONTROL));
control = CONTROL;
textField = control.getTextField();
initialized = false;
init();
private void init() {
initialized = true;
paint();
public final void paint() {
if (!initialized) {
init();
getChildren().clear();
getChildren().addAll(textField);
@Override public final TestInput getSkinnable() {
return control;
@Override public final void dispose() {
control = null;
}behavior:
import com.sun.javafx.scene.control.behavior.BehaviorBase;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.EventHandler;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
public class TestInputBehavior extends BehaviorBase<TestInput> {
private TestInput control;
public TestInputBehavior(final TestInput CONTROL) {
super(CONTROL);
control = CONTROL;
control.getTextField().addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
@Override public void handle(final KeyEvent EVENT) {
if (KeyEvent.KEY_PRESSED.equals(EVENT.getEventType())) {
keyPressed(EVENT);
control.focusedProperty().addListener(new ChangeListener<Boolean>() {
@Override public void changed(ObservableValue<? extends Boolean> ov, Boolean wasFocused, Boolean isFocused) {
if (isFocused) { isFocused(); } else { lostFocus(); }
public void isFocused() {
System.out.println(control.toString() + " got focus");
control.getTextField().requestFocus();
public void lostFocus() {
System.out.println(control.toString() + " lost focus");
public void keyPressed(KeyEvent EVENT) {
if (KeyCode.TAB.equals(EVENT.getCode())) {
control.getScene().getFocusOwner().requestFocus();
}the css file:
.test-input {
-fx-skin: "TestInputSkin";
}and finally the test app:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class Test extends Application {
TestInput input1;
TestInput input2;
TestInput input3;
TextField input4;
TextField input5;
TextField input6;
Scene scene;
@Override public void start(final Stage STAGE) {
setupStage(STAGE, setupScene());
private Scene setupScene() {
input1 = new TestInput(1);
input2 = new TestInput(2);
input3 = new TestInput(3);
input4 = new TextField();
input5 = new TextField();
input6 = new TextField();
GridPane pane = new GridPane();
pane.add(input1, 1, 1);
pane.add(input2, 1, 2);
pane.add(input3, 1, 3);
pane.add(input4, 2, 1);
pane.add(input5, 2, 2);
pane.add(input6, 2, 3);
scene = new Scene(pane);
return scene;
private void setupStage(final Stage STAGE, final Scene SCENE) {
STAGE.setTitle("Test");
STAGE.setScene(SCENE);
STAGE.show();
public static void main(String[] args) {
launch(args);
The test app shows three custom controls on the left column and three standard textfields on the right column. If you press TAB you will see what i mean... -
Hi all
I would like to create a customized button as a master so that if I change the look of the master all other buttons will change too.
I have done this with a custom control as a "strict type def" otherwise the look will not change BUT If I do this as a strict type def I cannot change the Boolean text anymore which should be different on every button.
How can I create a master control of a button where the look will be applied to all others but not the Boolean text?
Stay Hungry, Stay Foolish
Solved!
Go to Solution.Steve Chandler wrote:
I don't think you can do that. I just looked and as I suspected the Boolean text property is read only for strict typedefs so you cannot use property nodes to change the text.
As a workaround just make it a typedef. When you want to change the look open the typedef and make it strict, make your changes, then make it non strict again. You will have to update the Boolean text again for all instances. Kind of a pain. Maybe this is something for the idea exchange.
Kudos for being sneaky.
I like these creative work-arounds!
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
How do I find the EventID of an event in a custom control?
Hi all,
I have a custom control created in VB .NET that I have embedded into a SAP screen using a wrapper class as described in Thomas Jungs example: <a href="/people/thomas.jung3/blog/2004/09/01/using-net-windows-controls-in-the-abap-control-framework .Net Windows Controls in the ABAP Control Framework</a>
My problem is that I cannot get the wrapper class to react to any events raised by the custom control!
I do not know how to find what the EventID is of an event so that I can register it in the class - do you know how to find this EventID? Or even if this is the problem?
Tx.
NIs there any way to find the image dpi in a free or low cost program?
-
How to limit the number of rows in the Custom Control box
Hi All,
In my Module pool screen I have a Custom Control box for providing some free text as input. Now, there is no limit in the number of rows allowed for this box.
But, the requirement is, it should have the maximum number of rows = 99. and each row should have maximum length = 60 characters.
User should not be allowed to enter more than 60 characters per row and more than 99 rows.
Could you please let me know how to do this..? Are there any methods available which controls the maximum number of rows and maximum length per row..?
Please help me in resolving the issue. Thanks in advance.
Thanks & Regards,
Paddu.By "Custom Control Box", do you mean a Custom Container or a Table Control?
Anyway, I suggest you to use a table control (not a custom container as your requirement seems to be very precise on that point, maybe ask your client twice to make sure). Look at the examples of table controls in ABAPDOCU transaction. -
HTML Client: How to get the content/value of a custom control?
I made two Custom Controls named, "CustomControl_1" and "CustomControl_2".
In the render function of "CustomControl_1", how to access the value of "CustomControl_2"?
For example,
myapp.BrowseOrders.CustomControl_2_render = function (element, contentItem) {
$(element).text("Some Value");
myapp.BrowseOrders.CustomControl_1_render = function (element, contentItem) {
$(element).text( Value of CustomControl_2 ? );I would recommend creating screen properties and binding the controls to those screen properties. Then you can easily get a reference to any value. See this article for an example of the process using custom controls:
Using The Clippy Agent in the Visual
Studio LightSwitch HTML Client
Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book
http://LightSwitchHelpWebsite.com -
How do I create an emergency stop custom control in LabVIEW that looks like an actual E-stop button
How can I find (or buy) a variety of custom controls for various applications that look better than the standard NI controls.
Here is a simple E-Spot button. Warning: I'm no artist . I made the pictures in Word, edited them in MS Photo Editor and imported them into LabVIEW
Attachments:
E-Stop_Button.ctl 51 KB -
How to use custom control.
hi all,
how to use custom controls in screen painter.
can i add image to my screen using custom control.
is there any other way to display image on screen.
give me some notes about custom control.
and sample programs to display image and also the use of custom control.
regards,
bhaskar.hi vinod,
u can use the class <b>cl_gui_picture</b> to work around with pictures on the screen
just define a custom control on the screen
create an object of custom container.
create another object of cl_gui_picture giving container name as the parent name...
u can check out the class using the transn se24....
pls post if additional info is required...
Regards,
Vs -
How to use custom control in Dialog Programming?
How can I call a subscreen using custom control in Dialog Programming?
The required subscreen contains a calender. Any class or something available for this purpose. Please suggest.As [vinraaj|http://forums.sdn.sap.com/profile.jspa?userID=3968041] wrote, call transaction SE51, there is a Wizard to help you generate the table control, it will create the table control and some includes with PBO/PAI modules > Read [Using the Table Control Wizard|http://help.sap.com/saphelp_bw/helpdata/en/6d/150d67da1011d3963800a0c94260a5/frameset.htm]
Also there is a tutorial in the wiki, read [Learn Making First Table Control |http://wiki.sdn.sap.com/wiki/display/ABAP/LearnMakingFirstTableControl] by [Krishna Chauhan|http://wiki.sdn.sap.com/wiki/display/~nc0euof]
Regards,
Raymond -
How to save Custom control records through module pool program ?
Hi guru ,
1. How to save Custom control records through module pool program ?
I wrote multiple lines of record in custom control
Who to save that records ?
thanking you.
Regards,
Subash.Hi,
can refer following code -
IN PAI , CODE is as follows-
*& Form editor_output
FORM editor_output .
NARRATION1 is name of custom controller
IF v_editor IS INITIAL.
Create obejct for custom container
CREATE OBJECT v_custom_container
EXPORTING
container_name = 'NARRATION1'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Create obejct for the TextEditor control
CREATE OBJECT v_editor
EXPORTING
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
parent = v_custom_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " editor_output
getting textdata in internal table as follows
*& Form create_text
FORM create_text .
REFRESH : it_texttable,
it_text.
IF v_doc_number IS NOT INITIAL.
IF v_editor IS NOT INITIAL.
CALL METHOD v_editor->get_text_as_r3table
IMPORTING
table = it_texttable
EXCEPTIONS
error_dp = 1
error_cntl_call_method = 2
error_dp_create = 3
potential_data_loss = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Now, our final text data is in internal table it_texttable.
pls, Reward if found helpful. -
How to save Custom control records ?
Hi guru ,
1. How to save Custom control records module pool program ?
I wrote multiple lines of record in custom control
Who to save that records ?
thanking you.
Regards,
Subash.REPORT ZCUSTOMC.
CLASS event_handler DEFINITION.
PUBLIC SECTION.
METHODS: handle_f1 FOR EVENT f1 OF cl_gui_textedit
IMPORTING sender,
handle_f4 FOR EVENT f4 OF cl_gui_textedit
IMPORTING sender.
ENDCLASS.
DATA: ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm.
DATA: init,
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit.
DATA: event_tab TYPE cntl_simple_events,
event TYPE cntl_simple_event.
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
DATA handle TYPE REF TO event_handler.
START-OF-SELECTION.
line = 'First line in TextEditControl'.
APPEND line TO text_tab.
line = '----
APPEND line TO text_tab.
line = '...'.
APPEND line TO text_tab.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
IF init is initial.
init = 'X'.
CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',
editor EXPORTING parent = container,
handle.
event-eventid = cl_gui_textedit=>event_f1.
event-appl_event = ' '. "system event
APPEND event TO event_tab.
event-eventid = cl_gui_textedit=>event_f4.
event-appl_event = 'X'. "application event
APPEND event TO event_tab.
CALL METHOD: editor->set_registered_events
EXPORTING events = event_tab.
SET HANDLER handle->handle_f1
handle->handle_f4 FOR editor.
ENDIF.
CALL METHOD editor->set_text_as_stream EXPORTING text = text_tab.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'INSERT'.
CALL METHOD editor->get_text_as_stream IMPORTING text = text_tab.
WHEN 'F1'.
MESSAGE i888(sabapdocu) WITH text-001.
WHEN OTHERS.
MESSAGE i888(sabapdocu) WITH text-002.
CALL METHOD cl_gui_cfw=>dispatch. "for application events
MESSAGE i888(sabapdocu) WITH text-003.
ENDCASE.
SET SCREEN 100.
ENDMODULE.
CLASS event_handler IMPLEMENTATION.
METHOD handle_f1.
DATA row TYPE i.
MESSAGE i888(sabapdocu) WITH text-004.
CALL METHOD sender->get_selection_pos
IMPORTING from_line = row.
CALL METHOD sender->get_line_text
EXPORTING line_number = row
IMPORTING text = field.
CALL METHOD cl_gui_cfw=>set_new_ok_code "raise PAI for
EXPORTING new_code = 'F1'. "system events
CALL METHOD cl_gui_cfw=>flush.
ENDMETHOD.
METHOD handle_f4.
DATA row TYPE i.
MESSAGE i888(sabapdocu) WITH text-005.
CALL METHOD sender->get_selection_pos
IMPORTING from_line = row.
CALL METHOD sender->get_line_text
EXPORTING line_number = row
IMPORTING text = field.
CALL METHOD cl_gui_cfw=>flush.
ENDMETHOD.
ENDCLASS.
aniruddh -
How to save Custom control records module pool program ?
Hi guru ,
1. How to save Custom control records module pool program ?
I wrote multiple lines of record in custom control
Who to save that records ?
thanking you.
Regards,
Subash.Hi Subasha,
Please check the format below since it is based on a working code
**************data declarations
TYPES: BEGIN OF TY_EDITOR,
EDIT(254) TYPE C,
END OF TY_EDITOR.
data: int_line type table of tline with header line.
data: gw_thead like thead.
data: int_table type standard table of ty_editor.
You should create a text for uniquely identifying the text you are saving each time so that it doesn't get overwritten
For this a key combination must be decidedd to uniquely identify the test..here it is loc_nam
****************fill header..from SO10( t-code )
GW_THEAD-TDNAME = loc_nam. " unique key for the text
GW_THEAD-TDID = 'ST'. " Text ID
GW_THEAD-TDSPRAS = SY-LANGU.
GW_THEAD-TDOBJECT = 'ZXXX'. "name of the text object created
*Read Container and get data to int_table
CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
IMPORTING
TABLE = int_table
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
others = 5.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop data from int_table and save to int_line-tdline appending it.
*save the text
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = GW_THEAD
TABLES
LINES = InT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC 0.
ENDIF.
The code shown above is ok and working fine for save also,hope that the above sample with helps you solve the problem
Please check and revert,
Reward if helpful
Regards
Byju -
How to use the custom control ?
Hi Friends,
plz help to use of custom control in screen painter ?
and how to use the custom control ?
Thanking you.
Regards,
Subash.HI,
Screen Elements
A screen can contain a wide variety of elements, either for displaying field contents, or for allowing the user to interact with the program (for example, filling out input fields or choosing pushbutton functions). You use the Screen Painter to arrange elements on the screen.
You can use the following elements:
· Text fields
Display elements, which cannot be changed either by the user or by the ABAP program.
· Input/output fields and templates
Used to display data from the ABAP program or for entering data on the screen. Linked to screen fields.
· Dropdown list boxes
Special input/output fields that allow users to choose one entry from a fixed list of possible entries.
· Checkbox elements
Special input/output fields that the user can either select (value X) or deselect (value SPACE). Checkbox elements can be linked with function codes.
· Radio button elements
Special input/output fields that are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.
· Pushbuttons
Elements on the screen that trigger the PAI event of the screen flow logic when chosen by the user. There is a function code attached to each pushbutton, which is passed to the ABAP program when it is chosen.
· Frame
Pure display elements that group together elements on the screen, such as radio button groups.
· Subscreens
Area on the screen in which you can place another screen.
· Table controls
Tabular input/output fields.
· Tabstrip controls
Areas on the screen in which you can switch between various pages.
· Custom Controls
Areas on the screen in which you can display controls. Controls are software components of the presentation server.
· Status icons
Display elements, indicating the status of the application program.
· OK field
Every screen has a twenty-character OK_CODE field (also known as the function code field) that is not displayed directly on the screen. User actions that trigger the PAI event also place the corresponding function code into this field, from where it is passed to the ABAP program. You can also use the command field in the standard toolbar to enter the OK field. To be able to use the OK field, you need to assign a name to it.
All screen elements have a set of attributes, some of which are set automatically, others of which have to be specified in the Screen Painter. They determine things such as the layout of the screen elements on the screen. You can set the attributes of screen elements in the Screen Painter - either for a single element, or using the element list, which lists all of the elements belonging to the current screen. Some of the attributes that you set statically in the Screen Painter can be overwritten dynamically in the ABAP program.
with regards,
sowjanyagosala -
How can i create a custom control, indicator
This is FredFred,
How can i create a custom control switch with 3 or more options,
OFF
ON
STANDBY
Other than rocker, slide, or toggle switch, are there other switches that we can use, hence, the question of creating a custom switch.
Also, is there a way to create an indicator with two options. Enclosed is a jpeg with an example of what i need
Thanks in Advance
Attachments:
sample switches_displays.bmp 720 KBHello.
Boolean controls can only have 2 possible values, true or false, and there is no way to add more values to them.
If you need more values, then you must use a numeric control (or a string, but I tend to like numerics better, although strings could be just as useful).
There are several types of numeric controls you could use to provide 3 or more options. Attached is a VI which shows a ring, a knob, and a slide each with 3 possible values. In your code, you would then perform different actions depending on the numeric value of your control.
Hope this helps,
Alejandro
Attachments:
NumericsWith3Options.vi 14 KB -
How to display text in custom control?
Im doing a module pool program. There I have a Input field ,if user input there, some text I have to show in custom control. I have created custom control . But how to display some text there? what method I have to use?
I have use this code for creating custom control.
CREATE OBJECT EDITOR_CONTAINER
EXPORTING
CONTAINER_NAME = 'TEXTEDITOR'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
CREATE OBJECT TEXT_EDITOR
EXPORTING
PARENT = EDITOR_CONTAINER
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_POSITION = LINE_LENGTH
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE.Hi,
You will have to use the method 'set_text_as_r3table' to display your text in the object.
The text will have to be passed as an internal table to the method.
Regards,
Ankur Parab
Maybe you are looking for
-
Trigger Idoc when Batch is created or changed
Hello, We have to transfer Batch ID,Status and Batch Characteristics through IDoc to PI when Batch is created or updated. This can be possible by 3 scenarios. When Batch is created or updated manually through Tcode MSC1N. When Batch is created or upd
-
Hi there, I just bought a 13' 128gb Macbook Air but now realised that the storage capacity is too small. What is the alternative way to increase the storage capacity? Thank you
-
Pages repeatedly crashing due to "SFWord Processing Plugin"
I'll be working in Pages '08 and click on something (sometimes in the menu bar, sometimes in the text, sometimes in the Inspector--doesn't seem to follow a real pattern), and all the sudden I will get the spinning beach ball. I won't be able to save.
-
Extend the SSO Oracle Portal Authentication Mechanism
Hi All, I need to put some logic just before the Oracle Portal user is authenticated to SSO. Specifically I need to collect some information about the user from a database just before the SSOLoginServlet is called with all the parameters it needs. (u
-
Please:How to repeat the return values multiple times in sapscript
Currently my subroutine is returning a value called TOQBSSHB single time and i am working with standard layout called RFFOUS_C.Please can anybody tell me if i want to show multiple times TOQBSSHB for different values of VBLNR .Is it possible if it is