Unable to capture onClick event of htmlb:image in a controller
Hi,
I am trying to capture onClick event of an htmlb:image (which is present in my view) in DO_HANDLE_EVENT method of my controller.
Surprisingly, when I click the image, page does refreshes. But the event in not captured in do_handle_event method. Control never reaches that method. Whereas if I put onClick event of a button, it is easily captured in do_handle_event method.
Ex. code in my view is:
<%@page language="abap"%>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:image id = "searchimg"
src = "consvalue.jpg"
onClick = "search" />
<htmlb:button id="searchbutton" onClick="search"
text="Event Test"/>
Now, the button event is captured, but not the image event.
Any idea why this might be happening?
Regards,
Kaushal
Hi Kaushal,
are image and button enclosed by <htmlb:form> ?
Please post your of do_handle_event, where you look for the event.
Regards,
Sebastian
Similar Messages
-
Capture onclick event on flash object using javascript
May the admins forgive me if this is in the wrong forum.
How to capture the onclick event on a web page when the click
happens on an embedded flash object?
You can't. At least not in IE. For some arcane reason either
microsofts developers or the flash guys decided to overrule the DOM
in IE.
So the onclick event is never fired, in any browsers, when
the user clicks an embedded flash object like this:
However there's a workaround. Add the wmode="transparent"
parameter. This make the onclick event okay in Firefox, but still
not IE - where the flash movie is transparent the click event
fires, but only those places.
Instead use the onmousedown and onmouseup events which fires
anywhere on the flash.>
I tried each of the following in the the Element HTML Form Element Attributes for the File Browse item:
onClick=javascript:alert(this.value);
onClick=javascript:popupURL('http://www.google.com');
onFocus=javascript:alert(this.value);
onChange=javascript:alert(this.value);And what happened?
[A few points on good practice:
1. In the XHTML normally used in APEX 4.0 mark-up, all XHTML, including attribute/event handler names, should be in lower case: <tt>onclick</tt>, <tt>onfocus</tt>, <tt>onchange</tt>...
2. Attribute values should always be quoted.
3. The <a href="http://crisp.tweakblogs.net/blog/313/the-useless-javascript-pseudo-protocol.html">"javascript:" pseudo-protocol is evil</a>. There are a few places in APEX where we may have to resort to using it as URL is all we're offered to work with, but it's always better to use an event handler of some kind, either inline or (better) registered dynamically at runtime following the principles of <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">unobtrusive JavaScript</a>. +It absolutely should not be used in inline event handlers.+
So:
{code}
onclick="alert(this.value);"
etc -
Unable to capture button event in pageLayout Controller
Hi Guys,
I have the following layout
pageLayout
pageLayoutCO (controller)
----header (Region)
----------messageComponentLayout (Region)
-----------------MessageLovInpurt
-----------------MessageChoice(Item)
-----------------MessageTextInput
-----------------MessageLayout
----------HideShow (Region)
-----------------MessageLovInpurt(Item)
-----------------MessageChoice(Item)
-----------------MessageTextInput(Item)
-----------MessageComponentLayout (Region)
-----------------MessageLayout
------------------------SubmitButton(ID:SearchBtn)
------------------------SubmitButton(ID:ClearBtn, fires partial action named clear)
-----------header(Region)
I am not able to capture the event fired by the button ClearBtn in the controller of the pagelayout.....
The two methods I used as follows aren't worked:
if ("clear".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
if (pageContext.getParameter("ClearBtn") != null) {
what should i do in order to capture the button event in the pageLayout Controller
Thanks in advance
Mandy
Edited by: user8898100 on 2011-8-2 上午7:49Mandy,
Its really strange that its not able to caputure the event in CO.
Below is the way in which we handle to Submit action at CO level.
/Check whether ClearBtn is same in case too.
if(pageContext.getParameter("ClearBtn")!=null){
System.out.println("Inside the Clear Btn Action");
Regards,
Gyan -
Capture onclick event on the Download Link of a File Browse Item
I'm using APEX 4.0.1 and need to create a javascript:popupURL after a file browse item's onClick event fires and before the download dialog popup appears.
Here's a related thread: {thread:id=2135877}
Is this possible to do? If so, any help will be appreciated.
Edited by: CM Randy SD on Jan 11, 2011 7:54 AM>
I tried each of the following in the the Element HTML Form Element Attributes for the File Browse item:
onClick=javascript:alert(this.value);
onClick=javascript:popupURL('http://www.google.com');
onFocus=javascript:alert(this.value);
onChange=javascript:alert(this.value);And what happened?
[A few points on good practice:
1. In the XHTML normally used in APEX 4.0 mark-up, all XHTML, including attribute/event handler names, should be in lower case: <tt>onclick</tt>, <tt>onfocus</tt>, <tt>onchange</tt>...
2. Attribute values should always be quoted.
3. The <a href="http://crisp.tweakblogs.net/blog/313/the-useless-javascript-pseudo-protocol.html">"javascript:" pseudo-protocol is evil</a>. There are a few places in APEX where we may have to resort to using it as URL is all we're offered to work with, but it's always better to use an event handler of some kind, either inline or (better) registered dynamically at runtime following the principles of <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">unobtrusive JavaScript</a>. +It absolutely should not be used in inline event handlers.+
So:
{code}
onclick="alert(this.value);"
etc -
Unable to capture Action_Success event during update
Hi I am using SAP-B1 2004. Using UIAPI, i am trying to do something when an item information in item master is updated.
On update button click i am capturing the Before_Action =True event to do something. If the Item information is successfully updated, i am trying to capture Action_Success = True event to do something.
The problem i am encountering is that, the Action_Success event is not getting fired.
After Before_Action =True , Before_Action =false event is getting fired and after that the item uid value changes from 1 (for update button) to some other value.
Any idea why this is happening? My code is as follows:
If pVal.FormType = 150 And pVal.FormMode = 2 Then
If pVal.ItemUID = "1" And pVal.EventType =
et_ITEM_PRESSED And pVal.Before_Action = True Then
**Do Something***
End If
If pVal.ItemUID = "1" And pVal.EventType =
et_ITEM_PRESSED And pVal.Action_Success = True Then
**Do Something***
End If
If pVal.ItemUID = "1" And pVal.EventType =
et_ITEM_PRESSED And pVal.Action_Success = false Then
**Do Something***
End If
End If
Thanks.Just change the second condition from
If pVal.ItemUID = "1" And pVal.EventType =
et_ITEM_PRESSED And pVal.Action_Success = True Then
to
If pVal.ItemUID = "1" And pVal.EventType =
et_ITEM_PRESSED And pVal.BeforeAction = false Then
and forget ActionSuccess.
If there is an error in between, the "et_ITEM_PRESSED pVal.BeforeAction = false" is not sent. This means, whenever you get the event "et_ITEM_PRESSED pVal.BeforeAction = false", the action actually was successful.
You may want to test it with following proof-snippet:
If pVal.FormType = 150 And pVal.FormMode = fm_UPDATE_MODE Then
If pVal.ItemUID = "1" And pVal.EventType = _
et_ITEM_PRESSED And pVal.Before_Action = True Then
Debug.Print "before"
End If
If pVal.ItemUID = "1" And pVal.EventType = _
et_ITEM_PRESSED And pVal.Before_Action = False Then
Debug.Print "after"
End If
If pVal.ItemUID = "1" And pVal.EventType = _
et_ITEM_PRESSED And pVal.Action_Success = True Then
Debug.Print "success"
End If
If pVal.ItemUID = "1" And pVal.EventType = _
et_ITEM_PRESSED And pVal.Action_Success = False Then
Debug.Print "no success"
End If
End If
Case 1: Update successful
Output: before, after, no success
Case 1: Update fails
Output: before, no success
Means: forget ActionSuccess, use BeforeAction true/false.
(That's how solved the problem did it when I encountered the same problem.)
Problem is, you're not able to to something if there was an error. But why would you want to? User sees a red error message and tryes again...
Florian
Message was edited by: Florian Zeller -
Regarding onClick event of htmlb:Link element.
Hi All,
We have a table in which we are displaying error messages.
The requirment is that each message should be a link which , when clicked should set the focus on respective element in the form.
I am displaying each message as link as follows:
<%
loop at itab_message into wa_message.
%>
count = count + 1.
%>
</td>
<td bgcolor="#F0F0F0">
<htmlb:link id = "link<%= count %>"
text = "<%= wa_message-msg %>"
>
</htmlb:link>
</td>
</tr>
<%
endloop.
%>
</table>
<%
refresh itab_message.
%>
<%
endif.
%>
Displayng messages as links is fine , but how can i acchieve the functionality , that on clicking a particular link , the focus should be set on the respective field.
For Ex:
There are two error messages:
1)Enter your name
2)Select material group from drop down list box.
If the user clicks 1st message the focus should be set on NAME element.
Thanks,
Anubhav.Hi,
this is not gonna be easy but first, you´re not using
<div class="jive-quote"> </div>
so you should erase it.
Second, you have to extend the use of label <htmlb:link> in this way:
<htmlb:link id = "link<%= count %>"
text = "<%= wa_message-msg %>"
onClientClick = "set_focus('your_field')" >
And then, some Javascript code:
function setfocus(myfld) {
if (document.forms.elements[myfld] != null) {
document.forms.elements[myfld].focus();
Hope it helps. -
Htmlb:button onClick event
Hi experts I'm using follwoing code for htmlb :button
<htmlb:button id = "myButton2"
text = "<%= v_save %>"
tooltip = "<%= v_save %>"
onClick = "approveClick"
design = "emphasized"
/>
and in
do_handle_event I'm using followin code
DATA : button_event TYPE REF TO cl_htmlb_event_button,
event1 TYPE REF TO cl_htmlb_event.
event1 = cl_htmlb_manager=>get_event( runtime->server->request ).
CASE event1->server_event.
WHEN 'approveClick'.
button_event ?= event1 .
< some code >
ENDCASE.
when i clicked the button it is not going into do_handle_event
I'm unable to capture onclick event of button .I tried it by keeping some break points .But couldn't be ableto capture it
Here I'm using MVC pattern .When one check box clicked in view of another controller the page which contains this button will be displayed.Do i need to write any additional code for itThere are 2 kind of break-points.
1. Session break-points - This will wok only to debug normal ABAP codes.
2. External break-points - This will help you to debug BSP/Webdynpro application.
Set the external-break point to figure out whether its triggering the events or not.
<b>
To set the external Break-points:</b>
Before settings the external-break-point, you need to Active External break-point for HTTP. YOu can find this option in
SE80, in
Utilites--> Break-point/External break-point or Utilites--> External break-point --> Set External break-point
or if you dont find, then
utilities-->setttings -> ABAP Workbench -> look at the debugger tab
& find the external Debugging check box or External Debugging user ID. Give SAP User ID
Also have a look at this..
http://help.sap.com/saphelp_nw2004s/helpdata/en/17/00ab3b72d5df3be10000000a11402f/frameset.htm
<i>* Reward each useful answer</i>
Raja T
Message was edited by:
Raja Thangamani -
Unable to capture startup and shutdown event of Photoshop in automation Plugin.
Hi,
I am creating an automation plugin and I want to register some events. I have seen listener plugin sample to register event in startup and unregister event in shutdown. I have used same code in my plugin but I am unable to capture the startup nad shutdown event of Photoshop. On clicking the menu item of my plugin the calls come inside the AutoPluginMain but during the startup or shutdown of plugin, the calls does not come inside the AutoPluginMain.
I am unable to detect the cause of the problem. Can someone please giude me??
Thanks in advance.Hi Tom,
Thanks for the suggestion.
Yes, I am working on Windows. As you suggested, I compiled .rc file but the compile option for .r file was disabled. After compiling the .rc file, I again rebuild the complete project and tested my build. But still I was not able to achive the desired result.
Any other thing that I need to do to make it work?
Thanks -
"Unable to capture window image"
if I select a window to be screenshot, I get this error:
Your screen shot can’t be saved.
Unable to capture window image.
(shortcut: cmd-shift-4 and then space)
It seems to be new in Lion. Never had that problem before. And regular screenshots seem to work fine (cmd-shift-3).
Thanks for any help! ~ KaiThanks Davide ...
I created com.apple.screencapture.plist with Terminal and restarted the Mac.
The first couple of window screenshots worked on a Chrome browser window (command-shift-4, then space bar). But it did not work on other app's windows (Finder, Carousel).
Then I switched back to Chrome and I didn't work there too anymore. Crazy thing is that now it works on Finder windows. Very very strange.
All this is only true for capturing a whole window content (command-shift-4, then space bar)
~ Kai -
Camera - Torch 9800 - Unable to capture the image
Hey everyone!
Had a torch 9800 for 18 months now and always been working fine... until today.
I went to use the camera and it all seemed to open up fine but instead of seeing what the lens sees the screen was black. The centre focus [ ] was there and I could zoom back and forth just a black screen.
When I click for a photo I get a message " Unable to capture the image "
I have searched the web and found nothing conclusive. Battery pulls, a full wipe and installation of the o/s have made no difference to it's lack of function.
Does anyone out there have a suggestion?I am having the exact same issue. I also tried rebooting, taking out the battery and sim card and cleaning out the back, alas no difference.
-
EP 6.0 SP2: Update a HTMLB TableView after onClick Event
Hello,
i generate a TableView from a JDBC database selection.
Outside this TableView there are 3 Buttons.
Now the problem:
If one of the buttons will click, the TableView has to be updated with a new database result. Have somebody an idea, how to update the TableView?
StephanCould you be more precise?
Default behaviour/coding is that an onClick event effects a request to the server - as your component/dynpage handles this request, you should be able to present anything that you like on this occasion. Maybe you code does not react to the HTMLB event properly?
Regards,
Armin -
Unable to capture Exchange Mailbox Auditing events for email creation
We are looking to capture Owner mailbox auditing events using the native Exchange 2013 auditing tools (Search-MailboxAuditLog). I have auditing enabled with all actions for Owner, and capture items performed via Outlook, except for new emails created.
If I create new emails via OWA, I am able to capture the event, but as soon as I go back to Outlook and create a new message, I don’t see anything audited. I also tried this is our Dev environment and seeing the same behavior. Has anyone else experience this
behavior?Hi,
I have a test in my environment. If I create a message on Outlook as a owner, the mailbox audit logging can't record it.
If I create a message on Outlook as a delegate, when using the Search-MailboxAuditLog cmdlet to search the audit log, it will be displayed as follows:
The operation is "SendAs", not "Create".
Hope this can be helpful to you.
Best regards,
If you have feedback for TechNet Subscriber Support, contact
[email protected]
Amy Wang
TechNet Community Support -
Unable to capture a video using robot.createScreenCapture
Hi all,
I'm having one problem with robot.createScreenCapture, i used the
below code to take screen shot, everything goes fine except one case, I'm unable to capture videos played in windows media player & winamp, black screen is displaying instead of the video. I used avi files.
here is the code
import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JFrame;
public class CaptureImage implements ActionListener {
Robot robot = new Robot();
Image image = null;
public CaptureImage() throws AWTException {
JFrame frame = new JFrame("Capture");
JButton button = new JButton("Capture");
frame.setAlwaysOnTop(true);
button.addActionListener(this);
frame.getContentPane().add(button);
frame.pack();
frame.setVisible(true);
public void actionPerformed(ActionEvent e) {
// image = robot.createScreenCapture(new Rectangle(800, 600));
String outFileName = "shot.png";
// determine current screen size
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screenSize = toolkit.getScreenSize();
Rectangle screenRect = new Rectangle(screenSize);
// create screen shot
Robot robot;
try {
robot = new Robot();
BufferedImage image = robot.createScreenCapture(screenRect);
ImageIO.write(image, "png", new File(outFileName));
System.out.println("Saved screen shot (" + image.getWidth() + " x "
+ image.getHeight() + " pixels) to file \"" + outFileName
+ "\".");
} catch (IOException e2) {
e2.printStackTrace();
} catch (AWTException e1) {
e1.printStackTrace();
public static void main(String[] args) {
try {
new CaptureImage();
} catch (AWTException e) {
e.printStackTrace();
}Are you setting the videoPause property to true in the rule you're using to navigate to the video screen? For example, assume you're using a button to navigate to the VideoScreen, its OnSelect property should be: Navigate(VideoScreen, ScreenTransition!Fade,{videoPause:false}).
Basically, the value needs to change for the video to pause. If you don't have that set up, you could also do that within the rule you're using to navigate to scrHome as follows:
UpdateContext({videoPause: false});Navigate(scrHome, ScreenTransition!Fade,{videoPause: true})
Thanks
Robin -
Add a "hand"-mouse-cursor to a htmlb:image?
is it possible to let the mouse-cursor change to a "hand" when i move over an htmlb:image (with a onCLick-Event) like on links?
quite simple,
just place this tag around it:
<a style="cursor:pointer"> ... </a>
like this:
<a style="cursor:pointer"><htmlb:image
id="myimage1" src="@15@" onClick="myimageevent1" /></a> -
Hi all,
i want to capture mouse events like mousedown, mouseup and mousemove by clicking on the tree node of <htmlb:tree>.
Have any one some Idee?
Greeting,
agHi all,
i solved with your help the problem as follows:
thank you all.
PS: how can i Reward and close this topic?
<%data l_replace type string.%>
<%concatenate 'onSubmit(' '''' 'OnInputProcessing(this.id)' '''' ',this.id' ')' into l_replace.%>
<bsp:findAndReplace find = 'onclick="' replace = 'onMouseDown="<%=l_replace%>;' >
<bsp:findAndReplace find1 = "<td" replace1 = "<td bgcolor=green" >
<htmlb:tree id = "HDrag"
table = "<%=p_0costtree %>"
title = "Tree Left"
width = "100%"
height = "100%"
onTreeClick = "TreeClicked"/>
</bsp:findAndReplace>
</bsp:findAndReplace>
Maybe you are looking for
-
Cant upgrade to lastest itunes 10.5.1
I have a macbook, 2.4 intel core 2 duo version 10.5.8 Im trying to upgrade my iphone 4 to latest 5.0.1. I plug in my iphone, i tunes opens up, it says "a newer version of the iphone software is available (version 5.0.1) to update yor iphone with the
-
Hey can you guys advise me on how to find missing ringtones please
-
How to load apps on second iPad?
I have a rather expensive App on my iPad and iTunes in my MacBook Pro. How can I load this App on my wife's iPad? I think I can sync her iPad with my MacBook Pro. If so, how can I select only this App (not all my Apps) to load on her iPad?
-
How to delete all objects for one user from SE80
Hi all, If i want to delete the customer objects defined in the customer space Y or Z from SE80. Object of one user is defined in one package, if i want to delete the pakcage it says, it contain the subobject. So can anybody help me how to delete the
-
Static content which can be changed in specific time period.
Hi All, I have a requirement where I need to create a application and put some static data ( text and images) in that. for example all projects running under one company or like security policies of a company( which won't change daily basis, it will