here's the controller for enduser_index view. It's like I have this index
view to list and lick "View" button to pass the variable and go to
enduser_view page.
def enduser_index():
response.title = 'List'
response.subtitle = 'End User Code'
form=SQLFORM.factory(Field('search'))
form.custom.widget.search['_class'] = 'input-medium search-query'
form.custom.submit['_value'] = 'Search'
form.custom.submit['_class'] = 'btn'
if form.accepts(request):
key=form.vars.search.upper() + "%"
query = (db.EDXUSF00.USDIID.like(key)) |
(db.EDXUSF00.USDICD.like(key)) | (db.EDXUSF00.USTSKJ.like(key))
else:
query = db.EDXUSF00.USDIID!=""
# Paging plugin
paginate_selector = PaginateSelector(anchor='main')
paginator = Paginator(paginate=paginate_selector.paginate,
extra_vars={'v':1}, anchor='main',
renderstyle=True)
paginator.records = db(query).count()
paginate_info = PaginateInfo(paginator.page, paginator.paginate,
paginator.records)
# End Paging plugin...
lists=db(query).select(db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ,db.EDXUSF00.USUSCD,orderby=[db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ],limitby=paginator.limitby())
return
dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector,
paginate_info=paginate_info)
On Wednesday, January 20, 2021 at 2:01:07 PM UTC-6 Jim S wrote:
> I thought you were trying to get it working in this html tag:
>
> <td class="row_buttons"><a
> href="{{=URL('customer_view',args=[list.TKDIID,list.TKDICD])}}"
> class="btn"><i class="icon-search"></i> View<
>
> I don't see the 'list' variable in the controller...
>
> Where is that coming from?
>
> -Jim
>
> On Wed, Jan 20, 2021 at 1:49 PM Omi Chiba <[email protected]> wrote:
>
>> I'm not sure how to check...
>>
>> This is my controller for view page
>>
>> def enduser_view():
>> response.title = 'View'
>> response.subtitle = 'End User Code'
>>
>> request.args(0) or redirect (URL('enduser_index'))
>> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and
>> db.EDXUSF00.USDICD==request.args(1) and db.EDXUSF00.USYUB5==request.args(2)
>> and db.EDXUSF00.USTSKJ==request.args(3))
>>
>> if record != None:
>> form = SQLFORM(db.EDXUSF00,record, readonly=True)
>> else:
>> redirect(URL('enduser_index'))
>>
>> return dict(form=form)
>>
>>
>>
>> On Wednesday, January 20, 2021 at 11:47:17 AM UTC-6 Jim S wrote:
>>
>>> I don't think it will help to change the controller side.
>>>
>>> In the controller can you print out the values and also print out the
>>> XML(value) and see what the difference is?
>>>
>>> -Jim
>>>
>>> On Wed, Jan 20, 2021 at 10:36 AM Omi Chiba <[email protected]> wrote:
>>>
>>>> I added XML. It doesn't show the error but cannot get the value and
>>>> shows the records... should we changed the controller side too?
>>>>
>>>> View
>>>> <td class="row_buttons"><a
>>>> href="{{=URL('enduser_view',args=[XML(list.USDIID),XML(list.USDICD),XML(list.USYUB5),XML(list.USTSKJ)])}}"
>>>>
>>>> class="btn"><i class="icon-search"></i> View</a>
>>>>
>>>> Controller
>>>> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and
>>>> db.EDXUSF00.USDICD==request.args(1) and
>>>> db.EDXUSF00.USYUB5==request.args(2)
>>>> and db.EDXUSF00.USTSKJ==request.args(3))
>>>>
>>>> On Monday, January 18, 2021 at 4:16:04 PM UTC-6 Omi Chiba wrote:
>>>>
>>>>> JIm,
>>>>>
>>>>> Thank you for your reply! I will test it later this week and let you
>>>>> guys know.
>>>>>
>>>>> On Monday, January 18, 2021 at 12:58:43 PM UTC-6 Jim S wrote:
>>>>>
>>>>>> Can you wrap it in an XML function?
>>>>>>
>>>>>> <td class="row_buttons"><a href="{{=URL('customer_view',args=
>>>>>> [XML(list.TKDIID),XML(list.TKDICD)])}}" class="btn"><i
>>>>>> class="icon-search"></i> View</a>
>>>>>>
>>>>>> On Wednesday, January 13, 2021 at 4:03:54 PM UTC-6 Omi Chiba wrote:
>>>>>>
>>>>>>> In another word, how I can encode and decode the value including
>>>>>>> special characters such as "&".
>>>>>>>
>>>>>>> https://help.marklogic.com/Knowledgebase/Article/View/using-url-encoding-to-handle-special-characters-in-a-document-uri
>>>>>>>
>>>>>>> On Wednesday, January 13, 2021 at 8:24:22 AM UTC-6 Omi Chiba wrote:
>>>>>>>
>>>>>>>> Hi, the following works fine when there is no symbol such as "&" in
>>>>>>>> the field value. How can we pass and receive the parameters which
>>>>>>>> contains
>>>>>>>> "&"..etc.?
>>>>>>>>
>>>>>>>> View - customer_index
>>>>>>>>
>>>>>>>> <td class="row_buttons"><a href="{{=URL('customer_view',args=
>>>>>>>> [list.TKDIID,list.TKDICD])}}" class="btn"><i
>>>>>>>> class="icon-search"></i> View</a>
>>>>>>>>
>>>>>>>> Controller - default.py
>>>>>>>>
>>>>>>>> def customer_index():
>>>>>>>> response.title = 'List'
>>>>>>>> response.subtitle = 'Customer Code'
>>>>>>>>
>>>>>>>> form=SQLFORM.factory(Field('search'))
>>>>>>>> form.custom.widget.search['_class'] = 'input-medium
>>>>>>>> search-query'
>>>>>>>> form.custom.submit['_value'] = 'Search'
>>>>>>>> form.custom.submit['_class'] = 'btn'
>>>>>>>>
>>>>>>>> if form.accepts(request):
>>>>>>>> key=form.vars.search.upper() + "%"
>>>>>>>> query = (db.EDXTKF00.TKDIID.like(key)) |
>>>>>>>> (db.EDXTKF00.TKDICD.like(key))
>>>>>>>> else:
>>>>>>>> query = db.EDXTKF00.TKDIID!=""
>>>>>>>>
>>>>>>>> # Paging plugin
>>>>>>>> paginate_selector = PaginateSelector(anchor='main')
>>>>>>>> paginator = Paginator(paginate=paginate_selector.paginate,
>>>>>>>> extra_vars={'v':1}, anchor='main',
>>>>>>>> renderstyle=True)
>>>>>>>> paginator.records = db(query).count()
>>>>>>>> paginate_info = PaginateInfo(paginator.page,
>>>>>>>> paginator.paginate, paginator.records)
>>>>>>>> # End Paging plugin...
>>>>>>>>
>>>>>>>>
>>>>>>>> lists=db(query).select(db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD,db.EDXTKF00.TKTKSC,db.EDXTKF00.TKTKCD,db.EDXTKF00.TKDMCD,orderby=[db.EDXTKF00.TKDIID,db.EDXTKF00.TKDICD],limitby=paginator.limitby())
>>>>>>>> return
>>>>>>>> dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector,
>>>>>>>>
>>>>>>>> paginate_info=paginate_info)
>>>>>>>>
>>>>>>>> def customer_view():
>>>>>>>> response.title = 'View'
>>>>>>>> response.subtitle = 'Customer Code'
>>>>>>>>
>>>>>>>> request.args(0) or redirect (URL('customer_index'))
>>>>>>>> record = db.EDXTKF00(db.EDXTKF00.TKDIID==request.args(0) and
>>>>>>>> db.EDXTKF00.TKDICD==request.args(1))
>>>>>>>>
>>>>>>>> if record != None:
>>>>>>>> form = SQLFORM(db.EDXTKF00,record, readonly=True)
>>>>>>>> else:
>>>>>>>> redirect(URL('customer_index'))
>>>>>>>>
>>>>>>>> return dict(form=form)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http://github.com/web2py/web2py (Source code)
>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "web2py-users" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/web2py/O1Mv_tbFbcw/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/web2py/93e8a999-e0be-4e33-bc91-43e5451edee7n%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/web2py/93e8a999-e0be-4e33-bc91-43e5451edee7n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/O1Mv_tbFbcw/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/0679fc45-f9b0-4296-9724-deecf8a2014en%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/web2py/0679fc45-f9b0-4296-9724-deecf8a2014en%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/15f47f16-02da-446f-ab8f-879bfe017ef2n%40googlegroups.com.