Extending ContentBySearchWebPart with own buttons
Dear all,
I want to extend the Content Search Web Part (CSWB) with own buttons/tabs to refine the query. My idea was to derive a custom web part from the CSWB, add these buttons to the web part area and to extend the query in the button's event.
My actual problem is to place the button to the web part area. I used the CreateChildControls() method to add my buttons (to be exact RadioButton) to the Controls collection, but the buttons will be always attached at the bottom of the web part.
Here is my code:
protected override void CreateChildControls()
base.CreateChildControls();
//create filter buttons
for (int i = 0; i < 3; i++)
var filter = new RadioButton();
filter.Text = "filter " + i.ToString();
filter.GroupName = "NewsCSWP_tabs";
//set input properties
filter.InputAttributes["class"] = "NewsCSWP_radio";
//this.Controls.Add(filter);
this.Controls.AddAt(0, filter);
And it has the same effect if I use the .Add(...) or .AddAt(...) method. I tried also to call the base.CreateChildControls() after the Controls.Add(), but my buttons still appears at the bottom.
What is the supported way to achive this?
Thanks!
Maybe its possible, but it is not recommended to do so.
However it does not make to much sense.
Just run your servlet as a portal compoent with an entry as native-Servlet in the pc descriptor.
Thats a 5 minute trip.
Similar Messages
-
Extend XCM with own components
Hello,
in CRM-ISA 3.0 I have extended the web.xml-file with some parameters or own properties-files to configure self-developed extensions of the b2b- or b2c-application.
After migration to CRM 4.0 it would make sense to reegineer this things into own XCM-components to simplify the configuration and to avoid unnecessary modifications on file level.
So I have the following questions:
1. Do you know any documention about how the XCM can be extended by own components?
Or better:
2. Did anyone extend the XCM by own components and parameters and can give me a cookbook how this can be done?
With best regards,
Holger DittrichHi Holger,
Yes you can create custom components in scm settings. Follow the sap isa dev guide which is available for download in the service market place.
You have to download the config xml file from the start-> general page of xcm settings and edit its content with required custom component and upload it back to the backend system. Note : take the backup of the original.
Add this code to the file and upload back
<component id="project">
<configs>
<config id="projectconfig">
<params id="default">
<param name="myParam" value="defaultValue"/>
</params>
</config>
</configs>
</component>
then change the code of xcmadmin-config.xml file from web-inf/xcm/customer/modification.
<?xml version="1.0" encoding="UTF-8"?>
<xcmadmin>
<componentmetadata>
<component id="project" shorttext="Project specific setting" scope="application">
<longtext>Detailed overview on parameters configured here</longtext>
<params>
<param name="myParam" type="text" shorttext="custom parameter"/>
</params>
</component>
</componentmetadata>
<scenariometadata>
<!-- add additional scenariometadata here -->
</scenariometadata>
</xcmadmin>
add this code.
Deploy and restart the application.
Hopefully this is helpfull
Regards
Bharath. -
Extending EP6 with own Servlet and URL /irj/MyServlet
Hello,
I am working on a migration of a Servlet from IBM WebSphere Portal 5.0 to SAP EP6.0. The Servlet is an extension to the Portal and is manually deployd and not with an ear or war file.
Is it possible to extend the portal with my own servlet accessible with "/irj/MyServlet"?
I tried to copy the jars to one of the directories
server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\lib
server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\lib
server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\system\lib
and added my Servlet to the web deployment descripter
server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\web.xml
<servlet>
<servlet-name>MyServlet</servlet-name>
<display-name>MyServlet</display-name>
<servlet-class>com.mycompany.MyServlet</servlet-class>
<init-param>
<param-name>ServletMode</param-name>
<param-value>normal</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/MyServlet/*</url-pattern>
</servlet-mapping>
I also tried to modify the jar file in the same manner
server0\apps\sap.com\irj\servlet_jsp\irj\epbc.war
All this does not work.
Does somebody has experience with extending the SAP EP6 portal?
Greetings, Bernd.Maybe its possible, but it is not recommended to do so.
However it does not make to much sense.
Just run your servlet as a portal compoent with an entry as native-Servlet in the pc descriptor.
Thats a 5 minute trip. -
Tutorial about how to extend the bdoc activity_object with own segments
Hi!
We had lots of problems with the things described in this subject here.
Worse: We can't solve the problems and now we're going another way for our mobile-crm-solution...
Are there any how-to-guides or tutorials anywhere online about how to extend standard bdocs with own segments?
How-to-guides about mbdocs and sbdocs and how they are playing together?
Thanks a lot in advance.
Best regards,
IngoHi lngo,
I would suggest you use EEWB to enhance the Activity object. There is the provision of enhancing the Mobile sbdocs directly from EEWB.
This way you don't have to spend lots of efforts in developments.
When you create extension in EEWB, for input fields select the appropriate values mention below:
EEW Bus. Obj: BUSINESS_ACTIVITY
Extension Type: ACTIVITY_H
On Next Screen enter screen title and press continue.
On Next screen select 'Business Activity' and continue.
Enter the fields required on next screen and continue.
Further on next screen define if fields should be releavant for header, item or both.
and on the next screen select 'Mobile' so that sbdocs are accordingly modified.
Best Regards,
Pratik Patel.
Reward with points if it is of any help to you! -
After adding JButtons(with an image only) to a JToolBar, I noticed that
it is unnoticable when you press it. I wanted to make my own button
which does about the same the .NET style toolbars do. The result can be found here. If anyone wants to be so freely to test it if it works on
your toolbars?
Thanks
import javax.swing.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.*;
import java.awt.geom.*;
public class KButton extends JButton implements MouseListener
BufferedImage bimg;
Graphics2D g2;
String toolTipText;
Image image;
int
height, width,
x = 2,
y = 2,
sp = 4; // space extra to add to sizes and stuff
private Color fillColor = new Color(204,204,204);;
private boolean
isPressed = false,
isEntered = false,
isExited = false;
public KButton(ImageIcon icon, String toolTipText)
super(icon);
this.image = icon.getImage();
this.height = image.getHeight(this);
this.width = image.getWidth(this);
this.toolTipText = toolTipText;
bimg = new BufferedImage(width + 1, height + 1, BufferedImage.TYPE_INT_RGB);
g2 = bimg.createGraphics();
super.setToolTipText(toolTipText);
super.addMouseListener(this);
super.setMaximumSize(new Dimension(width + sp,height + sp));
super.setPreferredSize(new Dimension(width + sp, height + sp));
super.setBorder(null);
repaint();
public void setBackground(Color bgc)
this.fillColor = bgc;
public void paint(Graphics g)
// set the background
g2.setPaint(fillColor);
// clear the background
g2.fillRect(0,0,width+sp, height+sp);
// paint the icon to graphics 2d
g2.drawImage(image, 0,0, this);
// paint a border, or not
if(isEntered)
g2.setPaint(Color.white);
g2.draw(new Line2D.Double(0,0, width, 0));
g2.draw(new Line2D.Double(0,0, 0, height));
g2.setPaint(Color.gray);
g2.draw(new Line2D.Double(0,width, width, height));
g2.draw(new Line2D.Double(width, 0, width, height));
else if(isPressed)
g2.setPaint(Color.gray);
g2.draw(new Line2D.Double(0,0, width, 0));
g2.draw(new Line2D.Double(0,0, 0, height));
g2.setPaint(Color.white);
g2.draw(new Line2D.Double(0,width, width, height));
g2.draw(new Line2D.Double(width, 0, width, height));
// paint the whole lotta image on the button
g.setColor(fillColor);
g.clearRect(0,0,width+8,height+8);
g.drawImage(bimg, x,y, this);
/* =====================================
The following gives attention to actions which should be taken when the user
presses, enters, exits or releases the mouse on the button
======================================== */
public void mousePressed(MouseEvent e)
isEntered = false;
isPressed = true;
x = 3;
y = 3;
repaint();
public void mouseReleased(MouseEvent e)
isPressed = false;
x = 2;
y = 2;
repaint();
public void mouseClicked(MouseEvent e)
isPressed = false;
isEntered = false;
repaint();
public void mouseEntered(MouseEvent e)
isEntered = true;
repaint();
public void mouseExited(MouseEvent e)
isEntered = false;
repaint();Done. Your test case works fine if you replace getCurrentDirectory() with
getSelectedFile() for the APPROVE_OPTION branch in your code. If you still
disagree with me, then please provide exact information on operating system and
java version.
import java.awt.*;
import javax.swing.*;
public class BrowserWindow extends JFrame {
public BrowserWindow() {
Container con = this.getContentPane();
final JFileChooser jfc = new JFileChooser();
jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int result = jfc.showDialog(this, "Save BackUp");
switch (result) {
case JFileChooser.APPROVE_OPTION:
System.out.println(jfc.getSelectedFile());
break;
case JFileChooser.CANCEL_OPTION:
System.out.println("Cancelled");
break;
case JFileChooser.ERROR_OPTION:
break;
public static void main(String[] args) {
new BrowserWindow().setVisible(true);
} -
How can I switch to a different Nib file with a button
Hi there Im working on a Xcode application for IOS and I must admit im kinda new to Objective C. This specific application requires me to switch between different nib files. I am having quite a difficult time trying to figure this out on my own so some help would be appreciated. I have got the button linked with an
- (IBAction) but i can't quite get the coding to get the buttton to open the next application or nib file.
Thanks ~Cal~What i want is that it opens an application menu with several buttons, and then you press one and it opens a new window full of buttons
and i want it to be a mac osx app:) -
I bought a brand new Mac 27" desktop that came loaded with Adobe CS6. Everything worked like a charm until the hard drive, 1Tb, developed a bad sector and the Apple Store reinstalled a new one as I had extended warranty with them. They recycled the drive immediately (like a fool I didn't ask for it back to get the data off it.) But luckily I have all my data on CrashPlan. I downloaded it and it worked great except I downloaded it to the desktop and not the original location so it got squirrely. I also have an external 1.5Tb drive that I wanted to make bootable so I installed Mavericks 10.9.3 . I then went ahead and installed it on the newly installed drive too.
I think that because I have a new drive Adobe thinks I have a news computer. I bought the 27" Mac brand new from Ebay and it came loaded with software, including CS6. I have a serial number for CS6 but Adobe said it wasn't valid. (I have owned CS2, CS4 and now CS6 which came preloaded onto the Mac by the seller who told me that the software was registered to the Mac???
I am going to re-download the backup but this time to the original location (I still don't think it will work with Adobe. What can I do about this?
iMac 27-inch, Late 2012
Processor 3.2 GHz Intel Core i5
Memory 32 GB 1600 MHz DDR3
Graphics NVIDIA GeForce GTX 675MX 1024 MB
Software OS X 10.9.3 (13D65)@You need to contact Adobe Support either by chat or via phone when you have serial number and activation issues.
Here is a link to a page with options to help make contact:
http://www.adobe.com/support/download-install/supportinfo/ -
Problem with dual buttons on a form
Hello -
I have a single form with two buttons, currently named
'Button1' and 'Button2'. Both buttons lead through the default
DW/php code to update database records (in MySQL), but I want the
page redirect after updating to be determined by which button was
pushed.
I am using $_GET['ButtonName'] to direct action based on
which button was used to submit the form. Unfortunately, I can't
seem to redirect the page where I want.
The code I am using is:
=======
if (isset($_GET['Button1'])) {
$updateGoTo = "edit_onepage.php";
} else {
$updateGoTo = "account.php";
========
If the user submits using Button1, I want them forwarded to
"edit_onepage.php". If he submits using Button2, I want him
forwarded to "account.php". Unfortunately, no matter how I fiddle
with this code, the form is always forwarding to "account.php",
regardless of which button is pushed.
Can anyone see what I am missing here? Thanks in advance for
your advice.Oops! Found my own mistake. It works if I retrive the button
information with '$_POST', not '$_GET'. I'll leave this up in case
anyone else has a similar porblem. -
BP_CONT_SEARCH own button and own logic
Hello,
i need to implement a own button in the result list of component BP_CONT_SEARCH.
Which method do i need to redifine to add my own button?
With this button i need to read additional data to all Contact persons in the result list and export a detailed list per excel.
What is the easiest way to get all contact persons (for example ID or GUID) in the result list?
Thank you
Kind regards
ManfredFor button creation, code in DO_PREPARE_OUTPUT of the result IMPL class after redefining. Once done. On-Click event name should be created in the same IMPL class. This method id where you will code the logic.
Since the netity would be available from the context node RESULT, you will have the collection for all the entities. STRUCT.BP_GUID will give you the necessary GUID of the concerned contact person.
Rg,
Harshit -
Has anyone tried to extend Spatial with a 3D primitive?
Has anyone tried to extend Spatial with a 3D primitive that for example can model buildings and tunnels? I am trying to add the polyhedron primitive next to the existing point, line, polygon model. I just want to hear some tips or ideas...
The plan is to make a new GType and new stored functions that recognize this GType.
A polyhedron could be of type 3008,3D and 8=polyhedron(=new). The elem_info
and ordinates contain multiple planes. Self-created stored functions would be
able to recognize this GType, e.g. area3D should give the sum of the areas of all the
faces of the polyhedron and should also work on Gtype=3003 and give the real area
of a 3D polygon instead of the projection.I wouldn't suggest this methodology if you are considering using any spatial indexing or
functions with your data.
There is a mechanism Oracle Spatial has for defining custom datatypes. It should only
be used with custom apps, i.e. it won't be usable in the context of applications that know
about Oracle Spatial data types.
The mechanism allows you to define you own element using an element type of 0, and using
the interpretation to define what you are looking at. You would also include an a supported
element type that approximates your geometry, and that element is the one that is indexed,
and the gtype entered is associated with that geometry. Your private functions could access
the 3d geometry when required. For instance, you want to have a 3d cube. It might look like this:
sdo_gtype=3002
sdo_elem_info=(1,2,1, 7,0,1, 22,0,2 etc.
sdo_ordinates=(0,0,0,2,2,2, 0,0,0,2,0,0,2,2,0,0,2,0,0,0,0, 2,0,0,2,0,2,2,2,2,2,2,0,2,0,0, etc
the 1,2,1 in the elem info array corresponds to a 3d line string that when indexed with a minimum bounding
volume encloses the 3d cube. The 0,0,0 and 2,2,2 in the ordinate array stored as the line string when indexed
include the bounds of the cube. Next in the elem info array are 7,0,1. The 7 means offst 7 in the ordinate array
and in this example is fixed. Next the 0 tells Oracle Spatial to ignore this element. The interpretation of 1 you define,
the number could be anything. Since it is my example, I'll say the 1 means this is the definition of the first face in the
x,y plane (i.e. the front face of the cube which faces me). I've set the ordinate array with the coordinates of that face.
Next in elem info comes 22,0,2 which is starting at offset 22 there is another element that Oracle spatial should ignore
(element type 0), and next comes 2, which might mean this is the second face definition, that I've defined as the right
hand side y,z plane.
etc.
The meaning of the interpretation value is only limited by your imagination.
Note while you can index three dimensions if you want, the only spatial functionality that supports 3d is a spatial
index and a filter query, and some lrs functions. You will not be able to run any operator except for SDO_FILTER if you
have a 3d index, and all spatial functions will only work on 2d.
Do not define your own gtype and expect to use spatial. it will not work. -
Own Button in VA01/02/03 for calling an own FM to show some Information
Hi,
I'm looking for an EXIT to create an own button in VA01/02/03 to trigger an own FM.
This FM shell used to give additional Information for the Materials wich are in this sales-Order.
I don't want to update sap-standart code. I only want to use EXIT or BADI.
Regards, DieterDieter
This enhancement is not possible with Standard SAP..
Thanks
Amol Lohade -
Can we perform two actions with one button with two clicks one after other?
Sir,
can we perform two actions with one button with two clicks one after other?
I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
Regards
TanvirIn code it should be easy.
The following code adds a button called butman with a text "ADD".
It then registers a listener that will be called if the button is clicked.
This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
Therefore it will swap the button's functionality between ADD and CLEAR on every click.
final Button butman = new Button("ADD");
butman.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
if (butman.getText().equals("ADD")) {
butman.setText("CLEAR");
runAddData();
} else {
butman.setText("ADD");
runClearData();
} // END IF-THEN
}});I hope this is what you wanted.
Some extra food for thought.
You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed. -
Working with two buttons in jsp
hi
My working with jsp's in struts.
I have a jsp with two buttons "Save" and "Delete".
My requirement is, on clicking either the "save button" or "Delete button" in jsp, it should call the corresponding code in the Action class.
wht is the logic required to call the corresponding code in the Action class ?
Thankshi
Thanks nani and jHyena for ur reply , but its not working, can u tell me where i went wrong, how to set them in jsp and action class.
This is my Action class
public class EditUserDetailsAction extends Action {
* Generated Methods
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws DaoException {
System.out.println("---------------in execute() befor try/catch-----------");
//**************************the problem is here calling in if()/else, how should i call i?**************
if() {
try{
EditUserDetailsForm editUserDetailsForm = (EditUserDetailsForm) form;
System.out.println("------------ execute()-----------------");
DaoImplementer daoImpl = new DaoImplementer();
Integer editUid = (Integer) editUserDetailsForm.getUser_Id();
String editName = (String) editUserDetailsForm.getName();
String editTitle = (String) editUserDetailsForm.getTitle();
String editEmail = (String) editUserDetailsForm.getEmail();
Integer editTelephone = (Integer) editUserDetailsForm.getTelephone();
String editUserName = (String) editUserDetailsForm.getUserName();
String editPassword = (String) editUserDetailsForm.getPassword();
daoImpl.registerUser(editUid, editName, editTitle, editEmail, editTelephone, editUserName, editPassword);
System.out.println("------------sent to model components---------------");
System.out.println("----------forwarding to edituserdetail.jsp----------");
return mapping.findForward("editUserDetails");
catch (Exception e) {
System.out.println("@@@ ---Exception in EditUserDetailsAction class--@@@@");
throw new DaoException("Error adding userDetails: ",e);
return mapping.findForward("addUserDetails");
Here is the jsp
<html:html locale="true">
<head>
<html:base />
<title>editUserDetails.jsp</title>
<script type="text/javascript">
function save_display(){
var x = confirm("Save: Are you sure ?")
if( x == true ){
confirm("Save: OK")
else{
text("Save: Cancelled")
function delete_display(){
var y = confirm("Delete: Are you sure ?")
if( y == true ){
confirm("Delete: OK")
else{
alert("Delete: Cancelled")
function funSave(){
document.form[0].ID.value = id;
form[0].ID.value.action="<%=request.getContextPath()%>/division/editDesignation.app?save=save";
form[0].ID.value.method="post";
form[0].ID.value.submit();
function funDelete(){
function funSave(){
document.form[0].ID.value=id;
form[0].ID.value.action="<%=request.getContextPath()%>.app?save=save";
form[0].ID.value.method="post";
form[0].ID.value.submit();
</script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<html:javascript formName="editUserDetailsForm"/>
<html:form action="/editUserDetails" onsubmit="return validateEditUserDetailsForm(this);">
user_Id : <html:text property="user_Id"/><html:errors property="user_Id"/><br/>
name : <html:text property="name"/><html:errors property="name"/><br/>
title : <html:text property="title"/><html:errors property="title"/><br/>
telephone : <html:text property="telephone"/><html:errors property="telephone"/><br/>
email : <html:text property="email"/><html:errors property="email"/><br/>
userName : <html:text property="userName"/><html:errors property="userName"/><br/>
password : <html:password property="password"/><html:errors property="password"/><br/>
<html:submit property="save" value="Save" onclick ="funSave()"/>
<html:cancel property="delete" value="delete" onclick="funDelete()"/>
</html:form>
</body>
pls let me know how to set the hidden variables within the above jsp .
and in Action class how to call it.
I would be very thankful to u guys.
Thanks -
Pop-Up message with OK button in main page
All,
Below is my client's requirement....
when ever user login into Oracle EBS, before going to Home Page a pop-message with OK button should display and user must and should click OK button to proceed further...
I am planning to to extend the CO (OAHomePageCO) of /oracle/apps/fnd/framework/navigate/webui/HomePG ... is this is a correct approach or please provide your valueable inputs on this one...
Thanks in advanceAll,
any inputs on this requirement? -
Creating tables with a button click
can anyone give me a sample code for creating multiple tables in a scrollpane
with a button click.
ThanksHere is an example that returns a JTable in a JScrollPane in a JInternalFrame:
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import java.awt.GridLayout;
public class TablaJ extends JPanel{
public TablaJ(){
public TablaJ(String data[][], String columnNames[]){
super(new GridLayout(1,0));
final JTable table = new JTable(data, columnNames);
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this panel.
add(scrollPane);
static JInternalFrame crearFrameConTabla(String data[][], String columnNames[], String tabla) {
//Create and set up the window.
JInternalFrame frame = new JInternalFrame(tabla,true,true,true,true);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//Create and set up the content pane.
TablaJ newContentPane = new TablaJ(data, columnNames);
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
frame.pack();
return frame;
}
Maybe you are looking for
-
Dear Guru's, Is there any report to find the consumption with value in the specified time period. Regards, cherukuri
-
Music problems with my new 5230!
I wondered if you wonderful guys could help me out with a couple of problems concerning my new Nokia 5230. I just received my 16gb sd card today and started transferring music files so I could listen to music on the move. Unfortunately I have came ac
-
Why can't I select and drag files around in the preview area?
Out of nowhere. I have had no issues and now it is pretty much unusable. I thought maybe it was a bug so I uninstalled/reinstalled., There was an update when I went to install it the second time. I thought the update would help but there's no cha
-
Hi All can any on tell me how the vendor confirmation proces is taking place in MM. and if possible give me the steps. Regrds M S K
-
Scenario Activation Error /SMB99/CHARACTERISTIC_O209_J01
Hello, I have imported the packages for the SAP Best Practices Discrete Manufacturing. After successfully importing the Solution (DM_DE_V1603) I tried to activate the scenarios. While activating I get the following error for all scenarios: Materials