Using checkboxes as datasource of TileList - how do I then receive selected checkboxes?
I've been googling and searching for this and it should be simple I'd imagine... (I'm new to Flex so that probably doesn't help:)...
I have an array that I create using CheckBox components. I then use this array as the dataprovider for a TileList and then also create a CheckBox itemrenderer.
The issue I'm having is that, I thought if I went over the underlying checkbox array at a later point (say a button click) - that I'd be able to see some selected items yet none of them show up selected as I iterate over them (even though I've checked some of the checkboxes.)
I have an event on the checkbox rendererer itself and when it fires I do see the selected property set - It's just going over the whole array that I'm not seeing them set. It's as if the underlying dataset is not being modified. What do I need to do so that I can capture the selected checkbox items? (Is the issue something to do with the renderer being reused?) I'm thinking getting a handle to checkbox items from from a TileList would be somewhat common so any help/examples appreciated.
Below is the pertinent code:
[CODE]
dataArray is an array of type [B]CheckBox[/B]
<mx:TileList id="reportMetricsBox"
borderStyle="solid" height="100%" width="100%" maxColumns="3"
columnWidth="110" paddingLeft="0" textAlign="left" borderThickness="0"
dataProvider="{dataArray}">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox click="handleClick(event)">
<mx:Script>
<![CDATA[
import com.foo.event.CheckBoxEvent;
private function handleClick(event:Event):void {
dispatchEvent(new CheckBoxEvent(CheckBoxEvent.CLICKED, CheckBox(this)));
]]>
</mx:Script>
</mx:CheckBox>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
[/CODE]
Here's what I did to fix it...
in my item renderer click handler I set the data selected item:
private function onChange(event:Event):void {
dispatchEvent(new CheckBoxEvent(CheckBoxEvent.CLICKED, CheckBox(this)));
data.selected = !data.selected;
I'm assuming that's what I should be doing?
Similar Messages
-
How to disable a default selection checkbox in the tableview
Hi All,
How to disable a default selection checkbox in the tableview ???
I have a tableview with a iterator class mentioned on the iterator attribute of the table view. Table is a MULTISELECT tableview . Is it possible to disable or make it invisible a particular row selection check box?.
For my scenario I have Currency values on all the columns and I want to do a sub total overall total for all the price column fields in the last row of that table. I archived this functionality using Iterator class method. But I don't want the user to delete that last row in any case.
Thanks for your help in advance.
Thanks,
GreetsonHi,
You can NOT disable the "Checkbox" of particular row using HTMLB. I had the same requirement. I achieved using <b>2 Tableviews</b>, one after another. 1st tableview will show all the rows and 2nd Tableview(without Table Header) and without any row. The <b>total</b> will be displayed as <b>Column title</b> of 2nd Tableview.
Here is the code of 2nd tableview which we used to display the Total:
<htmlb:tableView id = "tv2"
headerVisible = "false"
keyColumn = "appid"
footerVisible = "false"
selectionMode = "SINGLESELECT"
design = "ALTERNATING"
fillUpEmptyRows = "false"
visibleRowCount = "0"
width = "100%"
table = "<%= tot_header %>" >
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName = "empno"
title = "Total"
width = "50"
type = "TEXT" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "ename"
title = " * "
width = "90"
type = "TEXT" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "appamount"
title = " <%= tot_appamt %> "
width = "60" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "ugjr_amt"
width = "60"
title = "<%= tot_ugjr %>" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "apprvd"
width = "50"
title = "*" >
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
Hope this will help you.
<b>Note: Reward each useful post.</b>
Raja T
Message was edited by:
Raja T -
How to retrive data from selected checkboxes with fieldnames
hi experts,
how to retrive data from selected checkboxes with fieldnames into another alv grid report.(here the fieldnames selected from table names is dynamically).
thankx in advance
rani.k.Hi,
Use user_command in the alv grid and then
do the follwoing code
FORM user_command1 USING lv_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Declaration of local Variables
DATA : lv_ref1 TYPE REF TO cl_gui_alv_grid.
DATA lv_cnt TYPE i. "+INS SUHESH 12.07.2008
Check function code
CASE lv_ucomm.
WHEN 'ONLI'.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref1.
CALL METHOD lv_ref1->check_changed_data.
now loop ur final internal table where check = 'X'.
now pass data to other internal table..Now the internal table will be having values that the user selcetd on the screen.
Hope this helps.
Regards,
Nagaraj -
Hi, Haven't used bridge in a while. How to you export a selected group of images to a contact sheet?
Exact version? Platform?
Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
http://forums.adobe.com/thread/419981?tstart=0
Thanks! -
When sending/receiving an iMessage (from gmail address) how can I then receive or access my iMessages on my actual gmail account/inbox?
Hi,
The Messages app can join 5 different services.
The "iChat Originals" that include AIM, Jabber and Yahoo (although they were added at different times to the app)
The Bonjour account that has been present for LAN based Mac to Mac chat and lastly the iMessages account in the Messages app that iChat has become.
Google email IDs can be used as a Jabber ID in Messages as Google run a Jabber server.
As the Google server does not follow conventional naming formatting it has it's own Add option in Messages.
Effectively all the services are separate.
Any email used as an Apple ID can be the iMessages account.
Of course this may be a Google one like you have that can also be used as Jabber/GoogleTalk ID or it may be an Apple issued ID (@mac.com @me.com or @icloud.com) that will also work as a Valid AIM Screen Name.
It may be that someone has their Yahoo email as their Apple ID.
8:35 pm Monday; August 11, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
Using checkboxes to set the category of a value, then add selected values
Hi there,
i'm using columns of checkboxes to set expense categories (Expense Type 1, Type2) once i set the type of expense that it is, i want the NET Value expenses of each category to be added to the bottom of the relevant Expense Type column.
thanks in advance. this forum rocks, but i didn't find this answer.
Mikel
Image: !http://youaremykin.com/images/xtra/question1.gif!Hi David,
Note that I used a Footer Row in my Table. Headers and Footers have special properties. (A poster in the last couple of weeks asked for a summary of Header and Footer properties - somewhat frustrated that he couldn't find a succinct description in the User Guide. Well, there isn't one and the answer is so complicated that nobody has taken on the project. Now we have a new version of Numbers and the answer would need to change.)
The way to avoid the error is to use a Footer Row and to use the shortcut cell reference notation: =SUMIF(C,TRUE,B). The columns are specified, but the row range is not. Footers are exempt in this notation, so no error is generated regarding a circular reference.
Hope this clears it up.
Jerry -
How To delete flex datagrid rows using multiple selected checkbox in flex
Hai
I need to delete the rows in the datagrid, using the checkbox slection...
for each row in the datagrid, there is a checkbox..
by slecting multiple checkbox i need to delete those rows by calling a method...
currently i am using this method for delete, but it deletes oly the finally selected checkbox
this is my code
private
function removeTaskRecord():void
//Check if the checkbox for the task is selected
if(generatedReportsgrid.selectedIndex>=0)
//Remove the task record from the Data Grid data provider
tagreportonload.lastResult.Generatedschedule.Generateddate.removeItemAt(generate dReportsgrid.selectedIndex);
can u help need it immediatly pl
Thanks in AdvanceDon't do this by operating on lastresult. Store the data in a collection like ArrayCollection or XMLListCollection, and remove an item from that. If you need to retain availability to the original data, create a copy of the collection.
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex / AIR Development, Training, and Support Services -
How do we create multiple selection checkboxes?
here is the more detailed description of what I want:
which of the next five days they would like to park, via a number of
checkboxes (important: it must be possible to make multiple
selections here � you must find out yourself how this is done, it�s not in
the handout!). The labels on the checkboxes should show the day of
the week (e.g., �Saturday� and the date and the month �14 March�).
Any other date information (such as the year) is optional.
thanks<input type="checkbox" name="checkboxName" value="1" />CheckBox1<br>
<input type="checkbox" name="checkboxName" value="2" />CheckBox2<br>
<input type="checkbox" name="checkboxName" value="3" />CheckBox3<br>
<input type="checkbox" name="checkboxName" value="4" />CheckBox4<br>
<input type="checkbox" name="checkboxName" value="5" />CheckBox5<br>
<input type="checkbox" name="checkboxName" value="6" />CheckBox6<br>
<input type="checkbox" name="checkboxName" value="7" />CheckBox7<br>
<input type="checkbox" name="checkboxName" value="8" />CheckBox8 -
How to do this fields selection.
I have one requirement like
I was given 15 fields with the descriptions...I have to put those in may be in table maintenance generator ( am not sure how to display then for selection ) and
when ever functional consultant edits the above 15 exisiting fields and save...
I have to write the coding as ...the same fields
sould be selected again from the table and displayed.If you need to use a maintenance view just create a view in SE11 using the provided 15 fields. After saving and activating the view got to SE54 and generated the view maintenance for your view. You can then use your view maintenance to edit/display the data by entering the view name into SM30.
That way you would not have to write any coding.
Hope that helps,
Michael -
How to create a list from checkboxes using Numbers on iPad?
I am creating a guest list using Numbers foriPad. First sheet is a list of invited people with checkboxes (Yes/No/still to reply) in next column. In the next sheet i want create a list of everyone that has replied yes.
I have tried using the if statement, but I dont want any blank cells.
-IF(A2;TRUE;A1) gives name in A1 if box is checked, but gives 0 or something else if i specify. But i want to automatically start on next row to avoid blank or 0-
Example:
David V
Lisa. V
Derek
Brad. V
Paul.
John
The separate list in another sheet should then be:
David
Lisa
Brad
Any help will be appreciated.Can you use the the reorganize panel to sort the list?
Idon't have Numbers on the iOS so I am not sure. You are posting in the forum for Numbers on Mac OS X.
you can also add a new column (let's say C)
where
C1=if(A1, A1, "")
this will include the name from column A when the checkbox in B is checked. You can then copy column C and paste values using the menu item (Edit > Paste Values, or equivalent in iOS... not sure what it is) -
How to stored data after clicking checkbox save in database table
TYPE-pools: slis.
tables:mkpf,mseg,mard,COWB_COMP.
TYPES: BEGIN OF tp_data,
mblnr LIKE mseg-mblnr,
matnr LIKE mseg-matnr,
werks LIKE mard-werks,
lgort LIKE mard-lgort,
lgpbe LIKE mard-lgpbe,
charg LIKE mseg-charg,
bwart LIKE mseg-bwart,
budat LIKE mkpf-budat,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
kostl LIKE mseg-kostl,
aufnr LIKE mseg-aufnr,
rsnum LIKE mseg-rsnum,
endkz like COWB_COMP-endkz,
END OF tp_data,
tp_tbl_data TYPE STANDARD TABLE OF tp_data.
*data: t_data like ztable occurs 0 with header line.
Constants
Data objects (variable declarations and definitions)
Report data to be shown.
DATA: it_data TYPE STANDARD TABLE OF tp_data.
Heading of the report.
DATA: t_heading TYPE slis_t_listheader.
========================== Selection Screen ==========================
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
smatnr FOR mseg-matnr MODIF ID m2,
swerks FOR mard-werks MODIF ID m3,
slgort FOR mard-lgort MODIF ID m4,
slgpbe FOR mard-lgpbe MODIF ID m5,
scharg FOR mseg-charg MODIF ID m6,
sbwart FOR mseg-bwart MODIF ID m7,
skostl FOR mseg-kostl MODIF ID m8,
saufnr FOR mseg-aufnr MODIF ID m9,
srsnum FOR mseg-rsnum MODIF ID m10.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
pse RADIOBUTTON GROUP radi,
bps RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETER:layout TYPE i.
SELECTION-SCREEN END OF BLOCK b3.
=========================== Event Blocks =============================
AT selection-SCREEN.
start-OF-selection.
PERFORM get_data USING it_data.
END-OF-selection.
PERFORM build_alv USING it_data t_heading.
=========================== Subroutines ==============================
*& Form get_data
Gets the information to be shown in the report.
FORM get_data USING t_data TYPE tp_tbl_data.
SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
msegmenge msegmeins msegkostl msegaufnr mseg~rsnum
INTO CORRESPONDING FIELDS OF TABLE t_data
FROM mseg
JOIN mard ON mardmatnr EQ msegmatnr
JOIN mkpf ON msegmblnr EQ mkpfmblnr
WHERE mseg~matnr IN smatnr.
ENDFORM. " get_data
*& Form build_alv
Builds and display the ALV Grid.
FORM build_alv USING t_data TYPE tp_tbl_data
t_heading TYPE slis_t_listheader.
ALV required data objects.
DATA: w_title TYPE lvc_title,
w_comm TYPE slis_formname,
w_status TYPE slis_formname,
x_layout TYPE slis_layout_alv,
t_event TYPE slis_t_event,
t_fieldcat TYPE slis_t_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv.
REFRESH t_fieldcat.
REFRESH t_event.
REFRESH t_sort.
CLEAR x_layout.
CLEAR w_title.
Field Catalog
PERFORM set_fieldcat2 USING:
1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space t_fieldcat,
4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
7 'BWART' 'BWART' 'MSEG' space space space space space space space space space space space space t_fieldcat,
8 'BUDAT' 'BUDAT' 'MKPF' space space space space space space space space space space space space t_fieldcat,
9 'MENGE' 'MENGE' 'MSEG' space space space space space space space space space space space space t_fieldcat,
10 'MEINS' 'MEINS' 'MSEG' space space space space space space space space space space space space t_fieldcat,
11 'KOSTL' 'KOSTL' 'MSEG' space space space space space space space space space space space space t_fieldcat,
12 'AUFNR' 'AUFNR' 'MSEG' space space space space space space space space space space space space t_fieldcat,
13 'RSNUM' 'RSNUM' 'MSEG' space space space space space space space space space space space space t_fieldcat,
14 'ENDKZ' 'ENDKZ' 'COWB_COMP' space space 'select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
Layout
x_layout-zebra = 'X'.
Top of page heading
PERFORM set_top_page_heading USING t_heading t_event.
Events
PERFORM set_events USING t_event.
GUI Status
w_status = ''.
User commands
w_comm = 'USER_COMMAND'.
Order
Example
PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
PERFORM set_order USING 'MBLNR' 'IT_DATA' 'X' space 'X' t_sort.
PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
Displays the ALV grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = t_fieldcat
is_layout = x_layout
it_sort = t_sort
i_callback_pf_status_set = w_status
i_callback_user_command = w_comm
i_save = 'X'
it_events = t_event
i_grid_title = w_title
TABLES
t_outtab = t_data
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. " build_alv.
*& Form set_top_page_heading
Creates the report headings.
FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
t_events TYPE slis_t_event.
DATA: x_heading TYPE slis_listheader,
x_event TYPE LINE OF slis_t_event.
Report title
CLEAR t_heading[].
CLEAR x_heading.
x_heading-typ = 'H'.
x_heading-info = 'Reporte Prueba'(001).
APPEND x_heading TO t_heading.
Program name
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Program: '.
x_heading-info = sy-repid.
APPEND x_heading TO t_heading.
User who is running the report
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'User: '.
x_heading-info = sy-uname.
APPEND x_heading TO t_heading.
Date of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Date: '.
WRITE sy-datum TO x_heading-info.
APPEND x_heading TO t_heading.
Time of execution
CLEAR x_heading.
x_heading-typ = 'S'.
x_heading-KEY = 'Time: '.
WRITE sy-uzeit TO x_heading-info.
APPEND x_heading TO t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-FORM = 'TOP_OF_PAGE'.
APPEND x_event TO t_events.
ENDFORM.
*& Form set_events
Sets the events for ALV.
The TOP_OF_PAGE event is alredy being registered in
the set_top_page_heading subroutine.
FORM set_events USING t_events TYPE slis_t_event.
DATA: x_event TYPE LINE OF slis_t_event.
Example
clear x_event.
x_event-name = .
x_event-form = .
append x_event to t_event.
ENDFORM.
*& Form set_order
Adds an entry to the order table.
FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
t_sort TYPE slis_t_sortinfo_alv.
DATA: x_sort TYPE slis_sortinfo_alv.
CLEAR x_sort.
x_sort-fieldname = p_fieldname.
x_sort-tabname = p_tabname.
x_sort-UP = p_up.
x_sort-down = p_down.
x_sort-subtot = p_subtot.
APPEND x_sort TO t_sort.
ENDFORM. "set_order
*& Form set_fieldcat2
Adds an entry to the field catalog.
FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
p_outputlen p_noout
p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
p_hotspot p_showasicon p_checkbox p_edit
p_dosum
t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-col_pos = p_colpos.
wa_fieldcat-no_out = p_noout.
wa_fieldcat-HOTSPOT = p_hotspot.
wa_fieldcat-CHECKBOX = p_checkbox.
wa_fieldcat-ICON = p_showasicon.
wa_fieldcat-do_sum = p_dosum.
Set reference fieldname, tablenam and rollname.
If p_ref_tabname is not given, the ref_fieldname given is a data element.
If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
IF p_ref_tabname IS INITIAL.
wa_fieldcat-rollname = p_ref_fieldname.
ELSE.
wa_fieldcat-ref_tabname = p_ref_tabname.
IF p_ref_fieldname EQ space.
wa_fieldcat-ref_fieldname = wa_fieldcat-fieldname.
ELSE.
wa_fieldcat-ref_fieldname = p_ref_fieldname.
ENDIF.
ENDIF.
Set output length.
IF NOT p_outputlen IS INITIAL.
wa_fieldcat-outputlen = p_outputlen.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
IF NOT p_seltext_l IS INITIAL.
wa_fieldcat-seltext_l = p_seltext_l.
ENDIF.
IF NOT p_seltext_s IS INITIAL.
wa_fieldcat-seltext_s = p_seltext_s.
ENDIF.
IF NOT p_reptext_ddic IS INITIAL.
wa_fieldcat-reptext_ddic = p_reptext_ddic.
ENDIF.
IF NOT p_ddictxt IS INITIAL.
wa_fieldcat-ddictxt = p_ddictxt.
ENDIF.
Set as editable or not.
IF p_edit IS NOT INITIAL.
wa_fieldcat-INPUT = 'X'.
wa_fieldcat-EDIT = 'X'.
ENDIF.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. "set_fieldcat2
=========================== Subroutines called by ALV ================
*& Form top_of_page
Called on top_of_page ALV event.
Prints the heading.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'XXXXX'
it_list_commentary = t_heading.
ENDFORM. " alv_top_of_page
*& Form user_command
Called on user_command ALV event.
Executes custom commands.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
ENDFORM. "user_command
this is my code, how to store data after clicking checkbox in databasetable,
how to write that cide.
plz send me code.hi!,
use MODIFY to update data into the data base table.
regards
anjali -
How to disbale a group of checkboxes when i select one check box WEBDYNPRO
Hi Friends,
Can any body help me how to disbale a group of checkboxes when i select one check box WEBDYNPRO Abap
Also can any body tell me how to handle chain endchain type of scenario in WEBDYNPRO Abap
Thank you..
SaiHi
In the context tab , create 2 context attributes ca_attr1 and ca_attr2 of type WDY_BOOLEAN under a context node cn_node
now in ur Layout , bind the ENABLE property of CheckBoxGroup UI Element with this attribute ca_attr1
bind the ENABLE property of CheckBox UI Element with this attribute ca_attr2
create a action for ur Checkbox , for the OnToggle property of ur checkbox
in OnactionToggle , check if ca_attr2 is 'X' , set ca_attr2 to ' ' ( for disable)
this can be done by code wizard , press control +f7 and use read/set context attributes , use get_attribute and set_attribute methods
// if ca_attr2 is 'X'
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
DATA ls_cn_node TYPE wd_this->element_cn_node .
DATA lv_attr LIKE ls_city-ca_attr2.
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
* get element via lead selection
lo_el_cn_node = lo_nd_cn_node->get_element( ).
* get single attribute
lo_el_cn_node->get_attribute(
EXPORTING
name = `CA_ATTR2`
IMPORTING
value = lv_attr ).
// if lv_attr2 is 'X' , use set_attribute method for ca_attr1
IF lv_Attr EQ 'X' .
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
DATA ls_cn_node TYPE wd_this->element_cn_node .
DATA lv_attr LIKE ls_city-ca_attr.
* navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
* get element via lead selection
lo_el_cn_node = lo_nd_cn_node->get_element( ).
* set single attribute
lo_el_cn_node->set_attribute(
EXPORTING
name = `CA_ATTR1`
value = ' ').
ENDIF.
regards,
amit -
How can I retrieve selected checkboxes by user into a JPA application?
Hello, I'm developing an app in JPA, still learning this, I'm displaying some checkboxes which I save into a List, then I separate the selections and put them into an Array, which I convert into String and that's what I store into MySQL table, this is what I have on the index.xhtml file:
<h:selectManyCheckbox value="#{employee.selectedItems}">
<f:selectItems var="checkList" value="#{employee.checkboxList()}" itemValue="#{checkList.idTechnology}" itemLabel="#{checkList.name}"></f:selectItems>
</h:selectManyCheckbox>
The method checkboxList is in charge of generating the checkboxes and assign a value and name, and the method "selectedItems" is the List<String> that stores the selected checkboxes values, so what I save into the table is something like this: "1,4,6,7" but I don't know how to retrieve the selections and check the checxkboxes according the what the user have on the table:
This is the method that I use to select all the records from the selected user, this fills all the textfields so I can edit the user, but not the checkboxes, and that's what I need to do:
public void seleccionarEmpleado(int id_empleado){
Query q = em.createNamedQuery("Employee.findByIdEmployee");
q.setParameter("IdEmployee", IdEmployee);
List<Empleado> listaEmple = q.getResultList();
for(IdEmployee emple1 : listaEmple){
emp.setIdEmployee(emple1 .getIdEmployeeo());
emp.setName(emple1 .getName());
emp.setLname(emple1 .getLname());
emp.setTel(emple1 .getTel());
emp.setAddress(emple1 .getDir());
emp.setTech(emple1 .getTecha());
Variable Tech is the one who gets the numbers like "2,3,4" etc, but how can I make the checkboxes to be checked according to these numbers? my english is not so good, thanks in advanced, have a nice day!Hello, I'm developing an app in JPA, still learning this, I'm displaying some checkboxes which I save into a List, then I separate the selections and put them into an Array, which I convert into String and that's what I store into MySQL table, this is what I have on the index.xhtml file:
<h:selectManyCheckbox value="#{employee.selectedItems}">
<f:selectItems var="checkList" value="#{employee.checkboxList()}" itemValue="#{checkList.idTechnology}" itemLabel="#{checkList.name}"></f:selectItems>
</h:selectManyCheckbox>
The method checkboxList is in charge of generating the checkboxes and assign a value and name, and the method "selectedItems" is the List<String> that stores the selected checkboxes values, so what I save into the table is something like this: "1,4,6,7" but I don't know how to retrieve the selections and check the checxkboxes according the what the user have on the table:
This is the method that I use to select all the records from the selected user, this fills all the textfields so I can edit the user, but not the checkboxes, and that's what I need to do:
public void seleccionarEmpleado(int id_empleado){
Query q = em.createNamedQuery("Employee.findByIdEmployee");
q.setParameter("IdEmployee", IdEmployee);
List<Empleado> listaEmple = q.getResultList();
for(IdEmployee emple1 : listaEmple){
emp.setIdEmployee(emple1 .getIdEmployeeo());
emp.setName(emple1 .getName());
emp.setLname(emple1 .getLname());
emp.setTel(emple1 .getTel());
emp.setAddress(emple1 .getDir());
emp.setTech(emple1 .getTecha());
Variable Tech is the one who gets the numbers like "2,3,4" etc, but how can I make the checkboxes to be checked according to these numbers? my english is not so good, thanks in advanced, have a nice day! -
How to get value from a checkbox in a jsp page?
hi there
i have a form in a jsp which contains a <input type='checkbox' name='xx'>
when i submit the form, how can i get the value for this checkbox? i could use request object to get parameter. i tried the following and could not get any value:
request.getParameter("xx");
is there any to get it? thanks."checkbox" can have multiple values b/c you can check more than 1 checkbox and they can have same name.
Example
<input type="checkbox" name="number" value="1">one
<input type="checkbox" name="number" value="2">two
<input type="checkbox" name="number" value="3">three
To get values of "number" field:
String [] numberValues = request.getParameterValues("number");
where numberValues[0] is the 1st value checked, numberValues[1] is 2nd value checkted and so on.....
If you have no checkbox checked then you might get a "null pointer exception", so make sure you check to see if it's null first before accessing your numberValues array.
If you just have 1 checkbox; then you can just call request.getParameterValue("number") and that will return your value. -
Checking Previously Selected Checkboxes using apex_item.checkbox API
Hello everyone,
Before I get into the exact nature of my 'problem at hand', I feel it would be a good idea to give you readers a little background info regarding what I'm working on.
I'm designing a page in my application (a Targeted Email Communications System) entitled the "Impacted Services Selection Screen." In a nutshell, this page will offer multiple check boxes that allow them to select/deselect the applications they wish to be notified about. Additionally, for each service, the user has the option to select the option to receive "planned" outage notifications, "unplanned" outage notifications, or both.
I'm working with a report region where I'm querying a table called "TEC_APPS" to populate my checkboxes. This table holds three columns which are:
(1) Primary Key APP_ID: Numerical identifier for each selectable service.
(2) APP_NAME: Name of the application itself (i.e. Banner INB, Oracle Collaboration Suite, etc.)
(3) ENTRY_TYPE: Type of entry within the table. I have four categories: (1) Planned Outage Notification, (2) Unplanned Outage Notification, (3) Horizontal Rule Formatting, (4) Title
The reason for the "ENTRY_TYPE" column is primarily to format the report so it doesn't look like a "table with a bunch of check boxes inside of it".
Here's the sql query for my report region:
select APP_NAME,ENTRY_TYPE,APP_ID,
decode(ENTRY_TYPE,
'Planned Outage Notification',apex_item.checkbox(1,APP_ID) || ENTRY_TYPE,
'Unplanned Outage Notification',apex_item.checkbox(1,APP_ID) || ENTRY_TYPE,
'Title',APP_NAME,
'Horizontal Rule Formatting','<hr size="6" width = "100%" color="#898A8A">')as result
from TEC_APPS
order by APP_ID;basically, this query generates check boxes for ENTRY_TYPEs of Planned/Unplanned Outage notification, Formatted Title Headers for an ENTRY_TYPE of a title, and an html Horizontal Rule for ENTRY_TYPES of horizontal rule formatting (the reason being my boss's specifications required there to be a formatted line that separates each check box group by context). That way, the groups will look like (note '[]' are meant to represent the check boxes):
BANNER INB
[ ] Planned Outage Notification
[ ] Unplanned Outage Notification
PORTAL
[ ] Planned Outage Notification
[ ] Unplanned Outage Notification
etc....
Additionally, I have an after submit process which uses the apex global array to store the selected check boxes and perform an insert into a different table called "TEC_SERVICES", which has the columns:
(1) PRIMARY_KEY SERVICE_ID: Numerical Identifier for each specific service requested for notification.
(2) SUB_ID ("subscriber id"): Numerical Identifier for each person using this application
(3) APP_ID: Foreign key reference to "TEC_APPS" which holds information regarding which application the user has selected for each SERVICE_ID
Here's the code for the process:
DECLARE
l_arrayMark NUMBER;
CURSOR c_id_check (aMark IN NUMBER) IS
SELECT service_id,sub_id,app_id
FROM tec_services
WHERE sub_id = :p4_sub_id
AND app_id = aMark;
r_id_check c_id_check%ROWTYPE;
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
BEGIN
l_arrayMark := to_number(APEX_APPLICATION.G_F01(i));
OPEN c_id_check(l_arrayMark);
LOOP
FETCH c_id_check into r_id_check;
IF c_id_check%NOTFOUND THEN
insert into "TEC_SERVICES"
( "SERVICE_ID",
"SUB_ID",
"APP_ID" )
values
( TEC_SERVICES_SEQ.nextval,
:P4_SUB_ID,
to_number(APEX_APPLICATION.G_F01(i)));
EXIT;
ELSIF c_id_check%found THEN
EXIT;
END IF;
END LOOP;
CLOSE c_id_check;
EXCEPTION
WHEN DUP_VAL_ON_INDEX
THEN NULL;
END;
END LOOP;
END;The sub-block loop basically checks to see if the user already has a record for that APP_ID, and if so exits the loop. I threw the unique key EXCEPTION in at the end just to be safe. I'm new to sql and pl/sql so I'm still trying to learn this stuff. I have come pretty far since I first started about 5 weeks ago.
Anyways, here's my problem:
I need to create a process that queries my TEC_SERVICES table to see if the person using my application already has a subscription for the "APP_ID" each checkbox in my report represents. If they do, the page is supposed to load with that/those checkbox(s) already checked. My problem is I'm not quite sure how to update those checkbox values. I have created a "before header" process that aimed at doing this, but is not working. Here is the "rough draft" of the code:
DECLARE
l_arrayMark NUMBER;
CURSOR c_id_find (aMark IN NUMBER)IS
SELECT sub_id, app_id
FROM tec_services
WHERE sub_id = :p4_sub_id
AND app_id = aMark;
r_id_find c_id_find%rowtype;
BEGIN
if APEX_APPLICATION.G_F01.count = 0 THEN return;
end if;
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
BEGIN
l_arrayMark := to_number(APEX_APPLICATION.G_F01(i));
OPEN c_id_find(l_arrayMark);
LOOP
FETCH c_id_find INTO r_id_find;
IF c_id_find%found THEN
apex_util.set_session_state(apex_item.G_F01,'CHECKED');
-- ** This is where I'm getting mixed up...this is basically trying to say, "if the record for this checkbox already exists for this person, then show this checkbox as selected."
-- ** I just don't know how I am supposed to do that. Maybe something similar, but more along the lines of: UPDATE apex_application.g_f01(p_checked_values => 'CHECKED')
ELSIF c_id_find%notfound THEN
exit;
END IF;
END LOOP;
CLOSE c_id_find;
END;
END LOOP;
END;I guess I just really don't know how to do this, and it's "Grinding my gears."
Any help is much appreciated.
Thank you all,
Eric
*** NOTE *** This is my first post ever in the oracle forums. I noticed that even when I include spaces and indentation in my code/post text, it doesn't display in the actual thread itself. Anyone know the markup to insert such things...or like an  ?
Edited by: user11685190 on Sep 28, 2009 2:09 PM
Edited by: user11685190 on Sep 29, 2009 6:32 AMGus,
1. Yeah...I tend to get carried away sometimes. This one's been killing me though b/c I've got a deadline of four weeks left to do this thing and I still have three somewhat "beastly" pages to write before it's completely ready to be tested and considered for production. On top of that, I'm pretty much learning a lot of this stuff as I go.
2. The first two loops I showed you (Query for the checkbox report, On-Submit process to read checkboxes and insert table data) are fully functional. The problem is, I've worked with "checkbox items" but not so much with the apex API for Report Checkboxes "apex_item.checkbox(p_id, p_val, etc.)). I don't know "how" I could write a pl sql process that queries the table when the page loads to check the checkboxes....addionally, I don't know what commands to use to fill these boxes b/c I've found somewhat unrelated information by conducting web research. Code-wise, my problem is I don't know whether to use:
UPDATE apex_application.g_f01(p_checked_values => 'CHECKED') ** OR ** if you'd instead use something like 'set available flag = 'Y'' The real problem is I just don't know how I'd do it.
...but, on second hand, I do find light in what you said about the "before header" process. If you look at the plsql block, the cursor I'm using to "see if that person already has subscribed to the service
represented by a checkbox," I'm referencing the page item :P4_SUB_ID. Since this is a before header process...it is running (i think) before the :p4_sub_id item loads...so the cursor is most likely returning as 'not found,' therefore it
does nothing. However, the source for the :P4_SUB_ID item says to use the source only when the value in session state is null. Because of this, I don't know if my above thoughts are correct.
Thank you for your thoughts and posting that link...I'll look into it a bit further.
Oh yeah...and thanks for the [/*code] tip...that looks a ton better.
Eric
Maybe you are looking for
-
Filename Compatibility: Win XP Pro Illustrator CS2
Hi, I'm having a problem when saving to web. I don't have spaces in my filename but when I save for web, my filename gets truncated to 30 characters. I go to my output settings and uncheck Mac & Unix to set the filename compatibilty to Windows only I
-
a symbol that looks like a phone has shown up on my status bar. I looks like a number pad & a handset. I have never seen it before what does it mean?
-
hi all how to find the use or purpose of CL_RECA_DDIC_DOMA and the methods declared in it.
-
I get the following error when try to connect to RAC from my java application: SQLException: No suitable driver found for oracle:jdbc:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost1)(PORT=1521))(ADDRESS=(PROTOCO
-
Option-Drag; Drag and Drop Timecode
Trying to copy tiimecode from one window to another. When I option-drag and drop it in the destination window it pops in with about 4 seconds subtracted. It's not a consistent difference, but always close to 4 seconds. Cut and paste (Apple+C; Apple+V